Monday, April 28, 2008

I was challenged with two exceptionally tough and brilliant logic problems today and thought I should share them. Don't be discouraged if you can't get the answers!

1. There was once a farm where 50 farmers lived and each of them owned a dog. The farmers and dogs were housed in a manner such that each farmer could see the dog of every single other farmer except for his own. One night, several of the dogs went mad and attacked the other livestocks that lived on the farm. On the following day (which we shall call Day 1), the 50 farmers realized that the mad dogs could be distinguished by their bloodied faces and bodies. The killings went on every night (during which the farmers do NOT wake up) until the morning of Day 11, when all the farmers who were certain that their own dogs were mad, simultaneously shot their own mad dogs. Given the fact that these farmers had no way of communicating with each other, and remembering that they cannot see their own dogs, how did they manage to figure out if their own dogs were mad, and how many dog were indeed mad?

2. A detention barrack once housed 500 detainees, all locked in separate cells such that it was impossible to observe the actions of one another. In addition to these cells, there was one unoccupied room, that has always been left unlit, with only a door (from which one can enter and exit) and a switch that was connected to a bulb in the room (which could be switched on or off). One day, the warrant of the detention barrack decided to gather these 500 detainees and struck a deal with them. He said, "I will choose one person at a time from your numbers at random to enter the [aforementioned unoccupied] room and repeat this procedure indefinitely. A person might be only called upon once, or maybe several times, consecutively or otherwise. If one of you can eventually tell me for certain that every one of the 500 of you has already entered the room, I will release all of you. Now you shall be given some time to discuss a stratagem amongst yourselves, after which all of you will return to your respective cells [where communication is impossible] and we shall begin." Without capabilities to leave any physical mark in the aforementioned room whatsoever, the detainees, however, eventually managed to secure their release. What was the stratagem they used?

I know they are long and convoluted, but I had to make the premises are set without ambiguity. I hope you enjoy solving them!

No comments: