[Tfug] [OT] Solution: A good brainteaser to flex your sad and flabby hacker brain muscles.

Bowie J. Poag bpoag at comcast.net
Wed Apr 11 13:57:00 MST 2007


The solution(s) are shown below. Scroll down to view them.



















Solution #1: (the hard way)

You don't know what state the light switches are in when the box is 
handed to you--there are 8 possible configurations that could be in 
play:  ("*" = on, "-" = off)

-  -  -
-  -  *
-  *  -
-  *  *
*  -  -
*  -  *
*  *  -
*  *  *

Since you don't know which of the 8 configurations is in play, the only 
way to place the system in a known state is to continuously flip each 
switch on and off randomly for half an hour or so to ensure each bulb is 
equally warm. From there, stop randomly flipping one of the switches 
permanently. This switch will control a bulb that will either be very 
hot, or very cold when it comes time to open the lid. A few seconds 
before you open the lid, stop randomly flipping the next switch. When 
you open the lid, the bulb controlled by this switch will either be 
slightly warmer or slightly colder than the third (evenly-warmed) bulb.  
In the end, you want a situation where one bulb is warm, another bulb is 
"slightly different than warm", and the last bulb is "VERY different 
than warm". Theres no way to predict if a bulb will be on or off when 
you open the lid...light, as an indicator, isn't useful at all in this 
situation. Besides, you wouldn't want a test that discriminated against 
blind applicants, would you? :)


Solution #2: (the clever way)

Push the box back across the table to the Unix administrator, and ask 
him to open it for you. The rules state that the person who opens the 
lid is not allowed to touch the switches ever again. If someone else 
opens the lid, then you can manipulate the switches freely. This is a 
perfectly valid (not to mention fast!) solution -- The ability to 
cooperate and work as a team is important in an environment like that, 
because solutions to complex problems usually aren't figured out by one 
person working on their own.

Food for thought, eh?

Cheers,
Bowie





More information about the tfug mailing list