• Home
  • About R Trix
  • Teaching Resources
  • RTricks Library
  • Interactive Apps
  • Training Network
RTFR landingdist

R Output for Discrete Probability Example 5

> dice <- rep(2:12, c(1:6, 5:1))

> table(dice)/36

23456789101112
0.028 0.056 0.083 0.111 0.139 0.167 0.139 0.111 0.083 0.056 0.028

> dice

2  3  3  4  4  4  5  5  5  5  6  6  6  6  6  7  7  7  7  7  7  8  8  8  8  8  9  9  9  9  10  10  10  11  11  12

> hist(dice, freq = FALSE, breaks = seq(1.5, 12.5, 1), ylab = "Probability",

> xlab = "Sum of Dice", main = "Probability Histogram of Two Dice Sum")