Y=mx+c to matrix vector?

  • Thread starter uperkurk
  • Start date
  • #1
uperkurk
167
0
So I have these two straight line equations:

[itex]y = -x + 1, y = 2x + 1[/itex] So now I have a single point of intersection of [itex](1y,0x)[/itex]

But the next part of the question is what confuses me but I've included a picture as it's just easier... would someone please be able to take the time to explain each step in the question?

I can do parts B and C but A is confusing me...
 

Attachments

  • Untitled.png
    Untitled.png
    14.5 KB · Views: 908

Answers and Replies

  • #2
Diffy
441
0
This would probably get a better response in the homework question forums.
 
  • #3
berkeman
Mentor
64,186
15,425
This would probably get a better response in the homework question forums.

Thread moved.
 
  • #4
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
So I have these two straight line equations:

[itex]y = -x + 1, y = 2x + 1[/itex] So now I have a single point of intersection of [itex](1y,0x)[/itex]

But the next part of the question is what confuses me but I've included a picture as it's just easier... would someone please be able to take the time to explain each step in the question?

I can do parts B and C but A is confusing me...

Write your two equations like this:
##x+y=1##
##-2x+y=1##
Then put it in the form:$$
\left[ \begin{array}{cc}
? & ?\\ ? & ?
\end{array}\right]
\left[ \begin{array}{c}
x\\y
\end{array}\right] = \left[ \begin{array}{c}
?\\?
\end{array}\right]$$
 
Last edited:
  • #5
uperkurk
167
0
Write your two equations like this:
##x+y=1##
##-2x+y=1##
Then put it in the form:$$
\left[ \begin{array}{cc}
? & ?\\ ? & ?
\end{array}\right]
\left[ \begin{array}{c}
x\\y
\end{array}\right] = \left[ \begin{array}{c}
?\\?
\end{array}\right]$$


[itex]\left[ \begin{array}{cc}
1 & 1\\ -2 & 1
\end{array}\right]
\left[ \begin{array}{c}
x\\y
\end{array}\right] = \left[ \begin{array}{c}
1\\1
\end{array}\right][/itex]

That doesn't even look remotely correct :/
 
  • #6
HallsofIvy
Science Advisor
Homework Helper
43,021
971
Why do you say that? We had kind of assumed that, since you talked about matrices and vectors, you knew what they are and knew how to multiply a matrix and a vector. is that not true?

Can you see that the matrix multiplication gives
[tex]\begin{bmatrix}1 & 1 \\-2 & 1\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}= \begin{bmatrix}x+ y\\ -2x+ y\end{bmatrix}= \begin{bmatrix}1 \\ 1\end{bmatrix}[/tex]
and that two vectors are equal if and only if their corresponding components are equal.

That is, that matrix-vector equation is exactly the same as saying that x+ y= 1 and -2x+ y= 1.
 
  • #7
uperkurk
167
0
Why do you say that? We had kind of assumed that, since you talked about matrices and vectors, you knew what they are and knew how to multiply a matrix and a vector. is that not true?

Can you see that the matrix multiplication gives
[tex]\begin{bmatrix}1 & 1 \\-2 & 1\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}= \begin{bmatrix}x+ y\\ -2x+ y\end{bmatrix}= \begin{bmatrix}1 \\ 1\end{bmatrix}[/tex]
and that two vectors are equal if and only if their corresponding components are equal.

That is, that matrix-vector equation is exactly the same as saying that x+ y= 1 and -2x+ y= 1.


I've multiplied matrices together and I know how to do them but usually I get given them in the form

[tex]\begin{bmatrix}1 & 1 \\-2 & 1\end{bmatrix}\begin{bmatrix}2 & 4 \\ 3 & 1\end{bmatrix}[/tex] For example and then you just multiply the 2 matrices together. But I understand how you explained it thanks.
 
  • #8
uperkurk
167
0
OK I've got to the last stage, I've worked out the matrix inverse which is [tex]\begin{bmatrix}0.333 & -0.333 \\0.666 & 0.333\end{bmatrix}[/tex] and I've verified it using the Identity matrix [tex]\begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}[/tex] so now I just have to plot the 2 straight lines but I'm kinda lost in my own work now...

Am I plotting the original 2 straight lines using the equations or am I plotting them via the matrix and if so how do I do that?

EDIT: It says using the matrix inverse but I'm not sure how to do it
 
  • #9
rock.freak667
Homework Helper
6,223
31
You changed your equations into a matrix form of Ax=B

so if you pre-multiply everything by A-1 you will have

A-1Ax = A-1B

