Zhang Qiujian Suanjing Lower Scroll 14

## **Problem**

答曰：甲六十，乙四十五，丙三十。

術曰：三甲、二乙、一丙，錢三百。四甲、六乙、三丙，錢六百。二甲、二乙、三丙，錢三百。如方程，即得。
草曰：置三甲於右上，二乙於右中，一丙於右下，錢三百於下。又置四甲於中上，六乙於中中，三丙於中下，錢六百於下。又置二甲於左上，二乙於左中，三丙於左下，錢三百於下。以右行上三遍因左行，甲得六，乙得六，丙得九，錢得九百。以右行再減之，餘乙二，丙七，錢三百。又以右行上三遍因中行，得甲一十二，乙一十八，丙九，錢一貫八百。以右行四遍減之，餘乙一十，丙五，錢六百。左行進一位，得乙二十，丙七十，錢三貫。以中行再減之，餘得丙六十，錢一貫八百。以六十除之，得丙三十。又中行錢六百，減一百五十，餘四百五十，以乙一十除之，得乙四十五。又去右行錢，減一百二十，餘一百八十。以甲三除之，得甲六十。合前問。

Answer: A 60 [coins], B 45 [coins], and C 30 [coins].

Method: 3 A, 2 B, 1 C, 300 coins. 4 A, 6 B, 3 C, 600 coins. 2 A, 2 B, 3 C, 300 coins. Use the *fangcheng* method to obtain the answer.
Explanation: Set 3 for A on the top [position] right [column], 2 for B on the middle right, 1 for C on the bottom right, and 300 coins beneath. Then set 4 for A on the top [position] middle [column], 6 for B on the middle middle, 3 for C on the bottom middle, and 600 coins beneath. Then set 2 for A on the top [position] left [column], 2 for B on the middle left, 3 for C on the bottom left, and 300 coins beneath. Use the top [position] right [column] value to triple the left column, giving 6 for A, 6 for B, 9 for C, and 900 coins. Subtract the [left column] using the right column [twice] to get 2 for B, 7 for B, and 300 coins remaining. Again, use the top [position] right [column] value to triple the middle column, giving 12 for A, 18 for B, 9 for C, and 1800 coins (錢一貫八百 *qian yi guan ba bai*). Subtract the middle column by the right column four times to get 10 for B, 5 for B, and 600 coins remaining. On the left column shift down one position [to the pivot] and get [by multiplying by 10] 20 for B, 70 for C, and 3000 coins (錢三貫 *qian san guan*). Subtract by the middle column [twice] to get 60 for C and 1800 coins (錢一貫八百 *qian yi guan ba bai*) remaining. Divide [the left column] by 60 to get 30 [coins] for C. Next subtract 150 from the 600 coins in the middle column to get 450 remaining, and then divide by 10 to get 45 [coins] for B. Next subtract 120 from the coins in the right column to get 180 coins. Divide by 3 to get 60 [coins] for A. This solves the problem.

**Translation note:** The explanation uses the term *guan* (貫 guàn) to mean a stash of 1000 coins.

## **Solution**

**Step 1: Set up the matrix**

In ancient China, matrices were organized in columns from right to left. This is in contrast with the modern European appraoch of arranging the matrix in rows from left to right. Each column in the initial matrix that Zhang Qiujian constructed is scaled to eliminate fractions. The left and right columns are scaled by 3 ; the middle column is scaled by 6.

[

2

/

3

2

/

3

1

2

/

3

1

2

/

3

1

1

/

2

1

/

3

100

100

100

]

→

[

2

4

3

2

6

2

3

3

1

300

600

300

]

{\displaystyle
\begin{bmatrix}
2/3 & 2/3 & 1 \\
2/3 & 1 & 2/3 \\
1 & 1/2 & 1/3 \\
100 & 100 & 100
\end{bmatrix}
\rightarrow
\begin{bmatrix}
2 & 4 & 3 \\
2 & 6 & 2 \\
3 & 3 & 1 \\
300 & 600 & 300
\end{bmatrix} }

**Step 2: Eliminating the top entry in the left column**

