# Thread: equation help

1. What is the equation for this problem?
A farmer goes to a sale with exactly $100 and must buy exactly 100 animals,and he has to buy one of each. Pigs are$3, chickens are $.50, and cows are$10.
I already got the answer, but I would like the equation.

2.

3. Sounds like a linear diophantine problem to me

3 x + 1/2 y + 10 z = 100

x + y + z = 100

x, y, z all positive integers

Trivially there must be an even number of chickens, and then go from there...

4. Originally Posted by river_rat
3 x + 1/2 y + 10 z = 100

x + y + z = 100

x, y, z all positive integers

Trivially there must be an even number of chickens, and then go from there...
Actually, the problem says he must buy one of each (at least). So:

3(x+1) + 1/2(y+1) + 10(z+1) = 100

3 x + 1/2 y + 10 z = 86.5

x + y + z = 97

The solutions (x,y,z) will all be 1 less than the actual. So just add 1 to each.

However this fact might not actually change the solution.

5. x, y, z are postive integers covers the fact that at least one must be bought, (0 is not a positive integer) though just shifting everything up by one and using natural numbers (assuming 0 \in N that is ) wouldnt change the solution.

6. It is never stated that he has to spend exactly $100, only that he went with$100.

7. True, but he has to spend exactly $100 8. Originally Posted by river_rat x, y, z are postive integers covers the fact that at least one must be bought, (0 is not a positive integer) though just shifting everything up by one and using natural numbers (assuming 0 \in N that is ) wouldnt change the solution. Oh I missed your condition. I was just looking at the equations. But yes, I guess you are correct, too. The way I posted it is how I would have done it 9. please explain, if you can only buy one animal each. the highest amount of money you spend can only be$13.5

10. "He has to buy one of each" is satisfied as long as he buys at least one of each.

 Bookmarks
##### Bookmarks
 Posting Permissions
 You may not post new threads You may not post replies You may not post attachments You may not edit your posts   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement