Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
The most seductive trap in LLM development is the hand-picked demo. You try three prompts, they all work, you ship — and then real users send the fourth, fifth, and thousandth prompt that you never imagined. Three examples cannot estimate a rate: a feature that passes 3/3 of your favorites can easily be a 60%-reliable feature in production, and you have no way to tell the difference from that sample. Understanding the statistics of small samples — why n=3 tells you almost nothing about the true pass rate, and how wide the confidence interval is — is what stops you from shipping confidently broken things. This is the quantitative backbone of everything that follows.
The demo computes a Wilson confidence interval for an observed pass rate. Watch how catastrophically wide the interval is at n=3 versus n=100 — the same observed pass rate means wildly different things depending on how many cases you actually ran.
wilson_interval(9, 10) (9 passes of 10) and compare its interval width to wilson_interval(90, 100).import math
def wilson_interval(passes, n, z=1.96):
if n == 0:
return (0.0, 1.0)
p = passes / n
denom = 1 + z*z/n
center = (p + z*z/(2*n)) / denom
half = (z * math.sqrt(p*(1-p)/n + z*z/(4*n*n))) / denom
return (max(0, center - half), min(1, center + half))
# Same 100% observed pass rate — but n changes everything
for n in (3, 10, 30, 100, 500):
lo, hi = wilson_interval(n, n) # passed all n
print(f"n={n:>3} observed=100% true rate is 95%% likely in [{lo:.0%}, {hi:.0%}]")
# 3/3 could hide a truly 40%-reliable feature; 500/500 almost cannot.python3 main.py