Use the value in the top entry in the right column, which is 3, to scale the left column, giving 6 for A, 6 for B, 9 for C, and 900 coins. Subtract the left column by the right column twice gives 0 for A, 2 for B, 7 for B, and 300 coins remaining.

[

6

4

3

6

6

2

9

3

1

900

600

300

]

→

[

0

4

3

2

6

2

7

3

1

300

600

300

]

{\displaystyle
\begin{bmatrix}
6 & 4 & 3 \\
6 & 6 & 2 \\
9 & 3 & 1 \\
900 & 600 & 300
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 4 & 3 \\
2 & 6 & 2 \\
7 & 3 & 1 \\
300 & 600 & 300
\end{bmatrix} }

**Step 3: Eliminating the top entry in the middle column**

Use the value in the top entry in the right column, which is 3, to scale the middle column. This gives 12 for A, 18 for B, 9 for C, and 1800 coins. Subtract the middle column by the right column four times to get 10 for B, 5 for B, and 600 coins remaining.

[

0

12

3

2

18

2

7

9

1

300

1800

300

]

→

[

0

0

3

2

10

2

7

5

1

300

600

300

]

{\displaystyle
\begin{bmatrix}
0 & 12 & 3 \\
2 & 18 & 2 \\
7 & 9 & 1 \\
300 & 1800 & 300
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 0 & 3 \\
2 & 10 & 2 \\
7 & 5 & 1 \\
300 & 600 & 300
\end{bmatrix} }

**Step 4: Eliminating the second entry in the left column and solving for C**

Use the value in the second entry in the middle column, which is 10, to scale the left column. This gives 20 for B, 70 for C, and 3000 coins. Subtract the left column by the middle column twice gives 60 for C and 1800 coins remaining. Divide the left column by 60 to get 30 coins for C.

[

0

0

3

20

10

2

70

5

1

3000

600

300

]

→

[

0

0

3

0

10

2

60

5

1

1800

600

300

]

→

[

0

0

3

0

10

2

1

5

1

30

600

300

]

{\displaystyle
\begin{bmatrix}
0 & 0 & 3 \\
20 & 10 & 2 \\
70 & 5 & 1 \\
3000 & 600 & 300
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 0 & 3 \\
0 & 10 & 2 \\
60 & 5 & 1 \\
1800 & 600 & 300
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 0 & 3 \\
0 & 10 & 2 \\
1 & 5 & 1 \\
30 & 600 & 300
\end{bmatrix} }

**Step 5: Eliminating the third entry in the middle column and solving for B**

Subtract 150 (

5
×
# 30
150

{\displaystyle
5 \times 30 = 150 }

) from the 600 coins in the middle column to get 450 remaining, and then divide by 10 to get 45 coins for B.

[

0

0

3

0

10

2

1

5

1

30

600

300

]

→

[

0

0

3

0

10

2

1

0

1

30

450

300

]

→

[

0

0

3

0

1

2

1

0

1

30

45

300

]

{\displaystyle
\begin{bmatrix}
0 & 0 & 3 \\
0 & 10 & 2 \\
1 & 5 & 1 \\
30 & 600 & 300
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 0 & 3 \\
0 & 10 & 2 \\
1 & 0 & 1 \\
30 & 450 & 300
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 0 & 3 \\
0 & 1 & 2 \\
1 & 0 & 1 \\
30 & 45 & 300
\end{bmatrix} }

**Step 6: Eliminating the second and third entry in the right column and solving for A**

Next subtract 120 (

1
×
30
2
×
# 45
120

{\displaystyle
1 \times 30 + 2 \times 45 = 120 }

) from the coins in the right column to get 180 coins. Divide by 3 to get 60 coins for A.

[

0

0

3

0

1

0

1

0

0

30

45

180

]

→

[

0

0

1

0

1

0

1

0

0

30

45

60

]

{\displaystyle
\begin{bmatrix}
0 & 0 & 3 \\
0 & 1 & 0 \\
1 & 0 & 0 \\
30 & 45 & 180
\end{bmatrix}
\rightarrow
\begin{bmatrix}
0 & 0 & 1 \\
0 & 1 & 0 \\
1 & 0 & 0 \\
30 & 45 & 60
\end{bmatrix} }