Database › Mathematics › Pure mathematics › Combinatorics
Ordered selections are counted by n!/(n−k)!, unordered ones by the binomial coefficient, arrangements with repeated items by the multinomial coefficient, and overlapping conditions by inclusion–exclusion.
Explanation
Dividing by $k!$ removes the order of the chosen items; dividing by each $n_i!$ removes the interchange of identical items. Distributing $q$ identical objects among $N$ boxes is the arrangement of $q$ objects and $N-1$ dividers, $\binom{q+N-1}{q}$ — the multiplicity of an Einstein solid and of bosons in degenerate levels.
Inclusion–exclusion: $|A_1\cup\dots\cup A_n|=\sum|A_i|-\sum|A_i\cap A_j|+\dots$. Applied to fixed points it gives the derangement number $D_n\approx n!/e$, so a random permutation has no fixed point with probability tending to $1/e$.
Example 1
How many distinct arrangements of the letters of BANANAS are there?
Solution
7 letters with A×3, N×2: $\frac{7!}{3!\,2!}=\frac{5040}{12}=420$.
Example 2
An Einstein solid of 3 oscillators holds 4 energy quanta. How many microstates are there? How many ways can 5 letters all go into wrong envelopes?
Solution
$\binom{4+2}{4}=\binom64=15$. $D_5=120\big(1-1+\frac12-\frac16+\frac1{24}-\frac1{120}\big)=44$.