My questions is this:
How to find the orthogonal projection of vector y= (7,-4,-1,2) on null space
Where A is a matrix
2, 1, 1, 3
3, 2, 2, 1
1, 2, 2, -9
First, row reduce A, find general solution to Ax = 0, and thus find basis for N(A). I found parametric solution is [-5t,7t-s,s,t] and thus basis is [-5,7,0,1] and [0,-1,1,0].
Put basis as columns in a matrix B.
The orthogonal projection matrix is P = B(B^T B)^-1 B^T.
The orthogonal projection is v = Py = [5,-5,-2,-1]. Check this is in N(A) since Av = 0 and/or v is linear combination of basis vectors.
Check y - v = [2,1,1,3] is in A, so is orthogonal to N(A) and thus v is indeed an orthogonal projection of y.
y - v = [7,-4,-1,2] - [0,-3/2,3/2,0] = [7,-5/2,-5/2,2]
must be orthogonal to N(A). But it is not because the dot product with the basis vector [-5,7,0,1] is not zero.
v is an orthogonal projection of y on the subspace spanned by [0,-1,1,0], but not on the subspace N(A).
The definition of an orthogonal projection of a vector y on a subspace W is a vector v in W such that y - v is orthogonal to W. It has the additional property that the distance ||y - v|| is the minimum distance from y to W. You should check as I did that the correct solution satisfies the definition and that the incorrect solution does not.
Another related question:
Finding an orthogonal projection of vector y = (4,8,1) on C(A) (columns space)
on A =
( -2 2)
1/3 ( 1 2)
( 2 1)
For this do I need to find the column space?
Cause after rref(A) i get "leading" valuse corresponding to 2 columns, so i get C(A) = A!!!