We place 15 black marbles and 15 white marbles in an urn. We have 30 additional black marbles in a bag. Then we follow these rules.
1. Remove two marbles from the urn.
2. If they are different colors, put the white marble back in the urn and the black marble in the bag.
3. If they are the same color, put both marbles in the bag, then put one black marble from the bag into the urn.
Continue following these rules until only one marble is left in the urn. What color is that marble? Click below for the answer.
When I first heard this puzzle, I immediately thought of writing a Python script, since that's my favorite method for dealing with problems in probability. This is a logic problem in disguise, though. I realized that as I tried to figure out the best way to set up the problem in code. If you pay close attention to the rules for adding and removing marbles from the urn, and the initial conditions, you'll notice a couple of things.
1. You start with an odd number of both black and white marbles in the urn.
2. The rules force you to always keep an odd number of white marbles in the urn (they can only be removed two at a time), but allow for both odd and even numbers of black marbles.
From those observations it's easy to see that when you get down to one marble, it must be a white marble.
No comments:
Post a Comment