Mathematical Rules of Thumb, illustrated reader · Chapter 12

12Probability

Fast Reasoning Under Uncertainty

5 demonstrations follow the chapter's rules. Choose a value, watch the figure and the numbers change, and check your prediction. Every choice is precomputed from the notebook calculations.

Ask the chapter skill

“Help me use Chapter 12 for my question. Choose a rule, check its assumptions, and show how the result changes when an input changes.”

Use math-thumb-probability from the companion's skill package. The demonstrations below also work on their own.

Examples use constructed inputs or the book's own values, disclosed in each panel. A picture illustrates a rule; its assumptions set its scope.

1Demonstration 1 of 5

Accumulate a rare risk across opportunities

If all failures happen together, can you still use the product complement?

Compare an independent exact probability with a rare-event approximation and a bound that does not require independence.

P(any)=1−(1−p)n≈1−e−np P(\text{any})=1-(1-p)^n\approx1-e^{-np}

Per-opportunity probability p. Exact formula assumes independent identical events. Union bound applies to specified marginals without independence.

Predict first. If all failures happen together, can you still use the product complement?

Choose an example

Accumulate a rare risk across opportunities. Over 100 opportunities at p=0.001, the chance of at least one event is 0.09521 if they are independent. The union bound n·p=0.1 is a ceiling that holds even without independence. For rare events the two nearly agree, so n·p is a safe quick estimate. A shared cause (one storm, one bad batch) breaks the independent formula.
Per-opportunity probability p: 0.001
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Per-opportunity probability
0.001
Exact risk at n=100
0.0952079
Union ceiling at n=100
0.1

Over 100 opportunities at p=0.001, the chance of at least one event is 0.09521 if they are independent. The union bound n·p=0.1 is a ceiling that holds even without independence. For rare events the two nearly agree, so n·p is a safe quick estimate. A shared cause (one storm, one bad batch) breaks the independent formula.

Use the idea

Use rule 12.1.8 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

Exact formula assumes independent identical events. Union bound applies to specified marginals without independence.

Check your understanding: If all failures happen together, can you still use the product complement?
No. Perfect dependence gives any-event probability p rather than 1−(1−p)ⁿ.

Book source: Rule 12.1.8: At Least One Rare Event. Demonstration C12-D01. Worked illustration.

2Demonstration 2 of 5

Make the base rate visible in an update

Why can many positive results be false when prevalence is tiny?

A stipulated detection model can yield very different positive-result meanings at different prior prevalence.

P(H∣+)P(H‾∣+)=p1−p⋅.95.05,P(H∣+)=.95p.95p+.05(1−p) \frac{P(H\mid+)}{P(\bar H\mid+)}=\frac{p}{1-p}\cdot\frac{.95}{.05},\qquad P(H\mid+)=\frac{.95p}{.95p+.05(1-p)}

Prior probability p. Illustrative sensitivity .95 and false-positive rate .05, with stable conditional probabilities.

Predict first. Why can many positive results be false when prevalence is tiny?

Choose an example

Make the base rate visible in an update. Under the stipulated .95 sensitivity and .05 false-positive rate, prior probability 0.01 becomes 0.161017 after a positive result. Picture 100,000 people: 950 true positives against 4,950 false positives. False alarms swamp the real cases, so a positive is still probably wrong. Inputs are made up for illustration.
Prior probability p: 0.01
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Sensitivity
0.95
False-positive rate
0.05
Prior probability
0.01
Posterior probability
0.161017

Under the stipulated .95 sensitivity and .05 false-positive rate, prior probability 0.01 becomes 0.161017 after a positive result. Picture 100,000 people: 950 true positives against 4,950 false positives. False alarms swamp the real cases, so a positive is still probably wrong. Inputs are made up for illustration.

Use the idea

Use rule 12.2.1 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

Illustrative sensitivity .95 and false-positive rate .05, with stable conditional probabilities.

Check your understanding: Why can many positive results be false when prevalence is tiny?
The large noncase population contributes false positives that can outnumber the true positives, despite high sensitivity.

Book source: Rule 12.2.1: Bayes Updating in Odds Form. Demonstration C12-D02. Worked illustration.

3Demonstration 3 of 5

Run a finite Monte Carlo estimate

How much more computation halves standard error?

A seeded simulation estimates the stipulated probability .3. Compare the result with its model standard-error scale.

SE⁡(p̂)=p(1−p)/N \operatorname{SE}(\hat p)=\sqrt{p(1-p)/N}

Independent trials N. Independent Bernoulli trials, seed 1203. A finite random result is not a guaranteed error bound.

Predict first. How much more computation halves standard error?

Choose an example

