Skip to content

The cheat sheet

Read a symbol as an instruction about an experiment. Worked notation problems show how several instructions combine in a full question.

notationread it as
Ω\Omega, ω\omegasample space; one outcome in it
AΩA\subseteq\Omegaevent A is a set of possible outcomes
ABA\cap B, ABA\cup Bboth events; at least one event
A\lvert A\rvertnumber of outcomes in a finite event
Pr(A)\Pr(A)probability of A
Pr(AB)\Pr(A\mid B)probability of A after conditioning on B

For finite equally likely outcomes, Pr(A)=A/Ω\Pr(A)=|A|/|\Omega|. More generally, add the probability mass assigned to the outcomes in the event.

Probabilities are nonnegative, the whole space has probability 1, and probabilities add for a countable collection of pairwise disjoint events. In particular:

Pr(Ac)=1Pr(A),Pr(AB)Pr(A)+Pr(B).\Pr(A^c)=1-\Pr(A),\qquad\Pr(A\cup B)\le\Pr(A)+\Pr(B).

Pr(AB)=Pr(AB)Pr(B),Pr(B)>0.\Pr(A\mid B)=\frac{\Pr(A\cap B)}{\Pr(B)},\qquad\Pr(B)>0.

Events A and B are independent when Pr(AB)=Pr(A)Pr(B)\Pr(A\cap B)=\Pr(A)\Pr(B).

namedefinitionhow to get a probability
PMFpX(x)=Pr(X=x)p_X(x)=\Pr(X=x)sum masses at relevant values
PDFfX(x)f_X(x): probability per unit of xintegrate over a region
CDFFX(x)=Pr(Xx)F_X(x)=\Pr(X\le x)subtract accumulated probabilities

A density can exceed 1; its total area must be 1. A CDF is nondecreasing, with limits 0 and 1 at the ends of the real line. For any distribution:

Pr(a<Xb)=FX(b)FX(a).\Pr(a<X\le b)=F_X(b)-F_X(a).

The lower endpoint is excluded. For a distribution with a density, endpoints carry no probability and the distinction disappears. In our smooth examples, fX=FXf_X=F_X' and FX(x)=xfX(t)dtF_X(x)=\int_{-\infty}^{x}f_X(t)\,dt.

E[g(X)]=xg(x)pX(x).\mathbb E[g(X)]=\sum_x g(x)p_X(x).

Evaluate g at each possible x first, then weight and add. For a density, use g(x)fX(x)dx\int g(x)f_X(x)\,dx instead.

With finite moments:

E[aX+bY+c]=aE[X]+bE[Y]+c.\mathbb E[aX+bY+c]=a\mathbb E[X]+b\mathbb E[Y]+c.

This does not require independence. Nonlinear operations generally cannot move outside the expectation: E[X2]\mathbb E[X^2] is usually different from (E[X])2(\mathbb E[X])^2.

Var(X)=E[(XE[X])2]=E[X2](E[X])2.\operatorname{Var}(X)=\mathbb E[(X-\mathbb E[X])^2]=\mathbb E[X^2]-(\mathbb E[X])^2.

Var(aX+b)=a2Var(X).\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X).

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

Independent variables have zero covariance. Zero covariance alone is sufficient for adding these two variances; it does not imply independence. Standard deviation is Var(X)\sqrt{\operatorname{Var}(X)}, in the original units.

operationdiscrete formulaphysical operation
jointpX,Y(x,y)p_{X,Y}(x,y)probability of a pair
marginalpX(x)=ypX,Y(x,y)p_X(x)=\sum_y p_{X,Y}(x,y)add a row
conditionalpYX(yx)=pX,Y(x,y)/pX(x)p_{Y\mid X}(y\mid x)=p_{X,Y}(x,y)/p_X(x)keep a row, divide by its total

The conditional PMF formula requires pX(x)>0p_X(x)>0. For joint densities, fYX(yx)=fX,Y(x,y)/fX(x)f_{Y\mid X}(y\mid x)=f_{X,Y}(x,y)/f_X(x) when fX(x)>0f_X(x)>0. This is a ratio of densities, not probabilities of exact continuous values.

Bayes’ rule reverses which quantity is conditioned on:

pXY(xy)=pYX(yx)pX(x)pY(y).p_{X\mid Y}(x\mid y)=\frac{p_{Y\mid X}(y\mid x)p_X(x)}{p_Y(y)}.

Cov(X,Y)=E[XY]E[X]E[Y].\operatorname{Cov}(X,Y)=\mathbb E[XY]-\mathbb E[X]\mathbb E[Y].

Condition first, then average back over the groups:

E[Y]=xE[YX=x]pX(x).\mathbb E[Y]=\sum_x\mathbb E[Y\mid X=x]p_X(x).

For continuous X, replace the sum with an integral using its density. The analogous averaging of conditional probabilities is the law of total probability.

notationexperimentmeanvariance
Ber(p)\operatorname{Ber}(p)1 with probability p; otherwise 0pp(1−p)
Bin(n,p)\operatorname{Bin}(n,p)successes in n independent identical Bernoulli trialsnpnp(1−p)
Unif[a,b]\operatorname{Unif}[a,b]uniform point in an interval, a<b(a+b)/2(b−a)²/12
N(μ,σ2)\mathcal N(\mu,\sigma^2)normal with mean μ, standard deviation σμσ²

The standard normal CDF is Φ\Phi. It has no elementary closed form; numerical software computes it accurately. For XN(μ,σ2)X\sim\mathcal N(\mu,\sigma^2), standardize with Z=(Xμ)/σZ=(X-\mu)/\sigma before using Φ.

  • X1,,XniidpX_1,\ldots,X_n\overset{\mathrm{iid}}{\sim}p: independent draws from the same distribution p.
  • 1{A}\mathbf 1\{A\}: 1 when A occurs, otherwise 0. Its expectation is Pr(A)\Pr(A).
  • Exp[logqθ(x)]\mathbb E_{x\sim p}[\log q_\theta(x)]: draw x from p, compute its log score under qθq_\theta, average.
  • argmaxθ\operatorname{argmax}_\theta: return the parameter choice with the largest score. maxθ\operatorname{max}_\theta returns the score itself.

Try mixed practice →

Definition

Read the full glossary entry →