Review of Probability
Random Experiments, Sample Spaces, and Events¶
Random experiment: a well-defined procedure whose outcome cannot be predicted with certainty in advance.
Example: tossing a coin twice.
Sample space S: the set of all possible outcomes.
Example: S={(H,H),(H,T),(T,H),(T,T)}.
Event A: any subset of the sample space, A⊆S.
Example: “at least one head” =A={(H,H),(H,T),(T,H)}⊆S.
Probability of Events¶
A probability function P(⋅) over events in S satisfies:
Non-negativity: P(A)≥0
Normalization: P(S)=1
Additivity:
Random Variables¶
A random variable is a function mapping outcomes to real values:
X:S→R Example (two coin tosses): Let X = number of tails.
X(H,H)=0,X(H,T)=1,X(T,H)=1,X(T,T)=2. The state space (support) of X is X={0,1,2}.
Two types:
Probability Mass Function (PMF) — Discrete¶
For a discrete random variable X with state space X, the PMF is P(X=x) for x∈X.
Properties:
Joint, Marginal, and Conditional Probabilities¶
For two discrete random variables X and Y:
Joint probability: P(X=x,Y=y)
Marginalization:
P(X=x)=y∈Y∑P(X=x,Y=y),P(Y=y)=x∈X∑P(X=x,Y=y) Conditional probability:
P(X=x∣Y=y)=P(Y=y)P(X=x,Y=y)
Bayes’ Rule¶
P(X=x∣Y=y)=x′∈X∑P(X=x′)P(Y=y∣X=x′)P(X=x)P(Y=y∣X=x) Independent Random Variables¶
X and Y are independent if:
P(X,Y)=P(X)P(Y) Expectation and Variance¶
For a discrete random variable X:
E[X]=x∈X∑xP(X=x) Var(X)=E[(X−E[X])2]=E[X2]−E[X]2 Std(X)=Var(X) Common Distributions¶
Bernoulli Distribution¶
Models a single binary trial (e.g., one coin flip).
p(x∣μ)=μx(1−μ)1−x,x∈{0,1} where μ=P(X=1). Mean and variance:
E[X]=μ,Var(X)=μ(1−μ) Binomial Distribution¶
Models the number of successes in N independent Bernoulli trials.
Bin(m∣N,μ)=(mN)μm(1−μ)N−m Mean and variance:
E[m]=Nμ,Var(m)=Nμ(1−μ) Continuous Random Variables¶
For a continuous random variable X, P(X=x)=0 for any single point. Probabilities are described by the probability density function (PDF) pX(x):
P(a<X<b)=∫abpX(x)dx The cumulative distribution function (CDF) is:
FX(x)=P(X≤x),pX(x)=dxdFX(x) Bivariate Continuous Distributions¶
For joint PDF pX,Y(x,y) satisfying ∫−∞∞∫−∞∞pX,Y(x,y)dxdy=1:
Marginals:
pX(x)=∫−∞∞pX,Y(x,y)dy,pY(y)=∫−∞∞pX,Y(x,y)dx Conditional:
pX∣Y(x∣y)=pY(y)pX,Y(x,y) Independence: X⊥Y⟺pX,Y(x,y)=pX(x)pY(y)
Gaussian (Normal) Distribution¶
The Gaussian distribution is one of the most important models in machine learning.
Univariate:
N(x∣μ,σ2)=2πσ21exp(−2σ2(x−μ)2) where μ is the mean and σ2 is the variance.
Multivariate (D-dimensional vector x):
N(x∣μ,Σ)=(2π)D/2∣Σ∣1/21exp(−21(x−μ)⊤Σ−1(x−μ)) where μ is the mean vector and Σ is the covariance matrix.