We saw that substitution is one way of solving systems of linear equations, but the method of substituion is not very practical when there are more than 2 or 3 varibables. In this section, we start learning a more generalizable and easy-to-automate way of solving systems of linear equations.
Mathematicians often see solutions to given problems and ask βWhat if \(\ldots\text{?}\)β What are the right kinds of βwhat ifβ questions to ask? Itβs impossible to know at first, and so mathematicians very often ask wrong questions. That is, they often ask questions and find that the answer isnβt particularly interesting. However, asking enough questions often will result in some good right questions. The answers to βrightβ questions help us see a bigger picture more clearly and usually lead to something applicable beyond the initial problem. The moral of the story is: donβt be afraid of doing something wrong because mathematicians do it all the time!
Recall that in the previous section, we worked through a few examples of solving linear equations using substitution; that is, we solved for one variable in one equation and substituted the resulting expression into another equation. What is a good question to ask after seeing ExampleΒ 1.1.8? Here are two possibilities (though not the only two):
Did we really have to call the red balls β\(r\)β? Could we call them β\(q\)β?
Letβs look at the first question. Would the solution to our problem change if we called the red balls \(q\text{?}\) No, we picked the letter βrβ because it made us think of βredβ, but we could have picked \(x\text{,}\)\(y\text{,}\) or any other letter instead. The process of solving would have been exactly the same if we used βqβ for the number of red balls, and at the end weβd find that \(q = 10\text{,}\) and we would know that this meant that we had \(10\) red balls.
Now letβs look at the second question. Suppose we had \(60\) balls, but the other relationships stayed the same. How would the situation and solution change? Letβs compare the original equations to the new equations.
The process of solving would stay exactly the same, substituting \(2g\) for \(r\) in the third equation to get that \(b=2g+g=3g\text{,}\) and then substituting for both \(r\) and \(b\) in the first equation to get that \(2g+3g+g=60\text{.}\) The only difference is that total is \(6g=60\) instead of \(30\text{,}\) so the value of \(g\) is twice as much, and thus also the values of \(r\) and \(b\) are twice what they had been.
In fact, it is a great discovery to realize that all that matters about a linear system are the constants and the coefficients of the equations. By systematically handling these, we can solve any set of linear equations in a way that saves on processing power, whether the processing is being done by a human or by a computer.
Letβs return to ExampleΒ 1.1.8. As we mentioned before, there isnβt just one right way of finding the solution to this system of equations. Here is another way to do it.
First, we rewrite the equations so that all variables are on the left of the equal sign and all constants are on the right. Also, for a bit more consistency, letβs list the variables in alphabetical order in each equation. Therefore we can write the equations as
A nice feature of this is that the only equation with a \(b\) in it is the first equation. One could say that we eliminated the \(b\) from the third equation.
This would eliminate the \(g\text{,}\) but to use this method systematically, weβre always going to want to multiply and add, not subtract. Subtracting \(2g\) is the same as adding \(-2g\) though!
Multiply the top equation by \(-2\) and add to the bottom equation.
Letβs now do both of those steps in a row to eliminate the \(g\) from the first and third equations; multiply the second equation by \(-1\) and add that to the first equation, replacing the first equation with that sum, and multiply the second equation by \(-2\) and add that to the third equation, replacing the third equation. Our new system of equations now becomes
Now letβs eliminate the \(r\)βs in the first and second equation. To remove the \(r\) in the first equation, letβs multiply the third equation by \(-\frac{3}{2}\) and add the result to the first equation, replacing the first equation with that sum. To remove the \(r\) in the second equation, we can multiply the third equation by \(\frac{1}{2}\) and add that to the second equation, replacing the second equation with that sum. This gives us:
Everyone thinks of a different way to solve a system using substitution β Mary might choose a different variable to solve for than John chose, and Alicia might start with a different equation, and Steven might substitute into a different equation. When there are more than 2 or 3 variables, substituting gets really laborious, and itβs not always clear what steps should come next in order to make progress in solving. Elimination can be made into an algorithm, a set of steps to follow in a particular order that will always result in an answer.β1β
Even if sometimes the answer is that there is no solution, or that there are infinitely many solutions.
This is both comforting and practical; if you have to work a problem by hand, itβs nice to know youβll be able to complete it as long as you remember the steps, and if you donβt have to work the problem by hand, an algorithm means itβs possible to program a computer to do the steps for you.
Substitute the expression for \(y\) from the first equation into the second equation, yielding \(6x + 3\left(\frac{3+3x}{2}\right) = 8\text{,}\) which simplifies to
Multiply the second equation by \(-2\) and add the result to the first equation, resulting in \(-3x+0y=-1\text{,}\) and multiplying both sides by \(\frac{-1}{3}\) yields
Substitute the value of \(y\) from the second equation into the first equation, resulting in \(-3x+2\cdot 2 = 3\text{,}\) so \(-3x+4=3\text{,}\) which means that
We noticed earlier that there is nothing special about the letters \(b\text{,}\)\(g\) and \(r\text{;}\) we could have used \(x\text{,}\)\(y\) and \(z\text{,}\) or \(x_1\text{,}\)\(x_2\) and \(x_3\text{.}\) Our work demonstrating the method of elimination suggests that we donβt actually need to write the variable names at all, as long as we carefully line them up in the system of equations so that we can keep track of whatβs being eliminated.
Letβs look again at our system of equations in (1.2.1) and write the coefficients and the constants in a rectangular array. If any variables are missing from any equations, we write that the coefficient is \(0\text{.}\)
Notice how even the equal signs are gone; we donβt need them, for we know that the last entry in each row is the constant of the corresponding equation.
The horizontal lines of numbers form rows and the vertical lines of numbers form columns. A matrix with \(m\) rows and \(n\) columns is said to be an \(m\times n\) matrix (said out loud as βan \(m\) by \(n\) matrixβ).
If a matrix corresponds to a linear system of equations such that the last column corresponds to the constants of the system, we call the matrix an augmented matrix.
We tend to use capital letters for matrices (the plural of matrix), such as \(A\text{,}\)\(B\text{,}\) and \(C\text{,}\) and we use lowercase letters with subscripts for the entries within a matrix. That is, \(a_{32}\) means βthe number in the third row and second columnβ of matrix \(A\text{.}\)
Since matrices contain all the important information from a linear system, we are working our way up to solving systems using only augmented matrices. Using matrices saves us from having to write out the variables over and over again, and matrices are also easy for a computer to understand and manipulate. Matrices are important objects in their own right, and in future sections, we will be able to compute with matrices even when we donβt think of them as corresponding to a system of linear equations.
Matrices are arrays of numbers. Right now, we are most interested in augmented matrices, whose entries correspond to the coefficients and constants of a system of linear equations.
In the following exercises, convert the given augmented matrix into a system of linear equations. Use the variables \(x_1\text{,}\)\(x_2\text{,}\) etc.