Multiplication principle. If an object is built in k stages and stage i offers miβ options regardless of the earlier choices, the number of distinct objects is m1βm2ββ―mkβ.
The clause "regardless of the earlier choices" is the entire content. Drawing k balls from nwith replacement leaves miβ=n at every stage, giving nk. Without replacement, the pool shrinks by a fixed amount, miβ=nβi+1, giving the falling factorial
nkβ=n(nβ1)β―(nβk+1)=(nβk)!n!β
Both are ordered counts: the choice tree has nk and nkβ leaves respectively, and each leaf is one sequence.
The four urn models
An urn holds n distinguishable balls, and we draw k. The two yes/no questions give exactly four counting problems.
ordered (sequence)
unordered (set / multiset)
with replacement
nk
(kn+kβ1β)
without replacement
nkβ=(nβk)!n!β
(knβ)=k!(nβk)!n!β
The bottom row is easy: every unordered selection of kdistinct balls has exactly k! orderings, so the ordered count over-counts by a constant factor, and (knβ)=nkβ/k!. Dividing out the symmetry is the standard route from ordered to unordered β but only because that factor is the same for every selection.
Stars and bars: why one cell is different
For multisets the division fails: {a,a,b} has 3 orderings, {a,b,c} has 6, so no single divisor undoes the over-counting (nk/k! is not even an integer in general). Re-encode instead: an unordered draw with replacement is determined by the multiplicities x1β+β―+xnβ=k, xiββ₯0. Write k stars and split the n bins with nβ1 bars:
Multisets are not an equally likely sample space. Two dice give (27β)=21 multisets, but {1,2} comes from 2 of the 36 ordered outcomes and {1,1} from only 1. Laplace probability lives on the ordered model; stars and bars is a counting device, not a probability model.
Exact values: 0.117 at k = 10, 0.507 at k = 23, 0.706 at 30, 0.903 at 41, 0.970 at 50, 0.9992 at 70.
The paradox is one of framing: intuition answers "who shares my birthday", i.e. kβ1 comparisons with P=1β(364/365)kβ1, which needs a group of k=254. The question instead counts all (2kβ) pairs, and at k=23 that is 253 pairs β numerically the same 253, by coincidence. Pretending those pairs were independent gives (1β3651β)253β0.4995; it is close to the exact 0.4927 but systematically overestimates non-collision, because the pair events are dependent (a shared birthday of A,B and of B,C forces one for A,C).
Bernoulli trials and the binomial distribution
Repeat an experiment n times independently, recording success (probability p) or failure. One outcome is a word in {S,F}n β ordered with replacement, but not equally likely: by independence a specific word with k successes has probability pk(1βp)nβk. That value depends only on k, not on where the successes sit, so we merely count the words β choosing which k of n slots succeed is unordered without replacement.
Definition
XβΌBin(n,p) if P(X=k)=(knβ)pk(1βp)nβk for k=0,β¦,n, with E[X]=np and Var(X)=np(1βp).
The binomial coefficient is no fudge factor: it is the urn model appearing inside a probability. Normalisation is the binomial theorem, βkβ(knβ)pk(1βp)nβk=(p+(1βp))n=1. If instead we sample without replacement from N items containing K successes, independence fails and the count becomes hypergeometric, P(X=k)=(kKβ)(nβkNβKβ)/(nNβ) β three binomial coefficients, no p at all.
Worked example: defective parts, with and without replacement
Step 4 β Compare with replacement. Testing and returning each part gives Bernoulli trials with p=4/12=1/3, hence P(Y=2)=(25β)(31β)2(32β)3=10β 91ββ 278β=24380ββ0.3292.
Step 5 β Read the difference. Both have mean np=5/3, but drawing without replacement is self-correcting, so the variance carries the finite-population correction Nβ1Nβnβ=117β and mass piles up near the mean.
Result
P(exactlyΒ 2Β defective)=3314ββ42.4% (hypergeometric, the correct model) versus β32.9% under the binomial. With n/N=0.42 the crate is far too small for that approximation β use it only when nβͺN (rule of thumb nβ€0.05N).
Summary
Multiplication principle: independent stage-by-stage choices multiply; every formula here follows from it.
Four urn models: nk, nkβ, (knβ), (kn+kβ1β) β classified by order and replacement.
Divide by k!only when the symmetry factor is constant; multisets need stars and bars.
Complement counting turns "at least one" into "none": k=23 birthdays suffice for P>21β because pairs grow like k2.
The coefficient in Bin(n,p)counts arrangements; the same count without replacement gives the hypergeometric law.
Questions & Answers
Why does dividing by k! fail for unordered sampling with replacement?
Answer
Dividing an ordered count by k! works only if every unordered object has exactly k! orderings, which requires all drawn items to be distinct. With repeats the factor varies β {a,a,b} has 3!/2!=3 orderings, {a,b,c} has 6 β so no single divisor undoes the over-counting. Note also that nk/k! is usually not even an integer, the fastest sanity check that the model is wrong; stars and bars avoids the issue by encoding the multiset as multiplicities.
Why is the birthday result so counter-intuitive?
Answer
People silently answer an easier question. "Does anyone share my birthday?" involves only kβ1 comparisons, so a 50 % chance needs a group of k=254 (P=0.5004; already 0.4991 at 253). The real question involves all (2kβ) unordered pairs, which grows quadratically; at k=23 that is exactly 253 pairs. That the two 253s coincide is arithmetic accident, not a link β but it shows why the two readings cross 50 % at such different group sizes.
What does complement counting buy us technically?
Answer
"At least one collision" is a union of heavily overlapping events, so direct counting needs inclusionβexclusion over many terms. Its complement, "all birthdays distinct", is a single ordered-without-replacement count 365kβ, i.e. one product. Whenever an event reads "at least one", test the complement first.
Where does independence enter the binomial formula?
Answer
Exactly when we assign pk(1βp)nβk to one specific success/failure word: independence licenses multiplying the per-trial probabilities, and identical distribution makes the product depend only on the number of successes, not their positions. That position-invariance is what lets us group the words and multiply by (knβ).
Why (knβ) rather than nkβ in Bin(n,p)?
Answer
We choose whichk of the n trial slots are successes, and the successes are indistinguishable β slot 3 being a success is the same outcome no matter in which order we "selected" it. That is selection without order and without replacement, so (knβ); using nkβ would count each word k! times.
When may I replace the hypergeometric by the binomial?
Answer
When the sample barely changes the population composition. The variances differ precisely by the finite-population correction Nβ1Nβnβ, so the approximation is good when that factor is close to 1, i.e. nβͺN; the usual rule of thumb is nβ€0.05N. In the worked example n/N=0.42, and the two answers differ by 9.5 percentage points.
How do I decide "ordered or unordered" in a word problem?
Answer
Ask whether two outcomes differing only by a permutation of the drawn items count as different. PIN codes, race podiums and toss sequences: order matters. Lottery tickets, committees and card hands: it does not. When unsure, model the ordered version: for uniform draws from an urn (with or without replacement) it is an equally likely space, and the event of interest is usually permutation-invariant, so the k! cancels in the ratio. This does not extend to non-uniform mechanisms β for Bernoulli trials with pξ =21β the ordered words are not equiprobable and must be weighted.
What links the birthday paradox to computer science?
Answer
Hash collisions. With a hash space of size n, about 2ln2β nββ1.177nβ random items give a 50 % collision chance β for n=365 that is 22.5, i.e. the k=23 found above. The expected number of items drawn before the first repeat is the larger Οn/2ββ1.25nβ, here 23.9; mean and median differ and must not be conflated. This birthday bound is why a 64-bit hash falls at roughly 232 items and why cryptographic digests use 256 bits.
The rest of the map
The four urn models are the entrance hall of discrete probability; here is what lies immediately beyond.
Advanced counting
Multinomial coefficients β k1β!β―kmβ!n!β counts arrangements with several item types; the binomial for m outcomes per trial.
Inclusionβexclusion β the systematic count of unions; yields derangements and "at least one of several types".
Related distributions
Hypergeometric β the without-replacement counterpart of the binomial; quality control and captureβrecapture.
Poisson β the limit nββ, pβ0, np=Ξ»; the law of rare events.
Geometric / negative binomial β count trials until the r-th success instead of successes in fixed n.
Approximation and limits
Stirling's formula β n!βΌ2Οnβ(n/e)n; tames factorials and binomial coefficients asymptotically; the nβ of the birthday bound comes from (2kβ)βn, not from Stirling.
De MoivreβLaplace and the CLT β the normal approximation of the binomial; the bridge to continuous probability.
Suggested roadmap
Drill the 2Γ2 table until any word problem can be classified in one sentence.
Prove (knβ)=nkβ/k! and the stars-and-bars bijection from scratch.
Practise complement counting on "at least one" problems: birthdays, hash collisions, lottery.
Derive Bin(n,p) from Bernoulli trials, then get E[X] and Var(X) via indicator variables.
Compare binomial and hypergeometric numerically until the finite-population correction feels obvious.
Take the Poisson limit of the binomial, then close with the normal approximation and the CLT.
Counting, complement counting and independence are the three moves behind nearly every discrete distribution β master the urn table and the rest is bookkeeping.