DSM-101 Probability & Statistics — full course recap, S1–S10 (Majumdar) + S11–S20 (Arshad)

discrete · single draw · prior continuous · sample mean · posterior

S1 · S2 — Majumdar

Why probability: inverse problems and two schools

Conceptual framing; not examined directly, but it's the vocabulary for everything after.

The inverse problem

forward problem
Model + parameters known → predict data. Easy ("two lines of Python" for a fair coin).
inverse problem
Data (effect) known → infer model/cause. Hard: different causes explain the same data.
a theory earns credibility
by surviving independent datasets across scales.

Three types of inverse problem

1 · hypothesis testing
Is a statement consistent with data? ("markets always crash")
2 · parameter estimation
What value does θ take? (TED spread threshold before 2008)
3 · model selection
Which of several fitting models? Hardest — needs the evidence term.

Where uncertainty comes from

  • Noise in the measurement
  • Intrinsic randomness (no two petals alike)
  • Designed randomness of complex systems (lottery drum)
  • Epistemic stance: causes unknown (age of universe ± error). Aleatory: games of chance, "40% rain tomorrow".
FrequentistBayesian
Probability isrelative frequency over an infinite ensemble of identical experimentsdegree of belief of an observer, given their information
Natureobjectivesubjective (observer-dependent, but grounded in data)
Outputa point value per parameter (best-fit $m, c$)a distribution (posterior) per parameter, with widths
One-off eventsbreaks down (needs hypothetical ensemble)fine (life on Mars, Drake equation)
New datarefit; estimate may jump (bias–variance)update; old posterior becomes new prior
PeopleBoole, Venn, Fisher, von MisesBayes, Laplace, Keynes, Jeffreys, Cox, Jaynes

Majumdar's pictures of the inverse problem:

  • Newton's apple: "gravity" and "magic" both explain one falling apple; only gravity survives the Earth–Sun, galaxy and cluster scales.
  • Tycho's Mars: naked-eye declination data (1582–1600) → Kepler's ellipses. Seeing ellipses in a wiggly plot is the hard part. Dots are data; a curve is a model or denser data — never just join the dots.
  • Hungry shopper: "empty stomach → more chips and Coke" is a bias until you survey hungry vs not-hungry buyers.
  • The ant and the finger: from limited data the ant infers a giant tooth; new data (squashed, or climbs over) forces an update — Bayes foreshadowed.

