MathBin Diophantine Equation - Farm Animals Member

A farmer spent \$100 to buy 100 animals of three different kinds. Each cow cost \$10, each pig \$3, and each sheep 50 cents. Assuming he bought at least one of each, how many of each animal did the farmer buy?

Cows Pigs Sheep Total Goal
Count
Cost (\$)
Sum (\$)

### Analysis

Note: Most of this analysis is from the book "Wheels, Life and other Mathematical Amusements" by Martin Gardner. I own this book and many other books by him.

There are two equations in three unknowns, where x is the number of cows, y the number of pigs, and z the number of sheep.

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

Solve the first equation for z, and multiply the second equation by 2 to remove the fraction.

1. z = 100 - x - y
2. 20x + 6y + z = 200

Eliminate z from the second equation.

1. z = 100 - x - y
2. 19x + 5y = 100

Use continued fractions to find integral values of x and y.

1. Put term with smallest coefficient (5) on left: 5y = 100 - 19x
2. Divide both sides by 5: y = (100 - 19x)/5
3. Divide each term and put remainder (if any) over 5 to form a terminal fraction

We now have: y = 20 - 3x - 4x/5. For x and y to be integers, x must have a positive value that makes 4x/5 an integer, so x must be a multiple of 5.

The one and only solution to this problem is when x = 5, y = 1, and z = 94. The means the farmer bought 5 cows, 1 pig, and 94 sheep for a cost of \$10 * 5 + \$3 * 1 + \$0.50 * 94 = \$50 + \$3 + \$47 = \$100.

Question: Is there a solution if cows cost \$5, pigs are \$2, and sheep are \$0.50? What if cows are \$4, pigs are \$2, and sheep are one-third of a dollar?
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://mathbin.com/interactive/diophantine-equation-farm-animals.php", "fetch_time": 1670374441000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-49/segments/1669446711121.31/warc/CC-MAIN-20221206225143-20221207015143-00190.warc.gz", "warc_record_offset": 31972114, "warc_record_length": 2508, "token_count": 514, "char_count": 1640, "score": 4.5, "int_score": 4, "crawl": "CC-MAIN-2022-49", "snapshot_type": "latest", "language": "en", "language_score": 0.9201263189315796, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00055-of-00064.parquet"}