Flipping a Coin
From SystemsWiki
There are situations where the events within the systems can not be explicitly defined as they are essentially random. The states of other elements of the model are then defined base on the result of the random event. This particular example of flipping a coin from Hannon & Ruth[1] is presented in Fig. 1.
Element Definitions
- cumulative net - The cumulative net result of flipping the coin
- Initial Value = 0
- net - represents heads inflow and tails outflow from cumulative net
- Flow Rate = [head rate] - [tail rate])
- head rate
- Value/Equation = IfThenElse([flipper] < .5, 1, 0)
- tail rate
- Value/Equation = IfThenElse([flipper] > .5, 1, 0)
- Show Slider Value = No
- flipper - generates a random number between 0 and 1 normally distributed
- Value/Equation = Rand(0,1)
- Time Settings
- Simulation Start = 0
- Simulation Length = 1000
- Simulation Time Step = 1
- Time Units = Seconds
Every time you run this model you will get a cumulative representation of the sum of the flips, +1 for heads, -1 for tails. Every run will be different, as evident in Fig. 2 and Fig. 3, even though the cumulative value for a sufficiently large number of flips should be 0.
Summary
Run this model several times to convince yourself that you will never get the same result though the result is most likely to vary across the zero value. You might also try running the model for 10,000 or 100,000 flips to examine the difference in results.
References
- ↑ Hannon, Bruce & Ruth, Matthias (1994) Dynamic Modeling. Springer-Verlag
| Systems Thinking World Discussions Systems Thinking World Q&A * Gene Bellinger |
