Skip to main content

Diagonalization

Diagonalization is the process of transforming a square matrix A\mathbf{A} into an equivalent diagonal matrix D\mathbf{D} by using its eigenvectors. This process is fundamentally a change of basis that simplifies many complex matrix operations, particularly when dealing with repetitive transformations.

1. The Diagonalization Formula​

A square matrix A\mathbf{A} is diagonalizable if and only if it has a full set of linearly independent eigenvectors. If it is diagonalizable, it can be written as:

A=PDPβˆ’1\mathbf{A} = \mathbf{P} \mathbf{D} \mathbf{P}^{-1}

Let's break down the components:

ComponentRoleDescription
A\mathbf{A}Original MatrixThe linear transformation we want to analyze.
P\mathbf{P}Eigenvector MatrixColumns are the linearly independent eigenvectors of A\mathbf{A}.
D\mathbf{D}Diagonal MatrixA diagonal matrix whose diagonal entries are the corresponding eigenvalues of A\mathbf{A}.
Pβˆ’1\mathbf{P}^{-1}Inverse MatrixThe inverse of the eigenvector matrix.
Connection to Eigen-Decomposition

The diagonalization formula is simply a rearrangement of the Eigen-Decomposition formula we saw earlier: A=VΞ›Vβˆ’1\mathbf{A} = \mathbf{V} \mathbf{\Lambda} \mathbf{V}^{-1}. Here, P\mathbf{P} is the matrix of eigenvectors (V\mathbf{V}), and D\mathbf{D} is the diagonal matrix of eigenvalues (Ξ›\mathbf{\Lambda}).

2. The Geometric Meaning: Change of Basis​

The true power of diagonalization lies in its geometric interpretation: it describes the transformation A\mathbf{A} from a simpler perspective.

  • Step 1: Pβˆ’1\mathbf{P}^{-1} (Changing the Basis): This transforms the coordinate system from the standard basis (x, y axes) into the eigenbasis (the axes defined by the eigenvectors).
  • Step 2: D\mathbf{D} (The Simple Transformation): In this new eigenbasis, the complex transformation A\mathbf{A} simply becomes a scaling operation D\mathbf{D}. Diagonal matrices only scale vectors along the axesβ€”the easiest transformation possible!
  • Step 3: P\mathbf{P} (Changing Back): This transforms the result back from the eigenbasis into the standard coordinate system.

The complex transformation A\mathbf{A} can therefore be understood as: Change to Eigenbasis β†’\rightarrow Scale β†’\rightarrow Change Back.

3. Application: Simplifying Powers of a Matrix​

Calculating high powers of a matrix, such as A100\mathbf{A}^{100}, is computationally intensive and tedious. Diagonalization makes this trivial.

If A=PDPβˆ’1\mathbf{A} = \mathbf{P} \mathbf{D} \mathbf{P}^{-1}, then:

A2=(PDPβˆ’1)(PDPβˆ’1)\mathbf{A}^2 = (\mathbf{P} \mathbf{D} \mathbf{P}^{-1})(\mathbf{P} \mathbf{D} \mathbf{P}^{-1})

Since Pβˆ’1P=I\mathbf{P}^{-1}\mathbf{P} = \mathbf{I} (the Identity Matrix):

A2=PD(Pβˆ’1P)DPβˆ’1=PDIDPβˆ’1=PD2Pβˆ’1\mathbf{A}^2 = \mathbf{P} \mathbf{D} (\mathbf{P}^{-1}\mathbf{P}) \mathbf{D} \mathbf{P}^{-1} = \mathbf{P} \mathbf{D} \mathbf{I} \mathbf{D} \mathbf{P}^{-1} = \mathbf{P} \mathbf{D}^2 \mathbf{P}^{-1}

For any power kk:

Ak=PDkPβˆ’1\mathbf{A}^k = \mathbf{P} \mathbf{D}^k \mathbf{P}^{-1}

Why this is simple:​

The power of a diagonal matrix Dk\mathbf{D}^k is found simply by raising each diagonal element to the power kk.

If D=[2003]\mathbf{D} = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}, then D3=[230033]=[80027]\mathbf{D}^3 = \begin{bmatrix} 2^3 & 0 \\ 0 & 3^3 \end{bmatrix} = \begin{bmatrix} 8 & 0 \\ 0 & 27 \end{bmatrix}.

4. Application in ML: Markov Chains​

Diagonalization is critical for analyzing Markov Chains, which model systems (like user behavior, or language transitions) that change state over time.

  • The system's transition probabilities are captured in a matrix A\mathbf{A}.
  • The state of the system after many time steps (kβ†’βˆžk \to \infty) is given by Ak\mathbf{A}^k.
  • By diagonalizing A\mathbf{A}, we can easily compute Ak\mathbf{A}^k to find the long-term steady state (equilibrium) of the system, which is crucial for modeling language, search engine rankings (PageRank), and customer journey analysis.

Conclusion of Linear Algebra​

You have successfully completed the foundational concepts of Linear Algebra! You now understand the basic data structures (scalars, vectors, matrices, tensors) and the core operations (multiplication, transpose, inverse) and decompositions (Eigen-Decomposition, SVD) that underpin all modern Machine Learning algorithms.


Your next module will delve into Calculus, the mathematics of change, which is the engine that drives the learning process in ML models.