** 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