Logical Puzzle - 18 Dec 2006

Crossing the Tunnel

Itzik Ben-Gan

December 17, 2006

2 Min Read
ITPro Today logo in a gray background | ITPro Today

Solution to December’s Puzzle: Arranging Soldiers in a Row


After some soldiers misbehave, their commander decides to teach them alesson while testing their powers of logic. He blindfolds them and places hatson their heads. Some hats have a circle on them, and others have a square. Hethen arranges the soldiers in a column in front of a door and gives them thefollowing orders:

  1. Enter the room one by one.

  2. After you enter the room, remove your blindfold. Don’t take off your hat or in any way check what sign is on your hat.

  3. Line up in a row facing the door. All soldiers who have a circle on their hats should be on the left, and all soldiers who have a square on their hats should be on the right.

  4. Don’t communicate with each other verbally or by any other means; rely solely on your sight and logic.

  5. If any soldier lines up in the wrong spot, the whole group will face severe penalties.

  6. If all soldiers form a row with all circles to the left and all squares to the right, you will get to sleep tonight.

  7. Now move!

Assuming you’re one of the soldiers, here’s the logic you would follow afteryou remove your blindfold and look at the 0, 1, or more soldiers standing in therow in front of you:

  • If you enter the room first, simply position yourself somewhere in the room and face the door so that the next soldier can see the sign on your hat.

  • If you’re not the first one in the room, look at the soldiers in the row facing the door. If all soldiers in the row have a circle on their hats, go to the right end of the row and face the door.

  • If they all have a square on their hats, go to the left end of the row and face the door.

  • If some soldiers have a circle (standing to the left) and some have a square (standing to the right), stand between the rightmost soldier who has the circle and the leftmost soldier who has the square.

January’s Puzzle: Crossing the Tunnel


Four people—let’s call them persons A, B, C, and D—need to cross a dark tunnel.Only two people at a time can cross the tunnel, and because the tunnel is verydark, a flashlight is mandatory. Person A can cross the tunnel in 1 minute, personB can cross in 2 minutes, person C can cross in 4 minutes, and person D canmake it in 5 minutes. The group has one flashlight, containing batteries that lastonly 12 minutes. What strategy will enable all members of the group to cross tothe other side in 12 minutes before the flashlight’s batteries run down?

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like