Euler Hall — free maths guides

Form the transpose

A plain-language explanation of the transpose of a matrix. The idea in plain words, a worked example, and a check with the answers shown — part of the free Linear Algebra guides.

The definition, in words and in symbols

Transposing exchanges rows and columns. Entry(i,j)(i,j) ofATA^{T} is entry(j,i)(j,i) ofAA:

(AT)ij=Aji.(A^{T})_{ij}=A_{ji}.

SoA=[123004]A=\begin{bmatrix}1&2&3\\0&0&4\end{bmatrix}, which is2×32\times3, transposes to

AT=[102034],A^{T}=\begin{bmatrix}1&0\\2&0\\3&4\end{bmatrix},

which is3×23\times2. The first row ofAA is now the first column ofATA^{T}.

Why the index rule is the definition, and "flip it over the diagonal" is not

Flipping a picture across the diagonal only makes sense when you can see the picture. The index rule works for any shape and is what every proof uses. It also explains, in one line, why transposing twice changes nothing:

((AT)T)ij=(AT)ji=Aij,((A^{T})^{T})_{ij}=(A^{T})_{ji}=A_{ij},

so(AT)T=A(A^{T})^{T}=A.

And it settles the shape question without any thought about pictures: the entry(j,i)(j,i) ofAA exists only whenj≤nj\le n andi≤mi\le m, so the transpose's row index runs tonn and its column index tomm.

A worked example in the exam's shape

A=[2−15703].A=\begin{bmatrix}2&-1&5\\7&0&3\end{bmatrix}.

Write the rows ofAA down the columns ofATA^{T}:

AT=[27−1053].A^{T}=\begin{bmatrix}2&7\\-1&0\\5&3\end{bmatrix}.

Two checks, both cheap and both worth doing every time:

Shape.AA was2×32\times3, soATA^{T} must be3×23\times2. It is. One entry.(AT)23=A32=3(A^{T})_{23}=A_{32}=3, and indeed row 2, column 3 ofATA^{T} holds33.

The entry counts are equal too — six in each — which is a weaker check than the shape but catches a dropped or duplicated entry.

By the end you can
  • Apply (A^T)_ij = A_ji entry by entry
  • Predict the shape of a transpose before computing it
  • Explain why transposing twice returns the original matrix
Check yourself

B=[1−20471]B=\begin{bmatrix}1&-2\\0&4\\7&1\end{bmatrix}.

(a) What is the shape ofBTB^{T}? (b) What is(BT)32(B^{T})_{32}? (c) IsBTBB^{T}B the same shape asBBTBB^{T}?

Answers

(a)BB is3×23\times2, soBTB^{T} is2×32\times3.

(b)(BT)32=B23(B^{T})_{32}=B_{23}. Row 2 ofBB is(0,4)(0,4), soB23B_{23} does not exist —BB has only two columns, so column 3 is out of range. The question has no answer, and recognising that is the point: an index pair outside the shape is not a small error, it is no entry at all.

(c) No.BTBB^{T}B is2×22\times2 andBBTBB^{T} is3×33\times3. They are both symmetric and both are perfectly well defined; they are simply different sizes, which is the reason ATA=AATA^{T}A=AA^{T}" is not an identity for rectangular matrices.

Work out where to start — free, no accountAnswer six real questions — free, no account