The von Neumann Model

Probability Puzzles in R

Peter Chi

Assistant Professor of Statistics Villanova University

Uniform Random Variables

Each "hand" drawn from a Uniform(0,1) distribution.

runif(n, min = 0, max = 1)

runif(n = 1)
0.5888486
playerA <- runif(n = 1)
playerB <- runif(n = 1)
playerA > playerB
TRUE

 

 

playerA
0.6575921
playerB
0.3587836
Probability Puzzles in R

Betting under the von Neumann model

Player B observes value, decides whether to wager $1 or not

  • If wagered, players compare values. Higher value wins $1 from other player
  • If not wagered: no money won or lost by either player
Probability Puzzles in R

The ifelse function

# Condition is true
x <- 4
result <- ifelse(x > 0, sqrt(x), sqrt(-x))
result
2
# Condition is false
x <- (-4)
result <- ifelse(x > 0, sqrt(x), sqrt(-x))
result
2
Probability Puzzles in R

The mean function, revisited

values <- replicate(10, roll_dice(3))
values
5 10 14  5 12 12  4 15  7  9

 

mean(values)
9.3
Probability Puzzles in R

Your turn!

Probability Puzzles in R

Preparing Video For Download...