Combinatorics & Counting Methods

the four sampling models (ordered/unordered × with/without replacement)

Almost every basic counting question is really one of just four standard problems, set by two yes/no decisions: does ORDER matter, and is there REPLACEMENT? Cross those two questions and you get a 2-by-2 grid that organises the whole subject. Once you can name which of the four boxes your problem sits in, the right formula is automatic. The trick is not memorising four formulas but learning to ask the two questions.

Here are the four boxes for choosing k items from n. Ordered WITH replacement: each of k positions independently picks any of n, so n^k (e.g. k-digit PINs from n symbols). Ordered WITHOUT replacement: positions fill in turn with the pool shrinking, so n!/(n-k)! = P(n,k) (e.g. medal rankings). Unordered WITHOUT replacement: take the ordered count and divide out the k! orderings, so C(n,k) = n!/(k!(n-k)!) (e.g. a poker hand, a committee). Unordered WITH replacement: the subtlest box, counted by stars and bars, giving C(n+k-1, k) (e.g. how many ways to choose k scoops from n flavours when repeats are allowed).

The two easy boxes are ordered: you just multiply choices. Unordered-without-replacement is ordered-without-replacement with the k! reshufflings removed. The fourth box, unordered-with-replacement, trips people up because you CANNOT simply divide n^k by k! — different multisets have different numbers of orderings (two scoops the same versus two different), so the division is uneven and the clean answer comes instead from the stars-and-bars argument. Diagnosing the box first is the single most reliable habit in elementary counting.

Choose 3 from 5 flavours. Ordered with replacement: 5^3 = 125. Ordered without replacement: 5 times 4 times 3 = 60. Unordered without replacement: C(5,3) = 10. Unordered with replacement (repeats allowed, order ignored): C(5+3-1, 3) = C(7,3) = 35.

Two questions—order? replacement?—pick one of four formulas.

For unordered WITH replacement you cannot just compute n^k / k! — the orderings per multiset vary, so the division is invalid. Use stars and bars: C(n+k-1, k).

Also called
four counting modelsthe twelvefold way (core cases)四種抽樣模型四種計數模型