1 Solving Linear System
A linear system is given below. please write a program to find its solution, using kramer’s rule.
\[ 3a + 4b + 5c + 6d + 7e =78\] \[ 2b + 3c + 4d + 5e =50 \] \[c + 2d + 3e =25 \] \[2d + 9e =46 \] \[3d + e =19 \]
Note that the solution of a two-variable system is known. For example, Given the system below
\[ ax + by =c \] \[ dx + ey =f \]
The solution is
\[ x = \frac{ce - bf}{ae - bd} \] \[ y = \frac{af - cd}{ae - bd} \]
So you can use the above rule to solve d
and e
first, and than solve c
, b
and finally a
. After finding the solution, please verify its correctness. That is, substitute the solution found to the left-hand side of the linear system and print out the right-hand side numbers. These numbers should match with those given above. The output of your program should have the following format:
Solution:
a=x b=xxx c=x d=x e=x
Verification:
3a+ 4b+ 5c+ 6d+ 7e= 78
2b+ 3c+ 4d+ 5e= 50
c+ 2d+ 3e= 25
2d+ 9e= 46
3d+ e= 19