I didn't invent this myself, I heard it a long time ago and it stuck with me.
Four glasses are placed on the corners of a square rotating table. Some of the glasses are facing upwards and some upside-down. Your goal is to arrange the glasses so that they are all facing up or all facing down. Here are the rules:
- You must keep your eyes closed at all times. (No tricks or lateral thinking, this is a pure logic puzzle)
- In a single turn, any two glasses may be inspected. After feeling their orientation, you may reverse the orientation of either, neither, or both glasses.
- After each turn, the table is rotated through a random angle.
- At any point, if all four glasses are of the same orientation a bell will ring.
Find a solution to ensure that all glasses have the same orientation (either up or down) in a finite number of turns. The algorithm must not depend on luck.
Edit: The bell will not ring mid-turn, it will only ring if the glasses are all of the same orientation at the end of your turn.
Answer
I have solution that can guarantee the end goal being reached in a maximum of four five steps. (Many thanks for @dmg and @Taemyr for their comments to fix this solution.) The trick is to:
Reduce the cups into the following configuration:
[∘∙∙∘]
where turning any two cups along the diagonal will satisfy the end goal
For a constructive proof, we first consider the following two three CASES:
CASE 1) the orientation of a single cup is different from the others, e.g. [∘∙∘∘] or [∙∘∙∙]
CASE 2a) two cups are in each orientation along the diagonal, e.g. [∘∙∙∘]
CASE 2b) two cups are in each orientation along two sides, e.g. [∘∙∘∙]
Step 1
Take two cups along the diagonal.
- If they are different, flip ∘ to ∙. If this doesn't sound the bell, we either have [∘∙∙∘] or [∘∙∘∘], with the majority orientation being ∘. In either case, proceed to step 2.
- If they are the same, flip both. If this doesn't sound the bell, we either have [∙∘∙∙] or [∘∙∘∘]. Either way, the majority orientation is known, and we can proceed to step 3.
Step 2
Take two cups along the diagonal.
- If they are different, we now know we have [∘∙∘∘]. Flip ∙ to ∘ to win.
- If they are the same, flip both. If this doesn't sound the bell, we now know we have [∘∙∘∘]. Proceed to Step 3.
Step 3
At this point, we have already figured out what the majority orientation is, so we assume we have [∘∙∘∘] WLOG. Then:
Take two cups along the diagonal.
- If the cups are different, flip ∙ to ∘ to win.
- If the cups are both ∘, flip one of them. We now know we have [∘∙∘∙].
Step 4
Take two adjacent cups along an edge and flip both.
- If the cups chosen are the same, we win.
- If they are different, we now know we have [∘∙∙∘]
Step 5
Take two cups along a diagonal and flip both. We win!
No comments:
Post a Comment