# Homework Help: Math Puzzle? [CS / Math]

1. Sep 29, 2010

### d-rock

1. The problem statement, all variables and given/known data
Two farmers have no more than 15 cows. They get as many dollars for each cow as they have cows. For example, if they have 3 cows then they get 3 dollars per cow so a total of 9 dollars.

After taking this money they bought as many sheep as possible at $10 a sheep. The remaining money was used to buy a goat. They did not have any money left over. After the livestock was purchased the farmers decided to split up the livestock. Since there was an odd number of sheep, the one who took the goat got his friend's pocket knife as compensation since the goat was worth less than a sheep. How much is the pocket knife worth? 2. Relevant equations None 3. The attempt at a solution NOTE: As said below, this was a test problem that we've already finished. My answer was$2. There is a debate over the problem but I wanted unbiased opinions to compare.

I gave my solution in a few posts below, but I would like the problem worked out by people so I can see what others say on their own without being influenced by my post. Thanks.

Last edited: Sep 30, 2010
2. Sep 29, 2010

### nvn

d-rock: I currently got a different answer than what you got.

3. Sep 29, 2010

### d-rock

If it is 4 then you will have to explain why, please. If not, then still explain why because then I won't have any clue how you got that.

4. Sep 29, 2010

Could you please show us how you got the $2 answer? 5. Sep 29, 2010 ### airborne18 I got a different answer than 2. 6. Sep 29, 2010 ### nvn d-rock: On this forum, the powers that be do not allow us to tell you how to solve your homework. They only allow us to check math. Did your professors give you the final answer? Or did they only tell you your current answer is incorrect? 7. Sep 30, 2010 ### d-rock It's not a homework problem. It was a test problem that we had and it's been a debate over the answer. I will give my work below, but I would like an unbiased opinion and explanation for your answers please, so please work it before reading my below solution if you will. My professor has a different answer but a few others and I think he is wrong, so it's been a debate. My solution First, we must figure out the number of cows. There can be 1 through 15 cows. As a sheep costs$10, then the number of cows squared must be greater than 10.

Therefore, n_cows must be > 3 as 3^2 = 9. Furthermore, there is an odd number of sheep as stated in the problem, therefore 5, 7, 8, 9, 10, 11, 12, 13, and 15 do not work, as their squares will leave an even number (plus a remainder) when divided by 10.

So the set of number of cows possible is {4, 6, 14}. Let us just choose the number 6 for example.

6^2 = 36, so they have $36. The most possible sheep that can be bought is 3, leaving$6. As the rest of the money is used to buy the goat, then the goat's price is $6. Now, they go to split up the livestock: 3 sheeps and 1 goat. Farmer A takes 2 sheep. Farmer B takes the last sheep and the goat. Farmer A has 2*10 =$20. Farmer B has 1*10 + 1*6 = $16. Farmer A wishes to give a knife that he owns to Farmer B in order to make their values equal. So, the value of the knife must be$2. If Farmer A loses the knife, he loses $2. This means$20 - $2 =$18. And Farmer B gains the knife, so he gains $2.$16 + $2 =$18.

Farmer A and Farmer B are both at $18. Therefore they are now equal. 8. Oct 1, 2010 ### nvn d-rock: The first time I worked this problem quickly, I got$4, which is incorrect. After working it more carefully, I got the correct answer, $2. Nice work. Your answer,$2, is correct. Although, a small part of your explanation is slightly incorrect, and should instead be as follows. Let us choose the case having six cows.

Farmer A started out with $2 + 18 =$20, and ended up with $20. Farmer B started out with$18, and ended up with $16 + 2 =$18.

Nonetheless, you got the right answer. Excellent work.

9. Oct 1, 2010

### airborne18

I worked it as an optimization problem, and I read it wrong. I didn't put it that no more than 15. Too much of that voodoo economics.