Why the Bayesian answer differs — "you always have more prior information than you think":

  • Supernova: 4 naked-eye supernovae in 10 centuries → frequentist 4/10 = 40%; see one in 1987 → 5/10 = 50%. Ignores who was looking up, population, industrialisation, night-sky darkness.
  • Bus No. 15: 3 buses in the last hour → "every 20 min". Bayesian: peaked at 20 but 15–25 possible, because you know about night schedules, jams, accidents ("latent observations").
  • Magician's coin / caveman and rain: same proposition, different information → different degrees of belief.
  • Straight-line fit: same model $y=mx+c$; frequentist gives best-fit $m,c$, Bayesian gives posteriors — like a standard ANN vs a Bayesian neural net.
  • History flip-flops: Pascal & Fermat (1654, a gambler's split-the-stakes question) built the calculus; Bernoulli's insufficient reason gives each of $n$ outcomes $1/n$ but can't update; Bayes supplied the update; Gauss gave least squares, Gaussian errors and the CLT.
  • Updating never ends, but it isn't a loop: Sun around Earth → ellipses → non-coplanar spirals; Newton → general relativity (GPS needs it). More data, sharper model.

S3 · S7 · S8 · S10 (2nd half) — Majumdar

Probability rules and Bayes' theorem

Write the conditional probability you want, expand it with Bayes, and never drop the prior.

The calculus of probability

bounds · sum rule
$0\le P\le1$, $\;\sum_i P(i)=1$, $\;\int P(x)\,dx=1$
product rule
$P(X,Y)=P(X\mid Y)P(Y)=P(Y\mid X)P(X)$
independent
$P(X,Y)=P(X)P(Y)$ — only then multiply marginals
mutually exclusive
$P(x_1\cup\dots\cup x_n)=\sum P(x_i)$

Total probability → Bayes

total probability
$P(E)=\sum_i P(E\mid A_i)P(A_i)$
Bayes (two hypotheses)
$$P(H\mid E)=\frac{P(E\mid H)P(H)}{P(E\mid H)P(H)+P(E\mid H^c)P(H^c)}$$
the maths is trivial
It's a rearranged product rule. Bayes' contribution was the interpretation: a way to update belief.

Inference form

$P(\theta\mid D,I,M)=\dfrac{P(D\mid\theta,I,M)\,P(\theta\mid I,M)}{P(D\mid I,M)}$
posterior
belief about θ after the data — what you want
likelihood
P(data | θ); product over independent data points only (apples from different, randomly chosen trees)
prior
everything known before the experiment
evidence
$\int P(D\mid\theta)P(\theta)\,d\theta$ — all ways the data could arise

Working rules

  • Posterior ∝ likelihood × prior for estimation and testing. Need the evidence only for model selection.
  • θ is meaningless without its model $M$; I and M are always silently conditioned on.
  • Flat prior $P(\theta)=$ const when you know nothing.

Updating

$P(\theta\mid D_1,D_2)\propto P(D_2\mid\theta)\,P(\theta\mid D_1)$
Yesterday's posterior is today's prior. Old data is never thrown away (needs $D_1, D_2$ independent).
prior-sensitivity test
If a different reasonable prior changes the answer a lot → you need more data.

Traps

  • $P(C\mid G)+P(C\mid G^c)\ne1$ in general. Only $P(C\mid G)+P(C^c\mid G)=1$.
  • Dropping implicit conditioning ("you chose door $a$", "a theft did happen").
  • Rule 1: write down exactly what you want to know. "There are no rules for $n>1$."

The prior is what intuition forgets (Majumdar, S7–S8, S10):

  • Steve, shy and tidy (Kahneman & Tversky): "librarian" feels right, but farmers outnumber librarians 20:1 → only 16.7% librarian. Our brains evolved for reflex "thinking fast" and skip the base rate.
  • Repeat offenders: even with a 50% re-offence rate, 80% of new crimes come from people with no record. Ignoring the prior → biased action → social disorder.
  • COVID testing: a "99% effective" test with 1% false positives at 0.5% prevalence is right only 1 in 3 times — hence rapid test, then a slow low-FPR confirmation.
  • MCQ exams: with 5 options, a correct answer means 5/6 "knew it" — why objective exams are trustworthy.
Base-rate calculator (two hypotheses)

Pick a lecture problem or drag the sliders. The bar shows 10,000 people split by truth, then by evidence.

prior P(H)
P(E | H)
P(E | not H)
Everyone (10,000) — H true vs H false
Only those showing the evidence E — H true & E vs H false & E

WORKED EXAMPLES

Urn: 3 black + 1 white, draw two without replacement. P(black then white)? P(white then black)?S3
  1. Draws are dependent → product rule, not marginals.
  2. $P(B)=\tfrac34$, then 3 left with 1 white: $P(W\mid B)=\tfrac13$ → $\tfrac34\cdot\tfrac13=\tfrac14$.
  3. $P(W)=\tfrac14$, then all 3 left are black: $\tfrac14\cdot\tfrac33=\tfrac14$.

both = 1/4 ("I care how you got it, not the number")

Monty Hall: you pick door $a$; Monty (who knows where the car is) opens $b$, junk. Stick or switch?S8
  1. Want $P(a\mid B)$, $B$ = "door $b$ opened, junk". Priors $P(a)=P(b)=P(c)=\tfrac13$.
  2. $P(B\mid a)=\tfrac12$ (Monty picks $b$ or $c$ at random). $P(B\mid b)=0$ (can't reveal the car). $P(B\mid c)=1$ (can't open $a$ or $c$ → forced).
  3. Evidence $P(B)=\tfrac12\cdot\tfrac13+0+1\cdot\tfrac13=\tfrac12$.
  4. $P(a\mid B)=\dfrac{\frac12\cdot\frac13}{\frac12}=\tfrac13$. The asymmetry $\tfrac12$ vs $1$ is the whole trick.

stick 1/3 · switch 2/3 (1000-run simulation in class: 34% vs 68%)

Barrister: only 1 in 2,500 lodger-thieves steal cheese ($P(S\mid T)=0.0004$), so "ignore his record". Background theft rate 1/20,000. P(he did it)?S8
  1. The defence dropped the fact that the cheese was stolen ($C$). Want $P(S\mid C,T)$.
  2. $P(C\mid S,T)=1$; $P(S\mid T)=0.0004$; $P(\tilde S\mid T)=0.9996$; $P(C\mid\tilde S,T)=1/20000$.
  3. $\dfrac{1\times0.0004}{0.0004+0.9996/20000}=\dfrac{0.0004}{0.00045}$

≈ 0.889 — not 0.0004

Practice: 2% of parts are defective. An inspector flags 95% of defective parts and 3% of good ones. A part is flagged — P(defective)?practice
  1. $H$ = defective, $P(H)=0.02$; $P(E\mid H)=0.95$; $P(E\mid H^c)=0.03$.
  2. $\dfrac{0.95\cdot0.02}{0.95\cdot0.02+0.03\cdot0.98}=\dfrac{0.019}{0.0484}$

≈ 0.393 — most flags are false alarms (base rate again)

Practice: Box A has 3 red + 1 blue, Box B has 1 red + 3 blue. Pick a box at random, draw one ball: red. P(Box A)?practice
  1. Prior $\tfrac12$ each; likelihoods $P(R\mid A)=\tfrac34$, $P(R\mid B)=\tfrac14$.
  2. $\dfrac{\frac34\cdot\frac12}{\frac34\cdot\frac12+\frac14\cdot\frac12}$

3/4

S3 (end) · S4 · S5 (1st half) — Majumdar

Samples, histograms and density

We only ever hold a finite sample; statistics compress it and estimate the population.

Population vs sample

population
infinite, holds the truth; never accessible
sample
finite $n$ draws; gives estimates (finite sums), not calculations (integrals)
statistic
any summary of a finite sample, no model assumed: mean, variance, skewness, kurtosis, correlation

Histogram → PDF

  • Equal-width bins; height = count in the bin ∝ probability density.
  • Smooth the bin tops → approximate PDF ("a poor person's PDF").
  • Hard edges, empty bins; converges to the true PDF as $n$ grows.
  • Try several bin widths — the apparent shape changes.

Density, joint, marginal

density
probability mass per unit length/area/volume, e.g. $\dfrac{dB}{dH\,dW}$
"average density"
$=1/V$ — meaningless; only local density informs
marginalise
$P(X)=\int P(X,Y)\,dY$ — integrate out what you don't want
joint needed when
the observable depends on several variables (BMI from $h,w$)

How many samples are enough?

  • Plot the running estimate (mean, variance) against $n$; enough when it plateaus.
  • Coin: 102 flips → 0.49/0.51. Die: running mean settles near $3.5$ by ~100 rolls.
  • Cards 1–10: true variance $\frac{10^2-1}{12}=8.25$ (quoted ≈8.5 in class); simulation 8.32 at ~300 draws.
  • Few outcomes → hundreds suffice; high-dimensional → far more.

Always quote the error

  • Continuous values are never exact: a 1 cm tape → $\pm1$ cm.
  • Report $m\pm\Delta m$, $c\pm\Delta c$ — clients can't judge a strategy without it.
  • For continuous $X$: $P(X=a)=0$; ask for $P(a\le X\le a+dx)$ instead.

Majumdar's pictures:

  • Five points, eight numbers: joining 5 points with 4 segments needs 8 parameters (no compression); one fitted line needs 2. A client with a million Netflix users wants the trend, not the scatter.
  • Bins are boxes: sort every number from a bag into its box, then count.
  • Mountainous cake: $P(h,w)$ is a 3-D mountain drawn as contours; cutting a slab out of it is a joint probability.
  • More dead than living: the "true" BMI population would need everyone who ever lived — the population is effectively infinite.
  • LLM training set = a finite sample; a good one represents the underlying distribution. Insurance premiums and sample surveys (when the census is late) hinge on sampling strategy.

S11 · S12 (10 Sep) · S13 (1st half) · S15 doubt session — Arshad

Random variables: PMF, PDF, CDF and transformations

Read a CDF, classify the variable, recover the PMF/PDF, find unknown constants, transform.

Definitions

random variable
$X:\Omega\to\mathbb{R}$; support $S=X(\Omega)$
PMF (discrete)
$p(x)\ge0$, $\sum_{S}p(x)=1$ — values are probabilities
PDF (continuous)
$f\ge0$, $\int f=1$ — not a probability; can exceed 1 ($f=2$ on $(0,\tfrac12)$)
link
$F(x)=\int_{-\infty}^x f(t)\,dt$, $\;f=F'$ (ignore finitely many kinks; set 0 there)

CDF $F(x)=P(X\le x)$

  • Defined on all of ℝ: write it piecewise, never as a 3-column table.
  • Valid CDF ⇔ (1) non-decreasing, (2) right-continuous $F(a)=F(a^+)$, (3) $F(-\infty)=0$, $F(\infty)=1$.
  • Unknown $k$: impose right-continuity for candidates, then non-decreasing to reject the wrong root.
  • $P(a<X\le b)=F(b)-F(a)$.

Jumps classify $X$

jump size = point mass
$P(X=a)=F(a)-F(a^-)$, $\;F(a^-)=\lim_{h\to0}F(a-h)$
Σ jumps = 1
discrete
no jumps
continuous: $P(X=a)=0$, so $<$ vs $\le$ doesn't matter
0 < Σ jumps < 1
mixed (rest spread over an interval)

Transform a discrete $X$: $Y=g(X)$

  • Find $S_Y$ first. $Y$ is always discrete.
  • One-one on $S_X$: $P(Y=y)=p_X(g^{-1}(y))$.
  • Not one-one: add all pre-images, $P(Y=y)=\sum_{g(x)=y}p_X(x)$ (pre-images outside $S_X$ give 0).
  • One-one is judged on $S_X$: $x^2$ is one-one on $\{0,1,2\}$.

Transform a continuous $X$

CDF technique (any $g$)
$F_Y(y)=P(g(X)\le y)$ case by case → check continuity of $F_Y$ ($Y$ may be continuous, discrete or mixed) → differentiate.
Jacobian (g one-one on $S_X$)
$f_Y(y)=f_X(g^{-1}(y))\left|\dfrac{d}{dy}g^{-1}(y)\right|$
convention
densities with strict inequalities; CDFs in right-continuous form

Arshad's framing: counting → discrete (accidents, items); measuring → continuous (speed, blood pressure, sugar level). Uncountably many points can't each carry positive probability, or the total would be infinite — so continuous variables get probability only on intervals. Transformations exist because we record weight but want BMI.

WORKED EXAMPLES

$F(x)=0\ (x<1),\ \tfrac12\ (1\le x<5),\ \tfrac34\ (5\le x<9),\ 1\ (x\ge9)$. PMF? Type?S11
  1. Jumps at 1, 5, 9: $\tfrac12-0$, $\tfrac34-\tfrac12$, $1-\tfrac34$.
  2. Sum $=1$ → discrete.

P(1)=1/2, P(5)=1/4, P(9)=1/4 · discrete

$F(x)=0\ (x<1),\ \frac{x-1}{2}\ (1\le x<2),\ 1\ (x\ge2)$. Type?S11
  1. At 1: $F(1^-)=F(1)=F(1^+)=0$ → no jump.
  2. At 2: $F(2^-)=\lim\frac{(2-h)-1}{2}=\tfrac12$, $F(2)=1$ → jump $\tfrac12$.
  3. Σ jumps $=\tfrac12$, strictly between 0 and 1.

mixed: P(X=2)=1/2, other 1/2 spread over [1,2)

$F(x)=0,\ \frac{x^2}{2}\ [0,1),\ \frac{x}{2}\ [1,2),\ 1\ (x\ge2)$. PDF and $P(\tfrac12<X<\tfrac32)$?S12 · 10 Sep
  1. Continuous everywhere (values match at 0, 1, 2) → continuous type.
  2. Differentiate: $f=x$ on $(0,1)$, $\tfrac12$ on $(1,2)$, 0 otherwise. (PDF jumps; CDF doesn't — that's allowed.)
  3. Integrate: $\int_{1/2}^1x\,dx+\int_1^{3/2}\tfrac12\,dx=\tfrac38+\tfrac14$.
  4. Or CDF difference: $F(\tfrac32)-F(\tfrac12)=\tfrac34-\tfrac18$.

5/8 both ways

$f(x)=k-|x|$ for $|x|<\tfrac12$. Find $k$.S12 · 10 Sep
  1. $\int_{-1/2}^{1/2}k\,dx=k$; $\int_{-1/2}^{1/2}|x|\,dx=2\int_0^{1/2}x\,dx=\tfrac14$ (even function).
  2. $k-\tfrac14=1$.

k = 5/4

Find $k$: branches $\tfrac23$ on $[2,5)$, $\frac{7-6k}{6}$ on $[5,9)$, …, $\frac{16k^2-16k+19}{16}$ on $[14,20]$, 1 after.Module 1 Ex 2.8 · S15
  1. No jump allowed at 20 (already 1 after): $\frac{16k^2-16k+19}{16}=1$ → $16k^2-16k+3=0$ → $k=\tfrac14$ or $\tfrac34$.
  2. Non-decreasing at 5: $\tfrac23\le\frac{7-6k}{6}$ → $k\le\tfrac12$. Reject $\tfrac34$.
  3. Lesson: one property alone leaves a wrong candidate — check all three.

k = 1/4

$p_X=\tfrac17$ on $\{-2,-1,0,1\}$, $\tfrac3{14}$ on $\{2,3\}$. PMF of $Y=X^2$?S12 · 10 Sep
  1. $S_Y=\{0,1,4,9\}$ — 6 points → 4, so not one-one.
  2. $P(Y=1)=P(-1)+P(1)=\tfrac27$; $P(Y=4)=\tfrac17+\tfrac3{14}=\tfrac5{14}$; $P(Y=9)=0+\tfrac3{14}$ ($-3\notin S_X$).

0: 1/7 · 1: 2/7 · 4: 5/14 · 9: 3/14 (sums to 1)

$X\sim U(-1,1)$, $Y=X^2$ (CDF technique) and $f_X=e^{-x}$, $x>0$, $Y=X^2$ (Jacobian).S13
  1. Uniform: $F_Y(y)=P(-\sqrt y\le X\le\sqrt y)=\tfrac12\cdot2\sqrt y=\sqrt y$ on $[0,1)$; continuous → $f_Y=\frac1{2\sqrt y}$, $0<y<1$.
  2. Exponential: $x^2$ is one-one on $(0,\infty)$; $x=\sqrt y$, $\frac{dx}{dy}=\frac1{2\sqrt y}$.
  3. $f_Y=e^{-\sqrt y}\cdot\frac1{2\sqrt y}$, $y>0$.

1/(2√y) on (0,1) · e^(−√y)/(2√y) on (0,∞)

Practice: $F(x)=0\ (x<0),\ \frac{x^2}{4}\ (0\le x<2),\ 1\ (x\ge2)$. PDF and $P(0.5<X<1.5)$?practice
  1. Continuous (0 at 0, 1 at 2). $f(x)=\frac x2$ on $(0,2)$.
  2. $F(1.5)-F(0.5)=\frac{2.25-0.25}{4}$.

f = x/2 on (0,2) · P = 0.5

Practice: $F(x)=0\ (x<0),\ \frac{x+1}{4}\ (0\le x<1),\ 1\ (x\ge1)$. Type? $P(X=1)$?practice
  1. Jump at 0: $\tfrac14-0=\tfrac14$. Jump at 1: $1-\tfrac24=\tfrac12$.
  2. Σ jumps $=\tfrac34$, between 0 and 1.

mixed · P(X=1) = 1/2

Practice: $f(x)=kx(1-x)$ on $(0,1)$. Find $k$; PMF of $Y=X^2$ if instead $p_X$: $-1{:}\,0.2,\ 0{:}\,0.3,\ 1{:}\,0.1,\ 2{:}\,0.4$.practice
  1. $k\int_0^1(x-x^2)\,dx=k(\tfrac12-\tfrac13)=\tfrac k6=1$.
  2. $Y$: $P(0)=0.3$, $P(1)=0.2+0.1$, $P(4)=0.4$.

k = 6 · Y: 0→0.3, 1→0.3, 4→0.4

S4 (moments, Majumdar) · S13 (2nd half) · S14 (1st half) — Arshad

Expectation, moments and the MGF

Check the mean exists, get moments from the MGF, and identify a distribution by its MGF.

Expectation

$E(X)$
$\sum x\,p(x)$ or $\int x\,f(x)\,dx$
exists only if
$E|X|<\infty$ — check first (modulus on $x$, never on $f$)
$E[g(X)]$
$\sum g(x)p(x)$ — swap $x$ for $g(x)$, keep the density
Gamma shortcut
$\int_0^\infty x^{\alpha-1}e^{-x}dx=\Gamma(\alpha)=(\alpha-1)!$
odd / even
odd over symmetric range → 0; even → 2× half

Moments

raw (about 0)
$\mu_r'=E(X^r)$; $\mu_1'$ = mean
central (about mean)
$\mu_r=E[(X-\mu_1')^r]$; $\mu_1=0$ always
variance
$\mu_2=\mu_2'-(\mu_1')^2=E[X^2]-(E X)^2$; $=0$ ⇔ degenerate
skewness
$\gamma_1=\mu_3/\mu_2^{3/2}$ — keeps the sign
kurtosis
$\beta_2=\mu_4/\mu_2^2$, $\gamma_2=\beta_2-3$ (normal: $\beta_2=3$)

Reading $\gamma_1$ and $\gamma_2$

  • $\gamma_1>0$: long right tail (positive skew). $\gamma_1<0$: long left tail. $=0$: symmetric.
  • $\beta_1=\mu_3^2/\mu_2^3\ge0$ loses the sign — prefer $\gamma_1$.
  • $\gamma_2>0$ leptokurtic (more peaked), $=0$ mesokurtic, $<0$ platykurtic.
  • Unit-free: cm → m scales $\mu_3$ by $10^{-6}$; ratios cancel it.

Caution: in the S13 lecture $\mu_3>0$ was called "left-skewed". The standard convention (and the one textbooks use) is that positive skew means the tail points right. Go by the sign.

Moment generating function

$M_X(t)=E[e^{tX}]$
must exist on some $|t|<h$ — the interval must contain 0; $M(0)=1$
$\mu_k'=M^{(k)}(0)$
differentiate $k$ times, set $t=0$
or series
$\mu_k'$ = coefficient of $\frac{t^k}{k!}$ in $M_X(t)$

Uniqueness

  • Same MGF ⇒ same distribution. Recognise $M$ → name the distribution → read off the mean/variance.
  • $X\overset{d}{=}Y$ means $F_X=F_Y$ everywhere — not $X=Y$. Heads vs tails in 2 fair tosses: same PMF, but $Y=2-X$.
  • Memorise each PMF/PDF + MGF; derive the rest (Arshad).

Moments are the minimum set of numbers that pin down a distribution (Majumdar). A Gaussian needs only $(\mu,\sigma)$ — only $\sigma$ once centred; every other shape is a "distortion of the Gaussian" measured by skewness, kurtosis and higher moments. Arshad on kurtosis: calling someone "tall" needs a reference, and the normal curve is that reference.

WORKED EXAMPLES

$p(x)=\frac{3}{\pi^2x^2}$, $x=\pm1,\pm2,\dots$ Does $E(X)$ exist?S13
  1. $E|X|=2\sum_{x\ge1}x\cdot\frac{3}{\pi^2x^2}=\frac6{\pi^2}\sum\frac1x$.
  2. Harmonic series ($p$-series, $p=1$) diverges.

E|X| = ∞ → no mean (even though the PMF is symmetric)

$f(x)=\tfrac12e^{-|x|}$ on ℝ. Does $E(X)$ exist? Value?S13
  1. $E|X|=2\int_0^\infty x\tfrac12e^{-x}dx=\Gamma(2)=1<\infty$ → exists.
  2. $x e^{-|x|}$ is odd over a symmetric range.

E(X) = 0

Binomial MGF, mean and variance from $p(x)=\binom nx p^x(1-p)^{n-x}$.S14
  1. $M=\sum\binom nx(pe^t)^x(1-p)^{n-x}=(pe^t+1-p)^n$ (binomial theorem), $t\in\mathbb R$.
  2. $M'(0)=n(p+1-p)^{n-1}p=np$.
  3. $M''(0)=np[(n-1)p+1]$ → Var $=n(n-1)p^2+np-n^2p^2$.

E = np · Var = np(1−p)

$M_X(t)=e^{5t+8t^2}$ and $M_X(t)=e^{e^t-1}$. Identify.S17 · S14
  1. Normal MGF $e^{\mu t+\frac12\sigma^2t^2}$: $\mu=5$, $\tfrac12\sigma^2=8$.
  2. Poisson MGF $e^{\lambda(e^t-1)}$: $\lambda=1$.

N(5, 16) · Poisson(1)

Practice: $M_X(t)=(0.3e^t+0.7)^{10}$ and $M_Y(t)=e^{4(e^t-1)}$. Name them; mean, variance; $P(Y=0)$.practice
  1. $X\sim\text{Bin}(10,0.3)$: $np=3$, $npq=2.1$.
  2. $Y\sim\text{Poisson}(4)$: mean = var = 4; $P(Y=0)=e^{-4}$.

Bin(10,.3): 3, 2.1 · Poisson(4): 4, 4 · P(Y=0) ≈ 0.0183

Practice: $f(x)=2x$ on $(0,1)$. Mean and variance.practice
  1. $E X=\int_0^12x^2dx=\tfrac23$; $E X^2=\int_0^12x^3dx=\tfrac12$.
  2. Var $=\tfrac12-\tfrac49$.

2/3 · 1/18 ≈ 0.0556

S5 (2nd half) · S6 (Majumdar) · S14 (2nd half) · S15 · S16 (1st half) — Arshad

Standard distributions

Pick the model from the situation, then use its PMF/PDF and MGF (with its domain).

DistributionSupport · PMF / PDFMGF (domain)Mean · VarUse when
Bernoulli$(p)$$\{0,1\}$ · $p^x(1-p)^{1-x}$$1-p+pe^t$, all $t$$p$ · $pq$one yes/no trial = Bin(1,p)
Binomial$(n,p)$$0..n$ · $\binom nx p^xq^{n-x}$$(pe^t+q)^n$, all $t$$np$ · $npq$# successes in $n$ independent identical trials; $n$ moderate
Poisson$(\lambda)$$0,1,2,\dots$ · $\dfrac{e^{-\lambda}\lambda^x}{x!}$$e^{\lambda(e^t-1)}$, all $t$$\lambda$ · $\lambda$rare events, huge $n$: accidents, calls, ER patients. Over time $t$: use $\lambda t$
Geometric$0,1,\dots$ · $q^xp$ (failures before 1st success)$\dfrac{p}{1-qe^t}$, $t<-\ln q$$q/p$ · $q/p^2$attempts until first success; memoryless
↳ trials$1,2,\dots$ · $pq^{y-1}$, $\;Y=X+1$$\dfrac{pe^t}{1-qe^t}$, $t<-\ln q$$1/p$ · $q/p^2$counts the successful trial too: mean shifts by 1, variance doesn't (S15)
Uniform$(a,b)$$(a,b)$ · $\dfrac1{b-a}$$\dfrac{e^{bt}-e^{at}}{t(b-a)}$, $t\ne0$; $M(0)=1$$\frac{a+b}2$ · $\frac{(b-a)^2}{12}$simulation; probabilities are rectangle areas $\frac{d-c}{b-a}$
↳ $U(0,1)$$(0,1)$ · $1$, $\;F(x)=x$$\dfrac{e^t-1}{t}$, $t\ne0$$\frac12$ · $\frac1{12}$standard uniform, $a=0,b=1$; the input to the probability integral transform
Exponential$(\lambda)$$(0,\infty)$ · $\lambda e^{-\lambda x}$$\dfrac{\lambda}{\lambda-t}$, $t<\lambda$$1/\lambda$ · $1/\lambda^2$lifetimes / waiting times; $F=1-e^{-\lambda x}$; Var = mean². Course uses this rate form.
↳ $\theta=1/\lambda$$(0,\infty)$ · $\dfrac1\theta e^{-x/\theta}$$\dfrac1{1-\theta t}$, $t<1/\theta$$\theta$ · $\theta^2$mean form: same distribution, textbook parameter; check which one a question uses (S16)
↳ Laplaceℝ · $\tfrac12e^{-|x|}$$\dfrac1{1-t^2}$, $|t|<1$$0$ · $2$double exponential: two-sided version of the exponential; odd-function trick gives $E X=0$, and $E|X|=\Gamma(2)=1$ (S13)
Gamma$(\alpha,\lambda)$
beyond notes
$(0,\infty)$ · $\dfrac{\lambda^\alpha x^{\alpha-1}e^{-\lambda x}}{\Gamma(\alpha)}$$\left(\dfrac{\lambda}{\lambda-t}\right)^{\alpha}$, $t<\lambda$$\alpha/\lambda$ · $\alpha/\lambda^2$waiting time to the $\alpha$-th event; sum of $\alpha$ independent Exp$(\lambda)$. $\Gamma(\alpha)=(\alpha-1)!$, $\Gamma(\tfrac12)=\sqrt\pi$
↳ special cases$\alpha=1$: Exp$(\lambda)$ · $\alpha=2,\lambda=1$: MGF $(1-t)^{-2}$, the $Y$ marginal in S20 · scale form $\theta=1/\lambda$: $\dfrac{x^{\alpha-1}e^{-x/\theta}}{\Gamma(\alpha)\theta^\alpha}$, mean $\alpha\theta$ · $\chi^2_k=$ Gamma$(\tfrac k2,\tfrac12)$
Beta$(\alpha,\beta)$
beyond notes
$(0,1)$ · $\dfrac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}$, $\;B=\dfrac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}$no closed form (not used)$\dfrac{\alpha}{\alpha+\beta}$ · $\dfrac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}$proportions and probabilities on $(0,1)$; the usual Bayesian prior for a coin's $p$
↳ special cases$\alpha=\beta=1$: $U(0,1)$ (the flat parent in the Seeing Theory CLT demo, S9) · $\alpha=\beta$: symmetric about $\tfrac12$ · $\alpha<\beta$: mass near 0, right-skewed
Normal$(\mu,\sigma^2)$ℝ · $\dfrac{1}{\sigma\sqrt{2\pi}}e^{-\frac12(\frac{x-\mu}\sigma)^2}$$e^{\mu t+\frac12\sigma^2t^2}$, all $t$$\mu$ · $\sigma^2$measurements, sums of many influences (CLT); see module 7
↳ $N(0,1)$ℝ · $\dfrac1{\sqrt{2\pi}}e^{-z^2/2}$, $\;Z=\dfrac{X-\mu}\sigma$$e^{t^2/2}$, all $t$$0$ · $1$standard normal: parameter-free, so one table serves all; $\Phi(-z)=1-\Phi(z)$

