Statistics + Computers: A Personal Reflection
I’ve recently taken up a new hobby while in Grinnell over the summer: Dungeons and Dragons. When I was approached at the start of the summer to play in a game of D&D, I was naturally a little hesitant – like most people, my knowledge of D&D was limited to what it is normally portrayed as in films/TV. As I got more familiar with the game, though, I realized that there was a much more quantitative side of the game than just wandering around trying to slay beasts.
D&D is, for the most part, fairly simple: you and a group of friends play through a pre-made “adventure” (or the “dungeon”, in some cases, usually designed by a “dungeon master”) in which you solve puzzles, complete tasks, fight monsters/etc., all to reach a certain goal in the end (some form of “winning” or completion). The big question, and what piqued my interested the most, was how success and failure on these quests were determined.
The answer, like in most games, lies in the roll of the dice: for every decision (well, nearly every decision) that is made in the game, dice are rolled to determine success/failure. For example: when attacking, you roll a twenty-sided die and compare that to your target’s armor. If the die roll is higher, you hit, otherwise you miss. It just so happened that an enemy we were fighting tried to attack me and on that twenty-sided die, the enemy rolled a one. Our dungeon master (DM) ruled that, because the enemy got such an awful roll, not only did he miss me, but he hit one of his allies! Of course this doesn’t always happen, but the general idea is there.
Because of the use of dice, statistics play a strong role in D&D. In fact, a basic understanding of statistical principles can make the difference between being properly equipped and being unprepared and out-armed. An example would be weapon selection – one weapon roles a twelve-sided die on an attack, while another rolls two six-sided dice. Do you want higher probability of maximum damage? Do you want higher average damage? Do you want more consistent damage? Depending on the player’s answer to these questions, knowing statistics can make a huge difference in choosing the right or wrong weapon.
What does this have to do with our project, though? Well, during one of our games, we were faced against a gigantic dragon (dragons in D&D are apparently sentient and intelligent, like humans). Having become somewhat familiar with D&D, I knew that the dragon’s hit points were dependent on the rolls of some dice. Instead of just calculating the average hit points it would have, I wanted to know more, so I created a program that simulated the dice rolls and calculated mean and standard deviation. Keeping a tally of how much damage we dealt to it, throughout our encounter I knew how close to being done we were. When the dragon was finally defeated, it didn’t come as a surprise.
My solution to the problem (finding the dragon’s hit points through simulations) might seem straight-forward considering my computer-science background, but in actuality it was in part due to a paper I read by George Cobb: “The Introductory Statistics Course: A Ptolemaic Curriculum?” The article can be found here.
The article is somewhat long, so I’ll try to give a brief summary – Cobb’s basic argument in this article is that introductory statistics courses need to stop focusing on the normal curve so much, and start switching over to an emphasis on inference. Part of the reason, he says, that statistics courses focus so much on the normal curve is that before computers, calculating statistics by hand was somewhat difficult and tedious. With computers, though, these calculations are done in the blink of an eye. One thing he wanted to see replace the normal curve is the use of repeated randomized simulations – have students conduct simulations and see if their results are consistent with hypotheses. This would serve as a replacement to the t-test, which, he argues, isn’t nearly as intuitive as just comparing results from experiments (or simulations).
While the method I used for determining the dragon’s hit points was sound, it proved unnecessary, as our DM used average die rolls instead of actually rolling the dice themselves. Beside that, though, the idea I used was practical and efficient – not only was I able to simulate how much health the dragon had, but I could modify my program to calculate how much damage my sword dealt, or how likely I was to perceive someone sneaking up on me. The possibilities behind these simulations are endless, and the practicality of not having to do the calculations myself is priceless.
For rectangular objects, this works well, but when either of the two objects are not rectangular, you quickly run into problems. For example, see these two triangles? According to their bounding boxes, they’re almost completely overlapping. Since many, if not most, tangram puzzles contain such arrangements, this is clearly not a workable solution.