First we need to combine the two equations into one. Let h be the number of horses, p the number of pigs, and r the number of rabbits. Double the prices, just for a moment, so we can write 20h + 6p + r = 200. At the same time, h + p + r = 100. Subtract the second from the first to get 19h + 5p = 100. Since h and p are integers, this is a Diophantine equation. There are ways to solve these in general, but in this case we can just try various values of h, to see if p winds up being a whole number. For instance, if h = 0, p = 20, and that works. The farmer buys 20 pigs and 80 rabbits. The only other combination is 5 horses, 1 pig, and 94 rabbits.
I like this!
ReplyDeleteinteger- A whole number; a number that is not a fraction.
ReplyDeleteDiophantine-
(Alg.) that branch of indeterminate analysis which has for its object the discovery of rational values that satisfy given equations containing squares or cubes; as, for example, to find values of x and y which make x2 + y2 an exact square.
maybe this will help, these words confused me.
The word (Diophantine) that confused you is more advanced math application, but you may find some more information by copy/paste the link below:
ReplyDeletehttp://en.wikipedia.org/wiki/Diophantine_equation