PGD01C01
Module 1 · Set Theory, Relations and Combinatorics

Permutations and Combinations

Core Titles
Key headlines and terms for quick recall
  • Factorial n!=n(n1)1n! = n(n-1)\cdots 1
  • Permutation nPr=n!(nr)!^nP_r = \dfrac{n!}{(n-r)!} (order matters)
  • Combination nCr=(nr)=n!r!(nr)!^nC_r = \binom{n}{r} = \dfrac{n!}{r!(n-r)!} (order doesn't)
  • Circular permutations of nn: (n1)!(n-1)!
  • Permutations with repetition n!n1!n2!nk!\dfrac{n!}{n_1! n_2! \cdots n_k!}
  • Binomial theorem
  • Pascal's identity (nr)=(n1r1)+(n1r)\binom{n}{r} = \binom{n-1}{r-1} + \binom{n-1}{r}
Basic Idea
What it is, why it matters, how it works

Counting rule of thumb

  • Order matters → permutation
  • Order doesn't matter → combination

Permutations

Number of ways to arrange rr items chosen from nn distinct items: nPr=n!(nr)!^nP_r = \frac{n!}{(n-r)!} Special case: arranging all nn items uses n!n! ways.

Circular arrangements of nn distinct objects: (n1)!(n-1)! — fix one object and arrange the rest.

Permutations with repetitionnn objects, where nin_i are of type ii: n!n1!n2!nk!\frac{n!}{n_1!\,n_2!\,\cdots\,n_k!} Example: arrangements of the letters in "BANANA" = 6!3!2!1!=60\dfrac{6!}{3!\,2!\,1!} = 60.

Combinations

Number of ways to choose rr items from nn: nCr=(nr)=n!r!(nr)!^nC_r = \binom{n}{r} = \frac{n!}{r!(n-r)!}

Key identities:

  • (nr)=(nnr)\binom{n}{r} = \binom{n}{n-r}
  • Pascal's rule: (nr)=(n1r1)+(n1r)\binom{n}{r} = \binom{n-1}{r-1} + \binom{n-1}{r}
  • r=0n(nr)=2n\sum_{r=0}^{n} \binom{n}{r} = 2^n

Binomial theorem

(x+y)n=r=0n(nr)xnryr(x+y)^n = \sum_{r=0}^{n} \binom{n}{r} x^{n-r} y^{r}

Why this matters in Data Science

Sample-space sizes in probability, feature combinations in ML, kk-fold splits, model selection grids, A/B test arrangements.

Mind Map
Visual structure of the concept
COUNTING
├── Order MATTERS → Permutation
│   ├── ⁿPᵣ = n! / (n−r)!
│   ├── All n items: n!
│   ├── Circular: (n−1)!
│   └── With repetition: n! / Π nᵢ!
├── Order DOESN'T matter → Combination
│   ├── ⁿCᵣ = n! / r!(n−r)!
│   ├── ⁿCᵣ = ⁿCₙ₋ᵣ
│   ├── Pascal: ⁿCᵣ = ⁿ⁻¹Cᵣ₋₁ + ⁿ⁻¹Cᵣ
│   └── Sum: Σ ⁿCᵣ = 2ⁿ
└── Binomial theorem (x+y)ⁿ = Σ ⁿCᵣ xⁿ⁻ʳ yʳ
Exam Q&A
Part A (2 marks) and Part B (20 marks) style questions

Part A (2 marks each)

Q1. State the formula for nPr^nP_r and nCr^nC_r. nPr=n!(nr)!^nP_r = \dfrac{n!}{(n-r)!} and nCr=n!r!(nr)!^nC_r = \dfrac{n!}{r!(n-r)!}.

Q2. How many ways can 5 people be seated around a round table? Circular permutations: (51)!=24(5-1)! = 24.

Q3. State Pascal's identity. (nr)=(n1r1)+(n1r)\binom{n}{r} = \binom{n-1}{r-1} + \binom{n-1}{r}.

Q4. How many arrangements of the letters in MISSISSIPPI? 11!4!4!2!1!=34650\dfrac{11!}{4!\,4!\,2!\,1!} = 34650.


Part B (20 marks)

Q. State and prove the Binomial theorem. Use it to find the coefficient of x5y3x^5 y^3 in (2x+3y)8(2x + 3y)^8.

Statement. For any non-negative integer nn: (x+y)n=r=0n(nr)xnryr(x+y)^n = \sum_{r=0}^{n} \binom{n}{r} x^{n-r} y^r

Proof by induction on nn.

Base n=0n=0: LHS = 1, RHS = (00)x0y0=1\binom{0}{0} x^0 y^0 = 1. ✓

Step. Assume the theorem for n=kn=k: (x+y)k=r=0k(kr)xkryr(x+y)^k = \sum_{r=0}^{k}\binom{k}{r}x^{k-r}y^r.

Then (x+y)k+1=(x+y)r=0k(kr)xkryr=r=0k(kr)xk+1ryr+r=0k(kr)xkryr+1.(x+y)^{k+1} = (x+y)\sum_{r=0}^{k}\binom{k}{r}x^{k-r}y^r = \sum_{r=0}^{k}\binom{k}{r}x^{k+1-r}y^r + \sum_{r=0}^{k}\binom{k}{r}x^{k-r}y^{r+1}.

Shifting indices and using Pascal's identity (kr1)+(kr)=(k+1r)\binom{k}{r-1} + \binom{k}{r} = \binom{k+1}{r}: (x+y)k+1=r=0k+1(k+1r)xk+1ryr.(x+y)^{k+1} = \sum_{r=0}^{k+1}\binom{k+1}{r}x^{k+1-r}y^r. \quad \blacksquare

Application — coefficient of x5y3x^5 y^3 in (2x+3y)8(2x + 3y)^8.

General term: (8r)(2x)8r(3y)r\binom{8}{r}(2x)^{8-r}(3y)^{r}. For x5y3x^5 y^3 we need r=3r=3:

(83)(2x)5(3y)3=5632x527y3=563227  x5y3=48384x5y3.\binom{8}{3}(2x)^5 (3y)^3 = 56 \cdot 32 x^5 \cdot 27 y^3 = 56 \cdot 32 \cdot 27 \; x^5 y^3 = 48384 \, x^5 y^3.

Coefficient = 48384.