1. Joint PMF of two random variables
DefinitionFor discrete \(X, Y\) defined on the same experiment, the joint PMF is \(f_{XY}(t_1,t_2)=P(X=t_1,\ Y=t_2)\) for \(t_1\in T_X,\ t_2\in T_Y\). Every entry is ≥ 0 and all entries add up to 1.
Write it as a table: one row per value of one variable, one column per value of the other. Any probability about \((X,Y)\) is a sum of cells: \(P(X+Y=3)\) is the sum of the cells with \(t_1+t_2=3\).
Example
A fair coin is tossed twice. \(X\) = heads on toss 1, \(Y\) = total heads.
\(f_{XY}(1,0)=0\): you cannot have 0 heads in total after a head on toss 1. Zeros like this are what make variables dependent.
- Unknown entries (a, b, k): use "sum of all cells = 1" plus whatever extra condition is given (a marginal, a conditional, or \(a=b/2\)).
- Formula-type joint PMFs such as \(f_{XY}(i,j)=\frac{i+2j}{k}\) on a grid: fill the table, add it up, set it equal to 1 to get k.
- Counting experiments (cards, balls without replacement): \(f_{XY}(x,y)=\frac{\binom{a}{x}\binom{b}{y}\binom{\text{rest}}{n-x-y}}{\binom{N}{n}}\). The "rest" factor is the one people forget.
2. Marginal PMF
Definition\(f_X(t_1)=\sum_{t_2\in T_Y} f_{XY}(t_1,t_2)\) (add along the row), and \(f_Y(t_2)=\sum_{t_1\in T_X} f_{XY}(t_1,t_2)\) (add down the column).
- The marginal is an ordinary PMF: it adds up to 1.
- Different joint PMFs can have the same marginals. The marginals alone never tell you the joint (unless the variables are independent).
- In the coin example: \(f_X=(1/2,1/2)\), \(f_Y=(1/4,1/2,1/4)\).
3. Conditional distribution
DefinitionFor \(t_1\) with \(f_X(t_1)>0\): \(f_{Y\mid X=t_1}(t_2)=\dfrac{f_{XY}(t_1,t_2)}{f_X(t_1)}\). Take the row of \(t_1\) and divide it by its own total.
- A conditional PMF adds up to 1 over \(t_2\): \(\sum_{t_2} f_{Y\mid X=t_1}(t_2)=1\).
- Range of \((Y\mid X=t_1)\) = the values of \(t_2\) whose cell in that row is non-zero. It can be smaller than \(T_Y\).
- Factorisation: \(f_{XY}(t_1,t_2)=f_{Y\mid X=t_1}(t_2)\,f_X(t_1)=f_{X\mid Y=t_2}(t_1)\,f_Y(t_2)\). Use it to build a joint PMF from a two-stage experiment.
- Conditioning on an event works the same way: \(P(X=t\mid A)=P(X=t, A)/P(A)\).
Two-stage example
Pick a card. If it is a face card (12 of 52) draw 2 balls from bag A, otherwise 3 balls from bag B. \(Y\) = number of red balls. Then \(f_Y(1)=P(\text{face})\,P(Y=1\mid\text{face})+P(\text{not face})\,P(Y=1\mid\text{not face})\), each conditional being hypergeometric. This "total probability over the first stage" is a standard quiz move.
4. Poisson splitting (the most repeated idea in Week 1)
ResultIf \(N\sim\) Poisson(λ) and, given \(N=n\), each of the n items independently has a property with probability p, so that \((X\mid N=n)\sim\) Binomial(n, p), then
\[f_{NX}(n,k)=\frac{e^{-\lambda}\lambda^n}{n!}\binom nk p^k(1-p)^{n-k},\qquad X\sim\text{Poisson}(\lambda p).\]
Also \(N-X\sim\) Poisson(λ(1−p)), and \(X\) and \(N-X\) are independent.
- \(f_{NX}(n,k)=0\) when \(k>n\) (you cannot have more spam emails than emails).
- Joint probability of "exactly b boys and g girls": \(P(B=b,G=g)=e^{-\lambda}\frac{\lambda^{b+g}}{b!\,g!}p^g(1-p)^b\). With p = 0.5 this is \(\frac{e^{-\lambda}(\lambda/2)^{b+g}}{b!\,g!}\).
- \(E[X]=\lambda p\) (useful in Week 3 questions).
5. Three or more random variables
- Joint PMF \(f_{X_1X_2X_3}(t_1,t_2,t_3)=P(X_1=t_1,X_2=t_2,X_3=t_3)\), usually given as a list of rows (t₁, t₂, t₃, prob).
- Marginalise by summing out the variables you do not want: \(f_{X_1X_2}(t_1,t_2)=\sum_{t_3}f_{X_1X_2X_3}(t_1,t_2,t_3)\); \(f_{X_1}(t_1)=\sum_{t_2,t_3}f(t_1,t_2,t_3)\).
- Condition on any subset: \(f_{X_1\mid X_2=a,X_3=b}(t)=\dfrac{f_{X_1X_2X_3}(t,a,b)}{f_{X_2X_3}(a,b)}\); \(P(X_3=1,X_4=1\mid X_1=1,X_2=1)=\dfrac{f(1,1,1,1)}{f_{X_1X_2}(1,1)}\).
- Chain rule (any order): \(f_{X_1X_2X_3}=f_{X_1\mid X_2,X_3}\cdot f_{X_2\mid X_3}\cdot f_{X_3}\). Typical quiz item: given three of these four numbers, find the fourth.
- \(f_{XYZ}=f_{X\mid Y,Z}\,f_{YZ}\) is always true; \(f_{X\mid Y,Z}\,f_Y\,f_Z\) is true only under independence of Y and Z.
Chain-rule example
\(f_{X_1X_2X_3}(0,1,2)=?\) given \(f_{X_3}(2)=0.4\), \(f_{X_2\mid X_3=2}(1)=0.5\), \(f_{X_1\mid X_2=1,X_3=2}(0)=0.25\).
Show working
\(0.25\times0.5\times0.4=0.05\).
Watch outIn "three cards from a deck, X kings, Y jacks, Z queens", the remaining cards are the 40 non-K/J/Q cards. \(P(X=1,Y=0,Z=1)=\frac{\binom41\binom41\binom{40}1}{\binom{52}3}\).