Discrete Random Variables
View .md

Joint PMFs and Multiple Random Variables

Joint PMF

When dealing with multiple random variables, the joint PMF describes their combined behavior:

pX,Y(x,y)=P(X=x and Y=y)p_{X,Y}(x, y) = P(X = x \text{ and } Y = y)

This gives the probability that XX takes value xx and YY takes value yy simultaneously.


Marginal PMF

From the joint PMF, we can find the marginal PMF of each variable:

pX(x)=∑ypX,Y(x,y)p_X(x) = \sum_y p_{X,Y}(x, y)

We sum over all possible values of YY to get the distribution of XX alone.

Intuition

The marginal PMF “integrates out” the other variable, giving us the distribution of one variable ignoring the other.


Conditional PMF

The conditional PMF of XX given Y=yY = y:

pX∣Y(x∣y)=pX,Y(x,y)pY(y)p_{X|Y}(x | y) = \frac{p_{X,Y}(x, y)}{p_Y(y)}

This describes the distribution of XX when we know that Y=yY = y.

Properties

  • For a fixed yy, the conditional PMF sums to 1: ∑xpX∣Y(x∣y)=1\sum_x p_{X|Y}(x|y) = 1
  • Conditional PMFs behave just like ordinary PMFs—they just apply in a “conditional universe”

Multiplication Rule

pX,Y(x,y)=pX(x)⋅pY∣X(y∣x)=pY(y)⋅pX∣Y(x∣y)p_{X,Y}(x, y) = p_X(x) \cdot p_{Y|X}(y|x) = p_Y(y) \cdot p_{X|Y}(x|y)

This connects joint, marginal, and conditional PMFs.


Independence of Random Variables

Two random variables XX and YY are independent if and only if:

pX,Y(x,y)=pX(x)⋅pY(y)for all x,yp_{X,Y}(x, y) = p_X(x) \cdot p_Y(y) \quad \text{for all } x, y

For Multiple Random Variables

Random variables X1,X2,…,XnX_1, X_2, \ldots, X_n are independent if:

pX1,…,Xn(x1,…,xn)=pX1(x1)⋅pX2(x2)⋯pXn(xn)p_{X_1, \ldots, X_n}(x_1, \ldots, x_n) = p_{X_1}(x_1) \cdot p_{X_2}(x_2) \cdots p_{X_n}(x_n)

Note: This is simpler than independence of events! For events, we needed to check many conditions. For random variables, just one equation suffices.


Functions of Multiple Random Variables

Expected Value

For a function g(X,Y)g(X, Y):

E[g(X,Y)]=∑x∑yg(x,y)⋅pX,Y(x,y)E[g(X, Y)] = \sum_x \sum_y g(x, y) \cdot p_{X,Y}(x, y)

Linearity

E[X+Y]=E[X]+E[Y]E[X + Y] = E[X] + E[Y]

This always holds, even if XX and YY are dependent.

Product (Independent Case)

If XX and YY are independent:

E[XY]=E[X]⋅E[Y]E[XY] = E[X] \cdot E[Y]


Variance of Sums

Independent Case

If XX and YY are independent:

Var(X+Y)=Var(X)+Var(Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y)

Dependent Case

For dependent variables, we need covariance:

Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) + 2\text{Cov}(X, Y)


Example: Three Coin Flips

Consider three coin flips. Let:

  • XX = number of heads in first two flips
  • YY = number of heads in last two flips

The joint PMF can be computed by enumerating all 8 possible outcomes (HHH, HHT, etc.).

From the joint PMF:

  • Find marginal PMF of XX by summing over YY
  • Find conditional PMF of XX given Y=2Y = 2
  • Check if XX and YY are independent

Key Terms

Joint PMFP(X=x,Y=y)P(X=x, Y=y) — gives the probability that two discrete random variables take specific values simultaneously.
Marginal PMFP(X=x)=∑yP(X=x,Y=y)P(X=x) = \sum_y P(X=x, Y=y) — the PMF of one variable obtained by summing over the other.
Conditional PMFP(X=x∣Y=y)=P(X=x,Y=y)P(Y=y)P(X=x \mid Y=y) = \frac{P(X=x, Y=y)}{P(Y=y)} — the probability distribution of X given Y=yY=y.
Independent Random VariablesTwo random variables are independent if P(X∈A,Y∈B)=P(X∈A)⋅P(Y∈B)P(X \in A, Y \in B) = P(X \in A) \cdot P(Y \in B) for all A,BA, B.