# Puzzle | Four Glasses and Blindfold

** Puzzle:** Four glasses are placed on the corners of a square plate which can rotate about its center. Glasses are either upright (up) or upside-down (down) in no known number.

A person is made blindfold and seated next to the rotating plate. The blindfold person has to re-arrange the glasses so that they are either all up or all down which will be signalled by the ringing of a bell.

The glasses can be rearranged in turns, following the given rules:

- In a single turn, any two glasses can be inspected and following three actions can be done by the person:
- The person can reverse the status (upright or upside-down) of either of the glass.
- The person can reverse the status (upright or upside-down) of both the glasses.
- The person can let the status (upright or upside-down) of glasses as it is i.e. no change.

- After each turn, the square plate is rotated through a random angle.

Help the blindfolded person by devising an algorithm that ensures all glasses in the same position (either up or down) in a finite number of turns. The algorithm must not depend on luck i.e. it should be non-stochastic.

__Solution__:

The bell will ring in at most five turns following the below algorithm. Let this be the initial arrangement.

**Turn 1:**Choose a pair of glasses which are diagonally opposite and turn both the glasses up.

**Turn 2:**Choose a pair of adjacent glasses, at least one of the glass will be up because of the previous step. If the other is down, then turn that glass up as well. If the bell does not ring, then now there are three glasses up and one down.

**Turn 3:**Choose a pair of glasses which are diagonally opposite. If one is down, then turn it up and the bell will ring. If both the glasses are up, then turn one down. There are now two glasses in down position and they must be adjacent.

**Turn 4:**Choose a pair of adjacent glasses and reverse both the glasses. If both the glasses were in the same position then the bell will ring, otherwise, there are now two glasses down and they must be diagonally opposite.

**Turn 5:**Choose a pair of glasses which are diagonally opposite and reverse both the glasses. Now, all the glasses are in the same position either up or down and the bell will ring.

**References:**

https://en.wikipedia.org/wiki/Four_glasses_puzzle

## Recommended Posts:

- Puzzle 1 | (How to Measure 45 minutes using two identical wires?)
- Puzzle 2 | (Find ages of daughters)
- Puzzle 3 | (Calculate total distance travelled by bee)
- Puzzle 4 | (Pay an employee using a 7 units gold rod?)
- Puzzle 13 | (100 Prisoners with Red/Black Hats)
- Puzzle 5 | (Finding the Injection for Anesthesia)
- Puzzle 6 | (Monty Hall problem)
- Puzzle 7 | (3 Bulbs and 3 Switches)
- Puzzle 8 | (Find the Jar with contaminated pills)
- Puzzle 9 | (Find the fastest 3 horses)
- Puzzle 10 | (A Man with Medical Condition and 2 Pills)
- Puzzle 11 | (1000 Coins and 10 Bags)
- Puzzle 12 | (Maximize probability of White Ball)
- Puzzle 14 | (Strategy for a 2 Player Coin Game)
- Puzzle 15 | (Camel and Banana Puzzle)

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.