Ask your own question, for FREE!
Mathematics 8 Online
OpenStudy (anonymous):

How do I solve this system of linear equations in three variables: x+y-z=-2 -x+y+2z=-1 3x-y-3z=2

OpenStudy (anonymous):

Are you familiar with matrices?

OpenStudy (anonymous):

I would need a bit of a review on them. How can I use matrices to solve the problem?

OpenStudy (e.mccormick):

Put it in matrix form, solve for RREF, the right hand side is the answer. There is also back substitution and a few others.

OpenStudy (anonymous):

Add the equations together.

OpenStudy (e.mccormick):

This look familliar to you?\[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ -1 & 1 & 2 & -1 \\ 3 & -1 & -3 & 2 \end{array} \right] \]

OpenStudy (e.mccormick):

If so, then you probably did the matrix method of solving these before. If not, well, there are other ways.

OpenStudy (anonymous):

Yeah, I just looked up a quick lesson on that and I got that matrix, but what do I do with it now? Can I punch it into my calculator? I forgot how to do that as well, sorry!

OpenStudy (e.mccormick):

Writing the next step.

OpenStudy (e.mccormick):

\[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ -1 & 1 & 2 & -1 \\ 3 & -1 & -3 & 2 \end{array} \right] \] 3 row 2 + row 3 -> new row 3 row 1 + row 2 -> new row 2 \[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 2 & 3 & -1 \end{array} \right] \]

OpenStudy (e.mccormick):

You keep doing basic row operations like that until the diagonal is all 1s and everything else on the left is 0. The right of the | is then the answer. This is Reduced Row Echelon Form, or RREF.

OpenStudy (anonymous):

Okay, I see how you got the new row 2 but how you got row 3 is confusing me. I was never taught RREF. Are you saying that the answers to the problem are (-2,-3,-1)?

OpenStudy (e.mccormick):

We are not to the answers yet. Row 3 I did before changing row 2. Now, I may have made a mistake, so let's check it. Row 2 is: -1 1 2 -1, and 3 of those are -3 3 6 -3 Row 3 is: 3 -1 -3 2 When I add those, it is -3 3 6 -3 3 -1 -3 2 = 0 2 3 -1

OpenStudy (anonymous):

Oh okay, I didn't see the you multiplied it by 3, my bad. So when using RREF do I always multiply the second row by 3 and add it to the third row?

OpenStudy (e.mccormick):

No. RREF means your end result is this: \[\left[ \begin{array}{ccc|c} 1 & 0 & 0 & x \\ 0 & 1 & 0 & y \\ 0 & 0 & 1 & z \end{array} \right] \] So you use whatver gets you to 1s and 0s in the proper places. I just did one where I needed 52 of a row... LOL. So it is certainly not set to 3!

OpenStudy (e.mccormick):

Now, you can just get to REF, not RREF, and use back subsitution. We are only one step away from REF.

OpenStudy (e.mccormick):

\[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 2 & 3 & -1 \end{array} \right] \] row 2 + (-1) row 3 -> new row 3 \[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 0 & -2 & 1 \end{array} \right] \] That means: \[-2z=1\] And that is enough information to solve for z. With z you can solve y. With y and z you can solve x.

OpenStudy (e.mccormick):

That means:\[ \begin{array}{rrrl} 1x & +1y & -1z & =-2 \\ & 2y & +1z &=-3 \\ & & -2z &=1 \end{array} \]

OpenStudy (e.mccormick):

We can continue to RREF, or you can use that and back substiture. Either way is fine.

OpenStudy (e.mccormick):

To be honest, RREF would have a lot of fractions with this one. Hehe. But you have to deal with that either way.

OpenStudy (e.mccormick):

Wait... did I make a mistake on that last one... I think so...

OpenStudy (anonymous):

Okay back at the step row 2 + (-1) row 3 -> new row 3, wouldn't the new row three be 0 0 -2 | -2 rather than 0 0 -2 | 1

OpenStudy (e.mccormick):

Yah, you saw it too. \[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 2 & 3 & -1 \end{array} \right] \] row 2 + (-1) row 3 -> new row 3 \[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 0 & -2 & -2 \end{array} \right] \] \(\therefore \;z=1\) \[ \begin{array}{rrrl} x & +y & -z & =-2 \\ & 2y & +z & =-3 \\ & & z & =1 \end{array} \]

OpenStudy (anonymous):

Okay, I see now! So now to get y I could substitute 1 in for z? 2y+(1)=-3 2y=-4 y=-2

OpenStudy (anonymous):

Then just plug in y=-2 and z=1 for the equation: x+y-z=-2

OpenStudy (e.mccormick):

After that, I get: \(2y +1 = -3 \Rightarrow 2y=-4 \Rightarrow y=-2\) \(x -2 -1 = -2 \Rightarrow x=1\) So the answers are:\[x=1,\;y=-2,\;z=1\]

OpenStudy (e.mccormick):

Sorry bout the confusion in the middle. It is the small mistakes that kick us all in the anatomy.

