Skip to content
Part IA Easter Term

Permutations and Combinations

Factorial

For a positive integer nn, the factorial is:

n!=n×(n1)×(n2)××2×1n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1

By convention, 0!=10! = 1.

Factorials count the number of ways to arrange nn distinct objects in a sequence. The first position has nn choices, the second has n1n-1, and so on.

Example: Arranging Books

Six distinct books can be arranged on a shelf in 6!=7206! = 720 ways.

Permutations

A permutation is an ordered arrangement of objects.

Permutations of nn Objects Taken rr at a Time

The number of ways to arrange rr objects selected from nn distinct objects:

P(n,r)=n!(nr)!=n(n1)(n2)(nr+1)P(n, r) = \frac{n!}{(n-r)!} = n(n-1)(n-2)\cdots(n-r+1)

Intuition: We have nn choices for the first position, n1n-1 for the second, down to nr+1n-r+1 for the rrth position.

Special case: P(n,n)=n!P(n, n) = n! arrangements of all nn objects.

Example: Committee Officers

From 10 people, select a president, vice-president, and treasurer. The order matters: select 3 and assign them to distinct roles.

P(10,3)=10×9×8=720P(10, 3) = 10 \times 9 \times 8 = 720

Combinations

A combination is an unordered selection of objects.

Combinations of nn Objects Taken rr at a Time

The number of ways to select rr objects from nn distinct objects (order does not matter):

(nr)=C(n,r)=n!r!(nr)!\binom{n}{r} = C(n, r) = \frac{n!}{r!(n-r)!}

Why divide by r!r!? Each unordered selection corresponds to r!r! ordered arrangements. The permutations overcount by exactly this factor.

Example: Selecting Books

How many ways to select 3 books from a set of 6?

(63)=6!3!3!=72036=20\binom{6}{3} = \frac{6!}{3! \cdot 3!} = \frac{720}{36} = 20

Compare with permutations: P(6,3)=120P(6, 3) = 120. Each unordered set appears as 3!=63! = 6 permutations.

Example: Committee Members

From 10 people, select 3 committee members (no roles assigned):

(103)=10!3!7!=7206=120\binom{10}{3} = \frac{10!}{3! \cdot 7!} = \frac{720}{6} = 120

Key Properties of Binomial Coefficients

Symmetry

(nr)=(nnr)\binom{n}{r} = \binom{n}{n-r}

Intuition: Selecting rr objects to include is equivalent to selecting nrn-r objects to exclude.

Pascal’s Identity

(nr)=(n1r1)+(n1r)\binom{n}{r} = \binom{n-1}{r-1} + \binom{n-1}{r}

Intuition: Any selection of rr from nn objects either includes a specific object (leaving (n1r1)\binom{n-1}{r-1} ways) or excludes it (leaving (n1r)\binom{n-1}{r} ways).

Sum

r=0n(nr)=2n\sum_{r=0}^{n} \binom{n}{r} = 2^n

This counts all subsets of an nn-element set. Each element can be either in or out: nn independent binary choices.

Balls and Bins

The techniques extend to distributing objects into containers.

Distinct Balls into Distinct Bins

nn distinct balls into kk distinct bins: knk^n ways. Each ball independently chooses a bin.

Identical Balls into Distinct Bins

nn identical balls into kk distinct bins, no restrictions: equivalent to placing k1k-1 dividers among n+k1n+k-1 positions.

(n+k1k1)=(n+k1n)\binom{n+k-1}{k-1} = \binom{n+k-1}{n}

Intuition: Imagine placing all nn balls in a row with k1k-1 dividers. The balls before the first divider go to bin 1, between first and second dividers to bin 2, and so on.

Example: Server Distribution

13 servers into 3 datacentres with capacities 6, 4, and 3. This counts arrangements where we partition the 13 labelled servers into groups of those sizes:

(136)(74)(33)=1716×35×1=60,060\binom{13}{6} \binom{7}{4} \binom{3}{3} = 1716 \times 35 \times 1 = 60{,}060

Alternatively: 13!6!4!3!\frac{13!}{6! \cdot 4! \cdot 3!} (multinomial coefficient).

Permutations with Repetition

When some objects are identical, the number of distinct arrangements is:

n!n1!n2!nk!\frac{n!}{n_1! \cdot n_2! \cdots n_k!}

where nin_i is the number of objects of type ii.

Example: DNA Sequences

How many distinct sequences can be formed from 3 A’s, 2 C’s, 1 G, and 1 T?

7!3!2!1!1!=504012=420\frac{7!}{3! \cdot 2! \cdot 1! \cdot 1!} = \frac{5040}{12} = 420

Example: Bit Strings

Distinct bit strings from three 0’s and two 1’s:

5!3!2!=12012=10\frac{5!}{3! \cdot 2!} = \frac{120}{12} = 10

These are: 00111, 01011, 01101, 01110, 10011, 10101, 10110, 11001, 11010, 11100.

Hypergeometric Formula

When sampling without replacement, we use hypergeometric counts.

Select nn items from a population of NN containing mm “special” items. The number of ways to get exactly ii special items:

(mi)(Nmni)\binom{m}{i} \binom{N-m}{n-i}

Choose ii special items from the mm available, and nin-i ordinary items from the NmN-m non-special.

Summary Table

ProblemFormula
Arrange all nn objectsn!n!
Arrange rr from nnP(n,r)=n!(nr)!P(n,r) = \frac{n!}{(n-r)!}
Choose rr from nn(nr)=n!r!(nr)!\binom{n}{r} = \frac{n!}{r!(n-r)!}
Arrange with repetitionsn!n1!nk!\frac{n!}{n_1! \cdots n_k!}
nn identical into kk bins(n+k1n)\binom{n+k-1}{n}