Equivalent & Similar Matrices

1896 words
9 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Equivalent & Similar Matrices ## ๐ŸŽฏ Learning Objectives After this topic you will be able to: - Define equivalent matrices and similar matrices - Distinguish between equivalence and similarity - Find the relationship between matrices representing the same transformation - Compute similar matrices via $P^{-1}AP$ -...

Equivalent & Similar Matrices

๐ŸŽฏ Learning Objectives

After this topic you will be able to:
  • Define equivalent matrices and similar matrices
  • Distinguish between equivalence and similarity
  • Find the relationship between matrices representing the same transformation
  • Compute similar matrices via Pโˆ’1APP^{-1}AP
  • Understand that similar matrices share eigenvalues, determinant, trace, and rank

๐Ÿ“‹ Prerequisites

  • Matrix Representation (Week 6) โ€” how matrices represent linear transformations
  • Change of Basis (Week 6) โ€” transition matrices
  • Matrix Multiplication (Week 1) โ€” necessary for Pโˆ’1APP^{-1}AP

1. Intuition: Same Map, Different Coordinates

When you change the coordinate system, the numbers describing a point change โ€” but the point itself doesn't. Similarly, when you change bases, the matrix representing a linear transformation changes โ€” but the transformation itself is the same. (Diagram)
  • Equivalent matrices: AA and BB represent the same T:Vโ†’WT: V \to W with different bases in domain and codomain
  • Similar matrices: AA and BB represent the same T:Vโ†’VT: V \to V with different bases in the domain (same basis change for input and output)

2. Equivalent Matrices

2.1 Definition

Definition (Equivalent Matrices). Two mร—nm \times n matrices AA and BB are equivalent if there exist invertible matrices PP (mร—mm \times m) and QQ (nร—nn \times n) such that:
>B=PAQ>> B = PAQ >
Why this matters: AA represents T:Vโ†’WT: V \to W in bases B,CB, C. BB represents the same TT in bases Bโ€ฒ,Cโ€ฒB', C'. Then PP is the change-of-basis in WW and QQ is the change-of-basis in VV:
B=[T]Cโ€ฒโ†Bโ€ฒ=PCโ€ฒโ†Cโ€…โ€Š[T]Cโ†Bโ€…โ€ŠPBโ†Bโ€ฒB = [T]_{C' \leftarrow B'} = P_{C' \leftarrow C} \; [T]_{C \leftarrow B} \; P_{B \leftarrow B'}

2.2 Properties

PropertyExplanation
Rank preservedrank(A)=rank(B)\text{rank}(A) = \text{rank}(B)
Dimensions sameBoth are mร—nm \times n
Row/column operationsPAQPAQ means row ops on AA ( PP ) and column ops on AA ( QQ )
Equivalence is...Reflexive, symmetric, transitive (an equivalence relation)
Key theorem: Two mร—nm \times n matrices are equivalent iff they have the same rank.
Example 1: Equivalent matrices
>A=[100000000]>> A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
and
>B=[100000000]>> B = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
have rank 1, so they're equivalent.
More interesting:
>A=[1234]>> A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} >
has rank 2. Any 2ร—22 \times 2 matrix with rank 2 is equivalent to AA (and to I2I_2).

3. Similar Matrices

3.1 Definition

Definition (Similar Matrices). Two nร—nn \times n matrices AA and BB are similar if there exists an invertible matrix PP such that:
>B=Pโˆ’1AP>> B = P^{-1}AP >
Why this matters: AA and BB represent the same linear operator T:Vโ†’VT: V \to V in different bases. PP is the change-of-basis matrix.

3.2 Properties of Similar Matrices

Similar matrices share many properties:
PropertyWhy?
Same determinantdetโก(Pโˆ’1AP)=detโก(Pโˆ’1)detโก(A)detโก(P)=detโก(A)\det(P^{-1}AP) = \det(P^{-1})\det(A)\det(P) = \det(A)
Same tracetr(Pโˆ’1AP)=tr(A)\text{tr}(P^{-1}AP) = \text{tr}(A)
Same rankrank(Pโˆ’1AP)=rank(A)\text{rank}(P^{-1}AP) = \text{rank}(A) ( PP is invertible)
Same eigenvaluesdetโก(Pโˆ’1APโˆ’ฮปI)=detโก(Pโˆ’1(Aโˆ’ฮปI)P)=detโก(Aโˆ’ฮปI)\det(P^{-1}AP - \lambda I) = \det(P^{-1}(A-\lambda I)P) = \det(A-\lambda I)
Same characteristic polynomialdetโก(Pโˆ’1APโˆ’ฮปI)=detโก(Aโˆ’ฮปI)\det(P^{-1}AP - \lambda I) = \det(A - \lambda I)
Same nullitydimโก(N(Pโˆ’1AP))=dimโก(N(A))\dim(N(P^{-1}AP)) = \dim(N(A))
What's NOT preserved:
  • The eigenvectors change (they transform by Pโˆ’1P^{-1})
  • The matrix entries themselves