OpenStudy (anonymous):

So how do I know when I have the right answers on the left side of the matrix? What exactly has to be aligned?

OpenStudy (anonymous):

*right side

OpenStudy (e.mccormick):

It is the 0s that are the big clue. If there is 0x and 0y, then only the z information is there.

OpenStudy (anonymous):

So I want to keep multiplying rows until they get to 0's for the two variables?

OpenStudy (anonymous):

I'm just confused as to how you knew which rows to add and how much to multiply them by. Are there rules as to which rows I can add?

OpenStudy (e.mccormick):

For REF, also known as Upper Triangular Form because the upper part sort of forms a triangle, yes. You can add multiples of any row and replace another row. Also, you can multiply a row by a constant and replace just that one row. So in that lat bit: \[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 0 & -2 & -2 \end{array} \right] \] I cam multiply the last row by \(-\frac{1}{2}\) and get: \[\left[ \begin{array}{ccc|c} 1 & 1 & -1 & -2 \\ 0 & 2 & 1 & -3 \\ 0 & 0 & 1 & 1 \end{array} \right] \]

OpenStudy (e.mccormick):

To be clear, when you add two rows, the one you replace needs to be one of the two you added.

OpenStudy (anonymous):

So if I added say row 1 and row 3, I could choose which one I wanted to add?

OpenStudy (e.mccormick):

Otherwise you lose information from the matrix.

OpenStudy (anonymous):

*replace

OpenStudy (e.mccormick):

Yah, you can add R1 and R3 and then use the result to replace either R1 or R3. But if you kill off R2 with R1 and R3 you would loose the information held in R2 and mess it up.

OpenStudy (e.mccormick):

So to change R2, you must use R2 and R3 or R2 and R1.

OpenStudy (e.mccormick):

So what I did was look at what would give me 0s below. OH! And one other huge thing, you can swap rows!

OpenStudy (anonymous):

Swap rows?

OpenStudy (e.mccormick):

Yah, ever had one where it was looking for x, y, and z, but one of the equations did not have x?

OpenStudy (anonymous):

Not yet.

OpenStudy (e.mccormick):

Ah, ok. If you are trying to have the zeros on the bottom, the ones without something need to go towards the botom. Let me give you an example.

OpenStudy (e.mccormick):

Lets say this was in the book: \[\begin{array}{rrrl} & y & -z& =1\\ 4x & & -2z & =3\\ x & -2y & +z & =2 \end{array} \]

OpenStudy (e.mccormick):

Well, as a direct writing that into matrix form it is: \[\begin{array}{ccc|c} 0 & 1 & -1& 1\\ 4 & 0 & -2 & 3\\ 1 & -2 & 1& 2 \end{array} \]

OpenStudy (anonymous):

Mhmm, now do what?

OpenStudy (e.mccormick):

This is where swap rows comes in handy. I have 1x on the bottom. For back substitution, that is the best thing for the first row. So I want to swap the first and third rows. \[\begin{array}{ccc|c} 1 & -2 & 1& 2\\ 4 & 0 & -2 & 3\\ 0 & 1 & -1& 1 \end{array} \] But I am not done swapping. Can you see another good swap?

OpenStudy (anonymous):

Sorry, why is 1x the best for the first row? Don't give me the next swap just yet, I want to understand this haha.

OpenStudy (e.mccormick):

Well, there are three reasons: 1) If the first non-zero number in a row is a 1, it is easy to use multiples of that row to knock out that variable in other rows. 2) If the first non-zero number in a row is a 1, it is easy to solve for it in the end when doing back subsitution. 3) The first row is what you use to solve for x, so having 1 in the first spot means 1x.

OpenStudy (e.mccormick):

FYI: We are reviewing about the first couple classes of a linear algebra course, so do not worry if it seems like it is a bit much.

OpenStudy (anonymous):

Oh okay, so would the next swap be R3 an R2 because we use R2 to solve for y and like you said in point, having 1 in the second spot means 1y?

OpenStudy (anonymous):

*in point 3

OpenStudy (e.mccormick):

Exactly \[\begin{array}{ccc|c} 1 & -2 & 1& 2\\ 0 & 1 & -1& 1\\ 4 & 0 & -2 & 3 \end{array} \]

OpenStudy (e.mccormick):

What do you think you would do next with this one?

OpenStudy (anonymous):

Not sure, I'm stuck. Can I get a hint? Haha.

OpenStudy (anonymous):

I don't think I see anymore swaps...so now we're either going to add two rows or multiply one, but I'm just not sure about what to do.

OpenStudy (e.mccormick):

Well, you want 0 in the bottom part. You have an x as a 1 up top, and a y as a 1 in the second row, but the z row still has 4 xes in it.

OpenStudy (anonymous):

So we want 1z in R3?

OpenStudy (e.mccormick):

And nothing else.

OpenStudy (e.mccormick):

Basically this is three steps from having the answer to z.

OpenStudy (anonymous):

