Nearly two thousand years before Carl Friedrich Gauss, Chinese officials were solving systems of simultaneous equations by arranging numbers in a grid and eliminating them column by column, the same method taught in university linear algebra today. Ancient Chinese mathematics was practical, algorithmic and astonishingly advanced, and much of it grew from one remarkable book.
Counting Rods: Calculating on a Board
From at least the Warring States period (475–221 BCE), Chinese calculators used counting rods: small sticks of bamboo or bone laid out on a board or table. Numbers were written in base 10 with place value, with vertical and horizontal rod arrangements alternating between places so that neighbouring digits would not run together. An empty space stood for zero; a round zero symbol appeared in Chinese texts much later, around the 13th century.
Counting rods had a clever feature: red rods for positive numbers and black rods for negative ones (some texts used slanted rods instead). This allowed Chinese mathematicians to work with negative numbers centuries before they were accepted in Europe. The abacus, now so closely associated with China, became widespread only later, around the 14th to 16th centuries.
The Nine Chapters on the Mathematical Art
The Jiuzhang Suanshu (The Nine Chapters on the Mathematical Art) is the most important text of ancient Chinese mathematics. It reached its final form around the 1st century CE, during the Han dynasty, but drew on much older material. A related earlier text, the Suan Shu Shu ("Writings on Reckoning"), was found in 1984 in a tomb sealed around 186 BCE.
The Nine Chapters contains 246 problems, each with an answer and a method. Its chapters cover:
- Field measurement (areas and fractions)
- Millet and rice (proportions and exchange)
- Distribution by proportion
- Short width (square and cube roots)
- Construction works (volumes)
- Fair taxes (transport and distribution)
- Excess and deficit (a method of double false position)
- Fangcheng (rectangular arrays: simultaneous linear equations)
- Gougu (right triangles)
In 263 CE, the mathematician Liu Hui wrote a famous commentary on the Nine Chapters, adding proofs and explanations. Liu Hui's version is the one that survives.
Worked Example 1: The fangcheng method (Chapter 8, Problem 1)
The problem reads, in modern words: 3 bundles of top-grade grain, 2 of medium and 1 of low yield 39 dou. 2 top, 3 medium and 1 low yield 34 dou. 1 top, 2 medium and 3 low yield 26 dou. How much does one bundle of each yield?
Let \( a, b, c \) be the yields of top, medium and low grain:
$$ 3a + 2b + c = 39 \quad (1) $$
$$ 2a + 3b + c = 34 \quad (2) $$
$$ a + 2b + 3c = 26 \quad (3) $$
The Chinese arranged these coefficients in columns on the counting board and eliminated entries by cross-multiplying and subtracting, never dividing until the end.
Step 1: Eliminate \( a \) from (2): multiply (2) by 3 and subtract 2 times (1):
$$ (6a + 9b + 3c) - (6a + 4b + 2c) = 102 - 78 $$
$$ 5b + c = 24 \quad (4) $$
Step 2: Eliminate \( a \) from (3): multiply (3) by 3 and subtract (1):
$$ (3a + 6b + 9c) - (3a + 2b + c) = 78 - 39 $$
$$ 4b + 8c = 39 \quad (5) $$
Step 3: Eliminate \( b \): multiply (5) by 5 and subtract 4 times (4):
$$ (20b + 40c) - (20b + 4c) = 195 - 96 $$
$$ 36c = 99 \quad\Rightarrow\quad c = \frac{99}{36} = \frac{11}{4} = 2\tfrac{3}{4} $$
Step 4: Back-substitute into (4):
$$ 5b = 24 - \tfrac{11}{4} = \tfrac{85}{4} \quad\Rightarrow\quad b = \tfrac{17}{4} = 4\tfrac{1}{4} $$
Step 5: Back-substitute into (1):
$$ 3a = 39 - 2\left(\tfrac{17}{4}\right) - \tfrac{11}{4} = 39 - \tfrac{45}{4} = \tfrac{111}{4} \quad\Rightarrow\quad a = \tfrac{37}{4} = 9\tfrac{1}{4} $$
The Nine Chapters gives exactly these answers: \( 9\tfrac{1}{4} \), \( 4\tfrac{1}{4} \) and \( 2\tfrac{3}{4} \) dou. Check in (3): \( 9.25 + 2(4.25) + 3(2.75) = 9.25 + 8.5 + 8.25 = 26 \). This procedure is, step for step, what we now call Gaussian elimination, and the cross-multiplication rule naturally produced negative numbers along the way, which is why rules for them appear in the same chapter.
The Gougu Theorem
Chapter 9 uses the gougu rule, the Chinese name for what we call Pythagoras' theorem: gou is the shorter leg and gu the longer leg. A classic problem asks about a reed growing in the centre of a square pond 10 chi wide. The reed sticks 1 chi above the water; when pulled to the edge, its tip just reaches the bank. How deep is the water?
If the depth is \( x \), the reed's length is \( x + 1 \), and half the pond's width is 5:
$$ x^2 + 5^2 = (x + 1)^2 \quad\Rightarrow\quad x^2 + 25 = x^2 + 2x + 1 \quad\Rightarrow\quad x = 12 $$
The water is 12 chi deep and the reed 13 chi long, giving the triple 5, 12, 13.
Calculating Pi
Liu Hui used inscribed polygons, much like Archimedes, starting with a hexagon and doubling to 192 sides. He obtained \( \pi \approx 3.14 \), and later 3.1416 using a 3,072-sided polygon. Around 480 CE, Zu Chongzhi went further, proving
$$ 3.1415926 < \pi < 3.1415927 $$
and recommending the fraction \( \tfrac{355}{113} \approx 3.14159292 \), which is accurate to six decimal places. No one in the world found a more accurate value for nearly a thousand years.
The Chinese Remainder Theorem
The Sunzi Suanjing (Master Sun's Mathematical Manual), written sometime between the 3rd and 5th centuries CE, asks: "There are certain things whose number is unknown. Counted by threes, 2 remain; by fives, 3 remain; by sevens, 2 remain. How many things are there?"
Worked Example 2: Solving Sunzi's problem
We need \( N \) with remainders 2, 3 and 2 when divided by 3, 5 and 7.
Step 1: Find numbers that handle one divisor each while being multiples of the other two:
- 70 is a multiple of 5 and 7, and \( 70 \div 3 \) leaves remainder 1.
- 21 is a multiple of 3 and 7, and \( 21 \div 5 \) leaves remainder 1.
- 15 is a multiple of 3 and 5, and \( 15 \div 7 \) leaves remainder 1.
Step 2: Multiply each by the required remainder and add:
$$ 2 \times 70 + 3 \times 21 + 2 \times 15 = 140 + 63 + 30 = 233 $$
Step 3: Subtract multiples of \( 3 \times 5 \times 7 = 105 \) to get the smallest answer:
$$ 233 - 2 \times 105 = 23 $$
Check: \( 23 = 7 \times 3 + 2 \), \( 23 = 4 \times 5 + 3 \), \( 23 = 3 \times 7 + 2 \). Correct. Sunzi's answer is 23. In 1247, Qin Jiushao generalised the method in his Mathematical Treatise in Nine Sections. Today the Chinese Remainder Theorem is used in computer arithmetic and RSA cryptography.
Did You Know?
- The triangle of binomial coefficients we call Pascal's triangle appears in Yang Hui's work of 1261, citing the earlier mathematician Jia Xian (11th century), about 400 years before Pascal.
- Zu Chongzhi's fraction \( \tfrac{355}{113} \) is called milü, "the close ratio".
- Chinese mathematics was taught in an official imperial examination system for civil servants during the Tang dynasty.
Key Takeaways
- Chinese calculators used counting rods with base-10 place value and red and black rods for positive and negative numbers.
- The Nine Chapters (around the 1st century CE) contains 246 practical problems with algorithmic solutions.
- Its fangcheng method is equivalent to Gaussian elimination, developed nearly 2,000 years earlier.
- Zu Chongzhi found pi to seven decimal places and the fraction \( \tfrac{355}{113} \).
- Sunzi's remainder problem is the origin of the Chinese Remainder Theorem.
From simultaneous equations to modular arithmetic, Amathify's experts and PhD scholars provide step-by-step solutions and assignment help, so message us on WhatsApp or use the Ask a Question form.
Stuck on a problem or assignment?
Our experts and PhD scholars solve maths, physics and chemistry — step by step.