Probability
Small calculators for chance and statistics.
Programmatically verified claims
Probability is hard, and intuition often fails. I like verifying claims programmatically: the programs prove nothing, but numbers are often easier to grasp than equations. The source is on GitHub — e-mail me if you want more tests. github.com/flogvit/probability
Lotto: two adjacent numbers
Question: How often is a row drawn that contains two adjacent numbers? E.g. a row containing both 13 and 14.
Check: 10 million draws per run. For 34 numbers drawing 7 (standard Norwegian lotto) the result was 77–78% across five runs. For 48 numbers drawing 6 (Viking Lotto) it was 50% in all five runs.
| Variant | Probability |
|---|---|
| 7 of 34 (Norwegian lotto) | approx. 77.5% |
| 6 of 48 (Viking Lotto) | approx. 50% |
Answer: For rows drawing 7 of 34 the probability is about 77.5%. For 6 of 48 it is about 50%.
Lotto: same row vs. a different row
Question: Is it smart to pick the same row every week, or should you pick different rows? Which is best?
Check: The simulation lets one player keep a fixed row and another pick a new row each draw, counting who wins first. 10,000 “lives” per run.
| Run | Same row | Different row |
|---|---|---|
| 1 | 5036 | 4964 |
| 2 | 4978 | 5022 |
Answer: There is no difference. You win just as often (or rarely) whether you keep the same row or switch every time.
Lotto: a row with two adjacent numbers vs. an arbitrary row
Question: Winning rows very often contain two adjacent numbers — so should your row always have two adjacent numbers?
Check: Like the previous test, but the fixed row is adjusted to always have at least two adjacent numbers. 1000 rounds per run.
| Run | With adjacent | Arbitrary |
|---|---|---|
| 1 | 475 | 525 |
| 2 | 495 | 505 |
| 3 | 497 | 503 |
| 4 | 526 | 474 |
Answer: No difference. Winning rows often having adjacent numbers does not mean rows with adjacent numbers win more often.