And you worked out what A-1A was. So just work out the right side of the equation.
 
  • #10
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
OK I've got to the last stage, I've worked out the matrix inverse which is [tex]\begin{bmatrix}0.333 & -0.333 \\0.666 & 0.333\end{bmatrix}[/tex] and I've verified it using the Identity matrix [tex]\begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}[/tex]

Get rid of the decimals. That is just an approximation to the inverse and it won't give you the identity when multiplying. There is absolutely no reason to use decimal approximations instead of exact fractional values in this problem.
 
  • #11
uperkurk
167
0
I'm still stuck on this question, I kinda just forgot about it but I really need all the marks I can get, can someone please tell me how to plot the point of intersection of the 2 lines using the inverse matrix?

It is worth 5% so I need to know how to do it.
 
  • #12
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
I'm still stuck on this question, I kinda just forgot about it but I really need all the marks I can get, can someone please tell me how to plot the point of intersection of the 2 lines using the inverse matrix?

It is worth 5% so I need to know how to do it.

Did you read RockFreak's post #9?
 
  • #13
uperkurk
167
0
Yes but I don't understand what he means... I have worked out what A[itex]^{-}[/itex]1 is but I don't know how to plot the matrix elements as points on the graph
 
  • #14
rock.freak667
Homework Helper
6,223
31
Yes but I don't understand what he means... I have worked out what A[itex]^{-}[/itex]1 is but I don't know how to plot the matrix elements as points on the graph

There is no need to plot a graph, you just need to calculate A-1B.
 
  • #15
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
Yes but I don't understand what he means... I have worked out what A[itex]^{-}[/itex]1 is but I don't know how to plot the matrix elements as points on the graph

Why don't you just plot the two straight lines the old fashioned way and look at how the intersection point compares with what you get when you solve the matrix equation by multiplying both sides by A-1?
 
  • #16
uperkurk
167
0
What is B though?
 
  • #17
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
Look at the matrices in your post #5. Use them.
 
  • #18
uperkurk
167
0
2, -1?
 
  • #19
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
2, -1?

Do you really have to ask? Does that point work in both lines? If it does you are done, otherwise check your arithmetic.
 
  • #20
uperkurk
167
0
I'm am losing my temper with this crap now, I don't know what is right, if you don't know what you're doing then you don't know if the answer is right or not... this is not homework, I am revising for a test so please can you just tell me?
 
  • #21
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,568
774
I'm sorry you are angry. You have been told more than enough to help you solve this problem. Perhaps if you can't solve it anyway you don't deserve the 5 marks you would get. I'm going to a movie now. Goodbye.
 
  • #22
uperkurk
167
0
I am clearly confused, I did most of the entire question by myself and now you won't help me on the last bit? Maybe if you told me the method I could work out the answer... but you have said multiply the inverse of matrix A with B which I thought was

1
1

you're not giving me direction.
 
Last edited:
  • #23
rock.freak667
Homework Helper
6,223
31
I am clearly confused, I did most of the entire question by myself and now you won't help me on the last bit? Maybe if you told me the method I could work out the answer... but you have said multiply the inverse of matrix A with B which I thought was

1
1

you're not giving me direction.

[tex]\left[ \begin{array}{cc}
1 & 1\\ -2 & 1
\end{array}\right]
\left[ \begin{array}{c}
x\\y
\end{array}\right] = \left[ \begin{array}{c}
1\\1
\end{array}\right][/tex]


That is the matrix equation which you formed in a previous post. This in the form Ax=B

(start from the left and match each letter to a matrix).

The matrix B is on the right side of the equation, from the equation you formed, what matrix is on the right side? Hence what is the matrix B (you already posted what it was).

You calculated A-1.

I just told you how to get the matrix B, can you now calculate what A-1B would be?
 
  • #24
uperkurk
167
0
Yes... A-1b would be a-1 multiplied by B which gives 2, -1?

If I am calculating it wrong and 2, -1 is not the correct answer then would it be 0, 36?

I am literally multiplying the left hand side by

1
1

which is the right hand side (b)?
 
  • #25
Muphrid
834
2
uperkurk, maybe it's time to take a step back and think about what's going on conceptually. You have a matrix equation [itex]Ax = b[/itex]. What you want to find is the vector [itex]x[/itex], which describes the coordinates of the point where the two lines intersect.

The way you do this is by trying to "get rid of" that A on the left hand side. You do this by multiplying by [itex]A^{-1}[/itex] on the left of both sides of the equation.

[tex]\begin{align*}
Ax &= b \\
A^{-1} A x &= A^{-1} b \\
x &= A^{-1} b \end{align*}[/tex]

