Well,

Sometimes it happens that you are so much biased to think in one direction that you forget to think that a simpler and better solution might exist from a different direction. I am referring to my post on the king’s wine cellar.

One of my friend Sameer has suggested a very simple and a better solution based on hamming code.

For example, in our case we had 100 wine barrels. Let us number them from 0 to 99. Now, if we convert these numbers into binary, we need 7 bits to represent them. Thus, we need only 7 servants to be put on stake when we want to find out a poisonous wine barrel.

So if 58th wine barrel is poisonous, binary equivalent will be 0111010, so from the right, second, fourth, fifth and sixth servant would have drank from that barrel (because of ‘1’ in those positions) and would have died.

How silly of me not to think about this solution!!!

–Saurabh Joshi

### Like this:

Like Loading...

*Related*

Tags: math, puzzle

This entry was posted on June 10, 2008 at 9:52 am and is filed under math, puzzle. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

June 20, 2008 at 3:00 am |

Very smart, increases my skillz. This should be the most optimal solution… for least servants.