This week’s Riddler classic is a logic problem.
There are four enormous bags of marbles. They are labeled RED, GREEN, BLUE, and ASSORTED. You want to buy two bags of marbles that are not assorted, and you’d settle for some combination of red, green or blue. However, someone switched around the labels on all four bags so that every single bag is incorrectly labeled. You may sample two marbles out of any of the bags, one at a time. Is there a picking strategy that guarantees that you will buy two non-assorted bags?
My solution:
[Show Solution]
Here is a strategy that works.
- Pick a marble from the bag labeled ASSORTED. Without loss of generality, suppose this marble is red. Since all bags are incorrectly labeled, this bag cannot contain assorted marbles, and is therefore the red marble bag.
- Pick a marble from the bag with the same label as the marble color we found in the previous step. In this case, the bag labeled RED. This bag can contain a red, blue, or green marble.
- If we find a red marble in the RED bag, then this bag must contain assorted marbles because we already identified the red marble bag. So the other three bags (ASSORTED, BLUE, GREEN) must contain the non-assorted marbles, so buy any two of them.
- If we find a blue marble in the RED bag, then this bag must contain blue or assorted. Let’s ask the question: Where are the green marbles? They can’t be in the ASSORTED bag (since it contains red), or the RED bag (since we pulled a blue marble from it), or the GREEN bag (since all bags are incorrectly labeled). This leaves the BLUE bag as the only possibility. Therefore, we can safely buy the bags labeled ASSORTED and BLUE.
- If we find a green marble in the RED bag, then this bag must contain green or assorted. Similarly to the previous case, the blue marbles must be in the GREEN bag. Therefore, we can safely buy the bags labeled ASSORTED and GREEN.
“Following the trail” works for n bags. I show that here:
https://www.starvind.com/math/can-you-keep-your-marbles/
Nice write-up, thanks for the link!
Pick from the same bag twice
Picking from the same bag twice will work sometimes, but it is not guaranteed to work. For example, if you pick two marbles from the bag labeled BLUE and you get one red and one green, then you know for sure that this is the assorted bag. But if instead you picked two red marbles, then it’s possible that the bag is full of red marbles, but it is also possible the bag is “assorted” and you just happened to pick two red marbles.