Chance-Getting On the Right Side of Luck


Lucky Roulette

Interviews at hi-tech companies often include puzzles. Here is one that has made the rounds in spite of its violent setting. We will spice it up a bit.

I put two bullets in two adjacent chambers of a six shot revolver. I point it at your head and pull the trigger. Click. You are still alive. The chamber has advanced by one. I am prepared to try again.

Warm-Up

Is it better for you if I spin again or not before pulling the trigger a second time?

Solution to Warm-Up

It’s better for you to keep the chamber where it is, i.e., not to spin. Why? Well, let E represent an empty chamber and B represent a chamber with a bullet.

Putting the chamber first used at the beginning on the left, the gun could have been in any of the following configurations with equal probability:

 BBEEEE EBBEEE EEBBEE EEEBBE EEEEBB BEEEEB

Because you didn’t die, the equi-probable configurations left are:

 EBBEEE EEBBEE EEEBBE EEEEBB

If I don’t spin, then you die in only 1 in 4 cases on the second trigger pull. If I spin, you have a 1 out of 3 chance to die. So, you don’t want me to spin.

Now suppose I am going to pull the trigger two more times for a total of four. If you survive the second trigger pull, then you must be in one of these cases:

 EEBBEE EEEBBE EEEEBB

  1. Do you ask for a spin of the chamber before the third trigger pull? How about before the fourth trigger pull? Using your best strategy, what are your chances of survival given that you’ve survived the first trigger pull?




Puzzles for Programmers and Pros
Puzzles for Programmers and Pros
ISBN: 0470121688
EAN: 2147483647
Year: 2007
Pages: 81
Authors: Dennis Shasha

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net