3 ms·
In this particular case it's pretty easy because you know you'll be working with small numbers, so once you establish tighter bounds the work to 'guess and chec
by Anderkent 12y ago
In this particular case it's pretty easy because you know you'll be working with small numbers, so once you establish tighter bounds the work to 'guess and check' will be small.
This 'bound tightening' is the 'ingenuity' required for the problem. There's no general process to achieve that, which is why it requires ingenuity :)
SPOILERS BELOW
To do that you have to notice the common factor in the initial equations.
Let n1, n2, and n3 be number of chickens sold pre-lunch time by each farmer. The initial equations are:
n1*x + (10-n1)*y = 35
n2*x + (16-n2)*y = 35
n3*x + (26-n3)*y = 35
Transforming them a little:
n1 * (x - y) + 10y = 35 ;[1]
n2 * (x - y) + 16y = 35 ;[2]
n3 * (x - y) + 26y = 35 ;[3]
The common factor of (x-y) looks useful; you can establish relationships between n1, n2 and n3 with it:
(n1 - n2) * (x - y) - 6y = 0 ;([1] - [2])
(n1 - n3) * (x - y) - 16y = 0 ;([1] - [3])
(n1 - n2) = 6 * (y / (x - y)) ;[4]
(n1 - n3) = 16 * (y / (x - y)) ;[5]
(n1 - n2) = 3/8 (n1 - n3) ;[6]
If you get there the puzzle is basically solved but for a bit of number crunching - you know n1, n2 and n3 are positive integers, n1 <= 10, so for [6] either n1=n2=n3 (trivial 0-post-lunch-price solution) or n1 - n2 = 3, n1 - n3 = 8. From there you substitute back into [4] and get 3 * (x-y) = 6y, so x = 3y.
You now have simple relations between n1, n2 and n3; as well as between x and y. The remaining step is to tie x or y to one of the n's by substituting into initial equations. For example from [1]:
n1 * 2y + 10y = 35
2y = 35 / (n1 + 5)
y must be integral in pennies; that part is tricker to derive and the simplest solution is to just notice that since n1 >= 0, and n3 >= 0, and n1 = n3 + 8, then 8 <= n1 <= 10, and try 8, 9 and 10 for n1. With n1 = 9, you get y = 1.25. That's the only 'guess and check' part of the problem.