8/23/2021

Why are you should care

  • Dungeons and dragons is a phenomenon that has taken the country by storm! Not only does it have a dedicated following it also has a large player base of new players just starting out the game.

  • This is great, but it comes with a problem, Most players are using complicated sets of dice which have a lot of mathematics behind them. Most of us aren’t PhD statisticians, so I’ve created this app to help players get a basic and intuitive understanding of how likely they are to get an outcome on their dice roll.

  • While this app isn’t perfect I hope it serves as a brief window into probability and an opportunity for people to learn more and create their own applications.

How the app works

  • The inputs are simple and intuitive. First enter the number of Faces for the die type you are using. For a classic die this would be six. Then input the number of dice you are rolling. After you’ve done this just hit the submit button and the histogram will be built.

  • The histogram is built off of 100,000 randomly generated sets of rolls. For example if i was rolling a 6 faced die 3 times the values would be created like this:

rolls <- rep(0, 100000)
rolls <- vapply(rolls, 
                function(x) {
                    sum(sample(6, 
                    size = 3, 
                    replace = TRUE))}, 
                    FUN.VALUE = numeric(1)
                    )

Continued on next page

How the app works part 2

Once our values are generated we can use them to build a histogram which would be created using the rolls we calculated and a mean generated by finding the true mean mean of the rolls given they are fair dice.

Conclusion

I hope you found this presentation informative!
Next time you’re playing DND be sure to open up the app and look at your approximate histogram.
If you’re interested in going further into probability I suggest you sign up for an online course it can be lots of fun and a great opportunity to pick up new skills.
credits: This app and presentation was created for JHU’s data science specialization on Coursera, be sure to check them out