The following entries were tagged with “puzzle”. They are displayed with the most recent entries first. (1–2)

Four Glass Puzzle — Solution

Posted in and on Sat, 12th Jan 2008 at 13:09

If anyone was waiting for the follow-up to the puzzle I posted last week, note that Joe has posted a solution in the comments of that entry.

Four Glass Puzzle

Posted in and on Sat, 05th Jan 2008 at 19:30

I learned this puzzle from a friend in work. He posed it one morning before everyone had had their coffee and ended up costing a small handful of engineers a whole morning of productivity as we each solved it. I've been meaning to post about it here for a while. Here's the formulation as best I can describe it:

You have in front of you one of those tables you get in Asian restaurants with the rotating centre—what one of our product managers described as a lazy susan, though I've never heard that phrase from anyone else. Picture the restaurant from the beginning of Indiana Jones and the Temple of Doom if you really want to set the scene.

On the table are four glasses, each of which is either standing upright or turned upside down. They're evenly spaced around the table, in a square. You sit at the table blindfolded. Your aim is to turn the glasses such that they are either all upright or all upside down, subject to the following rules.

You are allowed to inspect two of the glasses, by touch, at a time. You can choose to inspect either the two immediately in front of you (i.e., a side of the square) or one in front of you and the one opposite it (i.e., a diagonal). After inspecting the glasses you are allowed to turn either glass, both glasses or neither glass.

Once you've inspected and possibly turned two glasses the table is rotated a random amount so that you don't know which glass is which. You then have the same choices about inspecting and turning glasses as before. Then the tables is rotated again. It goes on like this for as long as you need to solve the puzzle.

If at any point you get all the glasses upright or all upside down you'll be told that you've won. You don't need to be able to know that you've solved it. You aren't told at the start what configuration the glasses are in, though you can assume they don't start in a solved state.

Find a way to reliably solve this puzzle that will be guaranteed to work in a finite number of moves regardless of the initial conditions or how lucky you are with rotations of the table. In particular this means that you can't just keep spinning the table and turning upright every glass you touch in the hope that you'll get them all eventually.

Comments:
Sat, 05th Jan 2008 (22:00)

First off, I'm not an engineer. Secondly, I thought I had it, then I thought I didn't, then I thought I did…

The big stumbling block is the random turning of the table after the selection of up/down glasses.

So, if it were me, I'd choose a diagonal selection and change both to UP. After every spin, I'd change both diagonal corner glasses to UP. I think this would be the shorterst route to completion.

I do hope you post the answer because this is going to bug me!

by isadub
Sat, 05th Jan 2008 (23:13)

"isadub": Your suggestion would be pretty pragmatic if you were really in that situation, as you'd be very likely to solve it in very few rounds. But technically it's no a solution because it would be possible (though unlikely) to get the same diagonal on every round forever.

I'm going to hold off on posting the solution for a little while, and I'll post it in a new entry after that.

by Rory
Sun, 06th Jan 2008 (00:52)

Come on, Rory! It's hardly physics.

One solution as follows: I'll refer to positions as follows: A B C D

Round 1: Select two glasses on the diagonal B-C. And turn them up correctly. (If the other two glasses are up, then you have already won)

Round 2: Select the C-D line. You are now gauranteed to have selected one and only one of the previous two glasses. -If one glass is up and one upside down, then you know the upside down glass is the new one. In this case flip both glasses so that one of the original pair is now upside down, while the new glass is turned up correctly. -If both glasses are up, then do nothing. -It is impossible for both to be upside down.

At this stage you have either won, or are gauranteed to be in a 3 up 1 upside down configuration.

Round 3: Select the glasses along C-D -If one is up and one is upside down, flip the latter and you win - If both are up then flip one at random

At this stage you have either won, or are gauranteed to be in a 2 up 2 upside down configuration.

Round 4: Select the glasses along B-C -If the glasses are both either up or down, then flip both and you win.

If you are still in the game, you now have two adjacent glasses up and two down.

Round 4: Select the glasses along C-D. -If the glasses are both either up or down, then flip both and you win. If not, flip them anyway. This gaurantees that one diagonal contains glasses pointing up and one contains glasses pointing down.

Round 5: Select the glasses along B-C and flip them. You have now won.

You can do better if you can feel one glass before choosing whether to pick a diagonal or side. You can also do better if you can flip and unflip in one turn.

Do I win a google job? I think I can do the XKCD problem too using combinatorics tricks.

by Joe
Mon, 07th Jan 2008 (10:02)

Rory, your puzzle gave me a stroke. Now I must sue you.

by Ronan Lowe