# Four cups on a table

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:

1. You must keep your eyes closed at all times. (No tricks or lateral thinking, this is a pure logic puzzle)
2. 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.
3. After each turn, the table is rotated through a random angle.
4. 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.

• Is it allowed to choose between two orthogonal or diagonal glasses by feeling the edges and corners or remembering the length of a single edge and using it? Commented Sep 2, 2015 at 8:32
• Or to feel the rotation itself? Commented Sep 2, 2015 at 8:47
• Similar puzzle: puzzling.stackexchange.com/questions/43
– f''
Commented Sep 2, 2015 at 11:14
• If you choose to turn both glasses are they turned simultaneously? Or can you turn 1 glass, see if it wins, if not turn the other glass?
– Ivo
Commented Sep 2, 2015 at 14:46
• Also, can you pick the second glass based on what you feel by inspecting the first? Or do you say which 2 you want to inspect before inspecting?
– Ivo
Commented Sep 2, 2015 at 14:54

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:
$\begin{bmatrix} \circ & \bullet \\ \bullet & \circ \end{bmatrix}$
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. $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$ or $\begin{bmatrix} \bullet & \circ \\ \bullet & \bullet \end{bmatrix}$
CASE 2a) two cups are in each orientation along the diagonal, e.g. $\begin{bmatrix} \circ & \bullet \\ \bullet & \circ \end{bmatrix}$
CASE 2b) two cups are in each orientation along two sides, e.g. $\begin{bmatrix} \circ & \bullet \\ \circ & \bullet \end{bmatrix}$

Step 1

Take two cups along the diagonal.
- If they are different, flip $\circ$ to $\bullet$. If this doesn't sound the bell, we either have $\begin{bmatrix} \circ & \bullet \\ \bullet & \circ \end{bmatrix}$ or $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$, with the majority orientation being $\circ$. In either case, proceed to step 2.
- If they are the same, flip both. If this doesn't sound the bell, we either have $\begin{bmatrix} \bullet & \circ \\ \bullet & \bullet \end{bmatrix}$ or $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$. 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 $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$. Flip $\bullet$ to $\circ$ to win.
- If they are the same, flip both. If this doesn't sound the bell, we now know we have $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$. Proceed to Step 3.

Step 3

At this point, we have already figured out what the majority orientation is, so we assume we have $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$ WLOG. Then:
Take two cups along the diagonal.
- If the cups are different, flip $\bullet$ to $\circ$ to win.
- If the cups are both $\circ$, flip one of them. We now know we have $\begin{bmatrix} \circ & \bullet \\ \circ & \bullet \end{bmatrix}$.

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 $\begin{bmatrix} \circ & \bullet \\ \bullet & \circ \end{bmatrix}$

Step 5

Take two cups along a diagonal and flip both. We win!

• It seems your initial assumption is wrong, there is a third case with two different "columns" or "rows" of glasses.
– dmg
Commented Sep 2, 2015 at 8:37
• Oh! You are quite right. Fortunately, we can simply patch the above solution by extending the first "easy out" 2-step solution to be exactly symmetric with the 4-step solution. That is, for that branch, we either have $\begin{bmatrix} \circ & \bullet \\ \bullet & \circ \end{bmatrix}$ or $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$ with the majority orientation known. In either case, we can proceed to the worst case Step 2 in the solution above. Commented Sep 2, 2015 at 8:48
• Hmm, I'm not sure about the "majority orientation known" part. Could you elaborate a bit? It seems that in step 3 you are assuming that there are 3 whites and 1 black, but that is not necessary the case.
– dmg
Commented Sep 2, 2015 at 10:25
• @dmg Re known majority oritentation: We know that there is at least 2 whites. Hench black can not be the majority orientation. Commented Sep 2, 2015 at 10:45
• @Dsel $\begin{bmatrix} \circ & \bullet \\ \circ & \circ \end{bmatrix}$ ->$\begin{bmatrix} \circ & \bullet \\ \bullet & \circ \end{bmatrix}$->$\begin{bmatrix} \bullet & \bullet \\ \bullet & \circ \end{bmatrix}$->$\begin{bmatrix} \circ & \bullet \\ \circ& \circ \end{bmatrix}$->$\begin{bmatrix} \bullet & \bullet \\ \circ& \bullet\end{bmatrix}$ This is fixable, but requires an extra step. I proposed an edit, but it was rejected. Commented Sep 2, 2015 at 18:07

