document.write( "Question 1190478: a farmer has to buy 100 animals using only $100.
\n" ); document.write( "a chicken costs $0.25
\n" ); document.write( "a sheep costs $3.5
\n" ); document.write( "and a cow costs $10\r
\n" ); document.write( "\n" ); document.write( "how can the farmer buy 100 animals with $100\r
\n" ); document.write( "\n" ); document.write( "Thank you :)
\n" ); document.write( "

Algebra.Com's Answer #822139 by math_tutor2020(3817)\"\" \"About 
You can put this solution on YOUR website!

\n" ); document.write( "x = number of chickens
\n" ); document.write( "y = number of sheep
\n" ); document.write( "z = number of cows
\n" ); document.write( "x,y,z are nonnegative integers\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "The farmer must buy 100 animals, so,
\n" ); document.write( "x+y+z = 100\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "a chicken costs $0.25
\n" ); document.write( "a sheep costs $3.5
\n" ); document.write( "and a cow costs $10\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Based on those costs, we have
\n" ); document.write( "0.25x = cost of the chickens only
\n" ); document.write( "3.50y = cost of the sheep only
\n" ); document.write( "10z = cost of the cows only\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "They sum to
\n" ); document.write( "0.25x+3.50y+10z
\n" ); document.write( "which is the total cost of all the animals.
\n" ); document.write( "This stated total cost is $100\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "0.25x+3.50y+10z = 100\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Let's multiply both sides by 100 to clear out the decimals.
\n" ); document.write( "0.25x+3.50y+10z = 100
\n" ); document.write( "100*(0.25x+3.50y+10z) = 100*(100)
\n" ); document.write( "25x+350y+1000z = 10000\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "--------------------------------------------\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "So far we have these two equations
\n" ); document.write( "x+y+z = 100
\n" ); document.write( "25x+350y+1000z = 10000\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "I'll multiply everything in equation 1 by 25
\n" ); document.write( "x+y+z = 100
\n" ); document.write( "25(x+y+z) = 25(100)
\n" ); document.write( "25x+25y+25z = 2500\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "So we have these two equations now
\n" ); document.write( "25x+25y+25z = 2500
\n" ); document.write( "25x+350y+1000z = 10000\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Subtract straight down. The x terms will cancel out.
\n" ); document.write( "25x-25x goes to 0x
\n" ); document.write( "25y-350y goes to -325y
\n" ); document.write( "25z-1000z goes to -975z
\n" ); document.write( "2500-10000 goes to -7500\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "This is the new equation we have now
\n" ); document.write( "-325y-975z = -7500\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "--------------------------------------------\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "To clean things up a bit, we can divide both sides by -25
\n" ); document.write( "-325y-975z = -7500
\n" ); document.write( "(-325y-975z)/(-25) = -7500/(-25)
\n" ); document.write( "(-325y)/(-25)-(975z)/(-25) = -7500/(-25)
\n" ); document.write( "13y+39z = 300\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Notice how the left side expression 13y+39z factors to 13(y+3z) showing that 13 is a factor of the left hand side.
\n" ); document.write( "However, 13 is not a factor of 300 because 300/13 = 23.0769 approximately.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "What this means is that the linear diophantine equation
\n" ); document.write( "13y+39z = 300
\n" ); document.write( "does not have any integer solutions for y & z.
\n" ); document.write( "Consequently, it means the original system we started with doesn't have any nonnegative integer solutions for x, y and z.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Therefore, it is impossible to buy 100 animals with $100 based on these prices.
\n" ); document.write( "Based on the phrasing, I'm assuming the goal is to have the farmer use up the entire $100 without any change leftover (otherwise there are many solutions possible).\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Side note:
\n" ); document.write( "I used computer software to check, just to be sure. I made 3 nested arrays loop through from 0 to 100 (for each variable x,y,z).
\n" ); document.write( "That means there are 101^3 = 1,030,301 combos to check. An insane amount by hand. But to a computer, that's practically nothing.
\n" ); document.write( "For each iteration, the software plugged in the particular x,y,z values into the two original equations mentioned.
\n" ); document.write( "As expected, the program found no integer solutions.
\n" ); document.write( "I wasn't sure how to show this aspect, but if you're curious then I'll share the source code.\r
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "Further thoughts:
\n" ); document.write( "Here are some near misses.
\n" ); document.write( "Each (x,y,z) triple satisfies x+y+z = 100, but the second equation isn't satisfied.
\n" ); document.write( "The closest I could get to $100, while staying under $100, is $99.75
\n" ); document.write( "Each of the triples shown below produce that final cost
\n" ); document.write( "(x,y,z) = (77,23,0)
\n" ); document.write( "(x,y,z) = (79,20,1)
\n" ); document.write( "(x,y,z) = (81,17,2)
\n" ); document.write( "(x,y,z) = (83,14,3)
\n" ); document.write( "(x,y,z) = (85,11,4)
\n" ); document.write( "(x,y,z) = (87,8,5)
\n" ); document.write( "(x,y,z) = (89,5,6)
\n" ); document.write( "(x,y,z) = (91,2,7)
\n" ); document.write( "For example, trying the second triple mentioned gets us
\n" ); document.write( "x+y+z = 79+20+1 = 100
\n" ); document.write( "0.25x+3.5y+10z = 0.25*79+3.5*20+10*1 = 99.75
\n" ); document.write( "
\n" ); document.write( "
\n" );