Skip to content

Instantly share code, notes, and snippets.

@orrymr
Created September 13, 2021 17:54
Show Gist options
  • Save orrymr/7b55899c60ab9b40843161d3ccae32f3 to your computer and use it in GitHub Desktop.
Save orrymr/7b55899c60ab9b40843161d3ccae32f3 to your computer and use it in GitHub Desktop.
number_of_rolls <- 1000000 # Or, we could manually roll a die 1 million times. Nah, let's let the computer do it.
mean(sample(1:6, number_of_rolls, replace = TRUE))
# [1] 3.499435
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment