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.
Is it better for you if I spin again or not before pulling the trigger a second time?
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
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?