Random Numbers and Simple Games
Random digits as reproducible game trials
A simulation represents a chance game by mapping random outcomes to events and then recording complete plays. The mapping must reproduce the stated chances, while each play must follow the game's stopping and payout rules. Repeating the same procedure gives estimates of win rates and average net payouts.
Mapping random outcomes
A fair digit from 0 through 9 has ten equally likely outcomes. Assigning digits 0 through 3 to a win therefore gives four winning digits and a theoretical probability of 4/10, or 0.4. If the physical outcomes have unequal probabilities, equal-width digit ranges represent them correctly only when those widths match the probabilities.
A pseudo-random generator can produce the labels, but using one does not by itself make the model faithful. State which labels mean each event before drawing, and use the same mapping for every simulated play.
Complete trials and payouts
Define one trial by its starting point, stopping rule, reward, and costs. If one play can require several draws, count that whole play once when estimating the fraction of plays won. To estimate expected net payout, average each play's reward minus its actual costs, including costs incurred before the game stops.
For independent attempts that stop at the first success or a fixed maximum, the chance of at least one success is one minus the chance that every allowed attempt fails.
The expected number of attempts is the sum of the probabilities of reaching each attempt. A simulated fraction has sampling variation; a probability calculated from the stated rules is exact under those rules.
Worked example
Suppose a player pays $2 once, rolls a fair six-sided die once, and receives $9 only on a 6.
The win probability is 1/6, so the expected gross reward is (1/6) × $9 = $1.50. Subtract the once-per-play fee: the expected net payout is $1.50 − $2 = −$0.50 per play.
Individual plays yield either +$7 or −$2; the expected value describes their long-run average.
A simulation runs 40 independent complete plays of a specified game and records 14 wins. What is the simulated estimate of the probability that a play wins?
A game gives a player two independent spins. Each spin wins with probability 0.30. The game counts as a win if either spin wins. What is the game win probability?