Introduction
The first problem in the eighth chapter of the Nine Chapters on the Mathematical Art asks for the yield of three grades of grain from three mixed totals (Yuan 2012). The text is a Chinese collection of problems and methods whose date is uncertain, with estimates running from about 200 BCE to 50 CE (O'Connor and Robertson 2003). This reading solves the problem by elimination: removing one unknown at a time by multiplying an equation and subtracting another from it. It follows the procedure the text describes, then checks the answer in all three equations.
The Problem
Bundles of grain come in three grades: top, middle, and low. Their yields are measured in dou, a traditional unit of volume for grain. You know three facts:
- Three bundles of top grade, two of middle grade, and one of low grade yield 39 dou.
- Two bundles of top grade, three of middle grade, and one of low grade yield 34 dou.
- One bundle of top grade, two of middle grade, and three of low grade yield 26 dou.
Let x be the yield of one bundle of top grade, y of middle grade, and z of low grade, all in dou. The facts become a system of three linear equations, meaning equations in which each unknown is only multiplied by a number and added:
\begin{aligned} 3x + 2y + z &= 39 \\ 2x + 3y + z &= 34 \\ x + 2y + 3z &= 26 \end{aligned}
You're asked to find x, y, and z. The Nine Chapters worked problems like this on a counting board, a surface on which numbers were laid out with small rods (O'Connor and Robertson 2003; Yuan 2012).
Working It Through
Step 1: Lay out the coefficients as a table
The numbers multiplying the unknowns are called coefficients. On the counting board, each fact went into its own column, with the first fact on the right and the totals along the bottom (Yuan 2012):
| Left column | Middle column | Right column |
|---|
| Top grade | 1 | 2 | 3 |
| Middle grade | 2 | 3 | 2 |
| Low grade | 3 | 1 | 1 |
| Total (dou) | 26 | 34 | 39 |
Modern textbooks turn this a quarter-turn and put each equation in a row. The result is a matrix, a rectangular array of numbers treated as one object. A vertical bar separates the totals from the coefficients:
\left(\begin{array}{ccc|c} 3 & 2 & 1 & 39 \\ 2 & 3 & 1 & 34 \\ 1 & 2 & 3 & 26 \end{array}\right)
From here on, the work changes only these numbers. The letters x, y, and z wait until the end.
Step 2: Remove the top grade from the second and third rows
Start with the second row, (2, 3, 1 \mid 34). You want its first number to become 0. The text's approach is to multiply first, then subtract (Yuan 2012). Multiply the second row by 3, the first number of the first row:
3 \times (2, 3, 1 \mid 34) = (6, 9, 3 \mid 102)
Now subtract the first row twice. Twice the first row is (6, 4, 2 \mid 78), and
(6, 9, 3 \mid 102) - (6, 4, 2 \mid 78) = (0, 5, 1 \mid 24).
The new second row says 5y + z = 24. The top grade is gone.
Do the same for the third row, (1, 2, 3 \mid 26). Multiply it by 3 to get (3, 6, 9 \mid 78), then subtract the first row once:
(3, 6, 9 \mid 78) - (3, 2, 1 \mid 39) = (0, 4, 8 \mid 39).
The new third row says 4y + 8z = 39.
Multiplying an equation by a number, or subtracting one true equation from another, never changes which values satisfy the system. So the new system has the same solution as the original.
Step 3: Remove the middle grade from the third row
The second and third rows are now (0, 5, 1 \mid 24) and (0, 4, 8 \mid 39). To clear the 4, multiply the third row by 5 and subtract 4 times the second row:
5 \times (0, 4, 8 \mid 39) - 4 \times (0, 5, 1 \mid 24) = (0, 20, 40 \mid 195) - (0, 20, 4 \mid 96) = (0, 0, 36 \mid 99).
Why 5 and 4? They are the two middle-grade numbers you want to match. Multiplying the third row by 5 and the second row by 4 makes both middle-grade entries equal to 20, so the subtraction clears them. Any pair of multipliers that makes the entries equal would work; these keep the numbers smallest.
The reduced table is triangular, with zeros below the diagonal:
\left(\begin{array}{ccc|c} 3 & 2 & 1 & 39 \\ 0 & 5 & 1 & 24 \\ 0 & 0 & 36 & 99 \end{array}\right)
Each row now has one fewer unknown than the row above it.
Step 4: Solve the last equation, then work back up
The bottom row says 36z = 99. Divide both sides by 36:
z = \frac{99}{36} = \frac{11}{4} = 2\tfrac{3}{4}.
The middle row says 5y + z = 24. Put in z = \tfrac{11}{4}:
5y = 24 - \frac{11}{4} = \frac{96}{4} - \frac{11}{4} = \frac{85}{4}, \quad\text{so}\quad y = \frac{17}{4} = 4\tfrac{1}{4}.
The top row says 3x + 2y + z = 39. Put in both values:
3x = 39 - 2 \cdot \frac{17}{4} - \frac{11}{4} = \frac{156}{4} - \frac{34}{4} - \frac{11}{4} = \frac{111}{4}, \quad\text{so}\quad x = \frac{37}{4} = 9\tfrac{1}{4}.
Working from the bottom row up like this is called back substitution.
Step 5: Check all three equations
Substitute x = \tfrac{37}{4}, y = \tfrac{17}{4}, and z = \tfrac{11}{4} into each original equation. Writing everything in quarters keeps the arithmetic short:
\begin{aligned} 3x + 2y + z &= \tfrac{111 + 34 + 11}{4} = \tfrac{156}{4} = 39 \\ 2x + 3y + z &= \tfrac{74 + 51 + 11}{4} = \tfrac{136}{4} = 34 \\ x + 2y + 3z &= \tfrac{37 + 34 + 33}{4} = \tfrac{104}{4} = 26 \end{aligned}
All three totals match. These values also agree with the answer recorded in the text: 9\tfrac{1}{4}, 4\tfrac{1}{4}, and 2\tfrac{3}{4} dou (Yuan 2012).
Key Considerations
Fractions are part of the method. The answer isn't a whole number, and the text gives it in mixed numbers (Yuan 2012). Multiplying before subtracting keeps whole numbers through the elimination itself, so fractions appear only in the last divisions.
Columns or rows. The Nine Chapters arranges equations in columns and works on columns, where modern books use rows. The operations are the same; only the layout is turned (O'Connor and Robertson 2003). The result also depends on nothing special about grain. Any system of this shape gives way to the same steps, and the same steps scale up to more unknowns: clear the first unknown from every row below the first, then the second from every row below the second, and so on (Hefferon n.d., chap. 1).
Negative numbers. No negative numbers appeared in this problem, but they often do. Subtracting a larger amount from a smaller one leaves a negative entry on the board, and the eighth chapter gives rules for computing with such numbers (O'Connor and Robertson 2003). The modern method handles them the same way.
When the steps fail. Here every step produced a usable row. In some systems, elimination produces a row of zeros with a nonzero total, such as 0 = 5, which means the system has no solution. In others, it produces a row that is all zeros; if no row says something false, that means there are infinitely many solutions. This system had exactly one, because the last row kept a nonzero number, 36, in front of z.
The common mistake: subtracting without multiplying first. It's tempting to subtract the first row straight from the second:
(2, 3, 1 \mid 34) - (3, 2, 1 \mid 39) = (-1, 1, 0 \mid -5).
The first number is now -1, not 0, so the top grade is still in the equation. Nothing was eliminated. Subtraction clears an unknown only when its coefficients match, which is why you multiply the rows first to make them match.
Summary
Elimination turned three tangled equations into a triangular table, and back substitution read off the answers one at a time. Here is the reduced table and the checked solution:
| Row | Top grade | Middle grade | Low grade | Total (dou) |
|---|
| First | 3 | 2 | 1 | 39 |
| Second | 0 | 5 | 1 | 24 |
| Third | 0 | 0 | 36 | 99 |
One bundle of top grade yields x = \tfrac{37}{4} = 9\tfrac{1}{4} dou, middle grade y = \tfrac{17}{4} = 4\tfrac{1}{4} dou, and low grade z = \tfrac{11}{4} = 2\tfrac{3}{4} dou. These values give 39, 34, and 26 in the three original equations.
- The second row came from 3 times the original second row minus twice the first row.
- The third row came from 3 times the original third row minus the first row, then 5 times that minus 4 times the new second row.
- The check uses the original equations, not the reduced ones, so it would catch an arithmetic slip anywhere in the work.
References
- Hefferon, Jim. n.d. Linear Algebra. 4th ed. Colchester, VT: Saint Michael's College. GNU Free Documentation License or CC BY-SA 2.5.
- O'Connor, J. J., and E. F. Robertson. 2003. "Nine Chapters on the Mathematical Art." MacTutor History of Mathematics Archive, University of St Andrews. Last updated December 2003.
- Yuan, Ya-xiang. 2012. "Jiu Zhang Suan Shu and the Gauss Algorithm for Linear Equations." Documenta Mathematica, Extra Volume: Optimization Stories, 9–14.