# Linear Algebra

1. Apr 13, 2009

### Lchan1

1. The problem statement, all variables and given/known data

I have a question about an old exam and i have no idea where to start. The question says:
Find the vector in the row space A=[1 0 1 1 /new row 0 1 -1 1] 2x4 matrix nearest to the vector (1,1,-1,1)
I have absolutely no clue how to start.

2. Relevant equations

3. The attempt at a solution
I have no clue how to start this...
my attempt was looking at it being confused for an hour

2. Apr 13, 2009

### Dunkle

Try writing the vector (1,1,-1,1) as a sum of two vectors, one parallel to Row A and one orthogonal to Row A. Hint: what does an orthogonal projection tell you?

3. Apr 13, 2009

### Lchan1

(2/3,2/3,-1,1/3)
does that sound right to you?
I project the vector onto the row space.
and v-the projection gives me nearest vector.

4. Apr 13, 2009

### Dunkle

I arrived at a different answer. You may want to check and see if the vector you found is in Row(A). This is equivalent to seeing if you can find real constants a and b such that

$$a(1,0,1,1) + b(0,1,-1,1) = (\frac{2}{3}, \frac{2}{3}, -1, \frac{1}{3})$$

I think you will find that the system of linear equations associated with this equation is inconsistent, so the vector you found does not satisfy the requirements of the problem. You may want to try and compute the orthogonal projection again.

5. Apr 13, 2009

### Lchan1

should i just project the vector to the matrix?
which i will get (1/3,1/3,0,2/3)

6. Apr 13, 2009

### Dunkle

Let r1 and r2 be the first and second rows of A respectively, and let v be the vector given in the problem.

The orthogonal projection you should be computing is:

$$\frac{v \cdot r_1}{r_1\cdot r_1}r_1 + \frac{v \cdot r_2}{r_2 \cdot r_2}r_2$$

This guarantees the vector you find is in Row A. Do you see why?

7. Apr 13, 2009

### Lchan1

Yea as this projects v onto r.
I think i didnt understand the question correctly. that's why i got the other answer.
so they wanted the vector in A that is neartest to vector r which is projecting R onto A.
and the projection could be expressed by r1 and r2

8. Apr 13, 2009

### Dunkle

I think you are confused. The projection I gave you is the projection of (1,1,-1,1) onto Row A. We know that
Row A = span{(1,0,1,1), (0,1,-1,1)} = a(1,0,1,1)+b(0,1,-1,1). They are asking for the vector in Row A that is closest to the vector (1,1,-1,1), which is the same as asking, "what is the orthogonal projection of (1,1,-1,1) onto the subspace Row A?"

Do you need any further clarification?

9. Apr 13, 2009