Module 7 Practice: Inner Product Spaces
10 problems on dot products, orthogonality, projections, Gram-Schmidt, and least squares.
Problem 1
Compute the dot product and angle between u = (1, 2, -1) and v = (3, -1, 1).
Solution
u · v = 3 - 2 - 1 = 0. Since dot product = 0, the vectors are orthogonal. Angle = 90 degrees.
Problem 2
Find a unit vector in the direction of v = (3, 4).
Solution
||v|| = sqrt(9 + 16) = 5. Unit vector: (3/5, 4/5).
Problem 3
Project y = (7, 1) onto u = (1, 3).
Solution
proj_u(y) = [(7+3)/10](1,3) = (10/10)(1,3) = (1, 3). Residual: (7,1)-(1,3) = (6,-2). Check: (6,-2)·(1,3) = 6-6 = 0.
Problem 4
Let W = span{(1,0,1), (0,1,0)}. Project y = (1, 2, 3) onto W.
Solution
u1 = (1,0,1), u2 = (0,1,0). u1 · u2 = 0 (orthogonal basis).
proj = [(1+3)/2](1,0,1) + [2/1](0,1,0) = 2(1,0,1) + 2(0,1,0) = (2, 2, 2).
Residual: (1,2,3) - (2,2,2) = (-1, 0, 1). Check: (-1,0,1) · (1,0,1) = 0 and (-1,0,1) · (0,1,0) = 0.
Problem 5
Apply Gram-Schmidt to {(1, 1, 0), (1, 0, 1)}.
Solution
v1 = (1, 1, 0). x2 · v1 = 1. v1 · v1 = 2.
v2 = (1,0,1) - (1/2)(1,1,0) = (1/2, -1/2, 1).
Check: v1 · v2 = 1/2 - 1/2 + 0 = 0. Orthogonal basis: {(1,1,0), (1/2, -1/2, 1)}.
Problem 6
Is {(1/sqrt(2), 1/sqrt(2)), (-1/sqrt(2), 1/sqrt(2))} an orthonormal set?
Solution
Dot product: (1/sqrt(2))(-1/sqrt(2)) + (1/sqrt(2))(1/sqrt(2)) = -1/2 + 1/2 = 0. Orthogonal.
||v1|| = sqrt(1/2 + 1/2) = 1. ||v2|| = 1. Both unit vectors. Yes, orthonormal.
Problem 7
Set up the normal equations for fitting y = c0 + c1*t to data (1, 2), (2, 3), (3, 7).
Solution
A = [1 1; 1 2; 1 3], b = (2, 3, 7). A^T A = [3 6; 6 14]. A^T b = [12; 29].
Normal equations: [3 6; 6 14](c0, c1)^T = (12, 29)^T.
Problem 8
Solve the normal equations from Problem 7 to find the best-fit line.
Solution
3c0 + 6c1 = 12 and 6c0 + 14c1 = 29. From first: c0 = 4 - 2c1. Substitute: 6(4 - 2c1) + 14c1 = 29 → 24 - 12c1 + 14c1 = 29 → 2c1 = 5 → c1 = 5/2.
c0 = 4 - 5 = -1. Best-fit line: y = -1 + (5/2)t.
Problem 9
Find the distance from y = (3, 1, 1) to W = span{(1, 0, 0), (0, 1, 0)}.
Solution
proj_W(y) = (3, 1, 0) (projection onto xy-plane). Distance = ||y - proj|| = ||(0, 0, 1)|| = 1.
Problem 10
Verify the Cauchy-Schwarz inequality for u = (2, 1) and v = (-1, 3).
Solution
|u · v| = |-2 + 3| = 1. ||u|| = sqrt(5). ||v|| = sqrt(10). ||u||*||v|| = sqrt(50) = 5*sqrt(2) is approximately 7.07.
1 ≤ 7.07. Cauchy-Schwarz holds.