hi there, im a student in gr11 currenting taking computer science.
I have a summative due 2-3 days from now and need help with explantion on one part of my program that im missing.
So far I've learned, functions,loops, and some understanding of arrays.
The project is to write a program that solves linear system of equations by elimination. a 4 by 5. example...
3a +2b -7c + 5d = -9
-2 -b + 5c -d = 14
a + B + C + d = 8
5a + 2b -3c +4d =8
solution: A=2, b-1,c=4, d=3
There was two possible solution. one was make a really long repetitive elimination for each varable by isolating them and then solving it for each of the remaining 3. then you solve for 2 then 1.
Another one was when i saw a buddy of mine do something called matrix gaussian elimination. He helped me get the basic understanding as in he told me to look on the internet and this is what i've concluded.
you want an result to look like..
aa bb cc dd :A
0a eb fc gd :B
0a 0b hc id :C
0a 0b 0c jd :D
i've done the problem on paper solving by using my head and i think you want all the numbers below a to be the same then subtract, then all the numbers under e, under h and solve in some way.
Can anyone please explain how to get this into a program in C++. I'm sorry this is very long to read.
PS:teacher never taught or even understand that much of matrix(though i think he lied on that part that he doesnt know alot about it.)
PPS: basic rules inorder to get the results...
-you can add/subtract one of the rows A B C D to another changing all the numbers.
-you can add/subtract any two rows and the sum/value can replace another row
e.g A+B = C or A+B=D
unfortunetily.. the computer is dumb and you have to find a way to make the computer do such a thing :(
Edited 6 Years Ago by numbawang: additional info of my knowledge