Randomness is too Important to Leave to Chance

SimulationEconomics.org is a website dedicated to the theory and practice of using computer simulation as a modeling tool in economics. In contrast to mathematical economics, simulation economics focuses on computer programs to model economic phenomena.

Please email NicholasKarlson@gmail.com to report errata or to make suggestions.


Mathematics can be used to model economic ideas.  Math is also good at modeling randomness.  To see how simulation can replace math in economic modeling a good place to start is to see how it can replace math in modeling randomness.  Consider a simple dice game called dgame. There are two players in dgame (player1 and player2).  Player2 starts by rolling two six-sided dice.  If the dice sum to 7 or 11, player2 wins and the game is over.  If the sum of the dice is 2,3, or 12 player1 wins and the game is over.  If the dice sum to the number x  ( x being 4,5,6,8,9, or 10) then player2 keeps on rolling the dice until either the dice sum to 7 (player1 wins) or the dice sum to x (player2 wins).

This is an amusing game of chance that you could play with a friend.  Which player has the advantage?  If you were playing an even simpler game (flipping a coin to see who wins) the obvious answer would be that neither player has an advantage since a "fair" coin would be "heads" 50% of the time on average (or the probability of "heads" is 0.5).  This is a very basic math model of flipping a coin.  It is a model, because it is trying to describe reality but it is not reality (suppose the coin for your game is weighted in a weird way so if you flipped it 1000 times it came up heads 905 times?).  Returning to dgame, it turns out that mathematical probability theory can be used to model the chance of player1 winning.  The mathematical model's answer is 251/495.  The important assumption to get this answer is that the dice are fair and any given roll has no effect on any other roll.

Instead of using math to derive 251/495 why not write a computer program to model the chance of player1 winning?  Would either method be more valid than the other?  Would either method be more practical in modeling reality?

Try a program that implements the above at a website hosted by MIT:


Below is code related to the program:

Original material on this website copyrighted 2011, 2014, 2018 please contact NicholasKarlson@gmail.com for details.