# Math Contest Question

1. Jun 26, 2004

### Parth Dave

This is a question from a math contest I did a little while back. 3 parts:

a. There are 3 different colours of balls: red, green, and yellow. Suppose you have 4 green balls, 5 red balls and 6 yellow balls. You are to constantly remove 1 ball from any 2 colours and than add 1 to the third colour. If you keep doing this until only 1 colour remains, what colour will it be?
ex. If you take away one red ball and one yellow ball, than you would have to add one green ball. Thus leaving you with 5 green balls, 4 red balls, 5 yellow balls.

b. If you are to start with 3 green balls, 5 red balls and 6 yellow balls. What colour will you always be left with?

c. Suppose this time you change the process so that instead of adding 1 ball to the colour you dont remove from, you instead add 2 colours. If you start with 4 green, 5 red and 6 yellow balls, show that there will never be one colour left.
ex. If you take away 1 green and 1 red you would than have to add 2 yellow. Leaving you with 3 green, 4 red and 8 yellow balls.

I wanted to see what people did with this. Because after the contest was over I was fairly confident about my solution. However, when i got my result i got 4/10 for this question.

Last edited: Jun 26, 2004
2. Jun 26, 2004

### AKG

Take a yellow and red, add a green, giving you 5 yellow, 5 green, and 4 red. Keep taking from yellow and green, adding to red and you end up with red. If you're going to always end up with one colour, and you end up with red in this situation, then you always end up with red.
R Y G
5 6 3
4 5 4
3 6 3
.....
0 9 0

Yellow
Now, it seems that in the first parts, the two colours that initially differed by 2 got eliminated. This makes sense because that pair of numbers you can add one and subtract the other and have them equal, and then keep eliminating that equal pair and you'll eliminate both colours together. In the last part, the numbers need to differ by three. For example, if we had 3 red, 10 blue, and 7 green, then we could take one from blue and red and add two to green, making blue and green have 9, and then you can eliminate them together. In part c, however, no pair of numbers differ by 3 (or some multiple of 3, I should say). Does a pair of numbers which differ by 3 (or some multiple) have to exist? Well, notice that at some point in time, you have to get two numbers to be the same, i.e. you'll ultimately have to have 2 colours with 1 bead each. Now, if you have x and y, and subtract 1 from both x and y, you do nothing to bring them closer together. The only way to bring two numbers closer together is to do the adding to one and the subtracting to the other. In this case, the adding and subtracting brings the pair of numbers closer together by 3 always. But if you bring them together by 3 and they never meet (because the difference between them is no multiple of 3) then they can never be equal, they can never both be 1, and thus you can never end and have two empty colours and 1 colour with balls.

That's a mess, so let me try to summarize:
In the final state, where only one colour has balls, the other two colours have the same number of balls, zero. To make any pair of colours have the same number of balls, you have to obviously change the number of balls each colour has. In the above situations, there are only two ways to change the number of balls of two given colours:
1) subtract 1 from both of them, which doesn't bring the numbers closer together, OR
2) subtract 1 from one of the two and add some balls (1 or 2) to the other colour. Let's say we add n balls to the other colour.
Note, we can ignore the third colour for now. We can deal in general with any two colours, and just apply the reasoning to all three pairs of colours.
Now, we add n balls to the other colour. If we subtract 1 ball from 1 of them and add n to the other, then the difference between the two colours changes by n+1. This is the only way to change the difference in number between two colours (because as we know, subtracting 1 from both does nothing). So, if the difference always changes by n+1, and D is the original difference, then D + k(n+1) must be zero for some k, i.e. there must be some multiple of n+1 that we can add to or subtract from D to get zero. If we don't get zero, the difference is never zero, which it must be because it is so in the final situation (remember two colours having zero balls).

So:
D + k(n+1) = 0
D = -k(n+1)
D/(n+1) = -k

Since -k is an integer, D/(n+1) must be an integer, meaning D must be divisible by n+1. If there is no D that is divisible by n+1, i.e. if the original difference between no two pairs of numbers is a multiple of n+1, you can't get the desired final state.

3. Jun 27, 2004

### Parth Dave

Thats what i thought the answer was too. Honestly, i dont see how they could have wanted a different solution. However, the fact remains i only got 4/10. Hmm... maybe my explanation was just severely lacking as it was rushed considering i only had ~8 mins to answer the question.

4. Jun 27, 2004

### matt grime

You must also justify why you always end up with red if you end up with a single colour in part a. this can be done simply by considering parity of elements.