This is a popular Chinese problem, on Linear Diophantine equations, which in wording seems as a puzzle or riddle. However, when used algebraic notations, it looks obvious. The problems states :
|If a cock is worth 5 coins, a hen 3 coins, and three chickens together 1 coin, how many cocks, hens and chickens, totaling 100 in number, can be bought for 100 coins?
This puzzle in terms of algebraic equations can be written as and
where being the number of cocks, hens and chicks respectively.
We find that there are two equations with three unknown quantities. So eliminating one of the unknowns, by putting from second equation into first one such that
Which is a linear Diophantine equation (with only two unknown quantities).
The equation has the general solution [links to WolframAlpha] and , so that where is an arbitrary integer.
Now, since are the number of creatures, hence and thus , and which imply that . And because t must have integer values, we have . Which gives the following three solutions:
||No. Of cocks ( )
||No. Of hens ()
||No. Of chicks ()
So there are the three ways to chose the number of cocks, hens and chicken totaling 100 to buy for 100 coins.
Elementary Number Theory
David M. Burton, 2006
Wikipedia article on Diophantine Equations