Run a finite Monte Carlo estimate. Seed 1203 gives estimate 0.318 from 1000 independent Bernoulli trials, missing the true .3 by 0.018, about 1.2 model standard errors. Quadrupling the simulation budget halves the model standard error; it does not fix an incorrect probability model.
Independent trials N: 1000
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Seed
1203
Trials
1000
Simulated estimate
0.318
Model standard error
0.0144914
True constructed probability
0.3

Seed 1203 gives estimate 0.318 from 1000 independent Bernoulli trials, missing the true .3 by 0.018, about 1.2 model standard errors. Quadrupling the simulation budget halves the model standard error; it does not fix an incorrect probability model.

Use the idea

Use rule 12.3.7 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

Independent Bernoulli trials, seed 1203. A finite random result is not a guaranteed error bound.

Check your understanding: How much more computation halves standard error?
Four times as many independent trials, because standard error scales as N⁻¹ᐟ².

Book source: Rule 12.3.7: Monte Carlo Error Falls as One Over Root N. Demonstration C12-D03. Worked illustration.

4Demonstration 4 of 5

See how soon random labels collide

How many people make a shared birthday more likely than not?

Plot the exact chance of at least one repeat as items are drawn. The 50% point sits near the square root of N, not near N.

k50%≈1.1774N k_{50\%}\approx1.1774\sqrt N

Equally likely values N. Independent uniform draws from N values. Real birthdays and IDs are not perfectly uniform, which makes collisions come sooner.

Predict first. How many people make a shared birthday more likely than not?

Choose an example

See how soon random labels collide. With 10,000 equally likely values, a repeat becomes more likely than not after only 119 draws, about 1.18√N. That is 1.19% of the possible values. Growing N by a factor of 100 grows the threshold only about tenfold (119 here, 1,178 at N=1,000,000).
Equally likely values N: 10000
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Equally likely values N
10000
Items for 50% repeat chance
119
1.1774·√N
117.74
Items as share of N
0.0119

With 10,000 equally likely values, a repeat becomes more likely than not after only 119 draws, about 1.18√N. That is 1.19% of the possible values. Growing N by a factor of 100 grows the threshold only about tenfold (119 here, 1,178 at N=1,000,000).

Use the idea

Use rule 12.1.9 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

Independent uniform draws from N values. Real birthdays and IDs are not perfectly uniform, which makes collisions come sooner.

Check your understanding: How many people make a shared birthday more likely than not?
23. With 365 days, 1.1774×√365≈22.5, and the exact count first passes 50% at 23.

Book source: Rule 12.1.9: Birthday Collision Threshold. Demonstration C12-D04. Worked illustration.

5Demonstration 5 of 5

See why the last coupons take longest

How many random birthdays do you expect to need before every day of a 365-day year appears?

Plot expected cumulative draws against coupons collected. The curve stays near one draw per coupon, then shoots up when only a few are missing.

E[TN]=N∑k=1N1k≈Nln⁡N+0.5772N E[T_N]=N\sum_{k=1}^N\frac1k\approx N\ln N+0.5772N

Distinct coupons N. Independent draws, each of N types equally likely. Unequal frequencies make completion slower.

Predict first. How many random birthdays do you expect to need before every day of a 365-day year appears?

Choose an example

See why the last coupons take longest. Collecting all 50 equally likely coupons takes 225 draws on average, about N ln N + 0.577N = 224.5, or 4.5 draws per coupon. Half of those draws are already spent by coupon 46 of 50, and the last 5 coupons alone take 50.7% of the effort. Finishing a set is dominated by hunting for the rare missing pieces, so budgets based on N draws fail badly.
Distinct coupons N: 50
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.

Calculated values

Distinct coupons N
50
Expected draws for all
224.96
N ln N + 0.5772N
224.461
Draws per coupon
4.49921
Share spent on last 10%
0.507497

Collecting all 50 equally likely coupons takes 225 draws on average, about N ln N + 0.577N = 224.5, or 4.5 draws per coupon. Half of those draws are already spent by coupon 46 of 50, and the last 5 coupons alone take 50.7% of the effort. Finishing a set is dominated by hunting for the rare missing pieces, so budgets based on N draws fail badly.

Use the idea

Use rule 12.1.10 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.

Where the conclusion applies

Independent draws, each of N types equally likely. Unequal frequencies make completion slower.

Check your understanding: How many random birthdays do you expect to need before every day of a 365-day year appears?
About 2,365, since 365×H₃₆₅≈2,364.6. That is about 6.5 people per day of the year.

Book source: Rule 12.1.10: Coupon Collector Scale. Demonstration C12-D05. Worked illustration.

Bring the idea to a question of your own

Choose the relationship that answers your question, check its conditions, and compare the result with the accuracy or decision threshold you need.

The chapter skill can adapt these calculations to your inputs. It should name the assumptions, explain what the result supports, and say what still needs evidence. The chapter workbook adds a lab and three exercises with answers.