The number of ways to choose k items from n when order does not matter.
The multinomial coefficient
(n1,n2,…,nrn)=n1!n2!⋯nr!n!
The number of ways to split n distinct items into labelled groups of sizes n1,…,nr — equivalently, the number of distinct arrangements of a word with repeated letters. The binomial coefficient is the case r=2.
Onto assignments
S(k,n)=j=0∑n(−1)j(jn)(n−j)k
The number of ways to assign k distinct items to n distinct boxes so that no box is empty. It is inclusion–exclusion over the set of boxes left empty, and it is the count behind "every desk gets at least one order" questions.
Remember
Decide order and repetition first; the formula follows from the four-case table.
The largest entry of row 2n, and the one that turns up in random-walk and coin-flip questions.
The binomial theorem, and the sums it gives for free
(1+x)n=k=0∑n(kn)xk
Substituting values of x produces the row identities at once: x=1 gives ∑k(kn)=2n; x=−1 gives ∑k(−1)k(kn)=0, so even- and odd-sized subsets are equally numerous; differentiating and setting x=1 gives ∑kk(kn)=n2n−1.
Each term picks, from each of the n factors, one of the r variables; the coefficient counts the ways to make a given choice of exponents.
Estimating the central coefficient
(n2n)≈πn4n
From Stirling’s formula. It is within about 1% by n=10 and improves from there, and it is the reason the chance of an exact tie in 2n fair flips falls like 1/πn.
Remember
Prove an identity by describing one set that both sides count.
Add the singles, subtract the pairs, add the triples, alternating. Each element ends up counted exactly once.
Derangements without the alternating sum
Dn=(n−1)(Dn−1+Dn−2),Dn=round(en!)
Condition on where item one goes, say to position j (n−1 choices). Either item j goes back to position one, leaving a derangement of n−2, or it does not, which behaves like a derangement of n−1. The rounding formula is exact for n≥1.
Euler’s totient as inclusion–exclusion
φ(n)=np∣n∏(1−p1)
The number of integers up to n sharing no factor with n — inclusion–exclusion over its prime divisors, collapsed into a product. φ(60)=60×21×32×54=16.
The generalised pigeonhole principle
some box holds at least ⌈kn⌉
Put n items in k boxes and at least one box holds ⌈n/k⌉. To guarantee r items in some box you need k(r−1)+1 items.
Remember
Inclusion–exclusion alternates: singles minus pairs plus triples.
Candidate A finishes with a votes and B with b<a. Counting the votes in random order, this is the chance A leads throughout.
Catalan numbers
Cn=n+11(n2n)=(n2n)−(n+12n)
Paths of n ups and n downs that never go below zero — and, by bijection, a great many other things.
The Catalan recurrence
Cn+1=i=0∑nCiCn−i,C0=1
Split a good path at its first return to zero: the part before is an elevated good path of some length, the part after is any good path. Every Catalan family has a first-return decomposition like this, and recognising the recurrence is often faster than finding the bijection.
Returning to the start
Pr(S2n=0)=4n(n2n)≈πn1
For a symmetric ±1 walk, the chance of being back at zero after 2n steps. It decays slowly, so returns keep happening — the one-dimensional walk is recurrent — even though each is individually less likely.
Remember
Monotone paths to (m,n) number (nm+n) — choosing steps is choosing a subset.