LINEAR-ALGEBRA Β· Interactive Practice

The Inverse That Always Exists: The Pseudo-Inverse

IKey Formulas

Formula Name Description
dim⁑(Row)=dim⁑(Col)=r\dim(\text{Row}) = \dim(\text{Col}) = r Matching dimensions Row space and column space share the rank rr
dim⁑(Null)=nβˆ’r,dim⁑(LeftΒ Null)=mβˆ’r\dim(\text{Null}) = n - r,\quad \dim(\text{Left Null}) = m - r Subspace dimensions What the null spaces "lose"
A+A=PRowA^{+}A = P_{\text{Row}} Projection identity A+AA^{+}A projects onto the row space (not II!)
AA+=PColAA^{+} = P_{\text{Col}} Projection identity AA+AA^{+} projects onto the column space
x^=A+b\hat{x} = A^{+}b Pseudo-inverse solution Minimum-norm least-squares solution

Recall: Row space βŠ₯\perp Null space, and Column space βŠ₯\perp Left null space. The pseudo-inverse A+A^{+} inverts the bijection Row β†’\to Column, and sends the left null space to zero.

IIVisualization 1 β€” The Four Fundamental Subspaces

For a matrix of rank rr, how large is each of the four fundamental subspaces?

πŸ’‘ A+A^{+} exists because that shared dimension rr lets AA act as a bijection from the row space onto the column space.

IIIVisualization 2 β€” Row Part, Null Part, and the Mapping

Every input vv splits into a row-space part and a null-space part β€” which one survives AvAv?

πŸ’‘ Because the null part is destroyed, AA has no true inverse; A+A^{+} can only ever recover the row-space part of a solution.

IVVisualization 3 β€” Least Squares and the Pseudo-Inverse

The pseudo-inverse fits the best line through the data and never breaks β€” even when ATAA^{T}A is singular.

πŸ’‘ Challenge: drag all three points to the same xx: the columns of AA become dependent and ATAA^{T}A turns singular, yet A+bA^{+}b still returns the minimum-norm fit.

VQuiz Questions

Question 1

A matrix AA has m=4m = 4 rows, n=3n = 3 columns, and rank r=2r = 2.

What is the dimension of the null space of AA?

βœ… Correct! The null space has dimension nβˆ’r=3βˆ’2=1n - r = 3 - 2 = 1.

❌ Not quite. The null space dimension is nβˆ’rn - r (use columns, not rows).

Show solution

Solution:

The null space lives in the input space Rn\mathbb{R}^n and has dimension nβˆ’rn - r: dim⁑(Null)=nβˆ’r=3βˆ’2=1.\dim(\text{Null}) = n - r = 3 - 2 = 1.

(For reference: the column space has dimension r=2r = 2, and the left null space has dimension mβˆ’r=4βˆ’2=2m - r = 4 - 2 = 2.)

Question 2

True or False: For every matrix AA, the product A+AA^{+}A equals the identity matrix.

βœ… Correct! A+AA^{+}A projects onto the row space; it equals II only with full column rank.

❌ Not quite. A+AA^{+}A is a projection onto the row space, not the identity in general.

Show solution

Solution:

A+AA^{+}A is the projection onto the row space, not the identity. Split any x∈Rnx \in \mathbb{R}^n into a row-space part plus a null-space part; A+AA^{+}A keeps only the row-space part and discards the null-space part: A+A=PRow.A^{+}A = P_{\text{Row}}.

You only get A+A=IA^{+}A = I when the null space is trivial β€” i.e. AA has full column rank. So the statement is False in general.

Question 3

For A=[1111]A = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, the row space is spanned by (1,1)(1, 1) and the null space is spanned by (1,βˆ’1)(1, -1).

What is the dot product (1,1)β‹…(1,βˆ’1)(1, 1) \cdot (1, -1), and what does it confirm?

βœ… Correct! The dot product is 00, so the row space and null space are orthogonal.

❌ Not quite. Compute (1)(1)+(1)(βˆ’1)(1)(1)+(1)(-1) β€” the result is 00, confirming orthogonality.

Show solution

Solution:

(1,1)β‹…(1,βˆ’1)=(1)(1)+(1)(βˆ’1)=1βˆ’1=0.(1,1)\cdot(1,-1) = (1)(1) + (1)(-1) = 1 - 1 = 0.

A dot product of 00 means the two directions are perpendicular. This confirms that the row space and the null space are orthogonal complements β€” the only vector lying in both is the zero vector. That orthogonality is exactly what makes the restriction of AA to the row space one-to-one.

Question 4

In a regression you accidentally include the same predictor twice, giving two identical columns A=[112233]A = \begin{bmatrix} 1 & 1 \\ 2 & 2 \\ 3 & 3 \end{bmatrix}. The ordinary least-squares formula x^=(ATA)βˆ’1ATb\hat{x} = (A^{T}A)^{-1}A^{T}b now fails.

Which statement best explains why β€” and how the pseudo-inverse helps?

βœ… Correct! ATAA^{T}A is singular, so (ATA)βˆ’1(A^{T}A)^{-1} fails; x^=A+b\hat{x} = A^{+}b rescues it.

❌ Not quite. The dependent columns make ATAA^{T}A singular (det⁑=0\det = 0); the pseudo-inverse still works.

Show solution

Solution:

The duplicated predictor makes the two columns identical (perfect collinearity), so AA is rank-deficient and ATAA^{T}A is singular: det⁑(ATA)=0\det(A^{T}A) = 0, which means (ATA)βˆ’1(A^{T}A)^{-1} is undefined and the OLS formula collapses.

The pseudo-inverse always exists, so we replace the broken formula with x^=A+b,\hat{x} = A^{+}b, which gracefully delivers the minimum-norm least-squares solution.

Solved: 0 / 4