# Homework Help: Find the QR Factorization of a matrix

1. Jun 10, 2010

1. The problem statement, all variables and given/known data
Find the QR factorization for the 4x3 matrix M
1 1 0
1 0 2
1 0 1
1 1 1

2. Relevant equations
M = QR

3. The attempt at a solution
I got the first two columns of Q correct, but im getting the third wrong for some reason beyond me.
for Q, i got u1= 1/2 (1, 1, 1, 1) (vertical, not horizontal)
and u2 = 1/2 (1, -1, -1, 1) (once again vertical, not horizontal, dont know how to make matrices easily on here)
I got R correct except for the last number in the bottom right, need v3perp.

thanks

Last edited: Jun 10, 2010
2. Jun 10, 2010

anyone?

3. Jun 10, 2010

### cronxeh

Q=[-0.5 0.5 -0.5 -0.5; -0.5 -0.5 0.5 -0.5; -0.5 -0.5 -0.5 0.5; -0.5 0.5 0.5 0.5]
r=[-2 -1 -2; 0 1 -1; 0 0 1; 0 0 0]

4. Jun 10, 2010

your matrices answers seem to big. there should only be three columns in Q

are you sure those are right. i got the answer not the solution and my u1 and u2 are the same as that, but its my u3 that is wrong. it says it is (-3/2, 3/2, 1/2, 1/2)

5. Jun 10, 2010

### cronxeh

Before we decide to correct my work, lets multiply Q and R, something you could've done with your Q and R to see your mistake

>> [-0.5 0.5 -0.5 -0.5; -0.5 -0.5 0.5 -0.5; -0.5 -0.5 -0.5 0.5; -0.5 0.5 0.5 0.5]*[-2 -1 -2; 0 1 -1; 0 0 1; 0 0 0]

ans =

1 1 0
1 0 2
1 0 1
1 1 1

6. Jun 10, 2010

ahh but you are wrong. you have TOO MANY columns. there are only three columns in Q and you just added a row in R to make M work.
i just figure my solution is correct and the soltion book is wrong
Q is
.5 .5 -.5
.5 -.5 .5
.5 -.5 -.5
.5 .5 .5

R is
2 1 2
0 1 -1
0 0 1

that equals M
so i believe that is right.
thanks anyways tho

7. Jun 10, 2010

### cronxeh

Ok then..

8. Jun 11, 2010

### hgfalling

You know that Q is supposed to be an orthogonal matrix, right? So if your Q isn't square, you've done something wrong.

9. Jun 11, 2010

nah man. Q is fine. R is the orthogonal matrix i believe. or at least it is always squared
my professor and another solution book both verified my answer.

thanks you guys, but this problem is good