How do you solve equations with 3 variables?

ndee

Lifer
Jul 18, 2000
12,680
1
0
[UPDATE]

Here's the problem:

a(k) = p*(k)^2 + q*(k) + r (k=1,2,3,...)

a(1) = 9
a(2) = 31
a(3) = 65
a(4) = 111



Now I made following equations:

Eq1: p*4 + q * 2 + r = 31

Eq2: p*9 + q * 3 + r = 65

Eq3: p*16 + q * 4 + r = 111


Then I subtracted Eq1 from Eq2 which gave me 5x - y = 34

Then I subtracted Eq2 from Eq3 which gave me 7x + y = 46

Then I subtracted the above two again from each other which gave me 12x = 80 (which is wrong though).

Would that be the right way to do?
 

Heisenberg

Lifer
Dec 21, 2001
10,621
1
0
Depends on how many equations you have. If you have three or more, you can possibly find an exact solution. If you have <3, you can only parameterize the solution. (I'm assuming linear equations here.)
 

helpme

Diamond Member
Feb 6, 2000
3,090
0
0
Just make up values for two of the variables, then solve :D

Yeah, it's just like Heisenberg said. You can solve for as many unknowns as you have equations. If you have more equations than unknowns, you solve for any number of possible answers.
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Originally posted by: Heisenberg
Depends on how many equations you have. If you have three or more, you can possibly find an exact solution. If you have <3, you can only parameterize the solution. (I'm assuming linear equations here.)

I can make as many equations as I want. We're now working with the Sum Sign, that big "E"(like the for loop in programming). Wait, got an idea...
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Here's the problem:

a(k) = p*(k)^2 + q*(k) + r (k=1,2,3,...)

a(1) = 9
a(2) = 31
a(3) = 65
a(4) = 111



Now I made following equations:

Eq1: p*4 + q * 2 + r = 31

Eq2: p*9 + q * 3 + r = 65

Eq3: p*16 + q * 4 + r = 111


Then I subtracted Eq1 from Eq2 which gave me 5x - y = 34

Then I subtracted Eq2 from Eq3 which gave me 7x + y = 46

Then I subtracted the above two again from each other which gave me 12x = 80 (which is wrong though).

Would that be the right way to do?
 

maziwanka

Lifer
Jul 4, 2000
10,415
1
0
wait. you have 3 equations, 3 unknowns, all linear. have you tried to solve this?

edit: i solved it.
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Originally posted by: maziwanka
wait. you have 3 equations, 3 unknowns, all linear. have you tried to solve this?

edit: i solved it.

yeah, that's what I'm trying right now but I come up with the wrong results.
 

dullard

Elite Member
May 21, 2001
25,954
4,540
126
My solution methods for problems like that (in order of effort required starting with the least amount of work):
1) Mathcad/Calculator/Some other matrix solver.
2) Mathcad/Excel/Some other form of solver for systems of linear/nonlinear equations (Excel Solver is so powerful, and one of the most useful things ever, but sadly no one seems to use it).
3) Write my own solver.
4) Subtract equations like you were doing (but do it correctly).
 

dullard

Elite Member
May 21, 2001
25,954
4,540
126
Originally posted by: ndee
Eq1: p*4 + q * 2 + r = 31

Eq2: p*9 + q * 3 + r = 65

Eq3: p*16 + q * 4 + r = 111


Then I subtracted Eq1 from Eq2 which gave me 5x - y = 34

Then I subtracted Eq2 from Eq3 which gave me 7x + y = 46

Then I subtracted the above two again from each other which gave me 12x = 80 (which is wrong though).
This is the most time consuming method, but if you don't know the other methods it will work.

Hint 1: There are 4 equations, but you only need 3 of them. The easiest one is: p + q + r = 9. It'll save you some work to use that simplier equation instead. But you don't need to use it. And since you started with the other equations, forget I mentioned this hint.

Hint 2: Don't try switching variables. Why did you replace 'p' with 'x'? Too much confusion and more work.

Hint 3: (9p + 3q +r) - (4p + 2q +r) = 5p + q. You mistakenly used 5p - q. Other than that error, you would have gotten the correct answer.