Example 2: Similar matrices
>A=[1234]>> A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} >
,
>P=[111โˆ’1]>> P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
, then
>Pโˆ’1=[1/21/21/2โˆ’1/2]>> P^{-1} = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} >
.
>B=Pโˆ’1AP=[5โˆ’1โˆ’20]>> B = P^{-1}AP = \begin{bmatrix} 5 & -1 \\ -2 & 0 \end{bmatrix} >
(as computed in Week 6).
Check: detโก(A)=โˆ’2\det(A) = -2, detโก(B)=0โˆ’(โˆ’2)(โˆ’1)=โˆ’2\det(B) = 0 - (-2)(-1) = -2 โœ“ tr(A)=5\text{tr}(A) = 5, tr(B)=5\text{tr}(B) = 5 โœ“

4. Equivalence vs. Similarity

AspectEquivalenceSimilarity
FormB=PAQB = PAQB=Pโˆ’1APB = P^{-1}AP
Same transformation?T:Vโ†’WT: V \to WT:Vโ†’VT: V \to V (operator)
BasesDifferent in domain & codomainSame basis in domain & codomain
Matrix sizemร—nm \times n (need not be square)Square nร—nn \times n
Key invariantRankRank, det, trace, eigenvalues, char poly
Example 3: Distinguishing equivalence and similarity
>A=[1000]>> A = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} >
and
>B=[0001]>> B = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} >
are equivalent (both have rank 1).
Are they similar? Check trace: tr(A)=1\text{tr}(A) = 1, tr(B)=1\text{tr}(B) = 1. Check determinant: detโก(A)=0\det(A) = 0, detโก(B)=0\det(B) = 0. Check eigenvalues: both have eigenvalues 0 and 1.
They could be similar. Find PP such that B=Pโˆ’1APB = P^{-1}AP:
>P=[0110]>> P = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} >
(swap basis vectors).
>Pโˆ’1AP=[0110][1000][0110]=[0001]=B>> P^{-1}AP = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} = B >
โœ“. Yes, they are similar.

5. Edge Cases & Gotchas

SituationWhat Happens
** AA and BB are equivalent but not similar**AA is mร—nm \times n , mโ‰ nm \neq n , or they have different trace/det
** AA is diagonalisable**AA is similar to a diagonal matrix
Identity matrixOnly similar to itself (check: Pโˆ’1IP=IP^{-1}IP = I )
Zero matrixOnly similar to itself

6. Common Pitfalls

โŒ Pitfall 1: Confusing Pโˆ’1APP^{-1}AP with PAPโˆ’1PAP^{-1}

The order matters. Pโˆ’1APP^{-1}AP changes basis for vectors, then applies AA, then changes back. PAPโˆ’1PAP^{-1} does the opposite.

โŒ Pitfall 2: Thinking "similar" means "equivalent"

Every similar pair is equivalent, but not vice versa (similar requires square matrices and preserves more properties).

โŒ Pitfall 3: Forgetting PP must be invertible

