Explain why a transpose changes the product

Preserve the order of coordinates and the signs of values. · 184 words

A transpose swaps rows and columns: the entry at row i, column j moves to row j, column i. This can change a product because matrix multiplication pairs rows of the left matrix with columns of the right matrix. Consider two feature vectors u = [1, 2] and v = [3, 4]. The product u^T v is a dot product: 1*3 + 2*4 = 11, with shape (1, 1). If we instead form u v^T, the result is [[3, 4], [6, 8]], with shape (2, 2). Each entry multiplies one component of u by one component of v.

Now consider A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]. Direct multiplication gives AB = [[19, 22], [43, 50]]. After transposing A, A^T = [[1, 3], [2, 4]], and A^T B = [[26, 30], [36, 42]]. The shapes remain (2, 2), but the values change because the new rows of A pair with different columns of B. In an AI pipeline, transposing a feature matrix can swap which items or features act as rows, so it is not merely visual formatting.

Check your recall

For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], what are the first entries of AB and A^T B, and why do they differ?

Check your answer

The first entry of AB is 19, while the first entry of A^T B is 26. Transposing A changes its first row from [1, 2] to [1, 3], so it pairs differently with B's first column, [5, 7].

Sources and credits

Original KeyTouch lesson. Background reading · Zhang et al. · Linear Algebra.