Ken's POTW


The Blind Bartender
The following game is played between a customer and a bartender. The customer places four glasses on a revolving tray, arranged in a circle. Each glass is either right-side-up or upside down. The bartender is blindfolded and cannot see which way the glasses are placed, but the goal is to turn all the glasses the same direction.

In each round, the tray is spun, and the bartender is allowed to touch only two glasses, turning over either or both of them. After each round, the bartender is told if all glasses are oriented the same and the game is over. What is the best strategy for the bartender? Is there a maximum number of moves, after which the bartender can be certain all the glasses are identically oriented?

There are several variations to this problem worth trying as well:

  1. The above problem
  2. Problem 1, but there are now 6 glasses in a circle, and any 4 of them can be touched in each round.
  3. Problem 1. Any number of glasses may be flipped, but the bartender wears boxing gloves and cannot determine the orientation of the glasses. An additional requirement in this version is that the game is over when all glasses are right-side up.
  4. Problem 3. Only one or two glasses may be flipped at one time.

Source: 1. rec.puzzles. 2. Original. 3. Duke U. Assignment Web page 4. Penn State Math Dept. Web page


Solutions were received from Philippe Fondanaiche and Yaacov Weiss. Yaacov Weiss' solutions follow. All of them are right except that for for number 1 (he missed one possible option.) Thus, Phillippe's solution for Number 1 is first.

There are four basic configurations where O represents a right-side-up glass
and X an upside down one.

configuration A:  O X
                  X X

configuration B:  O X
                  X O

configuration C:  O O
                  X X

configuration D:  O X
                  O O

Within each configuration, we obviously have the similar positions obtained
by rotation of 90o, 180o and 270o.

If at a round of the process, the bartender  succeeds to obtain the
configuration B, he is successful at the next round by turning  2 glasses of
any diagonal. Then,all the glasses are in the same direction. So the strategy
of the bartender is to obtain as quick as possible the configuration B as an
unique position.

Round 1: the bartender chooses a diagonal and put the glasses in the same
direction. If the glasses are already in the same direction, he turns the two
glasses. Three configurations are possible:
  - all the glasses in the same direction,so the game is over.
  - this is the configuration B called hereafter B1
  - this is the configuration A or D. Let consider that is the configuration
A called A1.

Round 2: the bartender chooses again any diagonal.Two cases are possible:
  2-1 the glasses are in the same direction. So the bartender turns these 2
glasses:
       -If the former position was B1, the 4 glasses are in the same
direction and the game is over.
       -If the former position was A1, the bartender obtains D called
hereafter D2.
  2-2 the glasses are not in the same direction. That means that the former
position was A1 and the bartender returns the glass which is not in 
the same direction as the 3 others. The game is over.

At the end of the round 2,the bartender obtains the configuration D.

Round 3:the bartender touches a first glass. If it is in the direction X,the
game is over by turning it. If it is in the direction O,the bartender
consider the other glass placed on the same diagonal.Two cases are possible:
 - this second glass is in the position X and the game is over by turning it.
 - it is in the position O, the bartender turns only one glass of the
diagonal and obtains the configuration C called C3.

Round 4:the bartender chooses 2 adjacent glasses.Two cases are possible:
 - the glasses are in the same direction. By turning both of them, the
bartender ends the game.
 - the glasses are not in the same direction. By turning them, the bartender
obtains the configuration B called B4.

Round 5:with the former position B4;the bartender is certain to end the game.

So the appropriate strategy can be summarized by the following sequence of
operators: D2 A2 D1 D1or2 D1or2 where the operators D and A indicate the
choice of respectively 2 glasses on the same diagonal and 2 adjacent glasses
with the index i representing  the number of glasses which are turned.


Yaacov:
First I want to solve problem 1 with boxing gloves:
Easier to follow

there are 4 possible configurations


#    abcd
0    oooo (impossible 'cause it's a solution)
1    ooox
2    ooxx
3    oxox