Family links: Bernoulli = Bin$(1,p)$ · sum of $n$ Bernoullis = Bin$(n,p)$ · Bin → Poisson ($np=\lambda$) → Normal · Exp = Gamma$(1,\lambda)$ · sum of $\alpha$ Exps = Gamma$(\alpha,\lambda)$ · $U(0,1)$ = Beta$(1,1)$. Rows tagged beyond notes aren't in the lecture notes (sessions 13, 16 and 17 have no notes); they're standard results, added on request.

The limit chain

Binomial → Poisson
$n\to\infty$, $p\to0$, $np=\lambda$ finite ($x\ll n$)
Poisson → Normal
also $\lambda\gg1$, look near the mean, and treat the variable as continuous
Poisson error bar
var = mean, so a count $n$ is quoted $n\pm\sqrt n$ (5 accidents/h → $5\pm\sqrt5$)

Shapes

  • Binomial $\gamma_1=\frac{q-p}{\sqrt{npq}}$: $p<\tfrac12$ right-tailed, $p=\tfrac12$ symmetric.
  • Binomial $\gamma_2=\frac{1-6pq}{npq}$: leptokurtic for $p<0.2113$ or $p>0.7887$, platykurtic between.
  • Poisson: small λ piles at 0; larger λ → symmetric.
  • Exponential: $\gamma_1=2$, $\gamma_2=6$. Uniform: symmetric, platykurtic, $\mu_4=\frac{(b-a)^4}{80}$.
  • Gamma: $\gamma_1=\frac2{\sqrt\alpha}$, $\gamma_2=\frac6\alpha$, so exponential's 2 and 6 at $\alpha=1$, heading to normal as $\alpha$ grows.

