Section 3.2 Examples
Subsection 3.2.1 A simple example
Some of the first recorded uses of systems of equations in human history (without all the modern algebraic symbolism, of course) were applications to agriculture and commerce.
Problem 3.2.1. Nutrient profiles in horse feed.
You have determined from recommendations in reputable reference sources that your large working horse requires 1150 g of protein, 36 g of calcium, and 25 g of phosphorous daily. You have had samples of your hay, grain, and pasture analyzed and have determine their nutritional components as percentages by mass.
Hay | Grain | Pasture | |
Protein | 8.2 | 13.9 | 4.1 |
Calcium | 0.46 | 0.06 | 0.15 |
Phosphorous | 0.21 | 0.45 | 0.07 |
How much of each feed type should your horse consume daily?
Solution.
Let \(H,G,P\) represent the amount in kilograms of the three types of feed that the horse will be fed. Then each nutritional requirement leads to an equation.
\begin{equation*}
\begin{array}{lrcrcrcr}
\text{Protein:} \amp
0.082H \amp + \amp 0.139G \amp + \amp 0.041P \amp = \amp 1.150 \\
\text{Calcium:} \amp
0.0046H \amp + \amp 0.0006G \amp + \amp 0.0015P \amp = \amp 0.036 \\
\text{Phosphorous:} \amp
0.0021H \amp + \amp 0.0045G \amp + \amp 0.0007P \amp = \amp 0.025
\end{array}
\end{equation*}
Multiplying each equation by \(10^4\) to clear all decimals, we obtain an augmented matrix for the system,
\begin{equation*}
\left[\begin{array}{ccc|c}
820 \amp 1390 \amp 410 \amp 11500 \\
46 \amp 6 \amp 15 \amp 360 \\
21 \amp 45 \amp 7 \amp 250
\end{array}\right]
\end{equation*}
If one were to solve this system, it would be revealed that the horse needs to eat close to 18 kg of pasture and be fed about 1.7 kg of hay and close to 2 kg of grain daily.
Subsection 3.2.2 Flow in networks
In a traffic network, fluid network, communications network, etc., matter cannot be created or destroyed. So at each node we can always apply some sort of law of conservation: the number of units entering the node (whether cars, litres of fluid, data packets, etc.) must be equal to the number of units exiting the node.
Let’s apply this to the network in Discovery 3.1, starting at the top node and working clockwise to form flow-in-equals-flow-out equations.
\begin{align*}
4 + w \amp= 2 + x\\
x + 6 \amp= 9 + y\\
y + 4 \amp= z + 6\\
8 + z \amp= w + 5
\end{align*}
In order to facilitate conversion to an augmented matrix, we usually write a system of equations with all the variable terms on the left and collect all the constant values on the right.
\begin{align*}
\amp\left\{\begin{array}{rcrcrcrcr}
w \amp - \amp x \amp \amp \amp \amp \amp = \amp -2 \\
\amp \amp x \amp - \amp y \amp \amp \amp = \amp 3 \\
\amp \amp \amp \amp y \amp - \amp z \amp= \amp 2 \\
-w \amp \amp \amp \amp \amp \amp z \amp= \amp -3
\end{array}\right.
\amp \amp\implies\amp
\amp\left[\begin{array}{rrrr|r}
1 \amp -1 \amp 0 \amp 0 \amp -2 \\
0 \amp 1 \amp -1 \amp 0 \amp 3 \\
0 \amp 0 \amp 1 \amp -1 \amp 2 \\
-1 \amp 0 \amp 0 \amp 1 \amp -3
\end{array}\right]
\end{align*}
Looking at the network diagram in Discovery 3.1, notice how all the external legs are known, and the internal legs are unknown. In trying to measure the behaviour of a system, it might be necessary to try to be as as unintrusive as possible, so you might be confined to measuring behaviour at points leading in or out of the overall system. Unfortunately, if you try to solve the system above, you will find that at least one more measurement of one of the internal legs is necessary in order to come to a definite solution.
Subsection 3.2.3 Balancing chemical equations
Similarly to network analysis, there is a law of conservation at play in a chemical reaction since atoms are not created, destroyed, or changed to other kinds of atoms. So all of the atoms that make up the reactant particles must also be present in the product particles.
Let’s apply this to the chemical reaction in Discovery 3.2, analyzing each atom in turn to balance the number of that atom in the reactant particles with the number of that atom in the product particles.
\begin{align*}
\amp\text{Nitrogen:} \amp a \amp= c\\
\amp\text{Hydrogen:} \amp 3a \amp= c + 2d\\
\amp\text{Oxygen:} \amp 2b \amp= c + d
\end{align*}
Again, we move all the variables to one side, obtaining in this case a homogeneous system, and then convert to a matrix.
\begin{align*}
\amp\left\{\begin{array}{rcrcrcrcr}
a \amp \amp \amp - \amp c \amp \amp \amp = \amp 0 \\
3a \amp \amp \amp - \amp c \amp - \amp 2d \amp = \amp 0 \\
\amp \amp 2b \amp - \amp c \amp - \amp d \amp= \amp 0
\end{array}\right.
\amp\amp\implies\amp
\amp\left[\begin{array}{rrrr}
1 \amp 0 \amp -1 \amp 0 \\
3 \amp 0 \amp -1 \amp -2 \\
0 \amp 2 \amp -1 \amp -1
\end{array}\right]
\end{align*}
This system must be consistent because it is homogeneous, but we have four variables and only three equations, so the solution will require a parameter. This makes sense physically, because we could always increase the number of reactant particles and just produce a larger number of product particles, but the parametric equations in the system solution will constrain the numbers of particles to be in balance relative to each other. But usually we prefer to describe the reaction as simply as possible by choosing the parameter value to be the smallest positive integer that clears all fractions that may have arisen in the solving process.
Subsection 3.2.4 Polynomial interpolation
It is a fundamental principle in plane geometry that given two distinct points there is one unique line that passes through those points. And this principle continues to higher degree polynomials.
For three points in the plane with disinct \(x\)-values there exists one unique parabola that passes through those points (where we consider a line as a degenerate form of parabola in the case that the three points are collinear). For four points with distinct \(x\)-values, there exists a unique cubic polynomial whose graph passes through all four points. And so on.
It may seem that this is not a linear problem, since polynomial functions involve powers of the variable \(x\text{.}\) But \(x\) is not the variable here — the unknown coefficients that define the particular polynomial function are what we are trying to solve for.
To illustrate how linear algebra can solve this problem, let’s work through the associated discovery activities from Discovery guide 3.1.
Example 3.2.2. Linear interpolation.
In Discovery 3.3, we would like to determine the line \(y=mx+b\) that passes through the points \((-3,4)\) and \((2,-1)\text{.}\) A point in the plane is on a particular line precisely when its coordinates satisfy the equation that defines the line. Requiring this gives us two equations, one for each point:
\begin{align*}
4 \amp= m\cdot (-3) + b,\\
-1 \amp= m\cdot 2 + b.
\end{align*}
We already have the variables to one side, so we will just flip the equations around. However, we have chosen to put the variables in the order \(b,m\) to emphasize a pattern that will become evident as we do more examples.
\begin{align*}
\amp\left\{\begin{array}{rcrcr}
b \amp - \amp 3m \amp = \amp 4 \\
b \amp + \amp 2m \amp = \amp -1
\end{array}\right.
\amp\amp\implies\amp
\amp\left[\begin{array}{rr|r}
1 \amp -3 \amp 4 \\
1 \amp 2 \amp -1
\end{array}\right]
\end{align*}
Solving this system would lead to one unique solution, as expected.
Example 3.2.3. Quadratic interpolation.
In Discovery 3.4, we would like to determine the parabola \(y=ax^2+bx+c\) that passes through the points \((-1,-4)\text{,}\) \((1,0)\text{,}\) and \((2,5)\text{.}\) Again, each point leads to an equation by requiring that the point’s coordinates satisfy the parabola’s defining equation.
\begin{align*}
-4 \amp= a (-1)^2 + b(-1) + c\\
0 \amp= a(1)^2 + b(1) + c\\
5 \amp= a(2)^2 + b(2) + c
\end{align*}
Again, we will reverse the order of the variables to highlight the patterns.
\begin{align*}
\amp\left\{\begin{array}{rcrcrcr}
c \amp + \amp (-1)b \amp + \amp (-1)^2a \amp = \amp -4 \\
c \amp + \amp 1b \amp + \amp 1^2a \amp = \amp 0 \\
c \amp + \amp 2b \amp + \amp 2^2a \amp = \amp 5
\end{array}\right.
\amp\amp\implies\amp
\amp\left[\begin{array}{rrr|r}
1 \amp -1 \amp (-1)^2 \amp -4 \\
1 \amp 1 \amp 1^2 \amp 0 \\
1 \amp 2 \amp 2^2 \amp 5\\
\end{array}\right]
\end{align*}
And again, solving this system would lead to one unique solution, as expected.
General interpolation.
Now let’s set up the solution to the general polynomial interpolation problem, as in Discovery 3.5. We have undetermined, degree-\(n\) polynomial equation \(y=a_nx^n + a_{n-1}x^{n-1} + \dotsb + a_1x + a_0\) that we would to make pass through the points \((x_1,y_1),(x_2,y_2),\dotsc,(x_{n+1},y_{n+1})\text{.}\)
Hopefully the pattern is obvious now, allowing us to proceed directly to the corresponding augmented matrix.
\begin{equation*}
\left[\begin{array}{ccccc|c}
1 \amp x_1 \amp x_1^2 \amp \cdots \amp x_1^n \amp y_1 \\
1 \amp x_2 \amp x_2^2 \amp \cdots \amp x_2^n \amp y_2 \\
\amp \amp \vdots \amp \amp \amp \vdots \\
1 \amp x_{n+1} \amp x_{n+1}^2 \amp \cdots \amp x_{n+1}^n \amp y_{n+1} \\
\end{array}\right]
\end{equation*}