When you have calculated [itex]A^{-1} b[/itex], you have the point of intersection. You can plot both lines and check visually that this point is in the right neighborhood, and you should take both lines, plug in the coordinates, and check that the answers are the same.

Do you understand the basic process that's going on here?
 
  • #26
uperkurk
167
0
This is ****ing ridiculous, look back at my first post, I posted the screenshot of the questions, it did not take me very long at all to figure out what needed to be done, but now I am going to be honest.

I have no idea of what you are talking about... whenever I have done y=mx+c equations I have always had 2 sets of coordinates. When you plot those coordinates the lines cross, the exact point at which they cross is the intersection.

The way you are explaining it is that

x = the intersection
A-1 = the inverse of matrix A
b = the matrix [itex]\begin{bmatrix}1 \\ 1\end{bmatrix}[/itex]

So I am reading that as "the point of intersection of x is found by multiplying the inverse of A with B.

Clearly this is incorrect because I even used a matrix calculator and the answer is most definitely [itex]\begin{bmatrix}2 \\ -1\end{bmatrix}[/itex] or [itex]\begin{bmatrix}0 \\ 36\end{bmatrix}[/itex]

So if you would be so kind as to tell me the answer, explain why the answer is what it is, then I can apply what you have showed me to solve some other problems, you can help some other people and I won't have a headache anymore... I am going to be honest I don't think any amount of typing is going to make me realize what I need to do so...
 
  • #27
Muphrid
834
2
You don't seem to be multiplying out [itex]A^{-1} b[/itex] correctly. Show the steps you're using to do this. Matrix multiplication of a matrix and a vector should give you

[tex]\begin{bmatrix}
c & d \\
e & f
\end{bmatrix}
\begin{bmatrix}
g \\
h
\end{bmatrix}
=
\begin{bmatrix}
cg + dh \\
eg + fh
\end{bmatrix}
[/tex]
 
  • #28
uperkurk
167
0
You don't seem to be multiplying out [itex]A^{-1} b[/itex] correctly. Show the steps you're using to do this. Matrix multiplication of a matrix and a vector should give you

[tex]\begin{bmatrix}
c & d \\
e & f
\end{bmatrix}
\begin{bmatrix}
g \\
h
\end{bmatrix}
=
\begin{bmatrix}
cg + dh \\
eg + fh
\end{bmatrix}
[/tex]

[tex]\begin{bmatrix}
1 & 1 \\
-2 & 1
\end{bmatrix}
\begin{bmatrix}
1 \\
1
\end{bmatrix}
=
\begin{bmatrix}
1*1 + 1*1 \\
-2*1 + 1*1
\end{bmatrix}
[/tex]

[itex]2, -1[/itex] I assure you that is the correct answer and I can bet my life that 3 different websites + the windows calculator are not wrong.
 
  • #29
Muphrid
834
2
You multiplied [itex]Ab[/itex], not [itex]A^{-1} b[/itex]. You found [itex]A^{-1}[/itex] already, remember? It was

[tex]A^{-1} = \frac{1}{3} \begin{bmatrix} 1 & -1 \\ 2 & 1 \end{bmatrix}[/tex]
 
  • #30
uperkurk
167
0
\begin{bmatrix} \frac{1}{3} & \frac{1}{3} \\ \frac {-2}{3} & \frac{1}{3} \end{bmatrix} multiplied by matrix B \begin{bmatrix} 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 26 \\ -10 \end{bmatrix} you can check that on the calculator and online matrix calculation websites too...

Someone fix my tex tags please it's screwed up
 
Last edited:
  • #31
Muphrid
834
2
You're still using the wrong matrix, man. You're not going to get any good answer when you're multiplying the wrong things. This is like trying to get the answer to (1/5)x4 when you're multiplying 5x4.
 
  • #32
uperkurk
167
0
ok it's 2:35am, **** the 5% this really is not worth it, this is my retake which if I fail I will have to resit the year so every % matters but if nobody is going to give me the answer after I've attempted to understand 20+ posts then **** the 5%

Thank for your help anyway, if you wish to provide me with the answer, show me what I missed then I'd be extremely grateful, if not then thank you for your patience anyway
 
Last edited:
  • #33
rock.freak667
Homework Helper
6,223
31
ok it's 2:35am, **** the 5% this really is not worth it, this is my retake which if I fail I will have to resit the year so every % matters but if nobody is going to give me the answer after I've attempted to understand 20+ posts then **** the 5%

Thank for your help anyway, if you wish to provide me with the answer, show me what I missed then I'd be extremely grateful, if not then thank you for your patience anyway

