Probability Puzzles in R
Peter Chi
Assistant Professor of Statistics Villanova University
The doors
object:
doors
1 2 3
Suppose that Door #1 is chosen, and Door #2 contains the prize...
Revealing the remaining door:
reveal <- doors[-c(1,2)]
reveal
3
The doors
object:
doors
1 2 3
Suppose that Door #1 is chosen, and Door #1 in fact contains the prize...
Revealing the remaining door:
reveal <- sample(x = doors[-1], size = 1)
Probability Puzzles in R