Probability

Small calculators for chance and statistics.

The birthday paradox

How many people before two share a birthday?

23 people

Dice

At least one six?

4 rolls

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.

VariantProbability
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%.

Source code

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.

RunSame rowDifferent row
150364964
249785022

Answer: There is no difference. You win just as often (or rarely) whether you keep the same row or switch every time.

Source code

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.

RunWith adjacentArbitrary
1475525
2495505
3497503
4526474

Answer: No difference. Winning rows often having adjacent numbers does not mean rows with adjacent numbers win more often.

Source code