KeithSchwarz.com Back | Forward

# Magic Boxes II

If you're here, you probably ran into some trouble trying to solve this problem. That's perfectly understandable, because the problem is unsolvable under normal conditions!

To understand this next section, let's begin with some small mathematical definitions of odd and even numbers.

The common definition of an even number is a number that ends in 0, 2, 4, 6, or 8. From a mathematical standpoint, an even number is a number divisible by two. We can write an even number in the form 2n, where n is any integer (an integer is a whole number, so 45 is an integer but 34.45 is not). An odd number is simply an even number plus one. This means that any even number has the form 2n + 1, where n is any integer. This looks confusing at first, but try plugging in values of n and see what you get.

Knowing that, we can now prove this problem has no solution. We have nine boxes, all of which must have an odd number of items in them. An odd number is of the form 2n + 1. So, to distribute the balls into the boxes, we could first put one single ball into every box. In order to have an odd number of balls in each box, then, we'd need to add 2n + 1 - 1 = 2n balls to each box. Thus, once the first ball in put into each box, we need to add an even number of balls to each box until the remaining balls are all put away.

So put a single ball into each box. There are 9 boxes each with one ball, so there is a total of 38 - 9 = 29 balls left to be put into boxes. As we just said, we now should fill the boxes by adding even numbers of balls to each. Taking even numbers out of 29 until none are left only works if you can take even numbers away from 29 until you have nothing left, or, mathematically, that 29 mod 2 = 0. This statement is not true, because 29 mod 2 = 1. Since we have reached a contradiction trying to solve this problem in a logical way, it cannot be solved.

Though we have just proven that no solution exists, there is actually a valid solution to this problem!

See the valid solution.