Saturday, January 4, 2014

100 birds for 100 coins

There is a very old style of math problem known as 100 birds for 100 coins. The usual set up is that there are three kinds of birds. The most expensive kind costs more than one coin each, the next most expensive also cost more than a coin, but the cheapest kind can be bought for less than a coin. Sometimes the three types of birds are three different species, like hawks, ducks and sparrows. In this case, let's say it's geese, ganders and goslings. Let us assume that the goslings are cheapest, the female geese are most expensive because they can either be eaten or kept to lay eggs, and the male gander is somewhere in the middle. (In some versions, the gander is worth more because he is usually larger and produces more meat when slaughtered.)

Here is the set-up for one version of this problem.

At a market, you can buy a goose for four coins, a gander for two coins and two goslings for one coin. Find all the ways you can buy exactly one hundred birds for exactly one hundred coins.

Okay, let's start with the semantics of the statement. For 50 coins, you can buy 100 goslings, but that isn't a solution to our problem because we asked for exactly 100 coins and exactly 100 birds. What we get are two equations. I will use x, y and z for geese, ganders and goslings respectively.

x + y + z = 100 (100 birds)
4x + 2y + ½z = 100 (100 coins)

Usually, if we have two equations and three unknowns, we will have infinitely many solutions. But this problem is called a Diophantine equation, which means the solutions must all be non-negative integers. (This means we can have fractions of birds.) The idea is to have one of our variables become the independent variable and the other be dependent. This can be done with linear algebra methods, subtracting multiples of one of the equation from the others. I will let the reader do this work if he or she desires, but the answers are as follows if x is the independent variable.

y = (100 - 7x)/3
z = 2(100 + 2x)/3

What this tells us is that 100 - 7x and 100 + 2x most both be divisible by 3. This is always possible if x is a number of the form 3k + 1, like 1, 4, 7, 10, 13... The limiting factors are:

Limiting factor #1:t 100 - 7x > 0
Limiting factor #2: 2(100 + 2x) < 300.

Let's start with x = 1 and see what we get.

x = 1, y = 93/3 = 31 z = 204/3 = 68
This works! 1 + 31 + 68 = 100 and 4(1) + 2(31) + ½(68) = 100.

What about x = 4? This works, too.
x = 4, y = 24, z = 72.

Let's continue on with all the solutions. (To get a new solution, add 3 to x, subtract 7 from y and add 4 to z.)

x = 7, y = 17, z = 76
x = 10, y = 10, z =80
x = 13, y = 3, z =84


This is the last possible solution, since if I subtract 7 from 3 I get -4, and we are not allowed to have -4 ganders. (This is because 100 - 7(16) < 0, so it doesn't hold with our Limiting factor #1 shown above.)

I can't just pick two whole numbers greater than 1 and less than 100 and some arbitrary fraction and get solutions to such a problem. There are some prices that produce only one legitimate answer and others that have no legitimate solutions. But the method of finding one independent variable and two dependent variables followed by guessing and checking will always find the solution set, whether it has multiple answers, one answer or none.

No comments:

Post a Comment