At the end of the last chapter we walked straight into a wall. We had found that probability is favourable outcomes over total. List them, count them, divide. That worked beautifully for one coin, for two coins, for a pair of dice. Then we asked about a hundred flips. That sample space holds 2¹⁰⁰ outcomes, which is about 1.27 × 10³⁰ of them. A machine listing a billion a second would still be writing 40 trillion years from now. That single run is 2,900 times the age of the universe. It's a list no human and no machine will ever write down. The method was right. The brute enumeration was hopeless. So this whole chapter builds the thing that rescues it: a counting engine that counts the favourable outcomes without ever listing them. And here's the surprise most courses bury on their way to the formulas. The entire engine turns on just two yes/no questions you ask of any counting problem: does order matter, and can things repeat? Answer those two and the right formula is already chosen for you. We'll build all four of them from nothing. We'll uncover why a combination divides by r!, stack the answers into Pascal's triangle, and watch the bell curve wave back at us from the far end of the course. Only then do we divide. Counting was never the same thing as probability, and the dividing is the trivial last step. No magic in any of it — just careful counting of a world too big to watch all at once.
01The two switches
Let's meet the wall head-on, then find the door in it. Counting by hand is a list: write out every possibility, then count the ones you want. That's exactly what we did for two dice, and it was fine, because 36 cells fit on a page. But the list explodes the instant a problem gets real. Pick a 4-digit PIN and there are ten thousand of them (10 × 10 × 10 × 10). Deal a 5-card poker hand and there are over two and a half million (2,598,960 of them exactly). Nobody lists those. What we need is a way to know how many there are without producing them one by one. The first step is noticing that not all counting problems have the same shape. Take one concrete task below — choosing a few letters from a small set — and flip the two switches on it. Watch the valid possibilities re-sort themselves before your eyes.
order matters? (is AB different from BA?)
repeats allowed? (reuse a letter twice?)
permutation, no repeats → 20
Fig. 1. Same task, every time: pick 2 letters from A–E. Flip order matters? and repeats allowed? and watch the list on the left refill in place while the count on the right jumps between 20, 25, 10, and 15 — and gold chips like AA mark the pairs only repeats allowed unlocks. Those two yes/no questions are the whole of counting: they carve one phrase, "pick some letters," into four different formulas, and the highlighted cell in the 2×2 grid shows exactly which one you asked for.
Feel what just happened: the same words — "pick some letters" — meant four completely different counts, and only two questions decided which. Does the order of your picks matter, so that AB counts as different from BA? And can you repeat a pick, so that AA is allowed? Those two yes/no switches, and nothing else, split every counting problem in the book into one of four kinds. So before you reach for any formula, you ask the two questions. That habit is the whole art.
Which means the entire chapter fits inside a single picture: a 2×2 grid. Order runs down one side, replacement runs across the other, and a formula lives in each of the four boxes. This is the map we're about to fill in. Toggle the two switches and watch the lit box swap in real time, along with its formula and a running worked example. Don't worry about why each formula is what it is yet. Right now just see that there are exactly four boxes, and that two switches select among them.
Q1 · does order matter?
Q2 · can items repeat?
pick r = 2 from n = 4 · {A,B,C,D}
you picked: sequences = 16
You never memorize which formula. Answer two questions — the grid picks the box for you.
Fig. 2. The whole chapter, compressed into one control. Every counting problem is really just two yes/no questions: does the order of your picks matter, and may an item repeat? Those two answers land you in exactly one of four boxes — and each box already holds its formula. Toggle the questions (or click a box) and watch the right formula light up while its count is worked out live for r picks from n items. Drag n and r to see all four counts move together: with n = 4, r = 2 you get 4² = 16 sequences, 12 permutations, 10 multisets, and 6 combinations. That is the payoff: you never memorize which formula to use — you answer the two questions, and the grid picks it for you.
Here is the trap almost every beginner walks into: order mattering is never a fact about the objects. The very same three runners are ordered when you hand out gold, silver and bronze. Those same three runners are unordered when you only pick who makes the final. The question decides, not the things. The grid picks the formula once you set the two switches, but the real skill is the step before that: reading a plain-English problem and setting the switches yourself. So try it before you trust it.
problem 1 / 6
…
Does order matter? (is A-then-B different from B-then-A?)
Are repeats allowed? (reuse the same pick?)
make the two calls, then Check
Fig. 3. Read each card, then call the two switches yourself — does order matter? are repeats allowed? — and hit Check. The medals card is order, no repeats (P(8,3) = 336); the very next card asks about the same 8 sprinters, yet "which 3 advance" drops the ranking and lands in a different box (no order, C(8,3) = 56). Nothing about the sprinters changed — the question moved the answer from one cell to another. Cycle all six (PIN 10,000, hand 2,598,960, scoops 125, toppings 35) and watch your "called N / 6" climb: once you ask the two questions, every counting problem sorts itself into exactly one box.
There it is: the whole lecture compressed into one control. Ordered, repeats allowed gives nʳ. Ordered, no repeats gives n!/(n−r)!. Unordered, no repeats gives the famous C(n,r). And the fourth box, unordered, repeats allowed, has a formula almost every course forgets: C(n+r−1, r), which we'll earn together. The rest of this section walks into each box and builds its formula from the ground up, so you never have to memorize one again.
02The four boxes
Start with the friendliest box: order matters and repeats are allowed. Picture a 3-wheel combination lock, each wheel showing the digits 0–9. The first wheel gives you 10 choices. Whatever you pick there, the second wheel still offers all 10. The pool never shrinks, because the wheels don't know or care about each other. They're independent, and independent choices multiply. Turn the wheels below and watch the total climb to a thousand settings, as 10 × 10 × 10.
wheels in play (r)
frame it as (cross-domain)
10^3 = 1,000 — pool never shrinks
Fig. 4. Click ▲ above a wheel to spin it, and use the wheels in play stepper to add or drop a slot: each independent slot doesn't add to the count, it multiplies it — one wheel gives 10, a second gives 10 × 10, a third gives 10 × 10 × 10 = 1,000. Nothing is ever removed from a wheel, so the same digit can repeat across slots — that's ordered with replacement: the pool stays exactly n every single turn. On the right, the identical nr reframes as a real lock or an r-character password — flip the toggle and see how an 8-character, 62-symbol password explodes to roughly 218 trillion possibilities. That's why brute force explodes: a constant pool raised to a growing length is vocabulary-to-the-length.
The wheels multiplied because every slot offered the same 10 options no matter what the other wheels showed. That independence is the whole license to multiply, and it can fail. Multiplication needs one thing: every step must offer the same count of options, whatever you picked before. The moment a later choice depends on an earlier one, the branches stop being equal and a flat product quietly lies. Watch a tree where every node has the same number of children. Then watch one where it doesn't.
Build a 2-symbol result from {1,2,3}. Can you just multiply?
Predict first — can you multiply 3×3?
equal branches → multiply: 3 × 3 = 9
Fig. 5. Flip the switch. In independent mode every first pick sprouts the same 3 children (badges read 3 / 3 / 3), the leaves form a clean rectangle, and 3 × 3 = 9 is honest. Switch to 2nd > 1st, predict whether you can still multiply, then hit Reveal: the tree grows branch by branch to 2 / 1 / 0 children, the naive 3 × 3 = 9 is struck through as a lie, and the true count is built by adding the ragged branches — 2 + 1 + 0 = 3. The instant a later choice depends on an earlier one the branches go uneven, so you must count them, not multiply.
That's the first formula, and it's the cleanest. You have r slots and n options at each slot, with the pool held constant, so the count is n × n × … × n = nʳ. This single expression is why brute force explodes. An 8-character password drawn from a 94-symbol keyboard has 94⁸ possibilities, about six quadrillion of them. That same "vocabulary-to-the-length" shape drives every cracking-time estimate, every DNA-codon count, and every tensor you’ll ever multiply out. When the pool doesn't shrink, counting is just repeated multiplication.
Now flip one switch. Keep order mattering, but forbid repeats. This is dealing cards. The first card can be any of 52. But once that card is out of the deck, the second card can only be one of the 51 that remain, then 50, then 49, then 48. The pool depletes by one on every draw. Deal below and watch the shrinking pool sit beside the constant pool from the lock. That is the difference between the two boxes, made visible.
draw 0 of 5
deal a card to compare
Without replacement means the pool remembers what you took — the lock's wheels forget every turn, so the same click shrinks one pool and leaves the other untouched.
Fig. 6. Deal cards one at a time: the deck (left) loses a dot with every click — 52, 51, 50, 49, 48 — while the lock from the last figure (right) keeps its full pool of 10 no matter how many turns it takes. Watch the hero line assemble 52×51×50×49×48 = 311,875,200, the exact descending product behind n!/(n−r)!. Keep dealing past 3 clicks and the lock has nothing left to show — it only ever had three wheels — but the deck keeps right on shrinking. Without replacement, the pool remembers what you took; with replacement, it doesn't.
So five ordered cards come to just over 311 million deals: 52 · 51 · 50 · 49 · 48, a descending run with one option fewer at each step. Write that descending run as a ratio of factorials and it becomes the box's formula: n!/(n−r)!, the number of permutations of r things drawn from n. (That descending product is easy to slip on. Count the factors, one per card dealt, and it stays honest.) The whole difference from the lock is a single word. Drawing without replacement means the pool remembers what you've taken.
That n! sitting in the formula deserves a proper introduction, because it's the engine under everything that follows. n factorial is just the number of ways to arrange n distinct things in a row: n choices for the first spot, n−1 choices for the next, all the way down to 1. Ten books on a shelf arrange in three and a half million orders (10! = 3,628,800). Step it down below, and watch what happens when you reach the very bottom, at 0!.
5 distinct things → 120 arrangements
1! and 0! both land on 1 — 0! isn’t a rule someone picked, it’s the honest count of the one way to arrange nothing.
Fig. 7. Click step down and watch n count 5, 4, 3, 2, 1, 0 while the row of distinct things shrinks to match. Each click peels one factor off the chain: 5! = 5×4!, then 4! = 4×3!, all the way to 1! = 1×0!. Since 1! has to equal 1, that last line pins down 0! = 1 — and the picture shows why: with nothing left to arrange, there is still exactly one arrangement, the empty one. Not a convention. The honest count.
Here's the part that trips people: 0! = 1. It looks like a rule invented to make formulas behave, but it isn't. It's a count, and it's honest. How many ways are there to arrange nothing? Exactly one way: the empty arrangement. Do nothing, and you have done it the single way it can be done. So 0! = 1 is not a convention pulled from a hat. It's the true answer to a real question, and it is why the permutation formula still works when you take everything or take nothing.
Now the box the whole chapter pivots on. Flip the last switch: order no longer matters. A 5-card poker hand is the same hand however you sort it. The ace-high straight is one hand, not the 120 different orders you could have dealt it in (5! = 120). But our permutation count did treat all 120 of those orders as separate hands. So the permutation count over-counted, and it over-counted by an exact, knowable amount. Take one fixed selection below, fan it into every order it could appear in, then collapse those orders back to the single unordered pick.
step 1 / 4
One selection — order not set yet
Undoing the r!-fold over-count isn't a step toward the answer — it is the whole of choosing.
Fig. 8. Pick r = 3 people from n = 5. Counting ordered line-ups gives P(5,3) = 5·4·3 = 60 — but the one team {A, B, C} shows up 3! = 6 times among them, once per ordering. Step through the fan-and-collapse: every unordered pick is over-counted exactly r! times, so C(5,3) = 60 / 6 = 10. Dividing by r! isn’t a move toward the combination — erasing the r!-fold over-count is the combination.
Fig. 8 fanned one team into its 6 orderings. But dividing by r! is only honest if every team gets the same 6 orderings, no more and no less. It does, and here is why you can trust it. The figure's case is a team of three chosen from five people, so r = 3 and r! = 3! = 6. Line up all 60 ordered picks, which is 5 × 4 × 3, and they fall into tidy columns — one column per unordered team, each column exactly 6 tall. Sixty picks in columns of six leaves 10 columns, so 10 teams. The ordered pile is a perfect rectangle: teams across, orderings down. Dividing by r! is just reading off how many columns there are. Sort them yourself and watch no column ever come up short.
r = 3 · line up 3 of 5
60 ordered line-ups of 3-from-5
predict, then auto-group to check
Every column is the same height — exactly r!. That's why ÷ r! is exact, not a fudge: you're just counting the columns.
Fig. 9. Guess how tall each column will be, then hit auto-group: the 60 ordered line-ups of 3-from-5 fly into 10 columns, and each one lands at exactly 6 = 3! tall — the green line touches every column top, so none is taller or shorter. Because the partition is uniform, C(5,3) = 60 ÷ 6 = 10 is exact counting, not rounding: dividing by r! is just counting the columns. Slide r to 2 or 4 and the column height tracks r! (2, then 24) every time — the rectangle law is general, never a one-off.
This is the keystone of the entire chapter, so let's say it slowly. Every unordered selection of r things shows up exactly r! times among the ordered ones, once for each way of shuffling those same r things. So the ordered count is r! times too big. To fix it, you divide by r!. That's the whole repair. And that division isn't a step toward the combination. That division is the combination. Understand this one move and you never memorize C(n,r) again; you reconstruct it.
Put the pieces together and the famous formula assembles itself. Order-with-depletion gave n!/(n−r)!. Correcting the over-count means dividing by r!. Do both and you have the combination, C(n,r) = n! / (r!(n−r)!), read out loud as "n choose r." Run poker through it and 311 million ordered deals collapse to two and a half million hands (C(52,5) = 2,598,960). Every one of those three factorials has a job. Explore it below: each factor lights up with the exact role it plays.
C(5,2) = 10
three factorials, three jobs: arrange everything, then cancel the two orderings you never cared about.
Fig. 10. Click a role — arrange all, cancel unpicked, cancel picked — and watch the matching factorial glow in the formula, the card, and the row of items itself. Slide n and r and every number updates together. That's why the formula carries exactly three factorials: n! arranges everyone, then you cancel the two orderings you never cared about — (n−r)! for the ones you left out, r! for the ones you picked.
Look again at fig. 7: r! and (n−r)! sit in the formula doing mirror-image jobs, and that symmetry is a free gift hiding in plain sight. Every time you choose r things to keep, you have in the same breath chosen the n−r things to throw away. Pick either side and the other side is already decided. The two choices are one act seen from two angles. So C(n,r) = C(n,n−r), exactly, and a monster like C(52,50) is really the baby C(52,2) in disguise — a mere 1,326 pairs. Flip between keep and toss and watch the count refuse to move.
Choose r to keep — the leftover n−r auto-tosses, same count either way
set n and r, predict, then flip
predict: does C(n,r) = C(n,n−r)?
predict, then flip to check
One partition, two names
gold — the side you're currently counting
muted — the other side of the very same split
Flipping never moves anyone between piles — it only changes which pile you call "the count". That is the whole reason C(n,r) always equals C(n,n−r), and why every row of Pascal's triangle reads the same forwards and backwards.
Fig. 11. Set n and r, predict yes/no — does C(n,r) equal C(n,n−r)? — then press what I toss to flip which side lights up gold. Nobody moved: the same split just got relabelled, and the twin boxes hold at, say, C(8,3) = C(8,5) = 56 the whole time. Press try the hard one and the ugly C(52,50) — 50 of 52 highlighted — folds down the instant you flip to C(52,2) = 1,326: the same tiny number was hiding in the scary one all along. That mirror is why every row of Pascal's triangle reads the same forwards and backwards.
So n! arranges everything, (n−r)! cancels the arrangements of the things you didn't pick, and r! cancels the arrangements of the things you did. What is left is a clean count of selections in which order is irrelevant. Three of the four boxes are now built from nothing but multiplication and one division. The fourth box is the sneaky one.
Back to order doesn't matter, but now repeats are allowed. This is the box most textbooks skip. Think of buying r scoops of ice cream from n flavours. You can double up on chocolate, and "chocolate then vanilla" is the same cup as "vanilla then chocolate." The trick that cracks it is a change of picture called stars and bars. Lay your r scoops out as stars, then separate the flavours with n−1bars. Every arrangement of stars and bars is exactly one valid selection. Click a divider, then click where it should land, and watch each layout become one selection.
Click a divider, then click where it should land — the scoops between dividers are one flavour's count.
2-1-2-0 · one of 56 arrangements
The click: choosing with repeats allowed is still an ordinary combination —
you're just choosing which of the n+r−1 row positions get to be stars.
Fig. 12. Five star-scoops, three bar-dividers, eight positions in a row — click a divider then click where it should land, and watch the four flavour cups below refill live. Every layout you make is one of exactly C(8,5) = C(8,3) = 56 arrangements, because laying r stars among n−1 bars is nothing more than choosing which of the n+r−1 row positions are stars — the "impossible" with-repeats box turns out to be a plain combination wearing a disguise.
Count the arrangements and the fourth box falls out. You have r stars and n−1 bars, which is n+r−1 symbols in a row, and all you do is choose which positions hold stars: C(n+r−1, r). Three scoops from five flavours is 35 different cups by that count (C(7,3) = 35). That's the cell almost nobody teaches. Now the grid is complete: two switches, four boxes, four formulas, every one of them derived rather than memorized. Everything else in counting is these four wearing costumes.
03Pascal's triangle
The combination numbers C(n,r) aren't a scattered pile. They lock together into one of the most beautiful objects in mathematics. Write C(0,0) at the top, which is 1, then let each row below it hold the choices for the next n. A pattern jumps straight out: every interior number is the sum of the two directly above it. Build the triangle below, and click any cell to see its two parents light up and add to it.
rows built: 1 / 7
click any cell to see its sum
Every interior cell is its two parents added — that's why you can generate every C(n,r) with nothing but addition.
Fig. 13. Hit + build row and watch the triangle grow one row at a time — each new cell is about to become the sum of the two cells sitting diagonally above it. Once a row exists, click any cell in it: its left parent and right parent light up with a line to the cell they made, and the sum reads out below. Click an edge cell and you'll see one parent replaced by a dashed 0 — there's nothing outside the triangle, so the edge is just 1 + 0. That's the whole triangle: no formula, no factorials, just two numbers added over and over — which is exactly why you can generate every C(n,r) with nothing but addition.
That "sum of the two above" isn't a coincidence to marvel at. It has a reason you can hold in your hand. Ask C(n,r) its own question: how many ways are there to choose r things from n? Single out one specific element, say the newest person added to the group. Either that person is in your selection, in which case you choose the remaining r−1 from the other n−1 people: that's C(n−1,r−1). Or that person is out, and you choose all r from the other n−1: that's C(n−1,r). Every selection is one or the other, and never both. Step through that split below.
1 / 5
C(n,r) — n elements, choose r
That's why Pascal's sum rule holds — it's one honest binary choice, repeated.
Fig. 14. Pick a cell with the C(n,r) switch, then step through the split: the newest element (ringed gold) is either in your pick — leaving C(n−1, r−1) ways to fill the rest — or out, leaving C(n−1, r) ways. Every selection lands in exactly one branch, never both, so the two counts add up to the parent, no matter which cell you choose. That's the whole engine behind Pascal's triangle: one honest yes/no question, asked once per element.
So the addition rule C(n,r) = C(n−1,r−1) + C(n−1,r) is just "the new element is in, or it's out" written in symbols. The whole triangle is that one honest choice, repeated row after row. Which makes Pascal's triangle not a curiosity but a machine: you can generate every combination number with nothing but addition, and no factorials at all.
And now the payoff that reaches across the entire course. Look at a single row of the triangle as a bar chart: small at the ends, fat in the middle. Row 4 reads 1, 4, 6, 4, 1, and the hump is already there. That's the shape of the binomial coefficients. As n grows, the shape sharpens into something you already half-recognize. Slide n up and watch the row of coefficients settle, once normalized, onto a smooth bell.
blocky — barely a hint of a curve
Nothing here is random yet — these are pure combination counts. Drag n up and watch the staircase melt onto the smooth bell.
Fig. 15. Every bar is a raw combination count — C(n,0), C(n,1), … C(n,n), the n-th row of Pascal's triangle — with each row squeezed to the same width so the shapes are comparable. At n = 2 it's a crude three-step staircase. Slide n up and the staircase melts, bar by bar, onto the one bell drawn behind it. Nothing here is random — these are pure counting numbers — yet stacked high enough they become the normal curve. That's the Central Limit Theorem waving from the far end of the book, and the reason the same bell governs measurement error, heights, and noise: it is simply what counting numbers turn into when you stack enough of them.
That bell is the normal distribution. It shows up here out of pure counting, before we have said a word about randomness, and that is the Central Limit Theorem waving at us from the far end of the book. Hold onto the sight; we'll come back and prove it. For now, just register the wonder. The same numbers that count poker hands, stacked high enough, are the curve that governs measurement error, exam scores, and the drift of the stock market. Counting and the bell are the same story told at two scales.
04More than two kinds
So far every selection sorted things into two piles: chosen or not, in or out. But plenty of problems have more than two categories. How many distinct ways can you arrange the letters of MISSISSIPPI? Eleven letters go in, but they arrive as 4 S's, 4 I's, 2 P's and 1 M, and swapping two identical S's changes nothing. It's the over-count problem again, now running on several fronts at once. Rearrange the tiles below and watch the identical-letter swaps collapse to the same word.
drag any two tiles to swap them — same-letter swaps collapse to the same word.
swaps 0 · found 1/34,650
drag two tiles to swap them
Fig. 16. Drag any two tiles to swap them. Swap two different letters and you get a genuinely new arrangement — the counter ticks up. But swap two tiles holding the same letter (hit swap two S’s to see it instantly) and the word you read off is exactly the word you had before — no new arrangement, because you can't tell those tiles apart. Eleven physically distinct tiles give 11! = 39,916,800 orderings, but every real word gets hit by 1!×4!×4!×2! = 1,152 of those identical-letter swaps — divide that out and exactly 34,650 distinct arrangements survive.
The fix is the same move fired repeatedly. Start with all 11! arrangements, as if every letter were distinct, which is just under forty million of them (11! = 39,916,800). Then divide away the arrangements you can't tell apart: 4! for the S's, 4! for the I's, 2! for the P's. That gives the multinomial coefficient11! / (4! · 4! · 2! · 1!), which comes out at 34,650 distinct words. And here's the lovely part. This isn't a new formula to bolt on. It telescopes out of the C(n,r) you already own. Choose which positions the S's take, then the I's from what's left, then the P's — a product of combinations — and watch the factorials cancel down the chain.
predict — then reveal step by step
n!⁄(n1!n2!n3!) is just C(n,n1) then C(n−n1,n2) then C(n−n1−n2,n3), multiplied — watch what's left in each denominator get eaten by the next numerator.
Fig. 17. Seven slots split into groups of 4, 2, and 1. Step through it: first choose 4 of the 7 slots for the blue group — that's C(7,4) = 7!⁄(4!·3!). Only 3 slots remain, so choosing 2 for the green group is C(3,2) = 3!⁄(2!·1!) — and notice the 3! left over from the first choice is exactly the 3! this new fraction starts from: it cancels. One slot remains, so the last group is forced — C(1,1) = 1!⁄(1!·0!) — and the leftover 1! cancels the same way (with 0!=1 simply vanishing). Multiply the three fractions and every middle term dies, leaving 7!⁄(4!·2!·1!) = 105. Nothing new was invented — the multinomial coefficient is just n-choose-r, done three times in a row, with each step's leftover feeding straight into the next.
Each combination in that chain cancels neatly into the next, telescoping down to a single clean quotient: n! / (n₁! n₂! … n_k!). The binomial coefficient is just that same quotient with two groups, chosen and unchosen. So the multinomial isn't a cousin of the combination. The multinomial is the same idea generalized from two piles to many. And that clears up a naming trap worth stating plainly, because it is exactly where courses — including the one behind this book — tangle their terms.
Four laws sit close enough to be confused, and two questions tell them apart: do you put each pick back? and how many categories are there? With replacement and two categories you get the binomial. With replacement and more than two categories you get the multinomial. Take replacement away and two categories give the hypergeometric, while more than two give its cousin, the multivariate hypergeometric. Sampling a deck without putting cards back is not multinomial. It's hypergeometric, and mixing those two up is a genuine error we're going to get right. Here they are, sorted by the two questions in one card.
put it back after each draw?
how many categories?
→ Binomial — p stays fixed each draw
Replacement and category-count are two separate questions. A deck dealt without replacement is still just 2 outcomes (red / black) — that's Hypergeometric, never Multinomial.
Fig. 18. Two independent questions sort every counting law: do you put it back (does p stay fixed), and how many categories (2, or 3+)? Toggle both and the matching cell lights up. Land on no + 2 categories and the dashed arrow fires: a deck dealt without replacement is still just two outcomes — that's Hypergeometric, never Multinomial, because the pool (and p) changes on every draw.
Fig. 18 lights the right cell once you set the two toggles. The skill that survives the exam is doing it the other way round: hearing a sampling story and setting the toggles yourself. This is exactly where courses slip. A deck dealt without replacement feels like it has many card-types, so people reach for the multinomial, when the honest answer is hypergeometric. Two questions save you every time: do you put each pick back, and how many categories are there? Read each story below, call the law before the reveal, and let the card catch you when you slip.
scenario 1 / 6A biased coin (heads 60%) is flipped 10 times. Count the heads.
put it back after each draw?
how many categories?
pick your two answers — the card lights the cell you predict
Two questions name all four laws. The trap: a deck dealt without replacement is never multinomial, however many card-types it holds.
Fig. 19. A story appears; you answer only two questions — put it back? and how many categories? — then Check lights the right cell. The dashed outline moves as you toggle, so you feel the two answers are the law. Land the deck traps: "count the spades" is no + 2 outcomes → Hypergeometric (not Multinomial, however many card-types the deck holds), and "tally each suit" is no + 3+ → Multivariate hypergeometric, the 4th cell the prose only implies. Six scenarios cycle with a running score.
Keep that card in your head. It turns four intimidating names into four cells of a small table. And notice the deepest thread running under all four: every one of them is powered by the same over-count correction you learned in the poker box. Now let's build the one law we've only named so far, the honest count of a shrinking pool.
05When the pool shrinks
Here's where the two-category-with-replacement math quietly breaks. Suppose an urn holds 4 red balls and 4 blue ones, eight in all, and you draw a handful. If you draw with replacement — peek, then put the ball back — the chance of red stays a flat 1/2 on every single draw, and the count is a plain product. But draw without replacement and every ball you pull changes the odds for the next one. Pull one red out and red's chance drops to 3/7. Draw a few below with the switch flipped each way, and watch the probability of red hold steady, or drift.
draws: 0 / 8
0.50 to start — now press draw
taking a ball out changes what's left next — the draws are no longer independent coins.
Fig. 20. Draw balls from an urn of 4 red and 4 blue: with replacement each draw is put back and P(red) sits flat at 0.50 forever; without replacement each ball stays out, so the urn's makeup — and the next draw's odds — drifts with every pull. That's why depletion needs its own law: the draws stop being independent coins.
That drift is the whole reason we need a separate law. When the pool depletes, you can't pretend each draw is a fresh independent coin. The draws are coupled. To count honestly, we go back to combinations. Say the urn holds k red balls among n in total, and you scoop out r of them. The chance of getting exactly m red is then a ratio of pure counts. Set the urn and the scoop below and watch that count assemble.
P(X=3) = 0.176
Push m past k and watch one count collapse to 0 — you can't scoop red balls that were never in the urn.
Fig. 21. An urn holds n balls, k of them red, the rest blue. Scoop out r at random, no
replacement. The number of scoops with exactlym red splits into two independent choices multiplied
together — pick the m reds from the k available, and pick the remaining r−m blues from the
n−k available — then that count is divided by every possible scoop of size r. Three binomial
coefficients, one ratio: C(k,m)·C(n−k,r−m) / C(n,r), the hypergeometric probability. Drag
m past k and the numerator flatlines at zero — you can't scoop reds that were never in the urn. Nothing
here is new counting machinery; it's the same combinations from this chapter, just divided — and that
division is the exact moment we quietly crossed from counting into probability.
Read the formula as three counts stacked. There are C(k,m) ways to choose your reds from the reds, times C(n−k, r−m) ways to choose the rest from the blues, all sitting over the C(n,r) ways to choose the scoop from the whole urn. That's the hypergeometric distribution. Notice that we are already dividing counts to get a probability, which is the tell that we've quietly crossed a line. Counting was the hard part. The division was trivial. And that's the point this chapter has been walking toward.
06You are here
Step back and see what we actually did. Every probability in this chapter came out the same way: count the favourable outcomes, count the total, divide. The counting was the entire job — permutations, combinations, stars and bars, telescoping multinomials. The dividing was one keystroke at the end. That is worth making explicit, because it's easy to think probability is doing the heavy lifting when combinatorics is doing all of it. Watch a real probability assemble from its two counts below.
next → start counting favourable
counting is the whole job — dividing is one keystroke.
Fig. 22. Pick a scenario, then hit next: the favourable count assembles from two multiplied factors — that's the hard part, the actual counting. The total count, though, lands in one clean choose; no multiplying needed, because you're just picking from everything. One more next and the two counts divide — a single keystroke — into the probability. Switch scenarios and watch it happen again on a poker hand, an urn, and a pair of dice: the plumbing changes every time, but the recipe never does.
So counting and probability are decoupled: master the count and the probability comes free. That is exactly why we spent a whole chapter here before returning to chance. The counting engine you just built is the muscle behind half the results still ahead of us. Let's put it on the map.
hover a rung — tap to pin on touch
Ch 2 — the counting engine
same ratio — now counted without listing it all.
P = favourable⁄total never changes — only how you COUNT the top & bottom does.
Fig. 23. The spine of the course, so far. Chapter 1 taught you to list every outcome by hand and read off favourable over total; Chapter 2 lights the next rung — the counting engine, which gets you that same ratio without ever listing outcomes one by one. Hover (or tap) any other rung to preview where the spine climbs next — notice every preview still ends in the same fraction. That's the whole point: combinatorics isn't a detour from probability, it's just a smarter way to count the numbers already sitting inside P = favourable / total.
There's our rung, lit: the counting engine, sitting one step above Chapter 1's favourable fraction. It is still just smarter counting of that same ratio. Everything above it on the tree — measures, conditioning, the Bayes flip, the whole family of distributions — leans on the counting you now own. But before we climb, there's a crack in the floor we have to look at.
Everything we counted, we counted as if every outcome carried equal weight. That's the same quiet assumption from Chapter 1, still load-bearing and still unmentioned. Our formulas count possibilities, and turning a count into a probability by dividing only works when those possibilities are equally likely. Bias one coin and the counts don't change at all, not by a single unit. The probabilities do. Watch the count sit frozen while the true chances peel away.
fair coin — count and truth agree
The count of {H, T} never moves. Only the weight on each outcome does — and count-and-divide can't see it.
Fig. 24. Drag the bias and watch two things happen at once. The gold plank — count/total = 1/2,
straight from "1 favourable H out of 2 outcomes {H,T}" — never moves; the card on the right proves the count itself
never changes either. But the true marker jumps to the new bias the instant you drag, prying a crack open in the
floor, and the strip of live coin flips below builds a real long-run frequency that heads toward the true value,
not the frozen 1/2. At P=0.5 the crack seals — count and truth agree, by luck, not by law. Everywhere else,
"count and divide" is quietly still assuming every outcome carries equal weight — and once that's false, the count
is fixed the moment you name the outcomes, but the world it's supposed to describe keeps moving without it.
So here's the next honest wall. Counting is a magnificent engine, but it hands us probabilities only in the fair, equally-likely world. The moment weight is uneven — a loaded die, a biased coin, a continuous spin — "count and divide" is no longer enough. We need to stop counting outcomes and start measuring them: assigning weight directly to events, to whole regions of the sample space. That upgrade, from a count to a measure, is the language the next chapter teaches. And now you can feel exactly why we need it.