11.6 Solving Systems with Gaussian Elimination

Figure 1 German mathematician Carl Friedrich Gauss (1777–1855).
Carl Friedrich Gauss lived during the late 18th century and early 19th century, but he is still considered one of the most prolific mathematicians in history. His contributions to the science of mathematics and physics span fields such as algebra, number theory, analysis, differential geometry, astronomy, and optics, among others. His discoveries regarding matrix theory changed the way mathematicians have worked for the last two centuries.
We first encountered Gaussian elimination in Systems of Linear Equations: Two Variables. In this section, we will revisit this technique for solving systems, this time using matrices.
11.6.1 Writing the Augmented Matrix of a System of Equations
A matrix can serve as a device for representing and solving a system of equations. To express a system in matrix form, we extract the coefficients of the variables and the constants, and these become the entries of the matrix. We use a vertical line to separate the coefficient entries from the constants, essentially replacing the equal signs. When a system is written in this form, we call it an augmented matrix.
For example, consider the following \(2 \times 2\) system of equations.
\[\begin{array}{l} {3x + 4y = 7} \\ {4x-2y = 5} \end{array}\]
We can write this system as an augmented matrix:
\[\left\lbrack {\begin{array}{rr} 3 & 4 \\ 4 & -2 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 7 \\ 5 \end{array}} \right.} \right\rbrack\]
We can also write a matrix containing just the coefficients. This is called the coefficient matrix.
\[\begin{bmatrix} 3 & 4 \\ 4 & -2 \end{bmatrix}\]
A three-by-three system of equations such as
\[\begin{array}{l} {3x - y - z = 0} \\ {\text{~~~~~~~}x + y = 5} \\ {\text{~~~}2x-3z = 2} \end{array}\]
has a coefficient matrix
\[\left\lbrack \begin{array}{rrr} 3 & -1 & -1 \\ 1 & 1 & 0 \\ 2 & 0 & -3 \end{array} \right\rbrack\]
and is represented by the augmented matrix
\[\left\lbrack {\begin{array}{rrr} 3 & -1 & -1 \\ 1 & 1 & 0 \\ 2 & 0 & -3 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 0 \\ 5 \\ 2 \end{array}} \right.} \right\rbrack\]
Notice that the matrix is written so that the variables line up in their own columns: \(x\)-terms go in the first column, \(y\)-terms in the second column, and \(z\)-terms in the third column. It is very important that each equation is written in standard form \(ax + by + cz = d\) so that the variables line up. When there is a missing variable term in an equation, the coefficient is 0.
11.6.2 Writing a System of Equations from an Augmented Matrix
We can use augmented matrices to help us solve systems of equations because they simplify operations when the systems are not encumbered by the variables. However, it is important to understand how to move back and forth between formats in order to make finding solutions smoother and more intuitive. Here, we will use the information in an augmented matrix to write the system of equations in standard form.
11.6.3 Performing Row Operations on a Matrix
Now that we can write systems of equations in augmented matrix form, we will examine the various row operations that can be performed on a matrix, such as addition, multiplication by a constant, and interchanging rows.
Performing row operations on a matrix is the method we use for solving a system of equations. In order to solve the system of equations, we want to convert the matrix to row-echelon form, in which there are ones down the main diagonal from the upper left corner to the lower right corner, and zeros in every position below the main diagonal as shown.
\[\begin{matrix} \text{Row-echelon~form} \\ \begin{bmatrix} 1 & a & b \\ 0 & 1 & d \\ 0 & 0 & 1 \end{bmatrix} \end{matrix}\]
We use row operations corresponding to equation operations to obtain a new matrix that is row-equivalent in a simpler form. Here are the guidelines to obtaining row-echelon form.
- In any nonzero row, the first nonzero number is a 1. It is called a leading 1.
- Any all-zero rows are placed at the bottom on the matrix.
- Any leading 1 is below and to the right of a previous leading 1.
- Any column containing a leading 1 has zeros in all other positions in the column.
To solve a system of equations we can perform the following row operations to convert the coefficient matrix to row-echelon form and do back-substitution to find the solution.
- Interchange rows. (Notation: \(R_{i}\mspace{9mu}\leftrightarrow\mspace{9mu}\mspace{9mu} R_{j}\) )
- Multiply a row by a constant. (Notation: \(cR_{i}\) )
- Add the product of a row multiplied by a constant to another row. (Notation: \(R_{i} + cR_{j})\)
Each of the row operations corresponds to the operations we have already learned to solve systems of equations in three variables. With these operations, there are some key moves that will quickly achieve the goal of writing a matrix in row-echelon form. To obtain a matrix in row-echelon form for finding solutions, we use Gaussian elimination, a method that uses row operations to obtain a 1 as the first entry so that row 1 can be used to convert the remaining rows.
11.6.4 Solving a System of Linear Equations Using Matrices
We have seen how to write a system of equations with an augmented matrix, and then how to use row operations and back-substitution to obtain row-echelon form. Now, we will take row-echelon form a step farther to solve a 3 by 3 system of linear equations. The general idea is to eliminate all but one variable using row operations and then back-substitute to solve for the other variables.
Section Exercises
Verbal
1. Can any system of linear equations be written as an augmented matrix? Explain why or why not. Explain how to write that augmented matrix.
Solution (click to reveal)
Yes. For each row, the coefficients of the variables are written across the corresponding row, and a vertical bar is placed; then the constants are placed to the right of the vertical bar.
2. Can any matrix be written as a system of linear equations? Explain why or why not. Explain how to write that system of equations.
3. Is there only one correct method of using row operations on a matrix? Try to explain two different row operations possible to solve the augmented matrix \(\left\lbrack {\begin{array}{rr} 9 & 3 \\ 1 & {- 2} \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 0 \\ 6 \end{array}} \right.} \right\rbrack.\)
Solution (click to reveal)
No, there are numerous correct methods of using row operations on a matrix. Two possible ways are the following: (1) Interchange rows 1 and 2. Then \(R_{2} = R_{2}-9R_{1}.\) (2) \(R_{2} = R_{1}-9R_{2}.\) Then divide row 1 by 9.
4. Can a matrix whose entry is 0 on the diagonal be solved? Explain why or why not. What would you do to remedy the situation?
5. Can a matrix that has 0 entries for an entire row have one solution? Explain why or why not.
Solution (click to reveal)
No. A matrix with 0 entries for an entire row would have either zero or infinitely many solutions.
Algebraic
For the following exercises, write the augmented matrix for the linear system.
6. \(\begin{array}{l} {8x-37y = 8} \\ {2x + 12y = 3} \end{array}\)
7. \(\begin{array}{l} {\text{~~}16y = 4} \\ {9x - y = 2} \end{array}\)
Solution (click to reveal)
\(\left\lbrack {\left. \begin{array}{rrrr} 0 & & 16 & \\ 9 & & -1 & \end{array} \right|\begin{array}{rr} & 4 \\ & 2 \end{array}} \right\rbrack\)
8. \(\begin{array}{l} {3x + 2y + 10z = 3} \\ {-6x + 2y + 5z = 13} \\ {\text{~~~~~~~~~~~~}4x + z = 18} \end{array}\)
9. \(\begin{array}{l} \\ {\ x + 5y + 8z = 19} \\ {12x + 3y = 4} \\ {3x + 4y + 9z = -7} \end{array}\)
Solution (click to reveal)
\(\left\lbrack {\left. \begin{array}{rrrrrr} 1 & & 5 & & 8 & \\ 12 & & 3 & & 0 & \\ 3 & & 4 & & 9 & \end{array} \right|\begin{array}{rr} & 19 \\ & 4 \\ & -7 \end{array}} \right\rbrack\)
10. \(\begin{array}{l} {6x + 12y + 16z = 4} \\ {\ 19x-5y + 3z = -9} \\ {\text{~~~~~~~~~~~~}x + 2y = -8} \end{array}\)
For the following exercises, write the linear system from the augmented matrix.
11. \(\left\lbrack {\begin{array}{rr} -2 & 5 \\ 6 & -18 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 5 \\ 26 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
\(\begin{array}{l} {-2x + 5y = 5} \\ {6x-18y = 26} \end{array}\)
12. \(\left\lbrack {\begin{array}{rr} 3 & 4 \\ 10 & 17 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 10 \\ 439 \end{array}} \right.} \right\rbrack\)
13. \(\left\lbrack {\begin{array}{rrr} 3 & 2 & 0 \\ -1 & -9 & 4 \\ 8 & 5 & 7 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 3 \\ -1 \\ 8 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
\(\begin{array}{l} {3x + 2y = 3} \\ {- x-9y + 4z = -1} \\ {8x + 5y + 7z = 8} \end{array}\)
14. \(\left\lbrack {\begin{array}{rrr} 8 & 29 & 1 \\ -1 & 7 & 5 \\ 0 & 0 & 3 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 43 \\ 38 \\ 10 \end{array}} \right.} \right\rbrack\)
15. \(\left\lbrack {\begin{array}{rrr} 4 & 5 & -2 \\ 0 & 1 & 58 \\ 8 & 7 & -3 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 12 \\ 2 \\ -5 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
\(\begin{array}{l} {4x + 5y-2z = 12} \\ {\text{~~~~~~~}y + 58z = 2} \\ {8x + 7y-3z = -5} \end{array}\)
For the following exercises, solve the system by Gaussian elimination.
16. \(\left\lbrack {\begin{array}{rr} 1 & 0 \\ 0 & 0 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 3 \\ 0 \end{array}} \right.} \right\rbrack\)
17. \(\left\lbrack {\begin{array}{rr} 1 & 0 \\ 1 & 0 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 1 \\ 2 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
No solutions
18. \(\left\lbrack {\begin{array}{rr} 1 & 2 \\ 4 & 5 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 3 \\ 6 \end{array}} \right.} \right\rbrack\)
19. \(\left\lbrack {\begin{array}{rr} -1 & 2 \\ 4 & -5 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} -3 \\ 6 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
\((-1,-2)\)
20. \(\left\lbrack {\begin{array}{rr} -2 & 0 \\ 0 & 2 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 1 \\ -1 \end{array}} \right.} \right\rbrack\)
21. \(\begin{array}{l} {\ 2x - 3y = - 9} \\ {5x + 4y = 58} \end{array}\)
Solution (click to reveal)
\(\left( {6,7} \right)\)
22. \(\begin{array}{l} {6x + 2y = -4} \\ {3x + 4y = -17} \end{array}\)
23. \(\begin{array}{l} {2x + 3y = 12} \\ {\ 4x + y = 14} \end{array}\)
Solution (click to reveal)
\(\left( {3,2} \right)\)
24. \(\begin{array}{l} {-4x-3y = -2} \\ {\ 3x-5y = -13} \end{array}\)
25. \(\begin{array}{l} {-5x + 8y = 3} \\ {10x + 6y = 5} \end{array}\)
Solution (click to reveal)
\(\left( {\frac{1}{5},\frac{1}{2}} \right)\)
26. \(\begin{array}{l} {\ 3x + 4y = 12} \\ {-6x-8y = -24} \end{array}\)
27. \(\begin{array}{l} {-60x + 45y = 12} \\ {\ 20x-15y = -4} \end{array}\)
Solution (click to reveal)
\(\left( {x,\frac{4}{15}(5x + 1)} \right)\)
28. \(\begin{array}{l} {11x + 10y = 43} \\ {15x + 20y = 65} \end{array}\)
29. \(\begin{array}{l} {2x - y = 2} \\ {3x + 2y = 17} \end{array}\)
Solution (click to reveal)
\(\left( {3,4} \right)\)
30. \(\begin{array}{l} \begin{array}{l} \\ {-1.06x-2.25y = 5.51} \end{array} \\ {-5.03x-1.08y = 5.40} \end{array}\)
31. \(\begin{array}{l} {\frac{3}{4}x - \frac{3}{5}y = 4} \\ {\frac{1}{4}x + \frac{2}{3}y = 1} \end{array}\)
Solution (click to reveal)
\(\left( {\frac{196}{39}, - \frac{5}{13}} \right)\)
32. \(\begin{array}{l} {\frac{1}{4}x - \frac{2}{3}y = -1} \\ {\frac{1}{2}x + \frac{1}{3}y = 3} \end{array}\)
33. \(\left\lbrack {\begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 31 \\ 45 \\ 87 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
\(\left( {31,-42,87} \right)\)
34. \(\left\lbrack {\begin{array}{rrr} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 50 \\ 20 \\ -90 \end{array}} \right.} \right\rbrack\)
35. \(\left\lbrack {\begin{array}{rrr} 1 & 2 & 3 \\ 0 & 5 & 6 \\ 0 & 0 & 8 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 4 \\ 7 \\ 9 \end{array}} \right.} \right\rbrack\)
Solution (click to reveal)
\(\left( {\frac{21}{40},\frac{1}{20},\frac{9}{8}} \right)\)
36. \(\left\lbrack {\begin{array}{rrr} -0.1 & 0.3 & -0.1 \\ -0.4 & 0.2 & 0.1 \\ 0.6 & 0.1 & 0.7 \end{array}\mspace{9mu}\ \left| {\mspace{9mu}\ \begin{array}{r} 0.2 \\ 0.8 \\ -0.8 \end{array}} \right.} \right\rbrack\)
37. \(\begin{array}{l} {-2x + 3y - 2z = 3} \\ {\text{~~~~~}4x + 2y - z = 9} \\ {4x - 8y + 2z = -6} \end{array}\)
Solution (click to reveal)
\(\left( {\frac{18}{13},\frac{15}{13}, - \frac{15}{13}} \right)\)
38. \(\begin{array}{l} {\text{~~~~~}x + y - 4z = -4} \\ {\ 5x - 3y - 2z = 0} \\ {\ 2x + 6y + 7z = 30} \end{array}\)
39. \(\begin{array}{l} {\text{~~~~~}2x + 3y + 2z = 1} \\ {\ -4x - 6y - 4z = -2} \\ {10x + 15y + 10z = 5} \end{array}\)
Solution (click to reveal)
\(\left( {x,y,\frac{1}{2}(1-2x-3y)} \right)\)
40. \(\begin{array}{l} {\text{~~~}x + 2y - z = 1} \\ {- x - 2y + 2z = -2} \\ {3x + 6y - 3z = 5} \end{array}\)
41. \(\begin{array}{l} {\text{~~~}x + 2y - z = 1} \\ {- x-2y + 2z = -2} \\ {3x + 6y-3z = 3} \end{array}\)
Solution (click to reveal)
\(\left( {x, - \frac{x}{2},-1} \right)\)
42. \(\begin{array}{l} {x + y = 2} \\ {\text{~~}x + z = 1} \\ {- y - z = -3} \end{array}\)
43. \(\begin{array}{l} {x + y + z = 100} \\ {\text{~~~}x + 2z = 125} \\ {- y + 2z = 25} \end{array}\)
Solution (click to reveal)
\(\left( {125,-25,0} \right)\)
44. \(\begin{array}{l} {\frac{1}{4}x - \frac{2}{3}z = - \frac{1}{2}} \\ {\frac{1}{5}x + \frac{1}{3}y = \frac{4}{7}} \\ {\frac{1}{5}y - \frac{1}{3}z = \frac{2}{9}} \end{array}\)
45. \(\begin{array}{l} {- \frac{1}{2}x + \frac{1}{2}y + \frac{1}{7}z = - \frac{53}{14}} \\ {\text{~~}\frac{1}{2}x - \frac{1}{2}y + \frac{1}{4}z = 3} \\ {\text{~~~}\frac{1}{4}x + \frac{1}{5}y + \frac{1}{3}z = \frac{23}{15}} \end{array}\)
Solution (click to reveal)
\(\left( {8,1,-2} \right)\)
46. \(\begin{array}{l} {- \frac{1}{2}x - \frac{1}{3}y + \frac{1}{4}z = - \frac{29}{6}} \\ {\text{~~}\frac{1}{5}x + \frac{1}{6}y - \frac{1}{7}z = \frac{431}{210}} \\ {- \frac{1}{8}x + \frac{1}{9}y + \frac{1}{10}z = - \frac{49}{45}} \end{array}\)
Extensions
For the following exercises, use Gaussian elimination to solve the system.
47. \(\begin{array}{l} {\frac{x-1}{7} + \frac{y-2}{8} + \frac{z-3}{4} = 0} \\ {x + y + z = 6} \\ {\frac{x + 2}{3} + 2y + \frac{z-3}{3} = 5} \end{array}\)
Solution (click to reveal)
\(\left( {1,2,3} \right)\)
48. \(\begin{array}{l} {\frac{x-1}{4} - \frac{y + 1}{4} + 3z = -1} \\ {~\mspace{9mu}\frac{x + 5}{2} + \frac{y + 7}{4} - z = 4} \\ {\text{~~~~~~~~}x + y - \frac{z-2}{2} = 1} \end{array}\)
49. \(\begin{array}{l} {\frac{x-3}{4} - \frac{y-1}{3} + 2z = -1} \\ {\frac{x + 5}{2} + \frac{y + 5}{2} + \frac{z + 5}{2} = 8} \\ {x + y + z = 1} \end{array}\)
Solution (click to reveal)
\(\left( {x,\frac{31}{28} - \frac{3x}{4},\frac{1}{28}(-7x-3)} \right)\)
50. \(\begin{array}{l} {\frac{x-3}{10} + \frac{y + 3}{2}-2z = 3} \\ {\frac{x + 5}{4} - \frac{y-1}{8} + z = \frac{3}{2}} \\ {\frac{x-1}{4} + \frac{y + 4}{2} + 3z = \frac{3}{2}} \end{array}\)
51. \(\begin{array}{l} {\frac{x-3}{4} - \frac{y-1}{3} + 2z = -1} \\ {\frac{x + 5}{2} + \frac{y + 5}{2} + \frac{z + 5}{2} = 7} \\ {x + y + z = 1} \end{array}\)
Solution (click to reveal)
No solutions exist.
Real-World Applications
For the following exercises, set up the augmented matrix that describes the situation, and solve for the desired solution.
52. Every day, Angeni’s cupcake store sells 5,000 cupcakes in chocolate and vanilla flavors. If the chocolate flavor is 3 times as popular as the vanilla flavor, how many of each cupcake does the store sell per day?
53. At Bakari’s competing cupcake store, $4{,}520 worth of cupcakes are sold daily. The chocolate cupcakes cost $2.25 and the red velvet cupcakes cost $1.75. If the total number of cupcakes sold per day is 2,200, how many of each flavor are sold each day?
Solution (click to reveal)
860 red velvet, 1,340 chocolate
54. You invested $10{,}000 into two accounts: one that has simple 3% interest, the other with 2.5% interest. If your total interest payment after one year was $283.50, how much was in each account after the year passed?
55. You invested $2{,}300 into account 1, and $2,700 into account 2. If the total amount of interest after one year is $254, and account 2 has 1.5 times the interest rate of account 1, what are the interest rates? Assume simple interest rates.
Solution (click to reveal)
4% for account 1, 6% for account 2
56. Bikes’R’Us manufactures bikes, which sell for $250. It costs the manufacturer $180 per bike, plus a startup fee of $3,500. After how many bikes sold will the manufacturer break even?
57. A major appliance store has agreed to order vacuums from a startup founded by college engineering students. The store would be able to purchase the vacuums for $86 each, with a delivery fee of $9,200, regardless of how many vacuums are sold. If the store needs to start seeing a profit after 230 units are sold, how much should they charge for the vacuums?
Solution (click to reveal)
$126
58. The three most popular ice cream flavors are chocolate, strawberry, and vanilla, comprising 83% of the flavors sold at an ice cream shop. If vanilla sells 1% more than twice strawberry, and chocolate sells 11% more than vanilla, how much of the total ice cream consumption are the vanilla, chocolate, and strawberry flavors?
59. At an ice cream shop, three flavors are increasing in demand. Last year, banana, pumpkin, and rocky road ice cream made up 12% of total ice cream sales. This year, the same three ice creams made up 16.9% of ice cream sales. The rocky road sales doubled, the banana sales increased by 50%, and the pumpkin sales increased by 20%. If the rocky road ice cream had one less percent of sales than the banana ice cream, find out the percentage of ice cream sales each individual ice cream made last year.
Solution (click to reveal)
Banana was 3%, pumpkin was 7%, and rocky road was 2%
60. A bag of mixed nuts contains cashews, pistachios, and almonds. There are 1,000 total nuts in the bag, and there are 100 less almonds than pistachios. The cashews weigh 3 g, pistachios weigh 4 g, and almonds weigh 5 g. If the bag weighs 3.7 kg, find out how many of each type of nut is in the bag.
61. A bag of mixed nuts contains cashews, pistachios, and almonds. Originally there were 900 nuts in the bag. 30% of the almonds, 20% of the cashews, and 10% of the pistachios were eaten, and now there are 770 nuts left in the bag. Originally, there were 100 more cashews than almonds. Figure out how many of each type of nut was in the bag to begin with.
Solution (click to reveal)
100 almonds, 200 cashews, 600 pistachios