Chapter 7: Quick Revision Notes
Revision Cheat Sheet
1. Probability & Bayes
- Addition: P(A ∪ B) = P(A) + P(B) − P(A ∩ B)
- Conditional: P(A|B) = P(A ∩ B) / P(B)
- Chain rule: P(A,B,C) = P(A) P(B|A) P(C|A,B)
- Bayes: P(A|B) = P(B|A) P(A) / P(B)
- Total probability: P(B) = ∑i P(B|Ai) P(Ai)
- Independence: P(A ∩ B) = P(A) P(B)
- Cond. independence: P(A,B|C) = P(A|C) P(B|C)
2. Common Distributions
| Distribution | PMF/PDF | E[X] | Var(X) |
|---|---|---|---|
| Bernoulli(p) | px(1−p)1−x | p | p(1−p) |
| Binomial(n,p) | C(n,k)pk(1−p)n−k | np | np(1−p) |
| Poisson(λ) | e−λλk/k! | λ | λ |
| Uniform(a,b) | 1/(b−a) | (a+b)/2 | (b−a)2/12 |
| Normal(μ,σ2) | (2πσ2)−1/2 exp(…) | μ | σ2 |
| Exponential(λ) | λe−λx | 1/λ | 1/λ2 |
3. Bayesian Networks
- Joint: P(X1,…,Xn) = ∏ P(Xi | Parents(Xi))
- D-Separation: Chain/Fork — blocked when middle observed. Collider — blocked when NOT observed (or descendant not observed).
- Markov blanket: parents + children + co-parents
- Naive Bayes: C* = argmaxc P(c) ∏ P(xi|c)
- Laplace smoothing: (count + 1) / (total + |V|)
4. HMM Key Formulas
- Forward: αt+1(j) = [∑i αt(i) aij] bj(ot+1)
- Viterbi: δt+1(j) = maxi[δt(i) aij] bj(ot+1)
- Complexity: O(T · N2) for both
- Three problems: Evaluation (Forward), Decoding (Viterbi), Learning (Baum-Welch)
5. MDP Key Formulas
- Bellman optimality: V*(s) = maxa ∑s' T(s,a,s')[R(s,a,s') + γV*(s')]
- Value iteration: Update V until convergence
- Policy iteration: Evaluate → Improve → Repeat
6. Information Theory
- Entropy: H(X) = −∑ pi log2 pi
- Cross-entropy: H(P,Q) = −∑ P(x) log Q(x)
- KL divergence: DKL(P||Q) = ∑ P(x) log(P(x)/Q(x)). NOT symmetric.
- Mutual info: I(X;Y) = H(X) − H(X|Y)
- Info gain: IG(S,A) = H(S) − ∑ (|Sv|/|S|) H(Sv)
7. MLE & MAP
- MLE: θ̂ = argmax ∑ log P(xi|θ)
- Bernoulli MLE: p̂ = k/n
- Gaussian MLE: μ̂ = x̄, σ̂2 = (1/n)∑(xi−x̄)2
- MAP: θ̂ = argmax [log P(D|θ) + log P(θ)]
- Uniform prior ⇒ MAP = MLE