Created
April 26, 2016 13:18
-
-
Save saralilyb/ca39c8395a9a9b4e4a0e183396e838d9 to your computer and use it in GitHub Desktop.
MCMC model of dice rolling: is a bastard sword better than a longsword (2nd Ed, BGII)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 2d4 vs 1d8 | |
samples <- 10000 | |
# 2d4 | |
m1d4 <- sample(1:4, samples, replace = TRUE) | |
m2d4 <- sample(1:4, samples, replace = TRUE) | |
bastard_sword <- m1d4 + m2d4 | |
# 1d8 | |
m1d8 <- sample(1:8, samples, replace = TRUE) | |
longsword <- m1d8 | |
summary(bastard_sword) | |
summary(longsword) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment