1.2 Solving Systems of Equations
Continuing our fruits example, we already know that we should get \(10\) mangoes and \(10\) avocados. But, let us go through the exercise of systematically finding the answer.
1.2.1 Substitution
Since \(x = y\), we can substitute either \(x\) for \(y\) or \(y\) for \(x\) as their values are one and the same. We can then write the first equation as:
\[x + x = 20\]
or \[y + y = 20\]
We can start by solving for \(x\), where the left hand side (LHS) \(x + x\) is \(2x\). So, \(x + x = 20\) becomes: \[2x = 20\]
This is an equation, which means we can perform the same operation on both sides of the equation and the equality would still hold. So, we can divide both sides by 2 where the LHS becomes \(x\) and the RHS becomes \(10\). So, the equation becomes:
\[ x = 10\]
That solved for \(x\). To solve for \(y\), we can similarly solve the equation:
\[y + y = 20\]
or we could go back to one of the original equations
\[x + y = 20\]
and substitute back the value of \(x\) since we solved for it, to get:
\[10 + y = 20\]
Again, this is an equation so, we are able to perform the same operation on both sides. To solve for \(y\), we will subtract \(10\) from both sides:
\[10 + y - 10 = 20 - 10\]
Which gives the answer: \[ y = 10\]
No surprise here, we got the answers we expected.
Now, let us say the mangoes and avocados are not exactly 1 bill each. For example, a mango is \(1.34\) and an avocado is \(0.89\). What is the maximum you can buy with the number of mangoes and avocados being equal? The answer now is not as intuitive as before so, this is a situation where the systematic method is valuable.
Let us go back and try to apply the same steps. Our previous equation becomes: \[(x \times mangoes \times 1.34) \, bill + (y \times avocados \times 0.89) \, bill = 20 \times bills\] which simplifies to \[1.34x + 0.89y = 20\]
So, now we have the following system:
Let us start by substituting \(y\) for \(x\) this time since substituting the other way previously was arbitrary. We get:
\[1.34y + 0.89y = 20\]
Adding the LHS, we get:
\[2.23y = 20\]
Dividing both sides by \(2.23\), we get: \[y = 8.97\]
Since \(x = y\), then also \[x = 8.97\]
We previously substituted back in the first equation (here, that would be \(1.34y + 0.89y = 20\)) which was arbitrary and, as you can see it was easier to do that with the second equation here; \(x=y%\). When it gets a bit more complicated, doing enough of these by hand should help develop an intuition of which route is best.
Now, the answer says to get \(8.97\) mangoes and \(8.97\) avocados, which is probably not possible. It is relatively easy to see here why you do not take the answer at face value since we are representing everyday objects. This is an instance where it is important to understand the tools we are using and the problem we are trying to solve and therefore, how applicable the tools are.
So, assuming that you cannot buy but whole fruits, then you can buy \(8\) of each, saving \(2 \times 0.97\). Or, you could break the other restriction of \(x = y\) and buy one more of either mangoes or avocados.
Let us take one more example this time just abstractly. Let us solve the following system of equation by substitution:
To solve by substitution, we first need to isolate one variable. For example, we can isolate \(x\) in the first equation as an easy choice as it has 1 coefficient. It does not matter here which equation and which variable we chose in terms of the answer. Some choices might just take more or fewer steps than others, but we should get the same answer. Isolating \(x\) in the first equation, we get:
\[x = 14 - 2y\]
Now, we substitute that for \(x\) in the other equation to get:
\[ 3(14 - 2y) - y = 7\]
We now have only one unknown, which we can solve for. This simplifies to \(42 - 6y -y = 7\), which gives us:
\[y = 5\]
Now we plug this value back in any of the two original equations as we did before. We can pick any of the two equations because we used both to solve for \(y\) and, \(y=5\) is now tied to both. You might want to try the rest of this example yourself as a quick check that you are following, and see if you get \(x = 4\).
1.2.2 Elimination
Another method for solving systems of equations is called solving by elimination. It also relies on the fact that we can do the same operation to both sides of an equation without effecting the equality. Let us look at the following system of equations:
If we pick any equation, we know two things; that by definition both sides are equal, and that we can perform the same operation to both sides and the equality still holds. So, if we pick the first equation and subtract the second equation from it as follows:
\[ (2x + 3y) - (2x + 2y) = (18) - (14) \]
On the LHS, the \(x\) cancels out, which is why it called Elimination, and we are left with \(y\). On the RHS, we get \(4\). So now we have:
\[ y = 4 \]
Is this the correct answer for \(y\)? Let us explicitly state what we did, and why it is allowed. Consider the first equation again; we know we can add and subtract the same thing from both sides without affecting the equality. The question then is, did we subtract the same thing from both sides? | Since the second equation is, well an equation, then again by definitio both sides are equal. So, subtracting the LHS of the second equation from the LHS of the first equation while also subtracting the RHS of the second equation from the RHS of the first equation is performing the exact operation on both sides of the first equation. What we just did, and in general adding and subtracting equations of a system, still follows the basic logic of equality.
Now that we know \(y=4\), we can plug it back in any equation to solve for the remaining variable \(x\). Let us pick the second equation, to get:
\[ 2x + 2(4) = 14 \]
Solving for \(x\), we get that:
\[ x = 3 \]
Let us look at another system of equations:
It is not useful here to just add or subtract the equations, as that will not eliminate any variable. We need to first multiply one or more of the equations by a factor so that either of the variables \(x\) or \(y\) has the same coefficient in both equations. For example, we could multiply the first equation by \(1/2\) to get \(x + 3/2 y = 9\). Now, we have the same coefficient for \(x\) which is \(1\) so, we can subtract one equation from the other to eliminate \(x\) and then solve for \(y\). However, we are now dealing with fractions, which is something we would like to avoid; not only because it would be easier to deal with by hand, but also it is better for numerical computations. So, we could instead multiply the second equation by \(2\) to get \(2x + 4y = 14\). Now we have the same system of equations as before in example 1.4, so we can proceed the same way.
You may or may not have realized that this was basically the same system we just solved. This might provide you another chance for the realization that it is permitted to do the same operation on both sides of an equation.
Final note, if we cannot multiply one equation to get a coefficient equal to that of another equation, then we can multiply both equations by the coefficient of the other equation’s variable (the variable that we want to eliminate).