Memoryless + simulation

geometric
$P(X\ge a)=q^a$; $P(X\ge k+t\mid X\ge k)=q^t=P(X\ge t)$
exponential
$P(X>d+x\mid X>d)=e^{-\lambda x}=P(X>x)$
only ones
geometric (discrete) and exponential (continuous)
prob. integral transform
$F_X(X)\sim U(0,1)$ → simulate $x_i=F^{-1}(u_i)$

Pictures from the lectures:

  • Binomial as "mother of all distributions" (Majumdar): Poisson and Gaussian are its limits. $(P_H+P_T)^2$ expanded gives HH, 2·HT, TT — the coefficients are the statistical weights.
  • Highway: 1000 cars/hour, a handful of breakdowns — a well-designed road makes accidents rare, which is exactly Poisson. More accidents than expected on one stretch → suspect the design (the null hypothesis rejected).
  • Telescope photons: catching a photon from one faint galaxy is a rare success → Poisson counts come with their own $\sqrt n$ error.
  • Loan-company calls (Arshad): keep calling until yes; at $p=1/8$ expect 8 calls. Memoryless: after 3 refusals, the next call is as good as the first.
  • Exponential lifetime: "the system forgets its age" — a used bulb is as good as new.
Binomial → Poisson → Normal

Bars: Bin(n,p). Hollow dots: Poisson(np). Curve: Normal(np, npq). Small p → Poisson wins; large npq → Normal wins.

