Chicken Problem from Terry Tao's blog (system of Diophantine equations) This problem was posted by Terry Tao in his blog earlier. It's actually from his son's Math Circle. It took him $15$ minutes to solve it. I guess we all can take a crack at it.
Three farmers were selling chickens at the local market.  One farmer had $10$ chickens to sell, another had $16$ chickens to sell, and the last had $26$ chickens to sell.  In order not to compete with each other, they agreed to all sell their chickens at the same price.  But by lunchtime, they decided that sales were not going so well, and they all decided to lower their prices to the same lower price point.  By the end of the day, they had sold all their chickens.  It turned out that they all collected the same amount of money, $\$35$, from the day's chicken sales.  What was the price of the chickens before lunchtime and after lunchtime?
 A: There does not seem to be a unique solution to this problem:  there are two $5$-tuples $(x,y,z,p,q)$ satisfying the given conditions, namely $$(x,y,z,p,q)  \in \left\{\left(8,5,0,\tfrac{105}{26},\tfrac{35}{26}\right), \left(9,6,1,\tfrac{15}{4},\tfrac{5}{4}\right)\right\}.$$  It is not stated that all farmers sold at least one chicken prior to lunchtime, and the difference between the first and second solution (one chicken each) is not, in my opinion, subjectively large enough to justify saying that the farmers were unhappy with the rate of sales for the former but not the latter.  The only plausible qualitative difference between the solutions is that the latter corresponds to an exact amount to the penny; the former does not (but why should this matter from a mathematical standpoint?).  A full solution is not difficult although it can be a bit tedious to obtain, but one key is to derive the Diophantine condition $$5x - 8y + 3z = 0,$$ in conjunction with the obvious constraint $10 \ge x > y > z \ge 0$.
A: Here $x,y$ are the prices before and after lunch, $k,l,m$ are the number of sold chickens before lunch. And $x>y>0$.
$
\left\{ 
\begin{array}{l}
kx+(10-k)y=35 \\ 
lx+(16-l)y=35 \\ 
mx+(26-m)y=35
\end{array}
\right. 
$
Subtract the second and the third from the first gives
$\displaystyle
\left\{ 
\begin{array}{l}
(k-l)x-(6+(k-l))y=0 \\ 
(k-m)x-(16+(k-m))y=0
\end{array}
\right. 
$
Multiply to eliminate $x$ gives
$\displaystyle
\left\{ 
\begin{array}{l}
(k-m)(k-l)x=(k-m)(6+(k-l))y \\ 
(k-l)(k-m)x=(k-l)(16+(k-m))y
\end{array}
\right. 
$
Which implies
$(k-m)(6+(k-l))=(k-l)(16+(k-m))\implies$
$6(k-m)=16(k-l)\implies$ 
$16l-6m=10k$
$(1)\quad 8l=5k+3m$
[Here I can't find out anything better than solving the diophantic equation and test. And I guess that $100x,100y$ must be integers.]

After some sleep:  


*

*the only explanation of the even outcome is that $k>l>m$

*(1) says that $5k+3m$ must be divisible with $8$, which gives $3$ alternatives


$$
\begin{array}{rrr}
k & l & m \\
\hline
10 & 7 & 2 \\
9 & 6 & 1 \\
8 & 5 & 0
\end{array}
$$
Only $k=9,l=6,m=1$ make sense and gives  
$\displaystyle y=\frac{5}{4}=1.25$ and  
$\displaystyle x=\frac{15}{4}=3.75$
A: 
I did it with the above diagram, now of course drawn to scale.
The two red rectangles (over) $QH$ & $HC$, green rectangles $AH$ & $HD$, blue rectangles $BH$ & $HE$ represent the three farmers' revenue. The horizontal axis represents the number of chicken sold, and the height is the price at which the farmer sold the chicken. Naturally, $H$ represents the point at which the farmers decide to lower the price.
The rectangle over $QA$ has the same area as that over $CD$ and same for $AB$ and $DE$. Hence $QA:AB=CD:DE=CD-QA:DE-AB=16-10:26-16=3:5$, and $QA+AB\le 10$. So $QA=3,AB=5$. This gives $CD=9,DE=15$, which means that the ratio of the two prices is $3:1$. Since $BC=2$, we test all possible positions of $H$, to obtain the one shown in the figure, because it gives some reasonable prices, as calculated below:
If $x$ is the starting price, then $9x+\frac{x}{3}=35$, and $x=3.75$. The ending price is $1.25$.
A: If $u>v>w$ are the number of chickens that the three farmers sold at the higher price, then, by linearity*, $(26-16)(u-v) = (16-10)(v-w)$, and so $u-v$ is divisible by $3$, and $v-w$ is divisible by $5$.  It follows that $(u,v,w) \in \{(8,5,0),(9,6,1), (10,7,2)\}$.
Only the middle solution gives prices that can be measured in USD (or most currencies), namely $\$3.75$ and $\$1.25$.

* To elaborate on this point: If a farmer begins with $n$ chickens, sells $f(n)$ at the higher price point $A$ and $n-f(n)$ at the lower price point $B$, and earns a profit $P$, then the points $(n,f(n))$ are collinear (assuming that $A,B,P$ are constant).
This is because these points are the solutions to a linear equation in two variables, namely $Af(n) + B(n-f(n)) = P$.  A line has constant slope, so the equation in my first paragraph follows.
A: 
a geometric solution to the problem
