All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Russian Roulette (Posted on 2010-06-08)
Eight men, including Colonel Mustard, sit at a round table, for a modified game of Russian roulette. They are using a six chamber revolver which has been loaded with 5 bullets.

The game begins by one of the men reaching into a hat, and randomly drawing the name of the first player.

If the first player survives his turn, the gun is handed to his adjacent clockwise neighbor, and his name is immediately returned to the hat.

If the first player loses, his name is thrown away, and the men pull from the hat, and choose the name of the next player.

The game is continued in such a way until either all five bullets have fired, OR a player survives his turn, but no longer has an adjacent clockwise neighbor to pass the gun to.

What is the probability that the Colonel will survive the game?

(Note that the chamber is spun every time a player takes his turn).

Comments: ( Back to comment list | You must be logged in to post comments.)
 "Exact" solution | Comment 6 of 12 |
(In reply to First Thoughts by Steve Herman)

I put "exact" in scare quotes as the result is only as accurate as double precision floating point allows, in this recursive program that goes through all sequences of shots, keeping track of the overall probability at each point and adding to the respective dead total (1 dead, 2 dead, etc.) when either the bullets run out or a person survives with no next person to whom to pass the revolver.

DECLARE SUB chooseNext ()
DEFDBL A-Z

FOR i = 1 TO 7: man(i) = 1: NEXT
dead = 1: bullets = 4: menRemain = 7
currProb = 1

CALL chooseNext

FOR i = 1 TO 5: PRINT USING "##.#####"; deadProb(i); : NEXT: PRINT
t = 0
FOR i = 1 TO 5
t = t + i * deadProb(i)
NEXT
PRINT t, t / 8#

END

SUB chooseNext
menBefore = 0
FOR m = 1 TO 7
IF man(m) = 1 THEN
totSubProb = 0
subProb = 1 / menRemain
FOR i = 1 TO menBefore
totSubProb = totSubProb + subProb * ((6# - bullets) / 6#) ^ (menBefore + 1 - i)
NEXT
pDie = (totSubProb + subProb) * bullets / 6#
' dies:
currProb = currProb * pDie
man(m) = 0
bullets = bullets - 1
menRemain = menRemain - 1

IF bullets > 0 THEN
CALL chooseNext
ELSE
END IF

menRemain = menRemain + 1
bullets = bullets + 1
man(m) = 1
currProb = currProb / pDie

' doesn't die:
IF m = 7 THEN cntnu = 0:  ELSE IF man(m + 1) = 0 THEN cntnu = 0:  ELSE cntnu = 1
IF cntnu = 0 THEN
END IF

menBefore = menBefore + 1
ELSE

menBefore = 0
END IF

NEXT
END SUB

finds

`0.07140 0.22491 0.34569 0.27186 0.086143.07643621243408            .38455452655426`

where the first row shows the respective probabilities of 1 through 5 men being killed, and the next line shows the expected number of dead, and that number divided by 8 to give the probability that a given player will die.

The colonel's probability of survival is approximately 61.544547344574 %.

 Posted by Charlie on 2010-06-09 01:51:32

 Search: Search body:
Forums (0)