Wednesday, October 26, 2016

The 10 Prisoners And The 1000 Bottles Of Wine

After much preparation, a group of 10 death-sentenced criminals are finally in the opportunity to execute their venomous plan. You might think I'm talking about a prison escape, but no. Their prison is highly secure and on an island, so escape seems impossible. Instead they've set out for the next best thing: revenge on their evil, sadistic prison warden. I am sure you remember that guy. He likes to play games with those on death row, and despite the hats it ain't a party.

The warden has a giant wine cellar in his prison. During convict labor, the group of ten are assigned to clean this wine cellar. It houses a collection of 1,000 bottles of expensive wine. And many of these wines get put on the table during lavish parties hosted by the warden. A big one is coming up in one month. And his guests, well they are as bad as he is. They can't get enough of the warden telling stories about what sadistic puzzle he has invented for the prisoners this time.

So none of the ten prisoners have any qualms about what they are about to do: secretly poison nearly the entire supply of wine. They managed to get a special needle to inject the poison into the wine via the corks — the whole thing is untraceable. There are guards watching them, so they have to be careful. During brief unsupervised moments is when they strike, injecting one bottle at a time.

But it does not go according to plan. They are caught red handed before even the second attempt. And shortly they find themselves in a room, being viciously questioned by none other than the warden himself.

Eventually one of the prisoners explains the situation.
“We have poisoned only one bottle in your collection. But we will never tell you which one. And this poison is so potent, it will kill you no matter how many times you dilute it. It won't kill you straight away though. For 3 weeks you will not notice a thing, and then suddenly you will drop dead.”

The wardens face gets red in anger, while the prisoner continues: “You will never find this bottle. Are you really willing to risk your own life and that of your guests over this? Ha, you will have to throw away your entire collection!”

The warden is furious. Foaming at the mouth, screaming: “How dare you! Do you have any idea how much these wines are worth?! I am not throwing out a single bottle more than needed!

He gets silent for a moment and thinks deeply. Suddenly his angry expression changes to an evil grimace.
“Yes, that's right. I can still serve the remaining 999 to my guests. Because I will find this one bottle that you poisoned. And I only need the 10 of you to do so,” he claims confidently.

He lowers his voice, as he tends to do. “You will test my wines for me. Some of you will die. But you have brought this upon yourselves.”

What tactic could the warden possibly employ to make good on his manic claims?

For the answer, we'll have to take a look at binary numbers. Binary is a counting system in which one does not count to 10, as we are all used to, but only to 2. A digit in binary is not in the range ‘0’ to ‘9’ — only numbers ‘0’ and ‘1’ are used. So counting from 0 to 7 in binary goes like 0, 1, 10, 11, 100, 101, 110, 111. *

The warden will number all his bottles, but he will number them in binary. Ten digits, read right to left. Like this:

Bottle # Binary # 512 256 128 64 32 16 8 4 2 1
Bottle 1 0000000001 0 0 0 0 0 0 0 0 0 1
Bottle 2 0000000010 0 0 0 0 0 0 0 0 1 0
Bottle 3 0000000011 0 0 0 0 0 0 0 0 1 1
Bottle 4 0000000100 0 0 0 0 0 0 0 1 0 0
Bottle 25 0000011001 0 0 0 0 0 1 1 0 0 1
Bottle 26 0000011010 0 0 0 0 0 1 1 0 1 0
Bottle 500 0111110100 0 1 1 1 1 1 0 1 0 0
Bottle 750 1011101110 1 0 1 1 1 0 1 1 1 0
Bottle 1000 1111101000 1 1 1 1 1 0 1 0 0 0
Prisoner: 1 2 3 4 5 6 7 8 9 10

To make it more clear, the binary digits are further separated into columns. By they way, you can convert a binary number back to a normal (decimal) number by adding together the numbers in the columns with a ‘1’. For example 0000011010 = 16 + 8 + 2 = 26.

Each of the prisoners represent a column. They will have to take a sip from every bottle where there's a ‘1’ in their column. For bottle 26 that means prisoners 6, 7 and 9 take a sip.

After doing all this, the prisoners have drunk a lot of wine, from a lot of bottles. Now all the warden has to do is wait.
Indeed, three weeks later, some of the prisoners have dropped dead. The warden now has all the information he needs.

The prisoners should still represent the same columns as before. By marking the dead prisoners with a ‘1’ and the live ones with a ‘0’, a binary number is formed which directly indicates the number of the bottle that was poisoned. Using bottle 26 as an example again, if this bottle was poisoned then only prisoners 6, 7 and 9 have died. This combination of deaths is unique to that specific bottle. After all, this is the same unique combination that drunk from it!

Okay, the poisoned wine has been identified and all the remaining bottles can safely be drunk (what's left of them, anyway). Hurray, let's get the party started...?

* A common joke is: “There are only 10 types of people in the world: those who understand binary, and those who don't.”

No comments:

Post a Comment