# Thread: find the orthogonal projection

1. ## find the orthogonal projection

My questions is this:
How to find the orthogonal projection of vector y= (7,-4,-1,2) on null space
N(A)

Where A is a matrix
A =
2, 1, 1, 3
3, 2, 2, 1
1, 2, 2, -9

2. Originally Posted by yevi
My questions is this:
How to find the orthogonal projection of vector y= (7,-4,-1,2) on null space
N(A)

Where A is a matrix
A =
2, 1, 1, 3
3, 2, 2, 1
1, 2, 2, -9
Are you supposed to do this entirely by hand? I used a computer program for half of it.

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.

3. Well, I did exactly the same and got the same answer [5,-5,-2,1]
But the answer should be 3/2(0,-1,1,0)

4. Originally Posted by yevi
My questions is this:
How to find the orthogonal projection of vector y= (7,-4,-1,2) on null space
N(A)

Where A is a matrix
A =
2, 1, 1, 3
3, 2, 2, 1
1, 2, 2, -9
Originally Posted by JakeD
Are you supposed to do this entirely by hand? I used a computer program for half of it.

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.
Originally Posted by yevi
Well, I did exactly the same and got the same answer [5,-5,-2,1]
But the answer should be 3/2(0,-1,1,0)
To me that answer is an error because for v = [0,-3/2,3/2,0] to be an orthogonal projection, by definition

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).

5. Well the following questiob is to find the distance from from vector u to sub space of N(A).

For this I do: ||y-P(y)||^2

The answer of this is: sqrt(131/2), and we get this only if we use 3/2(0,-1,1,0) as P(y)

6. Originally Posted by yevi
Well the following questiob is to find the distance from from vector u to sub space of N(A).

For this I do: ||y-P(y)||^2

The answer of this is: sqrt(131/2), and we get this only if we use 3/2(0,-1,1,0) as P(y)
Either you have not posted the question correctly or the solution you were given is in error. v = 3/2(0,-1,1,0) is not an orthogonal projection on N(A) because y - v = (7,-5/2,-5/2,2) is obviously not orthogonal to N(A). It also does not have the minimum distance to N(A) as an orthogonal projection must. Using the correct solution v = (5,-5,-2,-1), y - v = (2,1,1,3) and the distance is sqrt(15) < sqrt(131/2).

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.

7. I gave the question to a friend of mine.
And he got the same result ([5,-5,-2,1]).
So I can we can say about 99% that given answer is a mistake.

Thank you.

8. 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!!!
Why??

9. Originally Posted by yevi
Another related question:

Finding an orthogonal projection of vector y = (4,8,1) on C(A) (columns space)

on
Code:
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!!!
Why??

I think you needed to confirm the columns of A are a basis for C(A). And rref is a way to do that.

Now why are the columns of A a basis for C(A)? Because the columns of A are linearly independent.

10. Originally Posted by JakeD
I think you needed to confirm C(A) = span(A)
What do you mean by this? You mean I should get the same projection vector on space of A and space of C(A)? If yes, then something wrong again cause the given answer is: p=1/9(46,52,29)

11. Originally Posted by JakeD
I think you needed to confirm the columns of A are a basis for C(A). And rref is a way to do that.

Now why are the columns of A a basis for C(A)? Because the columns of A are linearly independent.
I originally said to "confirm C(A) = span(A)." That's what yevi is asking about. But span(A) is the definition of C(A). I edited it to "confirm the columns of A are a basis for C(A)."

Originally Posted by yevi
What do you mean by this? You mean I should get the same projection vector on space of A and space of C(A)? If yes, then something wrong again cause the given answer is: p=1/9(46,52,29)
I meant if the columns of A are a basis for C(A) then you can compute the projection matrix using A. I agree that the projection vector is not the p you give.

12. Could it be that I made a mistake and A!=C(A)??