n (trials)
p (success)

WORKED EXAMPLES

Call centre: 6 calls/minute. Distribution of calls in the next 10 minutes?S14
  1. Align the rate with the window: $\lambda t=6\times10=60$.
  2. $P(X=x)=\dfrac{e^{-60}60^x}{x!}$, e.g. $P(X=50)=\dfrac{e^{-60}60^{50}}{50!}$.

Poisson(60), not Poisson(6)

Simulate from $F(x)=1-e^{-x}$ using $u=0.1,\dots,0.5$.S15
  1. Set $u=1-e^{-x}$ → $x=-\ln(1-u)$.
  2. Plug in each $u$.

0.1054, 0.2231, 0.3567, 0.5108, 0.6931

Geometric memoryless proof in one line.S15
  1. $P(X\ge a)=\sum_{x\ge a}q^xp=p\cdot\frac{q^a}{1-q}=q^a$.
  2. $\{X\ge k+t\}\subseteq\{X\ge k\}$, so $P(X\ge k+t\mid X\ge k)=\frac{q^{k+t}}{q^k}=q^t$.

= P(X ≥ t), independent of k

Practice: server errors arrive at 2 per hour (Poisson). P(no errors in 3 hours)? P(at most 1)?practice
  1. $\lambda t=6$. $P(0)=e^{-6}$.
  2. $P(\le1)=e^{-6}(1+6)$.

≈ 0.00248 · ≈ 0.0174

Practice: a salesperson converts 20% of calls. Expected calls to first sale? P(at least 4 failures before the first sale)? Same, given 5 failures already?practice
  1. Trials to first success: $1/p=5$.
  2. $P(X\ge4)=q^4=0.8^4$.
  3. Memoryless: $P(X\ge9\mid X\ge5)=q^4$ again.

5 · 0.4096 · 0.4096

Practice: bulb lifetime is exponential with mean 500 h. P(lasts > 300 h)? Given it has lasted 1000 h?practice
  1. $\lambda=1/500$; $P(X>300)=e^{-300/500}$.
  2. Memoryless: same answer.

e^(−0.6) ≈ 0.549 both times

Practice: $X\sim\text{Bin}(10,0.3)$. $P(X=2)$? Skewness sign?practice
  1. $\binom{10}{2}(0.3)^2(0.7)^8=45\times0.09\times0.05765$.
  2. $p<\tfrac12$ → $\gamma_1>0$.

≈ 0.2335 · positively skewed (right tail)

S6 (end) · S9 · S10 (1st half) — Majumdar · S16 (2nd half) · S17 (1st half) — Arshad

Normal distribution, CLT and sampling distributions

Standardise, use Φ, and first ask: is this one value, a mean of $n$, or a sum of $n$?

Normal toolkit

standardise
$Z=\dfrac{X-\mu}{\sigma}\sim N(0,1)$
interval
$P(a\le X\le b)=\Phi\!\left(\frac{b-\mu}\sigma\right)-\Phi\!\left(\frac{a-\mu}\sigma\right)$
symmetry
$\Phi(0)=\tfrac12$, $\;\Phi(-z)=1-\Phi(z)$ — one table side is enough
no closed-form CDF
hence tables; read them backwards too ($\Phi(z)=0.75$ → $z\approx0.675$ by interpolation)

Area rule

$\mu\pm1\sigma$
68.27% (34.1% each side)
$\mu\pm2\sigma$
95.45% (+13.6% each side)
$\mu\pm3\sigma$
99.73% — only ~27 in 10,000 fall outside
moments
odd central = 0; $\mu_4=3\sigma^4$; $\mu_{2n}=1\cdot3\cdots(2n-1)\sigma^{2n}$

Central Limit Theorem

  • Sum/mean of many i.i.d. draws from any parent with finite variance → Gaussian. Infinite variance ("pathological") → no CLT.
  • Sample size 1 = no summing = no CLT (you just get the parent back).
  • Bigger sample size → narrower and faster; skewed parents converge slower.
  • Learn the implications; the derivation isn't examined.
You're asked about…CentreSpreadStandardiseLecture case
one value $X$$\mu$$\sigma$$\frac{x-\mu}{\sigma}$one teacher < $50,000 → 0.386
mean $\bar X$ of $n$$\mu$$\sigma/\sqrt n$ (standard error)$\frac{\bar x-\mu}{\sigma/\sqrt n}$mean of 100 teachers → 0.0019
sum $\sum X_i$ of $n$$n\mu$$\sqrt n\,\sigma$$\frac{y-n\mu}{\sigma\sqrt n}$50 customers in 90–110 min → 0.8427
$\sum a_iX_i$ (independent normals)$\sum a_i\mu_i$variance $\sum a_i^2\sigma_i^2$exact, no CLT needed$X_1-X_2$: means subtract, variances add

Sample statistics

$\bar X_n=\frac1n\sum X_i\sim N(\mu,\sigma^2/n)$
exact for normal data (MGF proof with $a_i=1/n$); approximate otherwise (CLT)
$S^2=\frac{1}{n-1}\sum(X_i-\bar X)^2$
$n-1$ makes it unbiased; $1/n$ is biased

Rarity of a result

  • Where does the new value sit in the tail? Beyond ~3σ → probably not from the same distribution.
  • Accidents: $\mu=100$, $\sigma=5$ → normal band 85–115; a day with 200 is 20σ out → something changed (the road was rebuilt).
  • Null hypothesis: start from the negation ("no force pulls the apple", "obesity isn't linked to processed food", "accidents here are rare"). A strong violation rejects it — your theory becomes credible, not proven.
  • No standard sample size exists — always quote the mean and its spread.

