ZQSJ3.38 張邱建算經·百雞問題 Zhang Qiujian Suanjing: Hundred Fowls Problem

In the *Zhang Qiujian Suanjing* (張邱建算經, *Zhang Qiujian's Mathematical Canon*), a text from 5th century AD, there is a famous indeterminate problem called the "hundred fowls problem" (百雞問題 bǎi jī wèn tí). The problem is named after the oldest problem of this type found in history. Similar problems found in later Indian, Arabic, European, and Japanese sources can trace its origin to the hundred fowls problem prototype in the *Zhang Qiujian Suanjing*.

**《張邱建算經·卷下·三十八問》**

今有雞翁[1]一直[2]錢五；雞母[3]一直錢三，雞雛[4]三直錢一。凡百錢買雞百隻。問：雞翁、母、雛各幾何?
答曰：雞翁四，直錢二十；雞母十八，直錢五十四；雞雛七十八，直錢二十六。
又答：雞翁八，直錢四十；雞母十一，直錢三十三；雞雛八十一，直錢二十七。
又答：雞翁十二，直錢六十；雞母四，直錢十二；雞雛八十四，直錢二十八。
術曰：雞翁每增四，雞母每減七，雞雛每益三，即得。

**Zhang Qiujian Suanjing (Chapter 3: Problem 38)**

Suppose roosters cost 5 *qian* each, hens cost 3 *qian* each, and 3 chickens cost 1 *qian*. In total 100 fowls are bought for 100 *qian.* Question: How many roosters, hens and chicks are there?
Answer: 4 roosters, cost 20 *qian*; 18 hens, cost 53 *qian*; 78 chickens, cost 26 *qian*.
Another answer: 8 roosters, cost 40 *qian*; 11 hens, cost 33 *qian*; 81 chickens, cost 27 *qian*.
Another answer: 12 roosters, cost 60 *qian*; 4 hens, cost 12 *qian*; 84 chickens, cost 28 *qian*.
Method: Increase 4 to the number of roosters every time, subtract 7 to the number of hens, and add 3 to the number of chicks every time to obtain the answer.

**Annotations**

[1] 雞翁 jī wēng：公雞。Rooster, an adult male chicken.

[2] 直 zhí：通"值"。Worth in value.

[3] 雞母 jī mǔ：雞母。Hen, an adult female chicken.

[4] 雞雛 jī chú：小雞。Chick, a young chicken.

**Solution**

The *Zhang Qiujian Suanjing* does not provide a systematic solution method to the problem. Instead, the solution method merely lists three rates for calculating the number of roosters, hens, and chickens, presumably after one obtains the solution with the least number of roosters. By the nature of the problem, only positive integers are admitted for the number of roosters, hens, and chickens.

Let

x
,
y
,
z

{\displaystyle x, y, z}

represent the number of roosters, hens, and chickens respectively. The problem is a system of two linear equations in three unknowns:

{

x
y
# z
100

5
x
3
y

1
3

# z
100

{\displaystyle
\begin{cases}
x + y + z = 100 \\
5x + 3y + \frac{1}{3}z = 100
\end{cases}
}

Multiply the second equation by 3 gives

{

x
y
# z
100

15
x
9
y
# z

{\displaystyle
\begin{cases}
x + y + z = 100 \\
15x + 9y + z = 300.
\end{cases}
}

Subtract the first equation from the second equation to obtain

14
x
8
# y
200

{\displaystyle 14x + 8y = 200 }

, or

# y
25
−

7
4

x
.

{\displaystyle y = 25 - \frac{7}{4}x. }

Substituting

y

{\displaystyle y}

 back into the first equation gives

# z
75

3
4

x
.

{\displaystyle z = 75 + \frac{3}{4}x. }

Thus, the solution set is

(
x
,
y
,
z
# )

(

x
,
25
−

7
4

x
,
75

3
4

x

)

.

{\displaystyle (x, y, z) = \left(x , 25 - \frac{7}{4}x, 75 + \frac{3}{4}x \right). }

By the nature of this problem, the solution for

x
,
y
,
z

{\displaystyle x, y, z}

 must be non-negative integers; hence,

x

{\displaystyle x}

 must be divisible by 4. Substitute

# x
4
t

{\displaystyle x = 4t }

 into the above solution set to obtain

(
x
,
y
,
z
# )

(

4
t
,
25
−
7
t
,
75
3
t

)

{\displaystyle (x, y, z) = \left(4t, 25 - 7t, 75 + 3t \right) }

where

# t
0
,
1
,
2
,
3

{\displaystyle t = 0, 1, 2,3 }

.

The possible solutions are:

(
x
,
y
,
z
# )

(

0
,
25
,
75

)

{\displaystyle (x,y,z) = \left(0,25,75 \right) }

(
x
,
y
,
z
# )

(

4
,
18
,
78

)

{\displaystyle (x,y,z) = \left(4,18,78 \right) }

(
x
,
y
,
z
# )

(

8
,
11
,
81

)

{\displaystyle (x,y,z) = \left(8,11,81 \right) }

(
x
,
y
,
z
# )

(

12
,
4
,
84

)

{\displaystyle (x,y,z) = \left(12,4,84 \right) }

Zhang Qiujian only gave positive integer solutions, so the first solution (0 roosters, 25 hens, and 75 chickens) is excluded.

 **Cost** | 20

 **Cost** | 40

 **Cost** | 60

**References**