Course Review

Study Sheet

Course Review

Every formula, identity, and technique for competition math

Fundamental Counting

Concept
Addition & Multiplication Principles

Multiplication (AND). A task done in independent stages with n1,n2,,nkn_1,n_2,\dots,n_k ways per stage has n1n2nkn_1 n_2 \cdots n_k total outcomes. Addition (OR). Disjoint cases add: A1++Ak|A_1|+\cdots+|A_k|. Ex. 2 letters then 3 digits: 262103=676,00026^2\cdot 10^3 = 676{,}000 plates.

Concept
Permutations (order matters, no repeats)

Arrange kk of nn distinct objects in ordered slots:

P(n,k)=n!(nk)!=n(n1)(nk+1),P(n,n)=n!.P(n,k)=\frac{n!}{(n-k)!}=n(n-1)\cdots(n-k+1),\qquad P(n,n)=n!.

Ex. Gold/silver/bronze among 88 runners: P(8,3)=876=336P(8,3)=8\cdot7\cdot6=336.

Concept
Combinations (order doesn't matter)

Choose kk of nn distinct objects, ignoring order:

(nk)=n!k!(nk)!=P(n,k)k!,(nk)=(nnk).\binom{n}{k}=\frac{n!}{k!\,(n-k)!}=\frac{P(n,k)}{k!},\qquad \binom{n}{k}=\binom{n}{n-k}.

Ex. A 44-person committee from 1010: (104)=210\dbinom{10}{4}=210.

Concept
Permutations with Identical Objects (multinomial)

Arrange nn objects with nin_i copies of type ii (ni=n\sum n_i = n):

n!n1!n2!nr!.\frac{n!}{n_1!\,n_2!\cdots n_r!}.

Ex. MISSISSIPPI: 11!1!4!4!2!=34,650\dfrac{11!}{1!\,4!\,4!\,2!}=34{,}650.

Concept
Circular Permutations

Arrangements around a circle count only relative position (fix one seat to remove nn rotations):

(n1)!;if reflections also identical (bracelet): (n1)!2 (n3).(n-1)!;\qquad \text{if reflections also identical (bracelet): } \frac{(n-1)!}{2}\ (n\ge 3).

Ex. 66 people at a round table: (61)!=120(6-1)!=120.

Tip

Tip. Titles, ranks, and ordered slots signal permutations; committees, subsets, and hands signal combinations. Labeled chairs make a “circular” problem linear again (n!n!, not (n1)!(n-1)!).

Counting Strategies

Concept
Casework

Split into disjoint, exhaustive cases; count each; add. Choose the split that makes each case easy and keeps cases from overlapping. Ex. Rolls of two dice summing to a multiple of 44: cases sum=4,8,12=4,8,12 give 3+5+1=93+5+1=9.

Concept
Complementary Counting

Count the opposite and subtract from the total: E=SEc|E| = |S| - |E^c|. Ideal for “at least one.” Ex. 33-digit numbers with a digit 77: 900899=252900 - 8\cdot9\cdot9 = 252.

Concept
Constructive Counting

Build a valid object step by step, multiplying the choices available at each step (keep the count per step constant, or split into cases). Ex. 55 books, dictionary on an end: 24!=482\cdot 4! = 48.

Concept
Correcting Overcounting (divide by symmetry)

Count an easy ordered/labeled way, then divide by the symmetries you introduced: rotations (÷n\div n), reflections (÷2\div 2), interchangeable groups (÷k!\div k!). Ex. Split 66 players into 33 unlabeled pairs: (62)(42)(22)3!=906=15\dfrac{\binom{6}{2}\binom{4}{2}\binom{2}{2}}{3!}=\dfrac{90}{6}=15.

Concept
Bijections

If a set is hard to count, find a one-to-one correspondence with a set you can count; equal sizes. Ex. Grid paths (0,0)(4,3)(0,0)\to(4,3) \leftrightarrow strings of 44 R's, 33 U's: (73)=35\dbinom{7}{3}=35.

Tip

Tip. “At least one” \Rightarrow complement. When a direct build overcounts by a fixed factor, count with order and divide. A clever bijection often turns a messy object into a simple string or lattice path.

Distributions: Stars & Bars

Concept
Nonnegative Integer Solutions

The number of solutions to x1+x2++xk=nx_1+x_2+\cdots+x_k=n with each xi0x_i\ge 0 (identical items into distinct boxes) is

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

Ex. 1010 identical candies among 44 kids: (133)=286\dbinom{13}{3}=286.

Concept
Positive Integer Solutions

For xi1x_i\ge 1, give each variable one unit first (yi=xi10y_i=x_i-1\ge 0):

(n1k1).\binom{n-1}{k-1}.

Ex. 1010 candies, each kid at least one: (93)=84\dbinom{9}{3}=84.

Concept
Bounded Variables (inclusion--exclusion)

For upper bounds like xicix_i \le c_i, subtract the “overflow” cases with inclusion--exclusion (give a violating variable ci+1c_i+1 units, then recount). Ex. x1+x2+x3=10x_1+x_2+x_3=10, each 4\le 4: (122)3(72)+3(22)=6663+3=6\binom{12}{2}-3\binom{7}{2}+3\binom{2}{2}=66-63+3=6.

Concept
Multinomial Coefficients (distinct items)

Split nn distinct items into labeled groups of sizes n1,,nrn_1,\dots,n_r:

(nn1,n2,,nr)=n!n1!n2!nr!.\binom{n}{n_1,n_2,\dots,n_r}=\frac{n!}{n_1!\,n_2!\cdots n_r!}.

Ex. Deal 99 distinct cards into piles of 4,3,24,3,2: 9!4!3!2!=1260\dfrac{9!}{4!\,3!\,2!}=1260.

Tip

Tip. Stars and bars needs identical items and distinct boxes. “Each at least one” subtracts kk from nn first; upper bounds require inclusion--exclusion; distinct items use the multinomial instead.

Binomial Theorem & Identities

Concept
Binomial Theorem
(x+y)n=k=0n(nk)xnkyk.(x+y)^n=\sum_{k=0}^{n}\binom{n}{k}x^{n-k}y^{k}.

Ex. Coefficient of x2x^2 in (1+x)5(1+x)^5 is (52)=10\dbinom{5}{2}=10.

Reminder — The binomial theorem:(x+y)n=k=0n(nk)xnkyk(x+y)^{n}=\sum_{k=0}^{n}\binom{n}{k}x^{\,n-k}y^{k}
Concept
Pascal's Rule
(nk)=(n1k1)+(n1k).\binom{n}{k}=\binom{n-1}{k-1}+\binom{n-1}{k}.

Ex. (52)=(41)+(42)=4+6=10\dbinom{5}{2}=\dbinom{4}{1}+\dbinom{4}{2}=4+6=10.

Concept
Row Sums
k=0n(nk)=2n,k=0n(1)k(nk)=0 (n1).\sum_{k=0}^{n}\binom{n}{k}=2^{n},\qquad \sum_{k=0}^{n}(-1)^k\binom{n}{k}=0\ (n\ge 1).

Ex. Subsets of a 55-set: 25=322^5=32; equal numbers of even- and odd-sized subsets.

Concept
Hockey Stick
i=rn(ir)=(n+1r+1).\sum_{i=r}^{n}\binom{i}{r}=\binom{n+1}{r+1}.

Ex. (22)+(32)+(42)=1+3+6=10=(53)\dbinom{2}{2}+\dbinom{3}{2}+\dbinom{4}{2}=1+3+6=10=\dbinom{5}{3}.

Concept
Vandermonde's Identity
k=0p(mk)(npk)=(m+np).\sum_{k=0}^{p}\binom{m}{k}\binom{n}{p-k}=\binom{m+n}{p}.

Ex. Pick 22 from 33 boys ++ 44 girls: k(3k)(42k)=(72)=21\sum_k \binom{3}{k}\binom{4}{2-k}=\binom{7}{2}=21.

Concept
Absorption & Lattice Paths
k(nk)=n(n1k1);paths (0,0)(m,n) (R/U steps)=(m+nm).k\binom{n}{k}=n\binom{n-1}{k-1};\qquad \text{paths }(0,0)\to(m,n)\text{ (R/U steps)}=\binom{m+n}{m}.

Ex. 3(63)=6(52)=603\dbinom{6}{3}=6\dbinom{5}{2}=60; paths to (4,3)(4,3): (74)=35\dbinom{7}{4}=35.

Tip

Tip. Prove identities combinatorially (count one set two ways) when algebra stalls. To evaluate a weird sum, match it to the binomial theorem by choosing clever x,yx,y (e.g. x=y=1x=y=1 gives 2n2^n; x=1,y=1x=1,y=-1 gives 00).

Inclusion--Exclusion, Derangements & Pigeonhole

Concept
Inclusion--Exclusion (PIE)
iAi=AiAiAj+AiAjAk\Big|\bigcup_{i} A_i\Big|=\sum|A_i|-\sum|A_i\cap A_j|+\sum|A_i\cap A_j\cap A_k|-\cdots

Ex. 100\le 100 divisible by 22 or 33: 50+3316=6750+33-16=67.

Concept
Derangements (no fixed points)
Dn=n!k=0n(1)kk!=(n1)(Dn1+Dn2),Dnn!e.D_n=n!\sum_{k=0}^{n}\frac{(-1)^k}{k!}=(n-1)(D_{n-1}+D_{n-2}),\qquad D_n\approx \frac{n!}{e}.

Ex. 44 letters, wrong envelopes: D4=9D_4=9.

Concept
Surjections (onto functions)

Functions from an nn-set onto a kk-set, by PIE:

j=0k(1)j(kj)(kj)n=k!S(n,k).\sum_{j=0}^{k}(-1)^j\binom{k}{j}(k-j)^n = k!\,S(n,k).

Ex. Onto maps {1,2,3}{a,b}\{1,2,3\}\to\{a,b\}: 232=62^3-2=6.

Concept
Pigeonhole Principle

Place nn items into kk boxes: some box holds at least nk\left\lceil \dfrac{n}{k}\right\rceil items (basic case: n>kn>k \Rightarrow a box has 2\ge 2). Ex. 1313 people share a birth month: some month has 13/12=2\lceil 13/12\rceil=2.

Tip

Tip. PIE shines for “at least one property” with overlapping conditions. For pigeonhole, the art is choosing the pigeons and holes; look for a quantity forced to repeat.

Recursion, Catalan & Generating Functions

Concept
Recursion & Fibonacci Tilings

Set up ana_n from smaller cases by conditioning on the last choice. Tiling a 1×n1\times n strip with 1×11\times1 and 1×21\times2 pieces:

an=an1+an2 (Fibonacci),a1=1, a2=2.a_n=a_{n-1}+a_{n-2}\ (\text{Fibonacci}),\quad a_1=1,\ a_2=2.

Ex. 1×41\times 4 strip: a4=5a_4=5 tilings.

Concept
Catalan Numbers
Cn=1n+1(2nn)=(2nn)(2nn+1),Cn+1=i=0nCiCni.C_n=\frac{1}{n+1}\binom{2n}{n}=\binom{2n}{n}-\binom{2n}{n+1},\qquad C_{n+1}=\sum_{i=0}^{n}C_i C_{n-i}.

Counts balanced parentheses, non-crossing paths, triangulations, binary trees. Ex. Valid sequences of 33 pairs of parentheses: C3=5C_3=5.

Concept
Generating Functions

Encode a sequence ana_n as coefficients of anxn\sum a_n x^n; products of series combine choices. Key:

11x=n0xn,(1+x)n=k(nk)xk.\frac{1}{1-x}=\sum_{n\ge 0}x^n,\qquad (1+x)^n=\sum_k \binom{n}{k}x^k.

Ex. Ways to make 66 from parts {1,2}\{1,2\}: coefficient of x6x^6 in 1(1x)(1x2)\frac{1}{(1-x)(1-x^2)} is 44.

Tip

Tip. When a count depends on a process built up one step at a time, define a recurrence by conditioning on the first or last move. Recognize Catalan whenever “balanced/non-crossing/never-dips-below” appears.

Probability Fundamentals

Concept
Equally Likely Outcomes
P(E)=ES,0P(E)1,P(Ec)=1P(E).P(E)=\frac{|E|}{|S|},\qquad 0\le P(E)\le 1,\qquad P(E^c)=1-P(E).

Ex. Two dice sum to 77: 636=16\dfrac{6}{36}=\dfrac16.

Concept
Counting-Based Probability

Compute favorable and total outcomes with the same counting rules (order-consistent on both). Ex. 22 aces in a 55-card hand: (42)(483)(525)\dfrac{\binom{4}{2}\binom{48}{3}}{\binom{52}{5}}.

Concept
Independence

Events are independent iff

P(AB)=P(A)P(B).P(A\cap B)=P(A)\,P(B).

Ex. Two coins both heads: 1212=14\tfrac12\cdot\tfrac12=\tfrac14.

Concept
Geometric Probability

When outcomes fill a continuous region, probability is a ratio of measures (length, area, volume):

P=measure of favorable regionmeasure of sample region.P=\frac{\text{measure of favorable region}}{\text{measure of sample region}}.

Ex. Random point in [0,1]2[0,1]^2 with x+y<1x+y<1: area 12\tfrac12, so P=12P=\tfrac12.

Tip

Tip. Keep numerator and denominator counted the same way (both ordered or both unordered). “At least one” in probability also loves the complement: P(1)=1P(none)P(\ge 1)=1-P(\text{none}).

Conditional Probability & Bayes

Concept
Conditional Probability
P(AB)=P(AB)P(B),P(B)>0.P(A\mid B)=\frac{P(A\cap B)}{P(B)},\qquad P(B)>0.

Ex. Die shows even, chance it's 22: 1/61/2=13\dfrac{1/6}{1/2}=\dfrac13.

Concept
Multiplication Rule
P(AB)=P(A)P(BA)=P(B)P(AB).P(A\cap B)=P(A)\,P(B\mid A)=P(B)\,P(A\mid B).

Ex. Two cards, both hearts (no replacement): 13521251=117\dfrac{13}{52}\cdot\dfrac{12}{51}=\dfrac{1}{17}.

Concept
Law of Total Probability

For a partition B1,,BnB_1,\dots,B_n of the sample space:

P(A)=iP(ABi)P(Bi).P(A)=\sum_{i} P(A\mid B_i)\,P(B_i).

Ex. Urn A (bag 12\tfrac12): P(red)=1225+1213=1130P(\text{red})=\tfrac12\cdot\tfrac{2}{5}+\tfrac12\cdot\tfrac{1}{3}=\tfrac{11}{30}.

Concept
Bayes' Theorem
P(BA)=P(AB)P(B)P(A)=P(AB)P(B)iP(ABi)P(Bi).P(B\mid A)=\frac{P(A\mid B)\,P(B)}{P(A)}=\frac{P(A\mid B)P(B)}{\sum_i P(A\mid B_i)P(B_i)}.

Ex. Test 99%99\% accurate, disease rate 1%1\%: P(sick+)=.99(.01).99(.01)+.01(.99)=12P(\text{sick}\mid +)=\dfrac{.99(.01)}{.99(.01)+.01(.99)}=\tfrac12.

Tip

Tip. “Given that” \Rightarrow conditional; restrict the sample space to the given event. When you know P(evidencecause)P(\text{evidence}\mid\text{cause}) but want P(causeevidence)P(\text{cause}\mid\text{evidence}), use Bayes. Rare conditions make “accurate” tests deceptively unreliable.

Expected Value

Concept
Definition
E[X]=xxP(X=x).E[X]=\sum_x x\,P(X=x).

Ex. One fair die: E[X]=1+2++66=3.5E[X]=\dfrac{1+2+\cdots+6}{6}=3.5.

Concept
Linearity of Expectation

Always true, even for dependent variables:

E[X1++Xn]=E[X1]++E[Xn].E[X_1+\cdots+X_n]=E[X_1]+\cdots+E[X_n].

Ex. Sum of 1010 dice: 103.5=3510\cdot 3.5=35.

Concept
Indicator Variables

Let Xi=1X_i=1 if event ii occurs, else 00; then E[Xi]=P(event i)E[X_i]=P(\text{event }i) and E[#events]=P(event i)E[\#\text{events}]=\sum P(\text{event }i). Ex. Expected fixed points of a random permutation of nn: n1n=1n\cdot\tfrac1n=1.

Concept
Expectation via States / Recursion

Let EE be the expected value from a state; condition on the next step and solve the resulting equation(s). Ex. Flips until first head: E=1+12EE=2E=1+\tfrac12 E \Rightarrow E=2.

Concept
Waiting Time & Coupon Collector

Geometric waiting time for a prob-pp event: E=1pE=\dfrac1p. Collecting all nn coupons:

E=n(1+12++1n)=nHn.E=n\Big(1+\tfrac12+\cdots+\tfrac1n\Big)=n H_n.

Ex. All 66 die faces: 6H6=64920=14.76H_6=6\cdot\tfrac{49}{20}=14.7.

Tip

Tip. “Expected number of \dots” almost always means indicators ++ linearity --- never fight the dependence. For a repeating process with memory, set up a states equation and solve for EE.

Problem-Solving Playbook

Concept
Cue \rightarrow Technique decision guide

multicols2

  • 3pt
  • order matters, no repeat \rightarrow P(n,k)P(n,k)
  • order doesn't matter \rightarrow (nk)\binom{n}{k}
  • repeated letters/objects \rightarrow multinomial n!n1!nr!\frac{n!}{n_1!\cdots n_r!}
  • around a circle \rightarrow (n1)!(n-1)!
  • “at least one” \rightarrow complement 1P(none)1-P(\text{none})
  • distribute identical items \rightarrow stars and bars
  • distinct items into groups \rightarrow multinomial
  • overlapping conditions / “or” \rightarrow inclusion--exclusion
  • nothing in its place \rightarrow derangement DnD_n
  • something forced to repeat \rightarrow pigeonhole
  • balanced / non-crossing \rightarrow Catalan CnC_n
  • process built step by step \rightarrow recursion
  • “given that” / updated info \rightarrow conditional / Bayes
  • continuous / random point \rightarrow geometric probability
  • expected count of something \rightarrow linearity + indicators
  • repeated states with memory \rightarrow expectation via states
  • time until first success \rightarrow waiting time 1/p1/p
  • weird binomial sum \rightarrow known identity / count two ways

multicols

Tip

Master flow. (1) AND \Rightarrow multiply, OR \Rightarrow add. (2) Does order matter? (3) Did I overcount by symmetry? (4) Is the complement easier? (5) For probability, count favorable and total the same way; for expectation, reach for linearity before anything clever.

Reference Tables

Concept
Factorials 0!0! through 10!10!

Concept
Catalan numbers C0C_0--C8C_8   and   Derangements D0D_0--D6D_6

Concept
Pascal's Triangle (rows n=0n=0 to 88)

11112113311464115101051161520156117213535217118285670562881\begin{array}{c} 1\\ 1\quad 1\\ 1\quad 2\quad 1\\ 1\quad 3\quad 3\quad 1\\ 1\quad 4\quad 6\quad 4\quad 1\\ 1\quad 5\quad 10\quad 10\quad 5\quad 1\\ 1\quad 6\quad 15\quad 20\quad 15\quad 6\quad 1\\ 1\quad 7\quad 21\quad 35\quad 35\quad 21\quad 7\quad 1\\ 1\quad 8\quad 28\quad 56\quad 70\quad 56\quad 28\quad 8\quad 1 \end{array}

Row nn sums to 2n2^n; entry kk is (nk)\dbinom{n}{k}; each entry is the sum of the two above it (Pascal's rule).

Advanced Reference

Concept
Burnside's Lemma (counting up to symmetry)

The number of distinct configurations under a symmetry group GG equals the average number of colorings fixed by each group element:

#orbits=1GgGFix(g).\#\text{orbits}=\frac{1}{|G|}\sum_{g\in G}\big|\mathrm{Fix}(g)\big|.

Ex. 22-color a necklace of 44 beads under 44 rotations: 14(24+21+22+21)=6\tfrac14(2^4+2^1+2^2+2^1)=6.

Concept
Stirling Numbers (2nd kind) & Bell Numbers

S(n,k)S(n,k) partitions an nn-set into kk nonempty unlabeled blocks; Bell number Bn=kS(n,k)B_n=\sum_k S(n,k) counts all partitions:

S(n,k)=S(n1,k1)+kS(n1,k),Bn=k=0nS(n,k).S(n,k)=S(n-1,k-1)+k\,S(n-1,k),\qquad B_n=\sum_{k=0}^{n}S(n,k).

Surjections from nn-set onto kk-set =k!S(n,k)=k!\,S(n,k). Ex. S(4,2)=7S(4,2)=7, so onto maps {1,2,3,4}{a,b}\{1,2,3,4\}\to\{a,b\} number 2!7=142!\cdot 7=14.

Concept
Derangement Nearest-Integer Formula

Since Dn=n!k=0n(1)kk!D_n=n!\sum_{k=0}^n \frac{(-1)^k}{k!} converges to n!/en!/e fast,

Dn=n!e+12(n1).D_n=\left\lfloor \frac{n!}{e}+\frac12\right\rfloor\qquad(n\ge 1).

Ex. D5=120/e+0.5=44.65=44D_5=\lfloor 120/e+0.5\rfloor=\lfloor 44.65\rfloor=44.

Concept
Roots of Unity Filter

To sum binomial coefficients over kk in one residue class mod mm, average (1+ωj)n(1+\omega^j)^n over the mm-th roots of unity ω=e2πi/m\omega=e^{2\pi i/m}:

kr (m)(nk)=1mj=0m1ωjr(1+ωj)n.\sum_{k\equiv r\ (m)}\binom{n}{k}=\frac{1}{m}\sum_{j=0}^{m-1}\omega^{-jr}(1+\omega^{j})^{n}.

Ex. k0 (2)(nk)=12(2n+0n)=2n1\sum_{k\equiv 0\ (2)}\binom{n}{k}=\tfrac12\big(2^n+0^n\big)=2^{n-1} for n1n\ge 1.

Concept
Generalized Binomial Series

For any real (or complex) α\alpha with x<1|x|<1, and the negative-power expansion:

(1+x)α=k0(αk)xk,1(1x)k=n0(n+k1k1)xn.(1+x)^{\alpha}=\sum_{k\ge 0}\binom{\alpha}{k}x^{k},\qquad \frac{1}{(1-x)^{k}}=\sum_{n\ge 0}\binom{n+k-1}{k-1}x^{n}.

Here (αk)=α(α1)(αk+1)k!\binom{\alpha}{k}=\dfrac{\alpha(\alpha-1)\cdots(\alpha-k+1)}{k!}. Ex. 1(1x)3\dfrac{1}{(1-x)^{3}} has xnx^n coefficient (n+22)\dbinom{n+2}{2} (stars and bars).

Concept
Key Weighted & Squared Sum Identities
k=0nk(nk)=n2n1,k=0n(nk)2=(2nn),\sum_{k=0}^{n} k\binom{n}{k}=n\,2^{n-1},\qquad \sum_{k=0}^{n}\binom{n}{k}^{2}=\binom{2n}{n},

and Vandermonde k(mk)(npk)=(m+np)\displaystyle\sum_{k}\binom{m}{k}\binom{n}{p-k}=\binom{m+n}{p} (the squared sum is its m=n=pm=n=p case). Ex. k(4k)=423=32\sum k\binom{4}{k}=4\cdot 2^{3}=32; (4k)2=(84)=70\sum\binom{4}{k}^2=\binom{8}{4}=70.

Concept
Catalan Interpretations & Closed Form
Cn=1n+1(2nn)=(2nn)(2nn1).C_n=\frac{1}{n+1}\binom{2n}{n}=\binom{2n}{n}-\binom{2n}{n-1}.

Counts: balanced parentheses, Dyck paths never dipping below the axis, triangulations of an (n+2)(n{+}2)-gon, full binary trees with n+1n{+}1 leaves, and non-crossing chord matchings. Ex. C4=(84)(83)=7056=14C_4=\binom{8}{4}-\binom{8}{3}=70-56=14.

Concept
Solving Linear Recurrences (characteristic roots)

For an=c1an1++cdanda_n=c_1 a_{n-1}+\cdots+c_d a_{n-d}, solve xd=c1xd1++cdx^{d}=c_1 x^{d-1}+\cdots+c_d. Distinct roots rir_i give an=Airina_n=\sum A_i r_i^{n}; a root of multiplicity mm contributes (A0+A1n++Am1nm1)rn(A_0+A_1 n+\cdots+A_{m-1}n^{m-1})r^{n}. Fix constants from initial values. Ex. an=2an1an2a_n=2a_{n-1}-a_{n-2} has double root 11: an=A+Bna_n=A+Bn (arithmetic).

Concept
Solving Recurrences (generating functions)

Multiply the recurrence by xnx^n, sum over nn, and solve for A(x)=anxnA(x)=\sum a_n x^n as a rational function; expand via partial fractions and 1(1rx)m\frac{1}{(1-rx)^{m}} to read off ana_n. Ex. Fibonacci: A(x)=x1xx2an=φnψn5A(x)=\dfrac{x}{1-x-x^{2}}\Rightarrow a_n=\dfrac{\varphi^{n}-\psi^{n}}{\sqrt5}.

Advanced Expectation & Markov Chains

Concept
Expectation Toolkit

Beyond linearity and indicators (E[Xi]=P(event i)E[\sum X_i]=\sum P(\text{event }i)), for a nonnegative integer XX use the tail sum:

E[X]=k1P(Xk),Var(X)=E[X2]E[X]2.E[X]=\sum_{k\ge 1}P(X\ge k),\qquad \mathrm{Var}(X)=E[X^{2}]-E[X]^{2}.

Geometric wait for a prob-pp event: E=1/pE=1/p. Coupon collector over nn types: E=nHnE=n H_n. Ex. Rolls to see all 66 faces: 6H6=14.76H_6=14.7.

Concept
Odds-Form Bayes

Updating hypothesis HH against Hˉ\bar H on evidence EE multiplies prior odds by the likelihood ratio:

P(HE)P(HˉE)=P(H)P(Hˉ)P(EH)P(EHˉ).\frac{P(H\mid E)}{P(\bar H\mid E)}=\frac{P(H)}{P(\bar H)}\cdot\frac{P(E\mid H)}{P(E\mid \bar H)}.

Ex. Prior odds 1:991{:}99, likelihood ratio 99:199{:}1 \Rightarrow posterior odds 1:11{:}1, i.e. P=12P=\tfrac12.

Concept
First-Step Analysis & Gambler's Ruin

Define hitting probabilities/times per state and condition on the first step. Fair-coin gambler's ruin from $kk with absorbing barriers 00 and NN:

P(reach N)=kN,E[duration]=k(Nk).P(\text{reach }N)=\frac{k}{N},\qquad E[\text{duration}]=k(N-k).

Ex. Start at $33 of $1010: reach goal with prob 310\tfrac{3}{10}, expected 2121 steps.

Concept
Stationary Distribution

A distribution π\pi is stationary for transition matrix PP when it is unchanged by a step:

πP=π,iπi=1.\pi P=\pi,\qquad \sum_i \pi_i=1.

For an irreducible chain the long-run fraction of time in state ii is πi\pi_i, and the mean return time is 1/πi1/\pi_i. Ex. Two-state chain with rates aa (out of 11), bb (out of 22): π=(ba+b,aa+b)\pi=\big(\tfrac{b}{a+b},\tfrac{a}{a+b}\big).

Tip

Tip. “Distinct up to rotation/reflection” \Rightarrow Burnside. “Partition into groups” (unlabeled) \Rightarrow Stirling/Bell. A weird sum over every mm-th term \Rightarrow roots of unity filter. For long-run behavior of a random process, solve πP=π\pi P=\pi; for hitting probabilities, use first-step analysis.

Concept
Stirling Numbers S(n,k)S(n,k) (2nd kind), n6n\le 6

Row sums give the Bell numbers.

Concept
Bell Numbers B0B_0--B6B_6

BnB_n counts all set partitions of an nn-set; Bn=k(n1k)BkB_n=\sum_{k}\binom{n-1}{k}B_k.