Search code examples
simulationprobabilitycoin-flipping

coin flip generator


what do you guys think will be the outcome if a program is coded to simulate a coin flip where there is a 50% of the coin landing either heads or tails when the results are looked at; Mainly will there be a higher % of the coin flips landing heads when the previous 10 flips were tails and vice versa?


Solution

  • This really depends on what mechanism is being used to generate the random numbers. If, say, a linear congruential generator is used...

    ... then clearly any given generated number is dependent on the one that preceded. The quality of the output also depends on what parameters are used in conjunction with the mechanism (e.g. if a small value was used for "m" in the above method, the quality would be poor... or if your seed value was highly predictable).

    Despite the fact that computers only generate pseudo-random numbers, some algorithms satisfy the tests for statistical randomness (i.e. have no discernible patterns) and can be used safely.

    If you are that concerned about the randomness of your generated numbers, you should look into the actual method being used to generate them within your specific context. For more information, take a look at Wikipedia.