Simulating Probabilistic Behaviour A coin flip Roll of a fair die Roll of an unfair die
Coin Flip Pie Chart
Coin Flip Simulation Generate a series of Random Numbers Assign a subset of the range of random numbers corresponding to the probability of a result to said result. Count all the times a random number in within that subset. Output the Count/Trials For a random number in [0,1]: Result Probability of Result Assigned Area Head 0.5 [0,0.5] Tails ]0.5,1]
Rolling a Die Now we need to have six counters, each with an equal probability of incrementing. Result Probability of Result Assigned Area 1 1/6 [0,0.16667] 2 ]0.16667,0.3333] 3 ]0.3333,0.5] 4 ]0.5,0.66667] 5 ]0.66667,0.8333] 6 ]0.8333,1]
An Unfair Die The point of this example is to show that any probabilistic event can be simulated with Monte Carlo simulations if we know the probabilities of every result. Result Probability of Result Assigned Area 1 .1 [0,0.1] 2 ]0.1,0.2] 3 .2 ]0.2,0.4] 4 .3 ]0.4,0.7] 5 ]0.7,0.9] 6 ]0.9,1]
Continuous Probability Distributions There are times when the probability of events occurring are not as obvious as previously shown.
How to Proceed Define an interval along the range of values of the independent variable. For each interval find the area under the probability distribution function. Continue as if simulating a rigged die.
Gasoline Demand Example Demand Bin Probability of Demand Area Assigned 1000-1199 .03 [0,0.03] 1200-1399 .17 ]0.03,0.2] 1400-1599 .47 ]0.2,0.67] 1600-1799 .26 ]0.67,0.93] 1800-2000 .07 ]0.93,1]