roulette <- function(time, spin) {
# Runs the Roulette game
#
# Args:
# time: Number of iterations
# spin: Boolean of spinning strategy
# Returns:
# WinRate (wins/time)
#
# Note that a WIN is simply surviving to the next round; a LOSE is shooting yourselff int eh head
# number of wins counter
wins <- c(0)
for (i in 1:time) {
bullets <- sample(1:6) # 6 is the bullet
# opponent goes first
opponentBullet <- bullets[1]
if (opponentBullet == 6) {
wins <- wins + 1
} else {
# player's turn
if (spin) {
newBullets <- sample(1:6)
} else {
newBullets <- bullets[bullets != opponentBullet]
}
playerBullet <- newBullets[1]
if (playerBullet != 6) {
wins <- wins + 1
}
}
}
message ("Spin Strategy:", spin)
message ("Total Wins: ", wins)
message ("Out of ", time)
return(wins/time)
}
iterations = 1E05
spinWinRate <- roulette(iterations, TRUE) # Spin Strategy TRUE
spinWinRate
[1] 0.86065
Spin strategy win rate approaches \(0.86111... => 31/36\)
noSpinWinRate <- roulette(iterations, FALSE) # Spin Strategy FALSE ie shoot yourself right away
noSpinWinRate
[1] 0.83261
No spin strategy win rate approaches \(0.8333... => 5/6\)
Therefore if you are ever in a russian roulette game, it is always a little better to let your opponent go first.
For a gun with \(n\) bullets, the difference in going first would be
\(((n^2 - n + 1)/n^2) - ((n - 1)/n)\)
\(= (n^2 - n + 1)/n^2) - ((n^2 - n)/n^2\)
\(= ((n^2 - n + 1) - (n^2 - n))/n^2\)
\(= (-n + 1 + n)/n^2\)
\(= 1/n^2\)
For a 6-shooter that should be
\(31/36 - 5/6 == 1/36 == 1/n^2\)
So we can now calculate the odds of winning a single round, assuming you get to go 2nd and you always choose to spin, in an n-chambered gun:
secondMoverWinrate <- function(n) {
return(0.5 + (1/n^2))
}
secondMoverAdvWithThreeShooter <- secondMoverWinrate(3)
secondMoverAdvWithThreeShooter
[1] 0.6111111
secondMoverAdvWithSixShooter <- secondMoverWinrate(6)
secondMoverAdvWithSixShooter
[1] 0.5277778
secondMoverAdvWithNineShooter <- secondMoverWinrate(9)
secondMoverAdvWithNineShooter
[1] 0.5123457
Before: “Therefore if you are ever in a russian roulette game, it is always a little better to let your opponent go first.”
After: “Russian-Roulette-like games involve SAMPLING WITHOUT REPLACEMENT and NEGATIVE OUTCOME. In these games it is best to go last.”
You are playing russian roulette and your opponent goes first. He pulls the trigger and does not kill himself; it is now your turn.
Q. Should you spin before it is your turn to shoot or should you shoot right away without spinning?
Q.2. What would the odds be of each strategy (spin/nospin) ?
If you spin, your odds should always be \(5/6\) of winning no matter who you are.
If you don’t spin, you now have a \(4/5\) (?)
If you keep taking turns without spinning, the win % goes \(3/4\) , \(2/3\) , \(1/2\) , then finally 1 (if you have made it this far for sure you are getting the bullet!!).
Backward Induction: On the 6th ply (3 turns each), under NOSPIN the last person will certainly get a bullet and therefore a chance of 1 of losing.
On the 5th ply there is a 1/2 chance of losing (2 bullets left).
On the 4th ply there is a 1/3 chance of losing (3 bullets left).
…
Therefore On the 2nd play there should be a 1/5 chance of losing, or a 4/5 chance of winning.
Bonus/Related Questions
Does it affect your odds to go first/second in Russian Roulette or is it always 50/50 ?