∑GATE DA Atlas

Random Variables, Expectation, Joint and Conditional Distributions

Discrete and continuous random variables, PMFs, PDFs and CDFs, expectation and the law of the unconscious statistician, variance and moments, functions of random variables, joint, marginal and conditional distributions (including conditional PDFs), independence, conditional expectation and variance with the laws of total expectation and total variance, and the Markov and Chebyshev inequalities.

Section 110 practice questions

What a random variable is

A random variable (RV) is a function X:S→RX: S \to \mathbb R that assigns a number to each outcome. "X=3X = 3" is shorthand for the event {s∈S:X(s)=3}\{s \in S : X(s) = 3\}.

  • Discrete RVs take countably many values (counts, indicators).
  • Continuous RVs take values in intervals and have P(X=x)=0P(X = x) = 0 for every single point.

PMF, PDF and CDF

DiscreteContinuous
DescribesPMF p(x)=P(X=x)p(x) = P(X = x)PDF f(x)f(x) with P(a≤X≤b)=∫abf(x) dxP(a \le X \le b) = \int_a^b f(x)\,dx
Conditionsp(x)≥0p(x) \ge 0, ∑xp(x)=1\sum_x p(x) = 1f(x)≥0f(x) \ge 0, ∫−∞∞f(x) dx=1\int_{-\infty}^\infty f(x)\,dx = 1
CDF F(x)=P(X≤x)F(x) = P(X\le x)step function, ∑t≤xp(t)\sum_{t \le x} p(t)continuous, ∫−∞xf(t) dt\int_{-\infty}^x f(t)\,dt
Recover from CDFjump sizesf(x)=F′(x)f(x) = F'(x)

CDF properties: non-decreasing, right-continuous, F(−∞)=0F(-\infty) = 0, F(∞)=1F(\infty) = 1, and P(a<X≤b)=F(b)−F(a)P(a < X \le b) = F(b) - F(a).

Expectation

E[X]=∑xx p(x)orE[X]=∫−∞∞x f(x) dx.E[X] = \sum_x x\,p(x) \qquad\text{or}\qquad E[X] = \int_{-\infty}^\infty x\,f(x)\,dx.

Law of the unconscious statistician (LOTUS): E[g(X)]=∑xg(x)p(x)E[g(X)] = \sum_x g(x)p(x) or ∫g(x)f(x) dx\int g(x)f(x)\,dx — no need to find the distribution of g(X)g(X).

Linearity holds always, even for dependent variables: E[aX+bY+c]=aE[X]+bE[Y]+cE[aX + bY + c] = aE[X] + bE[Y] + c.

For a non-negative integer RV, E[X]=∑k≥1P(X≥k)E[X] = \sum_{k \ge 1} P(X \ge k); for a non-negative continuous RV, E[X]=∫0∞P(X>x) dxE[X] = \int_0^\infty P(X > x)\,dx.

Variance and moments

Var⁡(X)=E[(X−μ)2]=E[X2]−(E[X])2,Var⁡(aX+b)=a2Var⁡(X).\operatorname{Var}(X) = E[(X - \mu)^2] = E[X^2] - (E[X])^2, \qquad \operatorname{Var}(aX + b) = a^2\operatorname{Var}(X).

The kk-th moment is E[Xk]E[X^k]; the kk-th central moment is E[(X−μ)k]E[(X-\mu)^k]. The moment generating function MX(t)=E[etX]M_X(t) = E[e^{tX}] gives moments by differentiation, E[Xk]=MX(k)(0)E[X^k] = M_X^{(k)}(0), and the MGF of a sum of independent RVs is the product of their MGFs.

Functions of a random variable

For continuous XX and a strictly monotone gg, Y=g(X)Y = g(X) has density

fY(y)=fX(g−1(y))∣ddyg−1(y)∣.f_Y(y) = f_X\bigl(g^{-1}(y)\bigr)\left|\frac{d}{dy}g^{-1}(y)\right|.

The safest general method is the CDF method: compute FY(y)=P(g(X)≤y)F_Y(y) = P(g(X) \le y) directly, then differentiate.

Inverse transform sampling: if U∼U(0,1)U \sim U(0,1) and FF is a CDF, then F−1(U)F^{-1}(U) has CDF FF. For example −ln⁡(U)/λ∼Exp(λ)-\ln(U)/\lambda \sim \text{Exp}(\lambda). This is how samplers generate arbitrary distributions — see approximate inference.

Joint distributions

For two RVs, the joint PMF p(x,y)=P(X=x,Y=y)p(x, y) = P(X = x, Y = y) or joint PDF f(x,y)f(x, y) with P((X,Y)∈A)=∬Af(x,y) dx dyP((X,Y) \in A) = \iint_A f(x,y)\,dx\,dy.

ConceptDiscreteContinuous
MarginalpX(x)=∑yp(x,y)p_X(x) = \sum_y p(x, y)fX(x)=∫f(x,y) dyf_X(x) = \int f(x, y)\,dy
ConditionalpY∣X(y∣x)=p(x,y)pX(x)p_{Y\mid X}(y\mid x) = \dfrac{p(x,y)}{p_X(x)}fY∣X(y∣x)=f(x,y)fX(x)f_{Y\mid X}(y\mid x) = \dfrac{f(x, y)}{f_X(x)}
Independencep(x,y)=pX(x)pY(y)p(x, y) = p_X(x)p_Y(y) for all x,yx, yf(x,y)=fX(x)fY(y)f(x, y) = f_X(x)f_Y(y) for all x,yx, y

