CombinatoricsTopic #16 of 40

Permutations

Permutations with and without repetition, circular permutations, and permutations with restrictions.

Definition

A permutation is an ordered arrangement of objects.

Permutations without Repetition

All nn Objects

The number of ways to arrange nn distinct objects: P(n)=n!=n×(n1)×(n2)××2×1P(n) = n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1

Example: Arrange letters A, B, C, D: 4!=24 ways4! = 24 \text{ ways}

rr Objects from nn (r-permutations)

The number of ways to arrange rr objects 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)

Example: First 3 places from 8 runners: P(8,3)=8×7×6=336P(8, 3) = 8 \times 7 \times 6 = 336

Permutations with Repetition

Arranging with Unlimited Supply

If we can use each of nn types of objects any number of times, arrangements of length rr: nrn^r

Example: 4-digit PIN using digits 0-9: 104=10,00010^4 = 10,000

Arranging with Fixed Counts

If we have nn objects where:

  • n1n_1 are of type 1
  • n2n_2 are of type 2
  • ...
  • nkn_k are of type kk

And n1+n2++nk=nn_1 + n_2 + \cdots + n_k = n: n!n1!n2!nk!\frac{n!}{n_1! \cdot n_2! \cdots n_k!}

Example: Arrangements of MISSISSIPPI:

  • 11 letters: 1 M, 4 I's, 4 S's, 2 P's 11!1!4!4!2!=39916800124242=34,650\frac{11!}{1! \cdot 4! \cdot 4! \cdot 2!} = \frac{39916800}{1 \cdot 24 \cdot 24 \cdot 2} = 34,650

Circular Permutations

Arrangements in a circle where only relative positions matter: (n1)!(n-1)!

Why? Fix one object to remove rotational equivalence, arrange remaining n1n-1.

With Reflections Considered Same

If reflections (flipping) also count as same: (n1)!2\frac{(n-1)!}{2}

Example: Seating 6 people around a table:

  • Rotations same: (61)!=120(6-1)! = 120
  • Rotations and reflections same: 5!2=60\frac{5!}{2} = 60

Permutations with Restrictions

Adjacent Constraints

Objects must be adjacent: Treat them as a single "super-object".

Example: Arrange ABCDE with A and B adjacent:

  1. Treat AB as one unit: arrange 4 units = 4!4!
  2. A and B can swap within: 2!2!
  3. Total: 4!×2!=484! \times 2! = 48

Objects must NOT be adjacent: Total minus adjacent cases.

Position Constraints

Example: Arrange 1,2,3,4,5 so that 1 is not first and 5 is not last:

  • Total: 5!=1205! = 120
  • 1 is first: 4!=244! = 24
  • 5 is last: 4!=244! = 24
  • 1 first AND 5 last: 3!=63! = 6
  • Answer: 1202424+6=78120 - 24 - 24 + 6 = 78

Relative Order Constraints

Example: Arrange ABCDE so A comes before B: By symmetry, A before B in exactly half: 5!2=60\frac{5!}{2} = 60

Derangements

A derangement is a permutation where no element is in its original position.

The number of derangements of nn elements: Dn=n!i=0n(1)ii!=n!(11+12!13!++(1)nn!)D_n = n! \sum_{i=0}^{n} \frac{(-1)^i}{i!} = n! \left(1 - 1 + \frac{1}{2!} - \frac{1}{3!} + \cdots + \frac{(-1)^n}{n!}\right)

Recursive formula: Dn=(n1)(Dn1+Dn2)D_n = (n-1)(D_{n-1} + D_{n-2})

With D0=1D_0 = 1 and D1=0D_1 = 0.

nnDnD_nDn/n!D_n/n!
011
100
210.5
320.333
490.375
5440.367

As nn \to \infty: Dn/n!1/e0.368D_n/n! \to 1/e \approx 0.368

Permutation as Functions

A permutation of set SS can be viewed as a bijection σ:SS\sigma: S \to S.

Cycle Notation

(1  3  2)(1 \; 3 \; 2) means: 13211 \to 3 \to 2 \to 1

Every permutation decomposes into disjoint cycles.

Permutation Composition

Apply right to left: στ\sigma \circ \tau means first τ\tau, then σ\sigma.

Identity Permutation

ee or id\text{id}: every element maps to itself.

Inverse Permutation

σ1\sigma^{-1}: reverse each cycle's direction.