If PP isn't invertible, B=Pโˆ’1APB = P^{-1}AP isn't defined (and PAPโˆ’1PAP^{-1} doesn't capture the same transformation in a different basis).

7. Formula Summary Table

ConceptFormulaInvariants
EquivalenceB=PAQB = PAQ , P,QP, Q invertibleRank
SimilarityB=Pโˆ’1APB = P^{-1}AP , PP invertibleRank, det, trace, eigenvalues, char poly
**Change of basis for T:Vโ†’WT: V \to W **[T]Cโ€ฒโ†Bโ€ฒ=PCโ€ฒโ†C[T]Cโ†BPBโ†Bโ€ฒ[T]_{C' \leftarrow B'} = P_{C' \leftarrow C} [T]_{C \leftarrow B} P_{B \leftarrow B'}โ€”
**Change of basis for T:Vโ†’VT: V \to V **[T]Bโ€ฒ=Pโˆ’1[T]BP[T]_{B'} = P^{-1} [T]_B Pโ€”

8. ๐Ÿ“ Practice Questions

Q1: Are these similar?
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
,
>B=[0005]>> B = \begin{bmatrix} 0 & 0 \\ 0 & 5 \end{bmatrix} >
.
Solution: tr(A)=5\text{tr}(A) = 5, tr(B)=5\text{tr}(B) = 5. detโก(A)=0\det(A) = 0, detโก(B)=0\det(B) = 0. Eigenvalues of AA: detโก(Aโˆ’ฮปI)=(1โˆ’ฮป)(4โˆ’ฮป)โˆ’4=ฮป2โˆ’5ฮป=ฮป(ฮปโˆ’5)\det(A - \lambda I) = (1-\lambda)(4-\lambda) - 4 = \lambda^2 - 5\lambda = \lambda(\lambda-5). So eigenvalues are 0 and 5. Eigenvalues of BB: 0 and 5.
Yes, they could be similar (same eigenvalues). Q2: Similarity preserves determinant
Prove: If B=Pโˆ’1APB = P^{-1}AP, then detโก(B)=detโก(A)\det(B) = \det(A).
Proof: detโก(B)=detโก(Pโˆ’1AP)=detโก(Pโˆ’1)detโก(A)detโก(P)=1detโก(P)detโก(A)detโก(P)=detโก(A)\det(B) = \det(P^{-1}AP) = \det(P^{-1})\det(A)\det(P) = \frac{1}{\det(P)}\det(A)\det(P) = \det(A). โœ“ Q3: Are these equivalent?
>A=[100000]>> A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
,
>B=[010000]>> B = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
.
Solution: Both have rank 1 and are 2ร—32 \times 3. Yes, they are equivalent. Q4: Not similar โ€” different trace
>A=[1001]>> A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} >
,
>B=[1002]>> B = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} >
.
Solution: tr(A)=2\text{tr}(A) = 2, tr(B)=3\text{tr}(B) = 3. Not similar. Q5: Finding similar matrix
Find BB similar to
>A=[2112]>> A = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix} >
using
>P=[111โˆ’1]>> P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
.
Solution:
>Pโˆ’1=[1/21/21/2โˆ’1/2]>> P^{-1} = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} >
.
>B=Pโˆ’1AP=[1/21/21/2โˆ’1/2][2112][111โˆ’1]>> B = P^{-1}AP = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
>=[1.51.50.5โˆ’0.5][111โˆ’1]=[3001]>> = \begin{bmatrix} 1.5 & 1.5 \\ 0.5 & -0.5 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} = \begin{bmatrix} 3 & 0 \\ 0 & 1 \end{bmatrix} >
.
BB is diagonal. detโก(B)=3=detโก(A)\det(B) = 3 = \det(A) โœ“, tr(B)=4=tr(A)\text{tr}(B) = 4 = \text{tr}(A) โœ“. Q6: Matrix equivalence classes
How many equivalence classes of 2ร—32 \times 3 matrices are there?
Solution: Equivalence is determined by rank. Rank can be 0, 1, or 2 (min(2,3) = 2). So 3 equivalence classes. Q7: Similarity preserves eigenvalues
Show that if ฮป\lambda is an eigenvalue of AA, then ฮป\lambda is also an eigenvalue of B=Pโˆ’1APB = P^{-1}AP.
Proof: If Av=ฮปvA\mathbf{v} = \lambda\mathbf{v}, then B(Pโˆ’1v)=Pโˆ’1AP(Pโˆ’1v)=Pโˆ’1Av=Pโˆ’1(ฮปv)=ฮป(Pโˆ’1v)B(P^{-1}\mathbf{v}) = P^{-1}AP(P^{-1}\mathbf{v}) = P^{-1}A\mathbf{v} = P^{-1}(\lambda\mathbf{v}) = \lambda(P^{-1}\mathbf{v}). So Pโˆ’1vP^{-1}\mathbf{v} is an eigenvector of BB with eigenvalue ฮป\lambda. โœ“ Q8: Are AA and ATA^T similar?
Is AA always similar to ATA^T?
Solution: Yes! Every matrix is similar to its transpose. (This is a known theorem, though the proof uses Jordan canonical form.) Q9: Determining similarity by invariants
>A=[1221]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix} >
,
>B=[300โˆ’1]>> B = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} >
. Are they similar?
Solution: detโก(A)=1โˆ’4=โˆ’3\det(A) = 1-4 = -3, detโก(B)=โˆ’3\det(B) = -3 โœ“. tr(A)=2\text{tr}(A) = 2, tr(B)=2\text{tr}(B) = 2 โœ“. Eigenvalues: AA has ฮป=3,โˆ’1\lambda = 3, -1 (since (1โˆ’ฮป)2โˆ’4=ฮป2โˆ’2ฮปโˆ’3=(ฮปโˆ’3)(ฮป+1)(1-\lambda)^2 - 4 = \lambda^2 - 2\lambda - 3 = (\lambda-3)(\lambda+1)). BB has eigenvalues 3, -1. Similar โœ“. Q10: Non-square case
Can a 2ร—32 \times 3 matrix be similar to a 3ร—23 \times 2 matrix?
Solution: No. Similarity is only defined for square matrices. Non-square matrices can be equivalent (if same rank) but not similar.

๐Ÿ”— Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.