Risk is a very popular and fun board game. I created this code to inform my decisions while playing it and increase my chances of winning. Specifically, I use Monte Carlo simulations to estimate the likelihood that a given attack will be successful. This code can produce the following calculations:
- The likelihood that one dice-roll will result in a succesful attack.
- The probability that, given a number of attacking and defending troops, the player that is defending will lose all of her/his troops.
- The (a) expected number and the (b) 95% confidence interval of troops that the attacker will lose if he was succesful in defeating his opponent.
- It can also be further generalized to compute other quantities of interest.
For more information about the game and its rules, please visit the following link.
Risk_util_functions.R
: A script with a set of functions that can be used to simulate an attack in Risk. It contains all of the functions needed to compute the quantities of interest relevant for an attack during the game.Risk_example_use.Rmd
: The code of a notebook where I show howRisk_util_functions.R
can be used to inform decisionmaking while playing Risk.Risk_example_use.md
: The output of said notebook.