The conditional PDF fY∣X(y∣x)f_{Y\mid X}(y \mid x) is a genuine density in yy for each fixed xx (it integrates to 1).

For independent X,YX, Y: E[XY]=E[X]E[Y]E[XY] = E[X]E[Y], Var⁡(X+Y)=Var⁡X+Var⁡Y\operatorname{Var}(X+Y) = \operatorname{Var}X + \operatorname{Var}Y, and E[g(X)h(Y)]=E[g(X)]E[h(Y)]E[g(X)h(Y)] = E[g(X)]E[h(Y)].

Sums of independent random variables

The PMF/PDF of Z=X+YZ = X + Y is a convolution: fZ(z)=∫fX(x)fY(z−x) dxf_Z(z) = \int f_X(x)f_Y(z - x)\,dx. Useful closed forms: sum of independent Poissons is Poisson (λ1+λ2\lambda_1 + \lambda_2); sum of independent normals is normal (means add, variances add); sum of nn i.i.d. Bernoulli(pp) is Binomial(n,pn, p).

Conditional expectation and variance

E[Y∣X=x]=∑yy p(y∣x)E[Y \mid X = x] = \sum_y y\,p(y\mid x) or ∫y f(y∣x) dy\int y\,f(y \mid x)\,dy is a number for each xx; E[Y∣X]E[Y\mid X] is a random variable (a function of XX).

Law of total expectation (tower property):

E[Y]=E[E[Y∣X]].E[Y] = E\bigl[E[Y \mid X]\bigr].

Law of total variance (Eve's law):

Var⁡(Y)=E[Var⁡(Y∣X)]⏟within-group+Var⁡(E[Y∣X])⏟between-group.\operatorname{Var}(Y) = \underbrace{E[\operatorname{Var}(Y\mid X)]}_{\text{within-group}} + \underbrace{\operatorname{Var}(E[Y \mid X])}_{\text{between-group}}.

E[Y∣X]E[Y\mid X] is the best predictor of YY from XX in mean squared error — the quantity regression tries to estimate.

Inequalities

InequalityStatement
Markov (X≥0X \ge 0)P(X≥a)≤E[X]/aP(X \ge a) \le E[X]/a
ChebyshevP(∣X−μ∣≥kσ)≤1/k2P(\lvert X - \mu\rvert \ge k\sigma) \le 1/k^2
Jensen (gg convex)g(E[X])≤E[g(X)]g(E[X]) \le E[g(X)] — e.g. (E[X])2≤E[X2](E[X])^2 \le E[X^2]
Cauchy–Schwarz(E[XY])2≤E[X2]E[Y2](E[XY])^2 \le E[X^2]E[Y^2]

Quick revision

Practice questions

GATE-style questions: 5 one-mark and 5 two-mark. Wrong MCQs cost ⅓ of their marks in the real exam; MSQ and NAT have no negative marking. Attempt each before opening the solution.

Q1NAT1 mark

f(x)=c x2f(x) = c\,x^2 for 0≤x≤20 \le x \le 2 (and 00 elsewhere) is a probability density function. The value of cc is ______.

Q2NAT2 marks

XX has PDF f(x)=2xf(x) = 2x on [0,1][0, 1]. Then Var⁡(X)\operatorname{Var}(X) is ______ (round to three decimals).

Q3MSQ1 mark

Which properties hold for every cumulative distribution function F(x)=P(X≤x)F(x) = P(X \le x)?

One or more options are correct.

Q4NAT2 marks

A discrete random variable has PMF P(X=k)=k/10P(X = k) = k/10 for k=1,2,3,4k = 1, 2, 3, 4. Then Var⁡(X)\operatorname{Var}(X) is ______.

Q5NAT2 marks

(X,Y)(X, Y) has joint PDF f(x,y)=x+yf(x, y) = x + y on the unit square 0≤x,y≤10 \le x, y \le 1. Then E[X]E[X] is ______ (round to two decimals).

Q6NAT1 mark

A fair die is rolled, and then a fair coin is tossed as many times as the number shown. The expected number of heads is ______.

Q7NAT2 marks

A fair die is rolled, and then a fair coin is tossed as many times as the number shown. If HH is the number of heads, Var⁡(H)\operatorname{Var}(H) is ______ (round to two decimals).

Q8MCQ1 mark

For any random variable with mean μ\mu and finite standard deviation σ>0\sigma > 0, Chebyshev's inequality guarantees that P(∣X−μ∣≥2σ)P(|X - \mu| \ge 2\sigma) is at most

Q9MCQ1 mark

XX and YY are independent with Var⁡(X)=3\operatorname{Var}(X) = 3 and Var⁡(Y)=5\operatorname{Var}(Y) = 5. Then Var⁡(X−Y)\operatorname{Var}(X - Y) is

Q10NAT2 marks

X∼Uniform(0,1)X \sim \text{Uniform}(0, 1) and Y=−ln⁡XY = -\ln X. Then P(Y>1)P(Y > 1) is ______ (round to two decimals).