Logical Puzzle: Arranging Soldiers in a Row

What logic must each soldier in a platoon use to determine on which side of a row he or she belongs, depending on whether the soldier's hat has a square or circle on it?

Itzik Ben-Gan

November 20, 2006

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

A commander decides to discipline his platoon after they misbehaved and also check their logic. He blindfolds their eyes and places hats on their heads. Some hats have a circle on the front of the hat, and some have a square. He arranges the soldiers in a column in front of the door of a room and gives them these orders:

      1. Enter the room one by one.

      2. Remove your blindfold after you enter the room.

      3. Don't remove your hat or in any way check what the sign on your hat is.

      4. Arrange yourselves in a row facing the door, with all soldiers with a circle on their hats on the left and all soldiers with a square on their hats on the right.

      5. Don't communicate with each other verbally or by any other means; rely solely on your sight and logic to form a row in compliance with these instructions (all circles to the left and all squares to the right.

Assume you're one of the soldiers who entered the room. You've removed your blindfold, and you’re facing none, one, or more soldiers in front of you. You don’t know what sign is on your hat, but you can see the signs on the hats of the soldiers already aligned in the row in front of you. What logic should you follow to comply with your commander’s instructions?

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