Why Gaussians are everywhere (Majumdar, S9–S10):

  • Everything is a sum: height (genes + food + …), ocean waves, a shopper's basket (hungry? payday?), Sensex ticks — each is many random influences added up.
  • Convolution proof: slide one box across another and record the overlap → a triangle; triangle ∗ box → a bell; keep going → a Gaussian. It's the same smoothing your phone camera applies, and why early AI images looked too smooth.
  • Accurate vs certain: 10 samples can hit the true mean by luck, but only large $n$ shrinks the $\sigma/\sqrt n$ band enough to be confident.
One value vs mean of n vs sum of n

n
CLT sampler

Each draw averages sample size values from the parent (faint amber) and adds one mean to the histogram. Teal = CLT prediction N(μ, σ²/n).

sample size n

WORKED EXAMPLES

Teacher salaries: normal, mean $52,174, SD $7,500. (a) P(one teacher < $50,000)? (b) P(mean of 100 < $50,000)? (c) Why different?S9 · S10
  1. (a) $z=\frac{50000-52174}{7500}=-0.290$ → $\Phi(-0.29)$.
  2. (b) $\sigma_{\bar X}=7500/\sqrt{100}=750$; $z=-2174/750=-2.90$ → $\Phi(-2.90)$.
  3. (c) Two different distributions: the same cutoff is 0.29σ away for one teacher but 2.9σ away for the mean of 100.

(a) ≈ 0.386 · (b) ≈ 0.0019

Bank teller: service time mean 2 min, SD 1, independent. P(50 customers take 90–110 min)?S10
  1. Sum: mean $50\times2=100$, SD $\sqrt{50}\times1$.
  2. $z=\pm10/\sqrt{50}=\pm\sqrt2=\pm1.414$.
  3. $\Phi(1.414)-\Phi(-1.414)$.

≈ 0.8427

$X\sim N(3,4)$. $P(0<X<3)$?S16
  1. $\sigma=2$: $P\!\left(\frac{0-3}{2}<Z<0\right)=\Phi(0)-\Phi(-1.5)$.
  2. $0.5-0.0668$.

≈ 0.4332

Recover parameters: (i) $N(\mu,1)$ with $P(X\le2)=\tfrac12$; (ii) $P(X\le4)=\tfrac12$ and $P(X\ge4)=\tfrac12$; (iii) $P(X\le4)=\tfrac12$ and $P(X\ge4)=\tfrac14$.S17
  1. (i) $\Phi(2-\mu)=\Phi(0)$ and Φ is monotone → $\mu=2$.
  2. (ii) Both give $\frac{4-\mu}{\sigma}=0$ → $\mu=4$, σ undetermined (redundant conditions).
  3. (iii) Second needs $\frac{4-\mu}{\sigma}\approx0.675$; first needs $0$ → σ = 0, degenerate → inconsistent.

μ=2 · μ=4, σ free · no valid normal

$X\sim N(0,1)$, $Y\sim\text{Bin}(2,\tfrac12)$, independent. $P(X+Y\le1)$?S17
  1. Total probability over $Y$: $\Phi(1)\cdot\tfrac14+\Phi(0)\cdot\tfrac12+\Phi(-1)\cdot\tfrac14$.
  2. $=\tfrac14[\Phi(1)+\Phi(-1)]+\tfrac14=\tfrac14+\tfrac14$.

1/2

Practice: delivery time $N(30,5^2)$ minutes. P(25 < X < 40)? P(mean of 25 deliveries > 32)?practice
  1. $\Phi(2)-\Phi(-1)=0.9772-0.1587$.
  2. SE $=5/\sqrt{25}=1$; $z=2$ → $1-\Phi(2)$.

≈ 0.8186 · ≈ 0.0228

Practice: 36 i.i.d. jobs, each mean 4 h, SD 3 h. P(total > 162 h)?practice
  1. Sum: mean 144, SD $\sqrt{36}\times3=18$.
  2. $z=(162-144)/18=1$ → $1-\Phi(1)$.

≈ 0.1587

Practice: $X_1\sim N(10,4)$, $X_2\sim N(6,9)$ independent. $P(X_1>X_2)$?practice
  1. $D=X_1-X_2\sim N(4,\,4+9)$.
  2. $P(D>0)=\Phi(4/\sqrt{13})=\Phi(1.109)$.

≈ 0.866

Practice: $X\sim N(\mu,\sigma^2)$ with $P(X\le10)=0.5$ and $P(X\le13)=0.8413$. Find μ, σ.practice
  1. First → $\mu=10$.
  2. $\Phi\!\left(\frac{3}{\sigma}\right)=0.8413=\Phi(1)$ → $\sigma=3$.

μ = 10, σ = 3

S17 (2nd half) — Arshad

Inequalities: Markov, Chebyshev, Jensen

Bounds for when you know only the mean (and maybe the variance), not the distribution.

Markov

$X\ge0$, $a>0$
$P(X\ge a)\le\dfrac{E X}{a}$
generalised
any $X$, $g\ge0$: $P(g(X)\ge a)\le\dfrac{E[g(X)]}{a}$
proof idea
drop $\int_0^a$, then $x\ge a$ on $[a,\infty)$

Chebyshev

upper
$P(|X-\mu|\ge\varepsilon)\le\dfrac{\sigma^2}{\varepsilon^2}$
lower
$P(|X-\mu|<\varepsilon)\ge1-\dfrac{\sigma^2}{\varepsilon^2}$
kσ form
$\le1/k^2$: at least 75% within 2σ for any distribution (normal: 95.45%)
from Markov
$g=(x-\mu)^2$, $a=\varepsilon^2$

Convexity and Jensen

test
$f''\ge0$ convex (chord above), $f''\le0$ concave; $f$ convex ⇔ $-f$ concave
Jensen
convex: $E[h(X)]\ge h(EX)$; concave: $\le$
uses
$x^2$ → $E X^2\ge(EX)^2$ so Var ≥ 0; $\log$ → $E\log X\le\log EX$

Arshad's caveat: these bounds are for "very limited information". If you know the distribution, compute the exact probability — the bound can be loose (0.52 vs an exact 0.20 below).

Factory: weekly output mean 50. (a) Bound P(output exceeds 75). (b) With Var = 25, bound P(40 ≤ X ≤ 60).S17
  1. (a) Count, so "exceeds 75" is $X\ge76$: $P\le50/76$.
  2. (b) $P(|X-50|\le10)\ge1-25/100$.

≤ 0.658 · ≥ 0.75

$X\sim U(0,10)$: Chebyshev bound vs exact for $P(|X-5|>4)$.S17
  1. Var $=100/12=25/3$; bound $\frac{25/3}{16}=\frac{25}{48}$.
  2. Exact: $1-P(1\le X\le9)=1-\tfrac8{10}$.

bound ≈ 0.52 · exact 0.20 (not sharp)

Practice: $X\ge0$ with mean 20. Bound $P(X\ge50)$. If Var = 16, bound $P(12<X<28)$.practice
  1. Markov: $20/50$.
  2. Chebyshev, ε = 8: $1-16/64$.

≤ 0.4 · ≥ 0.75

S18 · S19 · S20 (22–24 Sep) — Arshad

Bivariate random variables: joint, marginal, conditional, covariance

Two measurements on one outcome, $(X,Y):\Omega\to\mathbb{R}^2$. Everything univariate gets a joint version, plus one new question: do the two move together?

Joint and marginal PMF

joint PMF
$p(x,y)=P(X=x,Y=y)\ge0$, $\;\sum_x\sum_y p(x,y)=1$
marginals
$p_X(x)=\sum_y p(x,y)$ (row sums), $\;p_Y(y)=\sum_x p(x,y)$ (column sums)
dependent ranges
swapping the order keeps the answer but changes the limits: $\sum_{y=0}^{2}\sum_{x=0}^{y}=\sum_{x=0}^{2}\sum_{y=x}^{2}$

Joint CDF

definition
$F(x,y)=P(X\le x,\,Y\le y)$: the lower-left quadrant
properties 1–4
non-decreasing and right-continuous in each coordinate; $\to0$ as $x\to-\infty$ or $y\to-\infty$; $\to1$ as both $\to\infty$
5 · rectangle inequality
$F(x_2,y_2)-F(x_2,y_1)-F(x_1,y_2)+F(x_1,y_1)\ge0$. Not implied by 1–4.
marginal CDF
$F_X(x)=\lim_{y\to\infty}F(x,y)$: send the other variable to $+\infty$

