Topic 4 Orthogonality and Least-Squares

The final section of the study document, focusing on Topic 4: Orthogonality and Least-Squares.

This topic covers the geometric aspects of linear algebra: dot products, orthogonal complements, the Gram-Schmidt process for creating orthogonal/orthonormal bases, matrix factorizations like QR, and using the Normal Equations to find Least-Squares solutions to inconsistent systems.

Question 1: Finding a Basis for an Orthogonal Complement (W)

Source: Exam 2, Question 11
Exact Question: Let W=Span{[1321],[2671]}. Find a basis for W.

Methodology:

  1. Definition: The orthogonal complement W is the set of all vectors that are orthogonal to every vector in W.
  2. Logic: If a vector x is orthogonal to the spanning vectors of W, its dot product with each of them is zero. This is equivalent to saying x is in the null space of a matrix A where the rows of A are the spanning vectors of W (because Ax=0 computes exactly these dot products).
  3. Process: Put the spanning vectors as rows in a matrix A. Row reduce to find the parametric vector form of Nul A. The basis vectors of the null space form the basis for W.

Solution:


Question 2: The Gram-Schmidt Process (Orthonormal Basis)

Source: Practice Exam 4, Question 10
Exact Question: Find an orthonormal basis of the column space of the matrix A=[101311250112].

Methodology:

  1. Objective: Convert a set of arbitrary vectors (the columns of A) into a set of mutually orthogonal vectors of length 1 that span the same space.
  2. Gram-Schmidt Formulas: Let the original columns be a1,a2, and the new orthogonal vectors be v1,v2,
    • v1=a1
    • v2=a2a2v1v1v1v1
    • v3=a3a3v1v1v1v1a3v2v2v2v2
    • (Note: If any vi evaluates to the zero vector 0, it means the original column ai was a linear combination of previous columns. Discard the zero vector and move to the next column).
  3. Normalization: After finding the orthogonal basis {v1,}, divide each vector by its magnitude vi=vivi to make it orthonormal.

Solution:


Question 3: QR Decomposition

Source: Practice Exam 3, Question 7
Exact Question: Let A=[120114]. Find an QR decomposition of A.

Methodology:

  1. Objective: Factor matrix A into QR, where Q has orthonormal columns (meaning QTQ=I) and R is an upper triangular invertible matrix.
  2. Process:
    • Apply the Gram-Schmidt process to the columns of A to get an orthogonal basis {v1,v2}.
    • Normalize these vectors to get an orthonormal basis {u1,u2}. These form the columns of Q.
    • Compute R using the formula R=QTA.

Solution:


Question 4: Orthogonal Decomposition

Source: Practice Exam 4, Question 11
Exact Question: Let y=[5155], b1=[068], b2=[0211] and W=Span{b1,b2}. The vector y has an orthogonal decomposition y=y^+z, where y^W and zW. Compute z.

Methodology:

  1. Objective: Find z, which is the component of y orthogonal to W. By definition, z=yy^, where y^ is the projection of y onto W.
  2. Crucial Check: The projection formula y^=yv1v1v1v1+yv2v2v2v2 only works if the basis vectors are orthogonal. Check b1b2=012880. They are not orthogonal!
  3. Process:
    • First, apply Gram-Schmidt to {b1,b2} to find an orthogonal basis {v1,v2} for W.
    • Compute y^ using the projection formula with the new orthogonal basis.
    • Compute z=yy^.

Solution:


Question 5: Least-Squares Curve Fitting & Normal Equations

Source: Exam 2, Question 6
Exact Question: Consider the points (1,10), (1,25), (3,10) and (2,10). Find the equation y=a+bx of the best line (in the least-squares sense) that fits these points.

Methodology:

  1. Objective: Find the coefficients (a,b) that best satisfy an inconsistent system of linear equations derived from data points.
  2. Setup the Design Matrix (A) and Observation Vector (b):
    • For the equation y=a+bx, plug each (x,y) data point in to get a row.
    • 10=a+b(1)
    • 25=a+b(1)
    • 10=a+b(3)
    • 10=a+b(2)
    • Write this as a matrix equation Ax=b, where x=[ab]. The first column of A is all 1s (coefficients of a), the second column is the x-values (coefficients of b). b holds the y-values.
  3. Normal Equations: To find the least squares solution x^, you must solve the consistent system: ATAx^=ATb.

Solution:


Additional Note: Generating Design Matrices for Complex Curves

Source: Practice Exam 3, Question 5
(Quick Methodology highlight)
If asked to fit a more complex curve like y=αx+βx5, the process for finding the design matrix X is exactly the same as Step 1 above. The columns of X map to the functions attached to your coefficients.