Quiz 2

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 P1APP^{-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 P1APP^{-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:VWT: V \to W with different bases in domain and codomain
  • Similar matrices: AA and BB represent the same T:VVT: 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:VWT: V \to W in bases B,CB, C. BB represents the same TT in bases B,CB', C'. Then PP is the change-of-basis in WW and QQ is the change-of-basis in VV:
B=[T]CB=PCC  [T]CB  PBBB = [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=P1AP>> B = P^{-1}AP >
Why this matters: AA and BB represent the same linear operator T:VVT: 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(P1AP)=det(P1)det(A)det(P)=det(A)\det(P^{-1}AP) = \det(P^{-1})\det(A)\det(P) = \det(A)
Same tracetr(P1AP)=tr(A)\text{tr}(P^{-1}AP) = \text{tr}(A)
Same rankrank(P1AP)=rank(A)\text{rank}(P^{-1}AP) = \text{rank}(A) ( PP is invertible)
Same eigenvaluesdet(P1APλI)=det(P1(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(P1APλI)=det(AλI)\det(P^{-1}AP - \lambda I) = \det(A - \lambda I)
Same nullitydim(N(P1AP))=dim(N(A))\dim(N(P^{-1}AP)) = \dim(N(A))
What's NOT preserved:
  • The eigenvectors change (they transform by P1P^{-1})
  • The matrix entries themselves
Example 2: Similar matrices
>A=[1234]>> A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} >
,
>P=[1111]>> P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
, then
>P1=[1/21/21/21/2]>> P^{-1} = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} >
.
>B=P1AP=[5120]>> 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) = -2tr(A)=5\text{tr}(A) = 5, tr(B)=5\text{tr}(B) = 5

4. Equivalence vs. Similarity

AspectEquivalenceSimilarity
FormB=PAQB = PAQB=P1APB = P^{-1}AP
Same transformation?T:VWT: V \to WT:VVT: 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=P1APB = P^{-1}AP:
>P=[0110]>> P = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} >
(swap basis vectors).
>P1AP=[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 , mnm \neq n , or they have different trace/det
** AA is diagonalisable**AA is similar to a diagonal matrix
Identity matrixOnly similar to itself (check: P1IP=IP^{-1}IP = I )
Zero matrixOnly similar to itself

6. Common Pitfalls

❌ Pitfall 1: Confusing P1APP^{-1}AP with PAP1PAP^{-1}

The order matters. P1APP^{-1}AP changes basis for vectors, then applies AA, then changes back. PAP1PAP^{-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=P1APB = P^{-1}AP isn't defined (and PAP1PAP^{-1} doesn't capture the same transformation in a different basis).

7. Formula Summary Table

ConceptFormulaInvariants
EquivalenceB=PAQB = PAQ , P,QP, Q invertibleRank
SimilarityB=P1APB = P^{-1}AP , PP invertibleRank, det, trace, eigenvalues, char poly
**Change of basis for T:VWT: V \to W **[T]CB=PCC[T]CBPBB[T]_{C' \leftarrow B'} = P_{C' \leftarrow C} [T]_{C \leftarrow B} P_{B \leftarrow B'}
**Change of basis for T:VVT: V \to V **[T]B=P1[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=λ25λ=λ(λ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=P1APB = P^{-1}AP, then det(B)=det(A)\det(B) = \det(A).
Proof: det(B)=det(P1AP)=det(P1)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=[1111]>> P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
.
Solution:
>P1=[1/21/21/21/2]>> P^{-1} = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} >
.
>B=P1AP=[1/21/21/21/2][2112][1111]>> 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.50.5][1111]=[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=P1APB = P^{-1}AP.
Proof: If Av=λvA\mathbf{v} = \lambda\mathbf{v}, then B(P1v)=P1AP(P1v)=P1Av=P1(λv)=λ(P1v)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 P1vP^{-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=[3001]>> B = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} >
. Are they similar?
Solution: det(A)=14=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λ)24=λ22λ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
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.