Joint PDF

definition
$F(x,y)=\int_{-\infty}^{x}\int_{-\infty}^{y}f(u,v)\,dv\,du$; $\;f\ge0$, $\iint f=1$
back to PDF
$f=\dfrac{\partial^2F}{\partial x\,\partial y}$ where $f$ is continuous
regions
$P((X,Y)\in A)=\iint_A f\,dy\,dx$; $\;f_X(x)=\int f(x,y)\,dy$
uniform on a region
$f=\dfrac1{\text{area}}$, so probability $=$ area ratio
+F(x₂,y₂) −F(x₁,y₂) −F(x₂,y₁) +F(x₁,y₁) P(rectangle) ≥ 0 x₁ x₂ y₁ y₂

Take the whole quadrant under $(x_2,y_2)$, remove the strip below and the strip to the left, then add back the corner removed twice. What's left is $P(x_1<X\le x_2,\;y_1<Y\le y_2)$, and no rectangle may have negative probability. In 1-D this collapses to "non-decreasing", which is why it's new.

From Arshad's framing (S18–S19):

  • Height and weight, rainfall and temperature: one experiment, two readings. The step from here is regression, where $Y$ depends on $X$.
  • Joint vs marginal tell different stories: in the triangle example the joint is flat ($\tfrac16$ everywhere it lives), yet $X$ piles up at 0 and $Y$ at 2.
  • A density is a rate, not a probability: that's why the conditional PDF can't be $P(\cdot)/P(Y=y)$ and needs a limit instead.
  • Covariance only sees straight lines: $Y=X^2$ is completely determined by $X$ yet has zero covariance.
Joint PMF table: marginals and the independence test

Each cell shows p(x,y), with pX(x)·pY(y) underneath. Row sums give pX, column sums give pY. Red numbers mark joint ≠ product; the outlined cell is the first one, and one is enough to prove dependence.

Conditional distribution

why a limit
$P(Y=y)=0$ for continuous $Y$, so condition on $y-\varepsilon<Y\le y+\varepsilon$ and let $\varepsilon\to0^+$
result
$f_{X\mid Y}(x\mid y)=\dfrac{f(x,y)}{f_Y(y)}$, needs $f_Y(y)>0$. For fixed $y$ it is a PDF in $x$.
multiplication rule
$f(x,y)=f_{Y\mid X}(y\mid x)\,f_X(x)=f_{X\mid Y}(x\mid y)\,f_Y(y)$
conditional mean
$E[Y\mid X=x]=\int y\,f_{Y\mid X}(y\mid x)\,dy$

Independence

definition
$F(x,y)=F_X(x)F_Y(y)$ for all $x,y$
any one of
$p=p_Xp_Y$ · $f=f_Xf_Y$ · $M(t_1,t_2)=M_X(t_1)M_Y(t_2)$ near $(0,0)$
factorisation
$f=g(x)\,h(y)$ is enough; $g,h$ need not be densities
support test
rectangular support is necessary, not sufficient. Triangle or disk ⇒ dependent.
dependence
one point with $p(x,y)\ne p_X(x)p_Y(y)$ settles it

Covariance

expectation
$E[g(X,Y)]=\sum\sum g\,p$ or $\iint g\,f$; $\;\mu'_{r,s}=E[X^rY^s]$
formula
$\operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]$; $\;\operatorname{Cov}(X,X)=\operatorname{Var}X$
linear
$\operatorname{Cov}(aX+b,cY+d)=ac\operatorname{Cov}(X,Y)$, bilinear in each slot
variance of a sum
$\operatorname{Var}(aX+bY)=a^2\operatorname{Var}X+b^2\operatorname{Var}Y+2ab\operatorname{Cov}$
one-way street
independent ⇒ Cov $=0$. Cov $=0$ ⇏ independent ($X\sim U(-1,1)$, $Y=X^2$).

Independence in three moves (S19):

  • Support rectangular? If $x$'s range depends on $y$ (like $0<x<y<1$), stop: dependent.
  • Does the formula split? Products and quotients ($xy^2$, $x/y$) split; sums ($x+y$) generally don't.
  • Both yes ⇒ independent, without computing either marginal.

Joint MGF

definition
$M(t_1,t_2)=E\left[e^{t_1X+t_2Y}\right]$, finite on a neighbourhood of $(0,0)$
marginals
$M_X(t_1)=M(t_1,0)$, $\;M_Y(t_2)=M(0,t_2)$
product moments
$E[X^rY^s]=\dfrac{\partial^{r+s}M}{\partial t_1^{\,r}\,\partial t_2^{\,s}}\Big|_{(0,0)}$
independence
$\iff M(t_1,t_2)=M_X(t_1)M_Y(t_2)$ on a whole neighbourhood of $(0,0)$

Read the distribution off the MGF (uniqueness)

$e^{\mu t+\frac12\sigma^2t^2}$
$N(\mu,\sigma^2)$. So $e^{t^2}$ is $N(0,2)$, not $N(0,1)$.
$(q+pe^t)^n$
$\text{Bin}(n,p)$
$\sum_i p_i\,e^{x_it}$
discrete: exponent = value, coefficient = probability
$e^{ct}$
degenerate at $c$ ($P(X=c)=1$)
$(1-t)^{-1}$ · $(1-t)^{-2}$
Exp(1) · Gamma(shape 2, rate 1)

WORKED EXAMPLES

$p(x,y)=c$ for $x=0,\dots,y$ and $y=0,1,2$. Find $c$ both ways, then the marginals.S18
  1. $x$ first: $c\sum_{y=0}^{2}(y+1)=6c=1$, so $c=\tfrac16$.
  2. $y$ first: $x\le y$ means $y$ runs $x\to2$, which is $3-x$ values: $\tfrac16\sum_{x=0}^{2}(3-x)=\tfrac16\cdot6=1$. ✓
  3. $p_X(x)=\sum_{y=x}^{2}\tfrac16=\dfrac{3-x}{6}$; $\;p_Y(y)=\sum_{x=0}^{y}\tfrac16=\dfrac{y+1}{6}$.
  4. The trap: summing $y$ over all of $0,1,2$ for every $x$. Arshad made and corrected exactly this slip in class.

c = 1/6 · pX = (3/6, 2/6, 1/6) · pY = (1/6, 2/6, 3/6)

Show $G(x,y)=1$ if $x+y\ge0$, else 0, satisfies properties 1–4 but is not a CDF.S18
  1. Monotone and right-continuous in each coordinate; $\to0$ as either goes to $-\infty$; $\to1$ as both go to $\infty$.
  2. Rectangle $x_1=y_1=-1$, $x_2=y_2=1$: $G(1,1)-G(1,-1)-G(-1,1)+G(-1,-1)=1-1-1+0$.
  3. $(1,-1)$ and $(-1,1)$ lie on $x+y=0$, so both count as 1.

−1 < 0 → a rectangle with negative probability, so G is not a joint CDF

$f=\tfrac14$ on $(-1,1)^2$. Find $P(\tfrac14<X<\tfrac34,\;\tfrac14<Y<\tfrac34)$.S19
  1. Uniform, so area ratio: $\dfrac{\tfrac12\cdot\tfrac12}{4}$.

1/16

$X\sim U(0,1)$ and $Y\mid X=x\sim U(0,x)$. Find $f_Y$.S19
  1. Multiplication rule: $f(x,y)=\tfrac1x\cdot1$ on $0<y<x<1$.
  2. Fix $y$; then $x$ runs from $y$ to 1 (not "$x$ to 1", a slip Arshad corrected): $\int_y^1\tfrac1x\,dx=-\ln y$.

f_Y(y) = −ln y on (0,1)

