Permutations & Combinations – Rapid Review

Fundamental Principle of Counting

  • Rule of Sum: if a task can be done in mm ways or nn ways (exclusive), total m+nm+n.

  • Rule of Product: if Stage-1 has mm outcomes and Stage-2 (following it) has nn, total mnm\,n.

Factorial Basics

  • n!=n(n1)1n! = n(n-1)\dots1 ; 0!=10! = 1.

  • Recursive: n!=n(n1)!n! = n\,(n-1)!.

Permutations

  • Distinct objects, order matters: nPr=n!(nr)!^nP_r = \dfrac{n!}{(n-r)!}.

  • All nn objects: n!n!.

  • Repetition allowed: nrn^r.

  • With identical items: n!p!q!r!\dfrac{n!}{p!q!r!\dots} (where groups have p,q,rp,q,r\dots alike).

  • “Always together” (string method): if mm specified stick together inside nn total ⇒ m!(nm+1)!m!\,(n-m+1)!.

Combinations

  • Order irrelevant: nCr=n!r!(nr)!^nC_r = \dfrac{n!}{r!(n-r)!}.

  • Key identities: nC<em>r=nC</em>nr^nC<em>r = ^nC</em>{n-r} ; nC<em>0+nC</em>1++nC<em>n=2n^nC<em>0+^nC</em>1+\dots+^nC<em>n = 2^n ; biggest term is nC</em>n/2^nC</em>{\lfloor n/2\rfloor}.

  • Restrictions:
    • Exclude pp fixed objects ⇒ (np)C<em>r(n-p)C<em>r. • Include pp fixed objects ⇒ (np)C</em>rp(n-p)C</em>{r-p}.

  • Identical items: choosing any number from kk identical objects gives k+1k+1 ways.

Division into Groups

  • Split m+nm+n distinct items into two unequal groups: (m+n)!m!n!\dfrac{(m+n)!}{m!\,n!}.

  • Two equal groups of nn each: (2n)!n!n!2!\dfrac{(2n)!}{n!\,n!\,2!}.

  • (m+n+p)(m+n+p) into three unequal: (m+n+p)!m!n!p!\dfrac{(m+n+p)!}{m!\,n!\,p!}; equal nn each ⇒ (3n)!(n!)33!\dfrac{(3n)!}{(n!)^3\,3!}.

  • Into mm equal unlabeled boxes, mnmn distinct items: (mn)!(n!)mm!\dfrac{(mn)!}{(n!)^m\,m!} (multiply by m!m! if boxes labeled).

Circular Arrangements

  • nn distinct objects around a table: (n1)!(n-1)! (clockwise ≠ anticlockwise).

  • If a necklace/garland (mirror same) ⇒ 12(n1)!\tfrac12(n-1)!.

  • rr of nn around a circle: nP<em>rr\dfrac{^nP<em>r}{r} (or nP</em>r2r\dfrac{^nP</em>r}{2r} if reflections identical).

Non-Negative/Positive Integer Solutions

For x<em>1++x</em>k=nx<em>1+\dots+x</em>k=n:

  • Non-negative: (n+k1k1)\displaystyle {n+k-1\choose k-1}.

  • Positive: (n1k1)\displaystyle {n-1\choose k-1}.

Derangements (nothing in own place)

  • Number with nn items: Dn=n!(111!+12!+(1)n1n!)n!eD_n = n!\left(1-\frac1{1!}+\frac1{2!}-\dots+(-1)^n\frac1{n!}\right)\approx \dfrac{n!}{e}.

Inclusion–Exclusion (two sets version)

AB=A+BAB|A\cup B| = |A|+|B|-|A\cap B|.
General: alternately add/subtract intersections of increasing size.

Linear (Unit-Coefficient) Equations

Distributing nn identical objects to rr persons (none can be <0): same formula as non-negative solutions.

Prime-Exponent in n!n! (Legendre)

e<em>p(n!)=</em>i=1npie<em>p(n!) = \displaystyle \sum</em>{i=1}^{\infty} \left\lfloor \frac{n}{p^i} \right\rfloor.

Divisors of an Integer

If N=paqbrcN=p^a q^b r^c\dots then:

  • Number of divisors: (a+1)(b+1)(c+1)(a+1)(b+1)(c+1)\dots.

  • Sum of divisors: (1+p++pa)(1+q++qb)(1+p+\dots+p^a)(1+q+\dots+q^b)\dots.

  • Pairs of factors: half this count (adjust for perfect square).

  • Coprime factor-pairs: 2k12^{k-1} where kk is number of distinct primes.

Useful Digit/Divisibility Checks (4-digit examples)

Even ⇒ last digit even; divisible by 33 ⇒ digit-sum multiple of 33; by 66 ⇒ even and digit-sum multiple of 33, etc.

Quick Sum Formulas for All Numbers with Given Digits

Using digits a<em>1a</em>na<em>1\dots a</em>n (distinct):

  • Each digit appears (n1)!(n-1)! times in each place.

  • Sum of all numbers length nn: (a<em>1++a</em>n)(n1)!(1111(n times))(a<em>1+\dots+a</em>n)(n-1)!\,(111\dots 1_{(n\text{ times})}).

Multinomial Coefficient

Number of ways to put rr labeled items into boxes of sizes l,m,n,l,m,n,\dots equals coefficient of xrx^r in (1+x++xsize)\prod (1+x+\dots+x^{\text{size}}).

Standard Shortcuts

  • No two selected objects adjacent in a line of NN ⇒ choose gaps: (Nn+1n)\displaystyle {N-n+1\choose n} (multiply by n!n! if persons distinct).

  • Arrange mm W-balls and nn R-balls so that no two Rs touch (distinct balls): (m+1n)m!n!\displaystyle {m+1\choose n} m! n! (omit factorials for identical sets).

These formulas cover almost every “last-minute” question on counting, permutations–combinations, circular arrangements, distributions, and factorial exponents.