• subscribe
November 20, 2006 12:00 AM

Logical Puzzle

SQL Server Pro
InstantDoc ID #93906

DECEMBER'S PUZZLE: ARRANGING SOLDIERS IN A ROW
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?

WANT MORE T-SQL PUZZLES?
Look for Catch That Bug! and the solution to the November Logical Puzzle on Itzik's Puzzled by T-SQL blog at http://www.sqlmag.com/blog/index.cfm?action=blogindex&departmentid=1016



ARTICLE TOOLS

Comments
  • JOSEPH
    6 years ago
    Dec 15, 2006

    First person in simply goes to the middle and turns around. Everyone who follows should insert themselves to the right of the right-most (or only) circle and the left of the left-most (or only) square. Once there is at least one of each, the new person simply inserts into the gap between circles and squares. For neatness, the line should always shuffle and center itself on the door after each insertion.

You must log on before posting a comment.

Are you a new visitor? Register Here