$(X,Y)$ uniform on the unit disk. Find $f_X$, $f_{Y\mid X}$ and $P(X^2+Y^2\le\tfrac14)$.S19
  1. Area $\pi$, so $f=\tfrac1\pi$ on the disk.
  2. $f_X(x)=\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}\tfrac1\pi\,dy=\tfrac2\pi\sqrt{1-x^2}$ on $(-1,1)$. $f_Y$ is the same by symmetry.
  3. $f_{Y\mid X}=\dfrac{1/\pi}{\frac2\pi\sqrt{1-x^2}}=\dfrac1{2\sqrt{1-x^2}}$: uniform on $|y|<\sqrt{1-x^2}$. It changes with $x$, so $X,Y$ are dependent.
  4. Area ratio: $\pi(\tfrac12)^2/\pi$.

f_X = (2/π)√(1−x²) · Y|X=x ~ U(−√(1−x²), √(1−x²)) · P = 1/4

Independent or not? (a) $\tfrac1x$ on $0<y<x<1$ (b) $x+y$ on $(0,1)^2$ (c) $\tfrac{xy^2}{30}$, $x\in\{1,2,3\}$, $y\in\{1,2\}$ (d) $c\,\tfrac xy$ on $0<x<y<1$S19
  1. (a) Triangular support: dependent.
  2. (b) Rectangular support, but $x+y$ doesn't split: dependent.
  3. (c) Rectangular support, and it splits as $\tfrac{x}{30}\cdot y^2$: independent. Check: $\tfrac{(1+2+3)(1+4)}{30}=1$.
  4. (d) The formula splits, but the support is triangular: dependent.

only (c) is independent

$X\sim U(-1,1)$, $Y=X^2$. Find $\operatorname{Cov}(X,Y)$.S19
  1. $\operatorname{Cov}=E[X^3]-E[X]\,E[X^2]$.
  2. $E[X]=0$, so the second term vanishes and $E[X^2]$ isn't needed.
  3. $E[X^3]=\int_{-1}^{1}\tfrac{x^3}{2}\,dx=0$ ($x^3$ is odd on a symmetric interval).

Cov = 0, yet Y is a function of X: zero covariance ⇏ independence

$f=e^{-y}$ on $0<x<y<\infty$. Find the joint MGF, the marginals, $E[XY]$ and Cov.S20
  1. Inner: $\int_x^\infty e^{(t_2-1)y}dy=\dfrac{e^{(t_2-1)x}}{1-t_2}$, needs $t_2<1$.
  2. Outer: $\dfrac1{1-t_2}\int_0^\infty e^{(t_1+t_2-1)x}dx$, needs $t_1+t_2<1$. So $M=\dfrac1{(1-t_2)(1-t_1-t_2)}$.
  3. $M(t_1,0)=\tfrac1{1-t_1}$ is Exp(1); $M(0,t_2)=\tfrac1{(1-t_2)^2}$ is Gamma(2,1). Their product isn't $M$, so dependent.
  4. $\partial^2M/\partial t_1\partial t_2$ at 0: $1+2=3$. $E[X]=1$, $E[Y]=2$.

E[XY] = 3 · Cov = 3 − 1·2 = 1 > 0 (Y tends to rise with X)

(a) $M=e^{t_1^2+t_2^2}$: find $P(X<0,Y<0)$. (b) $M=e^{t_1^2+t_2}$: identify $X$ and $Y$.S20
  1. (a) $M=e^{t_1^2}\cdot e^{t_2^2}$ factorises, so the variables are independent. Match $\tfrac12\sigma^2=1$: both are $N(0,2)$.
  2. (a) $P(X<0)P(Y<0)=\Phi(0)^2$.
  3. (b) Independent again. $X\sim N(0,2)$; $e^{t_2}=e^{1\cdot t_2}\cdot1$, so $P(Y=1)=1$.

(a) 1/4 · (b) X ~ N(0,2), Y degenerate at 1, independent

Identify: (a) $M(t)=\tfrac16\left(2+e^{-t}+e^{2t}+2e^{6t}\right)$ (b) $M(t)=\left(\tfrac23+\tfrac13e^t\right)^2$S20
  1. (a) Exponents are values and coefficients are probabilities: $P(0)=\tfrac13$, $P(-1)=\tfrac16$, $P(2)=\tfrac16$, $P(6)=\tfrac13$. They sum to 1.
  2. (b) Matches $(q+pe^t)^n$ with $n=2$, $p=\tfrac13$.

(a) PMF on {−1, 0, 2, 6}, E[X] = 13/6 · (b) Bin(2, 1/3)

$f=8xy$ on $0<x<y<1$. Find $E[Y\mid X=\tfrac12]$.S20
  1. $f_X(x)=\int_x^1 8xy\,dy=4x(1-x^2)$.
  2. $f_{Y\mid X}=\dfrac{8xy}{4x(1-x^2)}=\dfrac{2y}{1-x^2}$ on $x<y<1$; at $x=\tfrac12$ this is $\tfrac{8y}3$ on $(\tfrac12,1)$, which integrates to 1 ✓.
  3. $\int_{1/2}^1\tfrac{8y^2}{3}\,dy=\tfrac89\left(1-\tfrac18\right)$.

7/9

$p(0,0)=\tfrac16$, $p(0,1)=a$, $p(1,0)=\tfrac13$, $p(1,1)=b$. Find $a,b$ for independence.S20
  1. $p_Y(0)=\tfrac16+\tfrac13=\tfrac12$ is already known, so use the $y=0$ column.
  2. At $(0,0)$: $\tfrac16=(\tfrac16+a)\cdot\tfrac12$, so $a=\tfrac16$.
  3. At $(1,0)$: $\tfrac13=(\tfrac13+b)\cdot\tfrac12$, so $b=\tfrac13$. Total $=1$ ✓. Try it on the widget above.

a = 1/6 · b = 1/3

Practice: $f=cxy$ on $0<x<2$, $0<y<1$. Find $c$, decide independence, and find $P(X<1)$.practice
  1. $c\int_0^2x\,dx\int_0^1y\,dy=c\cdot2\cdot\tfrac12$, so $c=1$.
  2. Rectangular support and $xy$ splits: independent, with $f_X=\tfrac x2$ on $(0,2)$.
  3. $\int_0^1\tfrac x2\,dx$.

c = 1 · independent · 1/4

Practice: $\operatorname{Var}X=4$, $\operatorname{Var}Y=1$, $\operatorname{Cov}(X,Y)=0.5$. Find $\operatorname{Var}(2X-3Y)$.practice
  1. $4\cdot4+9\cdot1+2(2)(-3)(0.5)=16+9-6$.

19

Practice: $M(t_1,t_2)=e^{2t_1+2t_1^2+3t_2+t_2^2/2}$. Identify $X$ and $Y$, then find $P(X>2,\;Y<3)$.practice
  1. It factorises, so the variables are independent. $\mu_X=2$, $\tfrac12\sigma_X^2=2$ gives $N(2,4)$; $\mu_Y=3$, $\tfrac12\sigma_Y^2=\tfrac12$ gives $N(3,1)$.
  2. Both events are "beyond the mean": $\tfrac12\cdot\tfrac12$.

X ~ N(2,4), Y ~ N(3,1) · 1/4

Practice: $(X,Y)$ uniform on the triangle $0<y<x<1$. Find the density, $P(X<\tfrac12)$ and $\operatorname{Cov}(X,Y)$.practice
  1. Area $\tfrac12$, so $f=2$.
  2. Area ratio: the triangle under $x=\tfrac12$ has area $\tfrac18$, so $P=\tfrac{1/8}{1/2}$.
  3. $E[X]=\tfrac23$, $E[Y]=\tfrac13$, $E[XY]=\int_0^1\int_0^x2xy\,dy\,dx=\tfrac14$, so $\operatorname{Cov}=\tfrac14-\tfrac29$.

f = 2 · 1/4 · Cov = 1/36

Practice: $p(0,0)=0.2$, $p(0,1)=a$, $p(1,0)=0.3$, $p(1,1)=b$. Find $a,b$ for independence.practice
  1. $p_Y(0)=0.5$. At $(0,0)$: $0.2=(0.2+a)(0.5)$. At $(1,0)$: $0.3=(0.3+b)(0.5)$.

a = 0.2 · b = 0.3