There are 6 men, 3 good and 3 bad. They stand on the east side of a very deep chasm. An electrified (untouchable) cable spans the chasm from which hangs a little car (which luckily is also on the east side). The car can transport one or two men from one side of the chasm to the other, but can't span the distance unmanned. If at any point the bad guys outnumber the good guys, they will kill the good guys. I.E. if a good guy and bad guy are in the cable car, traveling towards a side on which there is only a bad guy, then when they arrive the good guy will be outnumbered and will surely die.
How can everyone get across the chasm alive (such that all six men are on the west side at the same time) using only the car? (No funny business with the cable or alternate routes across the chasm.)
Solution in ASCII-HEX. (here's a converter)
496620796F7520766965772074686520666F6C6C6F77696E6720696E2061206D6F6E6F737061
636520666F6E742C2069742073686F756C64206D616B652073656E73652E1F1F202020202D2D
202D2D2D2D206767676262621F202020202D2D203C2D626220676767621F202020206262202D
2D2D2D20676767621F20202020206220622D3E2020676767621F202020202062202D2D2D2D20
67676762621F202020202062203C2D6262206767671F202020626262202D2D2D2D206767671F
20202020626220622D3E20206767671F202020206262202D2D2D2D20676767621F2020202062
62203C2D67672067621F202067676262202D2D2D2D2067621F2020202067622067622D3E2067
621F202020206762202D2D2D2D20676762621F202020206762203C2D67672062621F20206767
6762202D2D2D2D2062621F20202067676720622D3E202062621F202020676767202D2D2D2D20
6262621F202020676767203C2D626220621F206767676262202D2D2D2D20621F202067676762
20622D3E2020621F202067676762202D2D2D2D2062621F202067676762203C2D6262202D2D1F
676767626262202D2D2D2D202D2D
There are 100 doors, all closed and numbered 1 to 100.
There are 100 monkeys, numbered 1 to 100.
The monkeys are sent one by one (in order) to change the states of the doors (open to closed vs. closed to open).
Monkey 1 opens every door (1, 2, 3, 4...)
Monkey 2 changes the state of every other door (2, 4, 6, 8, 10...)
Monkey 3 changes the state of every third door (3, 6, 9, 12...)
And so on for monkeys 4-100...
After the monkeys make all their changes, what is the state of door N?
i.e., give a formula or script that computes the state of an arbitrary door.
Solution in ASCII-HEX. (here's a converter)
4C657420282073203D3D2030202920696E646963617465207468617420646F6F72204E206973
20636C6F7365642E1F4C657420282073203D3D2031202920696E646963617465207468617420
646F6F72204E206973206F70656E2E1F4C6574202520626520746865206D6F64206F70657261
746F722E1F1F73203D20313B1F666F722028206D203D20323B206D203C3D203130303B206D2B
2B20291F7B1F20206966202820284E2025206D29203D3D20302029207B2073203D202873202B
203129202520323B207D1F7D
Here's something drawn on paper.
Add one mark to make it mean nine fifty.
Here's an example of one mark.
Here's an example of two marks.
Solution in ASCII-HEX. (here's a converter)
44726177206120686F72697A6F6E74616C206C696E652061626F766520746865207365636F6E
6420766572746963616C206C696E652E1F5468697320676976657320796F753A202231302054
6F20313022207768696368206973207468652073616D65206173207468652074696D6520393A
35302E
There exists 1 incandescent light bulb and 3 independent binary switches.
The light bulb cannot be observed from the location where the switches can be manipulated.
On/Off positions for the switches are marked (known).
First, manipulate the switches. Second, observe the light bulb.
You only get to manipulate the switches once, you only get to observe the light bulb once.
Which switch controls the light bulb?
Solution in ASCII-HEX. (here's a converter)
496E63616E64657363656E74206C696768742062756C62732067657420686F742E1F53657420
73776974636865732028312C322C332920746F20286F6E2C6F6E2C6F66662920616E64207761
69742E1F5468656E207365742073776974636865732028312C322C332920746F20286F6E2C6F
66662C6F66662920616E64206F62736572766520746865206C696768742062756C622E1F4966
206974206973206F6E207468656E2073776974636820233120636F6E74726F6C732074686520
6C696768742062756C622E1F4966206974206973206F666620616E64207761726D207468656E
2073776974636820233220636F6E74726F6C7320746865206C696768742062756C622E1F4966
206974206973206F666620616E6420636F6C64207468656E2073776974636820233320636F6E
74726F6C7320746865206C696768742062756C622E
Jill: I don't know the ages of any of your three children.
Jane: The product of their ages is 36.
Jill: I still don't know their ages.
Jane: The sum of their ages is your street address.
Jill: I still don't know their ages.
Jane: The oldest has red hair.
How old are the children?
Solution in ASCII-HEX. (here's a converter)
46726F6D20612A622A633D333620776520686176653A1F1F31202A2031202A2033361F31202A
2032202A2031381F31202A2033202A2031321F31202A2034202A2020391F31202A2036202A20
20361F32202A2031202A2031381F32202A2032202A2020391F32202A2033202A2020361F3320
2A2031202A2031321F33202A2032202A2020361F33202A2033202A2020341F34202A2031202A
2020391F34202A2033202A2020331F36202A2031202A2020361F36202A2032202A2020331F1F
41667465722072656D6F76696E67206475706C69636174657320776520686176653A1F1F3120
2A2031202A2033361F31202A2032202A2031381F31202A2033202A2031321F31202A2034202A
2020391F31202A2036202A2020361F32202A2032202A2020391F32202A2033202A2020361F33
202A2033202A2020341F1F4C6F6F6B696E67206174207468652073756D732077652068617665
3A1F1F31202B2031202B203336203D2033381F31202B2032202B203138203D2032311F31202B
2033202B203132203D2031361F31202B2034202B202039203D2031341F31202B2036202B2020
36203D2031331F32202B2032202B202039203D2031331F32202B2033202B202036203D203131
1F33202B2033202B202034203D2031301F1F576520646F6E2774206B6E6F7720746865697220
616765732C20627574206E65697468657220646F6573204A696C6C20616E6420736865206365
727461696E6C79206B6E6F777320686572206F776E2073747265657420616464726573732C20
736F206974206D757374206265206F6E65206F663A1F1F31202B2036202B2036203D2031331F
32202B2032202B2039203D2031331F1F416E642073696E63652074686572652069732022616E
206F6C64657374222C206974206D757374206265207468617420746865206F6C646572206167
652069736E2774207477696E732E1F1F5468657265666F72652C20746865206368696C647265
6E27732061676573206172653A20322C20322C20392E
There exist four sticks and a fire source.
Lit from one end, a stick is guaranteed to be entirely consumed by fire in exactly 1 hour.
Each stick is different and burns non-linearly (i.e. it is not the case that the burning behaviour of one stick tells you anything about the burning behaviour of another stick, and it is not the case that half a stick burns in half an hour).
Measure exactly 1 hour and 45 minutes.
Solution in ASCII-HEX. (here's a converter)
596F752063616E206275726E206120737469636B20696E2068616C6620616E20686F75722062
79206C69676874696E672069742066726F6D20626F746820656E64732E1F53696E6365206561
636820626974206F6620737469636B2074616B6573206120626974206F662074696D6520746F
206275726E2C20616E642073696E6365207468652073756D206F6620616C6C20746865736520
62697473206F662074696D6520666F72206F6E6520737469636B206973206F6E6520686F7572
2C20697420666F6C6C6F77732074686174206275726E696E67206120737469636B2066726F6D
20626F746820656E64732077696C6C20726573756C7420696E207468652074776F206275726E
696E6720656E6473206D656574696E672028616E642074686520656E7469726520737469636B
206265696E67206275726E742920696E2065786163746C792068616C6620616E20686F75722C
20616C74686F75676820746865206D656574696E6720706F696E742070726F6261626C792077
6F6E277420626520617420746865206D6964646C65206F662074686520737469636B2E1F1F4E
6F7465207468617420796F752063616E2774206D656173757265203135206D696E7574657320
627920627265616B696E67206120737469636B20696E2068616C6620616E64206275726E696E
672066726F6D20666F757220656E64732C206265636175736520656163682068616C66206F66
2074686520737469636B2077696C6C20626520656E746972656C79206275726E742061742073
6F6D6520756E6B6E6F776E2074696D652E20416C736F206E6F74652074686174206275726E69
6E67206120737469636B2066726F6D20746865206D6964646C65206973206E6F742074686520
73616D65206173206275726E696E672069742066726F6D20626F746820656E64732E2053696E
6365206F6E6520656E64206D61792062652072656163686564206265666F726520746865206F
746865722C206C696B6520627265616B696E67206120737469636B2C206275726E696E672066
726F6D20746865206D6964646C652074656C6C7320796F75206E6F7468696E672E1F1F536F6C
7574696F6E3A1F2D204C6967687420737469636B2023312066726F6D20626F746820656E6473
20616E64206C6967687420737469636B2023322066726F6D206F6E6520656E642E1F2D205768
656E20737469636B202331206973206275726E742C2068616C6620616E20686F757220686173
2070617373656420616E642074686572652069732068616C6620616E20686F7572206F662062
75726E696E672074696D65206C65667420696E20737469636B2023322E1F2D20417420746869
732074696D652C206C6967687420746865206F7468657220656E64206F6620737469636B2023
322C2069742077696C6C206E6F77206275726E20617420747769636520737065656420286173
206465736372696265642061626F76652920616E64207468657265666F72652077696C6C2062
65206275726E7420696E203135206D696E757465732E1F2D204F6E636520737469636B202332
206973206275726E742C20796F752068617665206D65617375726564203435206D696E757465
732E204C6967687420737469636B2023332066726F6D206F6E6520656E6420746F206D656173
757265207468652072656D61696E696E6720686F75722E1F2D20537469636B20233420776173
6E2774206E65636573736172792E
There exist 8 balls, seven of equal weight, one heavier.
There exists a balancing scale.
Find the heavy ball with 2 weighings (uses of the scale).
Solution in ASCII-HEX. (here's a converter)
4E616D65207468652062616C6C733A20312C20322C20332C20342C20352C20362C20372C2038
2E1F576569676820312C322C3320616761696E737420342C352C362E1F496620746865792077
65696768207468652073616D653A1F205765696768203720616761696E737420382E1F205468
6520686561766965722069732074686520736F6C7574696F6E2E1F456C736520696620312C32
2C332069732068656176696572207468616E20342C352C363A1F205765696768203120616761
696E737420322E1F204966207468657920776179207468652073616D652C2033206973207468
6520736F6C7574696F6E2E1F20456C7365207468652068656176696572206973207468652073
6F6C7574696F6E2E1F456C736520342C352C362069732068656176696572207468616E20312C
322C333A1F205765696768203420616761696E737420352E1F20496620746865792077617920
7468652073616D652C20362069732074686520736F6C7574696F6E2E1F20456C736520746865
20686561766965722069732074686520736F6C7574696F6E2E
My interest in Monty Hall isn't in the solution, but in the clarity of the solution. For whatever reasons, if you just (without much forethought) try to explain the solution to someone, most people seem inclined to resist the truth for quite some time. I believe that the solution can be made simple. Here's my latest stab at it.
Let me describe a game. There are three doors. Two are empty and one hides a prize. I always know what's behind the doors. You pick one door. Of the remaining two, I will open one that is empty (never the prize door, remember I know where the prize is hidden). Now that two doors remain, you may open one (stay or switch). If you reveal the prize, you win.
You might want to believe that once only two doors are closed, each has a 50/50 chance of hiding the prize. But that's not true. Here's why.
The same game can be described as follows. There are three doors. Two are empty and one hides a prize. You pick one door. Now you may have the contents behind the door you picked, or you may have the contents behind both of the other doors, but when opening them, I will always open the empty one first. It's the same game, but it's hopefully clear to everyone that two doors are better than one.Monty Hall Problem and Intuitive Solutions
Classical Problem
There are three doors. Two hide nothing. One hides a car. In phase 1, you pick a door. Monty (knowing where the car is) opens a door that does not hide a car and that you did not pick. In phase 2, you may stay with your chosen door (StayStrategy) or you may change your guess to the one remaining door (SwapStrategy). If you've picked the door that hides the car, you win the car.
The Truth
In the Classical Monty Hall problem, the StayStrategy succeeds with 1/3 probability, and the SwapStrategy succeeds with 2/3 probability.
Hand Wavy Justification
Imagine that there are 100 doors. You choose one. Knowing where the car is, Monty Hall opens 98 doors (other than your pick) that don't have the car. It is intuitively clear that your door has low probability of success, while the swap door has high probability of success.
Modified Problem
Imagine the same game, except Monty Hall doesn't know where the car is. After you pick a door in phase 1, he randomly reveals one of the remaining two doors. Now consider the situation where (by chance) he does not reveal the car. Should you stay or swap? Note: this problem only considers the situation when Monty Hall (by chance) has opened a door that does not hide the car.
The Truth
In the Modified Monty Hall problem, the StayStrategy succeeds with 1/2 probability, and the SwapStrategy succeeds with 1/2 probability.
A False Hand Wavy Argument
Imagine that there are 100 doors. You choose one. Not knowing where the car is, Monty Hall opens 98 doors (other than your pick) that don't have the car. This situation is highly unlikely, but possible. Originally, you knew that your door had a 1/100 probability of hiding the car, so it must reasonably be true that all the other doors combined had a 99/100 probability of hiding the car, and since they have been narrowed to one selection, the swap door must have a higher probability of success.
Proof For The Classical Problem
The Classical Monty Hall problem is exactly equivalent to the following problem. You pick a door with a 1/3 probability of success. There is a 2/3 probability that one of the other two doors hides the car. You are given the option of opening and winning the contents of just your selected door (StayStrategy) or both the other doors (SwapStrategy). Because Monty Hall never reveals the car, the (SwapStrategy) is exactly equivalent to having both the other doors, and therefore 2/3 probability of success. It is important to remember that there are only two possible outcomes to this game: the stay door hid the car or the swap door hid the car. The Monty door never hides the car. This proof is particularly evident when examining the source code for a simulation of the game. In the simulation it is not necessary to determine which door Monty reveals. All you need to do is randomly generate a car on [1..3] and randomly generate a guess on [1..3]. If the car equals the guess then the (StayStrategy) wins, otherwise the (SwapStrategy) wins.
Proof For The Modified Problem
The Modified Monty Hall problem is actually three problems considered in isolation. It is true that your original pick has 1/3 probability of success. It is true that Monty Hall is not allowed to reveal your door. This does not change the fact that the door Monty Hall picks has a 1/3 probability of hiding the car. Since neither your nor Monty have knowledge of which door hides the car, regardless of the picks, each door has a 1/3 probability of hiding the car. Hence in the millions of times that the game is played, 1/3 of the games end with Monty Hall accidentally revealing the car. In the remaining 2/3 of the games played there is a 50% probability that the (StayStrategy) wins, and a 50% probability that the (SwapStrategy) wins. That is to say that 1/3 of all games end with Monty Hall accidentally revealing the car, 1/3 of all games end with your original pick hiding the car, and 1/3 of all games end with the remaining door (picked by neither you nor Monty) hiding the car.
If You Don't Believe Me
Java Simulation Source CodeJava Simulation Executable Jar File
Java Simulation Results




