search
Search
Login
Unlock 100+ guides
menu
menu
web
search toc
close
Comments
Log in or sign up
Cancel
Post
account_circle
Profile
exit_to_app
Sign out
What does this mean?
Why is this true?
Give me some examples!
search
keyboard_voice
close
Searching Tips
Search for a recipe:
"Creating a table in MySQL"
Search for an API documentation: "@append"
Search for code: "!dataframe"
Apply a tag filter: "#python"
Useful Shortcuts
/ to open search panel
Esc to close search panel
to navigate between search results
d to clear all current filters
Enter to expand content preview
icon_star
Doc Search
icon_star
Code Search Beta
SORRY NOTHING FOUND!
mic
Start speaking...
Voice search is only supported in Safari and Chrome.
Navigate to
check_circle
Mark as learned
thumb_up
1
thumb_down
0
chat_bubble_outline
0
Comment
auto_stories Bi-column layout
settings

Comprehensive Guide on Transpose of Matrices

schedule Jan 4, 2024
Last updated
local_offer
Linear Algebra
Tags
mode_heat
Master the mathematics behind data science with 100+ top-tier guides
Start your free 7-days trial now!
Definition.

Transpose of a matrix

The transpose of a matrix A, denoted as AT, is a matrix obtained by swapping the rows and the columns of A. This means that:

  • the first row of A becomes the first column of AT.

  • the second row of A becomes the second column of AT.

  • and so on.

Mathematically, if A is an m×n matrix with entries aij, then the transpose of AT is an n×m matrix with entries aji. In other words, the entry located at the i-th row j-th column in A will be located at the j-th row i-th column in AT.

Example.

Finding the transpose of matrices

Find the transpose of the following matrices:

A=(1234),B=(123456),C=(123456789)

Solution. The transpose of these matrices is:

AT=(1324),BT=(142536),CT=(147258369)

Notice how taking the transpose affects the shape of the matrices:

  • a 2×2 matrix remains a 2×2 matrix.

  • a 3×2 matrix becomes a 2×3 matrix.

  • a 3×3 matrix remains a 3×3 matrix.

In general, if A is an m×n matrix, then AT will be an n×m matrix. Let's also understand the mathematical definition of the matrix transpose. Observe what happens to the entry a21=3 in A after taking the transpose. Since the rows and columns are swapped, this entry is located at a12 in AT.

Example.

Shape of a matrix after taking its transpose

Suppose we take the transpose of a matrix A with 2 rows and 3 columns. What would the shape of AT be?

Solution. Since we are swapping the rows and columns, the transpose of A would have 3 rows and 2 columns, that is, ATR3×2.

Properties of matrix transpose

Theorem.

Transpose of a matrix transpose

Taking the transpose of a matrix transpose results in the matrix itself:

(AT)T=A

Proof. By definition, AT is obtained by swapping the rows and columns of A. Taking the transpose of AT will swap back the rows and columns and so we end up with the original matrix A.

To be more mathematically precise, suppose A is as follows:

A=(a11a12a1na21a22a2nam1am2amn)

The transpose of A is:

AT=(a11a21am1a12a22am2a1na2namn)

The transpose of AT is:

(AT)T=(a11a12a1na21a22a2nam1am2amn)=A

This completes the proof.

Theorem.

Transpose of A+B

If A and B are matrices, then:

(A+B)T=AT+BT

Proof. Consider the following matrices:

A=(a11a12a1na21a22a2nam1am2amn),B=(b11b12b1nb21b22b2nbm1bm2bmn)

The transpose of A and B is:

AT=(a11a21am1a12a22am2a1na2namn),BT=(b11b21bm1b12b22bm2b1nb2nbmn)

The sum AT+BT is:

(1)AT+BT=(a11+b11a21+b21am1+bm1a12+b12a22+b22am2+bm2a1n+b1na2n+b2namn+bmn)

Now, the sum A+B is:

A+B=(a11+b11a12+b12a1n+b1na21+b21a22+b22a2n+b2nam1+bm1am2+bm2amn+bmn)

Taking the transpose gives:

(2)(A+B)T=(a11+b11a21+b21am1+bm1a12+b12a22+b22am2+bm2a1n+b1na2n+b2namn+bmn)

Notice that this matrix is equal to (1). Therefore, we have that:

(A+B)T=AT+BT

This completes the proof.

Theorem.

Diagonal entries of a square matrix do not change after taking its transpose

Let A be a square matrix. The diagonal entries of A and AT are the same.

Proof. Suppose A is an n×n matrix. The diagonals of A is aii for i=1,2,,n. Taking the transpose involves switching the two subscripts, but since they are identical, we also end up with aii as the diagonal entries of AT. This completes the proof.

Theorem.

Transpose of kA where k is a scalar

If A is a matrix and k is any scalar, then:

(kA)T=kAT

Proof. Consider the following matrix:

A=(a11a12a1na21a22a2nam1am2amn)

If k is any scalar, then the product kA is:

kA=(ka11ka12ka1nka21ka22ka2nkam1kam2kamn)

The transpose of kA is:

(3)(kA)T=(ka11ka21kam1ka12ka22kam2ka1nka2nkamn)

The transpose of A is:

AT=(a11a21am1a12a22am2a1na2namn)

The scalar-matrix product kAT is:

(4)kAT=(ka11ka21kam1ka12ka22kam2ka1nka2nkamn)

This is equal to the matrix in (3). Therefore, we conclude that:

(kA)T=kAT

This completes the proof.

Theorem.

Expressing dot product using matrix notation

If v and w are vectors, then:

vw=vTw=wTv=vwT

Proof. We will prove the case for R3 but this easily generalizes to Rn. Let vectors v and w be defined as follows:

v=(v1v2v3),w=(w1w2w3)

Their dot product is:

vw=v1w1+v2w2+v3w3=(v1v2v3)(w1w2w3)=vTw

Similarly, we have that:

vw=v1w1+v2w2+v3w3=(w1w2w3)(v1v2v3)=wTv

Similarly, we have that:

vw=v1w1+v2w2+v3w3=(v1v2v3)(w1w2w3)=vwT

This completes the proof.

Theorem.

Matrix product of a vector and its transpose is equal to the vector's squared magnitude

If v is a vector in Rn, then:

vTv=v2

Where v is the magnitudelink of v.

Proof. By the previous propertylink and propertylink of dot product, we have that:

vTv=vv=v2

This completes the proof.

Theorem.

Transpose of a product of two matrices

If A is an m×n matrix and B is an n×p matrix, then:

(AB)T=BTAT

Proof. From the rules of matrix multiplication, we know that:

(5)(AB)ij=k=1naikbkj

Here, the subscript ij represents the value in the i-th row j-th column. (5) is true for all i=1,2,,m and j=1,2,,p. For instance, (AB)13 represents the entry at the 1st row 3rd column of matrix AB.

We know from the definition of transpose that:

(6)(AB)ij=(AB)jiT

Equating (6) and (5) gives:

(7)k=1naikbkj=(AB)jiT

Now, consider the following:

(8)(BTAT)ji=k=1nbjkTakiT=k=1nbkjaik

Here, we used the fact that the entry bjk in BT is equal to the entry bkj in B.

Equating (7) and (8) gives:

(9)(BTAT)ji=(AB)jiT

Equation (9) holds true for all j=1,2,,p, and i=1,2,,m. Since the values of two matrices ABT and BTAT are equivalent, these matrices are equivalent, that is:

(AB)T=BTAT

This completes the proof.

Theorem.

Transpose of a product of three matrices

If A, B and C are matrices, then:

(ABC)T=CTBTAT

Proof. The proof makes use of our previous theorem (AB)T=BTAT. We start from the left-hand side of our proposition:

(ABC)T=((AB)C)T=CT(AB)T=CTBTAT

This completes the proof.

We will now generalize this theorem for any number of matrices. The proof uses induction and follows a similar logic.

Theorem.

Transpose of a product of n matrices

If Ai for i=1,2,,n are matrices, then:

(A1A2An)T=AnTA2TA1T

Proof. We will prove the theorem by induction. Consider the base case when we have 2 matrices. We have already shown in theoremlink that:

(A1A2)T=A2TA1T

Therefore, the base case holds. We now assume that the theorem holds for n1 matrices:

(10)(A1A2An1)T=An1TA2TA1T

Our goal is to show that the theorem holds for n matrices:

(A1A2An1An)T=((A1A2An1)An)T=AnT(A1A2An1)T

We now use the inductive assumption (10) to get:

(A1A2An1An)T=AnTAn1TA2TA1T

By the principle of mathematical induction, the theorem holds for the general case of n matrices. This completes the proof.

The next theorem is useful for certain proofs.

Theorem.

Another expression for the dot product of Av and w

If A is an m×n matrix and vRn and wRm are vectors, then:

Avw=vATw

Proof. The matrix-vector product Av results in a vector. We can use theoremlink to convert the dot product of Av and w into a matrix product:

Avw=wT(Av)=(wTA)v=(ATw)Tv=vATw

Note the following:

  • the third step uses theoremlink, that is, (AB)T=BTAT.

  • the final step uses theoremlink to convert the matrix product into a dot product.

This completes the proof.

Practice problems

Consider a 3×4 matrix A. What would the shape of AT be?

3×3
4×4
4×3
3×4

Since AT has the columns of A as its rows while the rows of A as its columns, we have that AT has shape 4×3.

Consider the following matrix:

A=(341568)

Find AT.

Your answer
Submit answer
Show solution

We flip the rows and columns to get:

AT=(354618)
robocat
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
thumb_up
thumb_down
Comment
Citation
Ask a question or leave a feedback...
Cookie Policy
close
By using our site, you acknowledge that you agree to our Privacy Policy and Terms and Conditions.