1: I switch 2 opposite cups (ac or bd)
   this eliminates case 3 (it solves it.)
   cases 1 and 2 remain the same
2: Then I switch 2 cups next to each other:
   case 2 gets solved or turns into case 3
   case 1 stays the same
3: Then I again switch opposite cups.
   if i have case 3 (from case 2) I solved it.
   case 1 remains the same
4: I change 1 cup
   I've either solved it or changed it to 2 or 3
5: Then I again switch opposite cups.
   case 3 is solved, 2 remains the same.
6: Then I switch 2 cups next to each other:
   I solve or turn into case 3
7: Then I again switch opposite cups.
   Solving in all cases

Problem 1
1: Touch opposite cups:
   if the same change both
     A1 case 3 is solved
     A2 case 1 stays case 1 but i know what there are 3 of.
   if different change 1.
     B1 case 1 is solved or case 3
     B2 case 2 turns into case 1 while I know what there are 3 of.
A2  
2:   touch 2 opposite each other, if different--solve
     if same-turn 1 over and you have case 2
3,4: same as previous solution (with gloves) steps 6,7
B  2:touch opposite. If different--solve if same switch both
     B1-solved,B2-case 1 where I know what there are 3 of.
3,4: same as previous solution (with gloves) steps 6,7

Problem 2 (6/4)
  Complicated :)
  possible configurations (circular)
  
case   0   1   2   3   4   5   6   7
      ooo ooo ooo ooo oox ooo oox oxo
      ooo oox oxx xox xoo xxx xxo xox
I won't write such a detailed solution for this just short-hand.

without looking, turn over every other cup.
x->y (case x into case y)

1->3   2->6   3->1   4->5   5->4   6->2   7->0
I have deleted case 7.
--------------------------------------------------------------
touch the o's in case 4
The possible configurations are:
?=untouched
  a        b        c        d        e
oo?oo?   oo?ox?   oo?xx?   ox?ox?   ox?xo?


p-ij (if I touch case p, possible current config's could be i or j)

a-14
b-1236
c-25
d-46
e-35

case a Will be later
case b switch single
1-0 2-1 3-1 6-4
   This means I know i have case 1 or case 4 knowing what has 4 or 5
case c switch so all are same direction
2-0,2-4 5-1
   This means I know i have case 1 or case 4 knowing what has 4 or 5
case d switch so all are same direction
4-0,4-4 6-1
   This means I know i have case 1 or case 4 knowing what has 4 or 5
case e switch so all are same direction
3-0,3-4 5-1
   This means I know i have case 1 or case 4 knowing what has 4 or 5

In all cases I have case 1 or 4 when I know what direction has 4 or 5
---------------------------------------------------------------
touch the o's in case 4 again.

If all the same direction (and case a from before) turn all over
   and I either solved it or know it is case 1 (knowing which has 5)
If ox?ox? I solve (i know which to turn)
If oo?ox? I solve (i know which to turn)


Next I touch o's in case 4 again. If 1 is different I solve
If no I turn 2 cups on one side.
now i have xxx
           ooo
now pick up the o's in case 3:
cases   A   B
       ?x? ?x?
       ooo xoo
in case A turn 3 o's over
in case B turn the xoo on the bottom over
now I have xxo
           oxx case 4 which is simple to solve (I know what I have
                                                    4 of)
Problem 3 gloves,right side up,(4/4)
  Follow solution of the first solution I wrote (not the puzzle's)
  while starting by turning all cups over and turning all cups over
  between every move.
Problem 4 gloves,right side up,(4/2)
  No solution because you can never garentee you will touch
   the elusive upside-down cup.

I'm wondering what the rule for how many you need to touch to be able
to solve these problems is. If you know tell me. If not I have some
ideas but high numbers offer many options.

Thank you,
Yaacov Weiss


Mail to Ken