Overview

In this presentation, we will explore probability using two dice in the real-world vs simulation.

We will compare:

  • Classical Probability (counting outcomes)
  • Simulation probability (using random sampling in R)

What is Probability?

Probability measures how likely an event is to happen.

\[ P(A) = \frac{\text{# of favorable outcomes}}{\text{# of total outcomes}} \]

Probability of Rolling Doubles

Total possible outcomes: \(6 \times 6 = 36\)

\[ P(\text{double}) = \frac{\text{# of favorable outcomes}}{\text{total outcomes}} = \frac{6}{36} = \frac{1}{6} \]

Simulating Doubles in R

We can roll two dice many times and estimate the probability of rolling doubles using simulation.

set.seed(123)
n = 100000
die1 = sample(1:6, n, replace = TRUE)
die2 = sample(1:6, n, replace = TRUE)
doubles = die1 == die2
mean(doubles)
## [1] 0.16551

Explanation:

  • mean(doubles) gives the proportion of doubles
  • Result should be close to 1/6

Plot 1

Plot 2

Plot 3

Conclusion

  • Two dice have 36 equally likely outcomes
  • Classic probability can be verified using simulations
  • Simulation in R confirmed this probability (around 0.1667).
  • Visualization helped us explore the frequency of doubles and probability in real life.