Can I multiply R1 by -4 then add it to R3 to get a new R3 but keep my R1 as: 1 -2 1 | 2

OpenStudy (anonymous):

Or is that against the rules?

OpenStudy (anonymous):

Nevermind, I don't even know where I'd go with that haha. I'm stuck again.

OpenStudy (e.mccormick):

That is just fine. You are using R1 and R3 to get a new R3.

OpenStudy (e.mccormick):

In fact, it is the right path.

OpenStudy (e.mccormick):

\[\begin{array}{ccc|c} 1 & -2 & 1& 2\\ 0 & 1 & -1& 1\\ 4 & 0 & -2 & 3 \end{array} \] (-4)R1+R3 for new R3. \[\begin{array}{ccc|c} 1 & -2 & 1& 2\\ 0 & 1 & -1& 1\\ 0 & 8 & -6 & -5 \end{array} \]

OpenStudy (e.mccormick):

Now the target is the 8 in the second spot of R3.

OpenStudy (anonymous):

Oh! Okay haha. So now I have: 1 -2 1 | 2 0 1 -1 | 1 0 8 -6 | 5

OpenStudy (anonymous):

Oops, I think I meant -5

OpenStudy (e.mccormick):

Well, -5. Hehe. That is what gets me a lot too!

OpenStudy (e.mccormick):

So just do the same srt of thing with R2 and R3 to 0 out the y spot in R3.

OpenStudy (e.mccormick):

It looks like we have a fraction coming our way, but for something I made up at random that it not unusual.

OpenStudy (anonymous):

Okay, so just (-8)R2 + R3 = New R3 New R3= 0 0 -2 | -13

OpenStudy (e.mccormick):

Exactly. I copy and paste mine, so I can edit the whole thing, so I got: (-8)R2+R3 for new R3. \[\begin{array}{ccc|c} 1 & -2 & 1& 2\\ 0 & 1 & -1& 1\\ 0 & 0 & 2 & -13 \end{array} \]

OpenStudy (anonymous):

And then I just solve by plugging in z to all the other equations.

OpenStudy (anonymous):

z= -2/13

OpenStudy (e.mccormick):

Yes, which I am not going to do thanks to my lovely \(z=-\frac{13}{2}\)

OpenStudy (e.mccormick):

\(R3 \times \frac{1}{2}\) is the last step to get a 1 there.... \[\begin{array}{ccc|c} 1 & -2 & 1& 2\\ 0 & 1 & -1& 1\\ 0 & 0 & 1 & -\dfrac{13}{2} \end{array} \]

OpenStudy (e.mccormick):

Now, can you see the upper triangle I mentioned a while back?

OpenStudy (anonymous):

Oh yeah, I got the numbers on the wrong side of the fraction hah.

OpenStudy (anonymous):

Yeah, I can see it now!

OpenStudy (e.mccormick):

When it looks like that, back substitution will finally work. If you just have ANY numbers in the diagonals it is upper triangular. If they are 1s, it is Row Echelon Form. If you have 1s on the the diagonal and 0s both above and below, it is Reduced Row Echelon Form. I mention this because on a scientific calculator they have REF and RREF funtions. That is what they mean.

OpenStudy (anonymous):

Okay, thanks. Now could you help me with just one last system? If you can't then that's okay, you've already helped a ton!

OpenStudy (e.mccormick):

And in an hour, we have covered a really good chunk of matrix math. I think it will help with anything like this you run into. It eve works for larger arrays of functions, like things with 5 or 10 variables, but it is a TON of work.

OpenStudy (e.mccormick):

Well, put it in here and work on it. I'll check what you do while I work on my own systems. I am doing my Linear Algebra homework between posts. Hehe

OpenStudy (anonymous):

Okay.

OpenStudy (anonymous):

\[2x -y+3z=16\] \[4x+y-2z=6\] \[-x-3y+z=-5\]

OpenStudy (anonymous):

2 -1 3 | 16 4 1 -2 | 6 -1 -3 1 | -5

OpenStudy (anonymous):

I don't know how to put that into the correct formatting on this website, haha.

OpenStudy (e.mccormick):

For the pretty printing, between \(\backslash [ \backslash ]\)

OpenStudy (e.mccormick):

\begin{array}{ccc|c} 2 & -1 & 3& 16\\ 4 & 1 & -2& 6\\ -1 & -3 & 1 & -5 \end{array}

OpenStudy (e.mccormick):

AARGH! It is fixing it.... hmmm Right click on that, and you should hav something about viewing the code.

OpenStudy (anonymous):

Okay, so first I want zeroes on the bottom, I already have a 1Z

OpenStudy (e.mccormick):

Well, the 1z may change in the process, but do not worry too much about that.

OpenStudy (e.mccormick):

I tried emailing you the LaTeX formatting. I don't know if they fix it in email.

OpenStudy (anonymous):

I got the message.

OpenStudy (anonymous):

Okay, so what if I did this: (3)R2+R3

OpenStudy (anonymous):

Replace R3 with New R3

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!