Since at any turn, two glasses are inspected, the best bet would be to identify one corner and inspect the glass at that corner and the glass on its opposite corner.

Stick to one outcome, all up or all down (I am going ahead with downward arrangement). At the first turn, turn over any glass that isn't facing down. If the other two glasses are facing downward, then you're done.

After the table is then rotated randomly, repeat this process. If you find that the glasses you touch are already facing downward, it could be that you are touching the same glasses as before. Assuming that the rotations of the table are truly random, there is a 0.5 probability of picking one combination of glasses. The probability of touching the same two glasses each time is (0.5)n. So the probability of not having the glasses all down diminishes with each turn.

• As far as i understand rule #2 is that you are allowed to change the orientation of 0 or 2 glasses in the process, not of 1. Have i misunderstood the rule? So if the glasses got different orientations you would run into a dead lock. Commented Sep 2, 2015 at 7:03
• @WaKai: you may reverse the orientation of either, neither, or both glasses. either (1 of 2), neither (0 of 2) or both (2 of 2) glasses. Commented Sep 2, 2015 at 7:05
• Yep it seems I misunderstood it. Else it wouldn't be solvable for a 3:1 orientation at the beginning. Commented Sep 2, 2015 at 7:12
• Everything you said is accurate but I specified that the solution must solve the problem in a finite number of turns.
– Dsel
Commented Sep 2, 2015 at 16:47

This solution is incorrect because it doesn't account for case 2b since flipping two diagonals of 2b causes it to remain the same orientation.

Therefore step 2 is an invalid assumption since the majority orientation is not the only possible outcome.

Solution is 6 steps.

1. Two Diagonals
3. Two Diagonals (Flip 1 coin back if no bell)
4. Two Diagonals
6. Two Diagonals

This now takes into account case 2b

• With the marked correct solution in the case of 2B, step 1) any diagonal you grab will lead you to the option of 3 in an L in one orientation and one remaining step 2) will then either win or lead to another 3 in an L and one remaining and continue through the steps to be solved Commented Dec 6, 2018 at 20:57
• @Kevin Please hide your answers in spoilers. Also, this doesn't appear to ber an answer but rather a comment on another post. Commented Dec 7, 2018 at 4:33

To solve this puzzle, we can use a systematic approach that guarantees all glasses will be oriented the same way (either all facing up or all facing down) regardless of the table’s rotations. Here is a step-by-step strategy to achieve this:

### Step 1: Initial Check and Action

1. Turn 1: Select any two glasses (say A and B). Feel their orientation.
2. If both glasses are the same (both up or both down), flip one of them (e.g., flip A).
3. If the glasses are different (one up, one down), do nothing.

This initial action ensures that there are definitely two glasses with different orientations, or it might flip a pair that was the same, making two adjacent or opposite glasses different.

### Step 2: Standardize the Approach

1. Turn 2: Select two other glasses (if you chose glasses at positions 1 and 2 previously, now choose glasses at positions 3 and 4). Repeat the same actions as in Turn 1:
• If both glasses are the same, flip one.
• If the glasses are different, do nothing.

This step ensures that there is a high probability that the table now has two glasses facing up and two facing down, though their arrangement is unknown due to the random rotation.

### Step 3: Create Symmetry

1. Turn 3: Go back to the first two glasses you selected in Turn 1 (positions you recall as 1 and 2).
2. Without checking their current state, flip both glasses.

### Step 4: Verification and Final Adjustment

1. Turn 4: Select any two glasses (e.g., glasses at positions 3 and 4 or 1 and 3, etc.). Feel their orientation.
• If both are the same, the puzzle is likely solved, and the bell should ring soon.
• If they are different, flip one glass.

### Final Note

Since the table rotates randomly, it's important to know that in the first three turns, you're aiming to get all glasses in the same state by creating a pattern and then breaking the symmetry if needed. By the fourth turn, checking and adjusting one pair either finalizes the pattern or requires one more minor adjustment, depending on whether the bell rings.

This method works by systematically ensuring that you disrupt any initial all-same state and then methodically work toward re-establishing a consistent orientation across all glasses. The use of feeling and flipping strategically without needing to know the specific rotations of the table ensures success.

• table is rotated between each action, you cannot select the "other two glasses", you don't know where they are. Also "there is a high probability" is not enough. Commented May 1 at 9:03