Telling you the answer will not help you if in the exam they change the numbers. So far we've told you exactly what to multiply but you keep getting the wrong answer which means that you need to work on multiplying your matrices.

But if you keep getting frustrated, it might be time to step away from it for a while and then come back to it. The more you frustrate yourself, the more mistakes you'll make which will become an endless cycle.


You wrote the correct matrix in post #5 (HallsofIvy explained why it was correct)

You correctly found A-1 in post #8 (just use the exact numbers and not the decimals)

uperkurk told you what to multiply to calculate A-1B in post #30.


Just use those posts as your starting points when you come back to it.
 
  • #34
uperkurk
167
0
OK I've decided to redo the entire question as I feel like last night I was just very tired. So step by step here is what I have worked out.

1. Given the two straight lines [itex]y=-x+1, y=2x+1[/itex] formulate the matrix vector equation representing the two lines in the form [itex]Ax=B[/itex]

I rewrote the equations in the form [tex]x+y=1, -2+x=1[/tex] and put them into the form [tex]Ax=B[/tex]
[itex]\left[ \begin{array}{cc}
1 & 1\\ -2 & 1
\end{array}\right]
\left[ \begin{array}{c}
x\\y
\end{array}\right] = \left[ \begin{array}{c}
1\\1
\end{array}\right][/itex]

2. Find the inverse of the 2 by 2 matrix A obtained obove.

A-1=[itex]\left[ \begin{array}{cc}
1 & -1\\ 2 & 1
\end{array}\right][/itex] because I used the formula supplied to me. But this is not the actual inverse yet, I now must do the ad-bc part which means the real inverse of A is going to be A-1=[itex]\left[ \begin{array}{cc}
\frac{1}{3} & \frac{-1}{3}\\ \frac{2}{3} & \frac{1}{3}
\end{array}\right][/itex]

3. Confirm this is the real inverse by showing that A * A-1= [itex]I[/itex]

So I multiplied A with the inverse of A which produced an identity matrix [itex]\left[ \begin{array}{cc}
1 & 0\\ 0 & 1
\end{array}\right][/itex]

4. Using the matrix INVERSE find the POINT of intersection of the two lines.

After re-reading every post given to me, I am still convinced that to find the point of intersection I have to multiply A-1[itex]\left[ \begin{array}{cc}
\frac{1}{3} & \frac{-1}{3}\\ \frac{2}{3} & \frac{1}{3}
\end{array}\right][/itex] which is the inverse, by B which is [itex]\left[ \begin{array}{cc}
1 \\ 1
\end{array}\right][/itex]

After mutiplying these two matrices by the only way I have been taught, and checking and doubled checking my answer using an online matrix calculator yields the result 0, 36 (check the screenshots)

Now I don't know what more I can do to convince you all that I believe 100% that this is the correct answer, I'm not going to call you all liers I'm sure you know something that I do not.

Is there a special way to multiply matrices that have fractions?
Do I have the correct numbers?
Am I calculating the correct matrices?
Am I completely misunderstanding what a point of intersection is? Do I have to convert something back before doing the calculation?
Where exactly am I going wrong? Why am I going wrong?
Do I have to divide anything or perform some other calculation?

I know that you guys might think the best way for me to learn is to work the answer out by myself, but I think I have put in more than suffient effort myself, I'm attempted for 3 days to understand this question but my brain is not capable of understanding why my calculations are wrong.

I've had it before where I struggle to understand something and then someone has told me the answer, told my why the answer is what it is and where I went wrong and it helped me an insane amount.

But keep telling me "my calculations are wrong" is really really not going to help me.
 

Attachments

  • Untitled.png
    Untitled.png
    1.3 KB · Views: 393
  • Untitled2.png
    Untitled2.png
    845 bytes · Views: 396
  • #35
Muphrid
834
2
You now have the matrices correct, but that calculator is completely wrong. While the x-coordinate is correct, the y coordinate isn't. What's (2/3)x1+(1/3)x1? Do you see whatever mistake there must've been in the multiplication now? This is what you should get for the answer.

I really wanted you to go through and post steps because nothing is remotely close in size to 36 in this problem-- how do you multiply two fractions by 1, add them, and get such a number? So I was skeptical the error would be apparent otherwise. Hopefully this shows you what you need to do.
 

Suggested for: Y=mx+c to matrix vector?

Replies
5
Views
819
Replies
4
Views
279
  • Last Post
Replies
4
Views
371
  • Last Post
Replies
1
Views
460
  • Last Post
Replies
1
Views
120
Replies
9
Views
330
Replies
3
Views
285
  • Last Post
Replies
5
Views
356
Top