Random experiments, events, random variables, and the distributions that model them
Probability is the mathematical language of uncertainty. It assigns numbers to events in a repeatable experiment so that long-run frequencies, fair bets, and physical noise can be reasoned about with the same calculus.
This note builds the subject from the ground up: a random experiment produces an outcome in a sample space; an event is a subset of that space; a probability is a consistent assignment of mass to events; a random variable turns outcomes into numbers, and a distribution tells us how those numbers are spread. We then study the three workhorse laws of an introductory course — the binomial, the Poisson, and the Gaussian — and the two numbers that summarise them, mean and variance.
A random experiment is a well-defined, repeatable procedure whose outcome cannot be predicted with certainty, even though the set of possible outcomes is known in advance.
The same protocol can be run again under essentially identical conditions (toss, roll, count, measure).
Before the trial we do not know which elementary result will occur — only the catalogue of possibilities.
Each run ends in a definite, observable outcome (heads, a face of a die, a count, a measured length).
The first four have a discrete list of outcomes; the last has a continuum. That distinction will reappear as discrete versus continuous random variables.
A pair of fair dice — the prototype random experiment. Press “Roll the dice”; drag to inspect.
The sample space Ω (omega) is the set of all possible outcomes of the experiment. Each element ω ∈ Ω is an elementary outcome (or sample point).
Finite or countably infinite. Coin: Ω = {H, T}. One die: Ω = {1,2,3,4,5,6}. Two distinguishable dice: Ω = {(i, j) : i, j = 1…6}, so |Ω| = 36.
Uncountable. Lifetime of a bulb: Ω = [0, ∞). Impact position on a target: Ω ⊂ ℝ². Probability of a single point is typically zero; mass lives on intervals and regions.
Two-dice sample space: each cube is one outcome (i, j). Highlight an event; |E|/36 is the classical probability.
An event is a subset E ⊆ Ω — a statement about the outcome that is either true or false after the experiment is performed.
E ∩ F = ∅. They cannot occur together. Disjoint dice events: “sum = 2” and “sum = 12”.
E1 ∪ … ∪ Ek = Ω. Together they cover every outcome. Faces {odd} and {even} on one die.
Knowledge of F does not change the chance of E: P(E ∩ F) = P(E) P(F). Two successive fair coin tosses.
Let A = {first die even}, B = {sum = 7}, C = {doubles}. Then |A| = 18, |B| = 6, |C| = 6, A ∩ B = {(2,5),(4,3),(6,1)} so |A ∩ B| = 3. A and B are independent: 18/36 × 6/36 = 3/36.
A probability is a function P that assigns to each event a number in [0, 1] in a way that matches the long-run frequency of that event.
P(E) ≥ 0 , P(Ω) = 1 , P(E ∪ F) = P(E) + P(F) if E ∩ F = ∅
Countable additivity extends the third axiom to a sequence of pairwise disjoint events. Immediate consequences:
P(Ec) = 1 − P(E) , P(∅) = 0 , P(E ∪ F) = P(E) + P(F) − P(E ∩ F)
If Ω is finite and every elementary outcome is equally likely,
P(E) = |E| / |Ω| = (number of favourable outcomes) / (number of possible outcomes)
If the experiment is repeated independently n times and the event occurs Nn times, then
P(E) = limn → ∞ Nn / n
The running relative frequency of heads in fair coin tosses jitters around 1/2 and settles there — the law of large numbers made visible.
One simulated sequence of 400 fair coin tosses. The relative frequency of heads converges to 1/2 (dashed).
P(E | F) = P(E ∩ F) / P(F) (P(F) > 0)
Independence is the special case P(E | F) = P(E). Bayes’ rule reverses the conditioning:
P(F | E) = P(E | F) P(F) / P(E)
A random variable is a numerical function of the outcome: X : Ω → ℝ. We never need the inner details of Ω once we know how X is distributed.
X takes a countable set of values {xk}. It is described by a probability mass function (PMF)
pX(x) = P(X = x) , Σx pX(x) = 1
Examples: die face, number of heads, number of arrivals.
X has a probability density function (PDF) fX with
P(a ≤ X ≤ b) = ∫ab fX(x) dx , ∫−∞∞ f = 1
A single point has probability zero. Examples: noise voltage, measurement error, waiting time.
The cumulative distribution function (CDF) FX(x) = P(X ≤ x) exists in both cases: it is a step function for a discrete X and a smooth increasing function (the integral of the PDF) for a continuous X.
The simplest discrete law is the Bernoulli trial: one success/failure experiment with P(success) = p. A random variable X ~ Bernoulli(p) satisfies
P(X = 1) = p , P(X = 0) = 1 − p , E[X] = p , Var(X) = p(1 − p)
Repeat the Bernoulli trial independently n times and let X be the number of successes. Then X follows the binomial distribution Binomial(n, p):
P(X = k) = C(n, k) pk (1 − p)n − k , k = 0, 1, …, n
C(n, k) = n! / (k! (n − k)!) , E[X] = n p , Var(X) = n p (1 − p)
Any particular sequence with k successes and n − k failures has probability pk(1 − p)n − k. There are C(n, k) such sequences, and they are disjoint, so the probabilities add.
E[X] = 10.00 , Var(X) = 5.00
Binomial PMF. Drag n and p. For large n and p near 1/2 the histogram approaches a Gaussian bell (De Moivre–Laplace).
Galton board (quincunx). Each peg is a fair Bernoulli trial; the bin index is Binomial(rows, 1/2). Many balls reconstruct the bell.
The Poisson law models a count of rare, independent events in a fixed interval of time or space — arrivals, decays, defects, misprints.
P(X = k) = e−λ λk / k! , k = 0, 1, 2, …
E[X] = λ , Var(X) = λ
The single parameter λ > 0 is both the mean and the variance. That “equal scatter” is a diagnostic: counts whose sample variance greatly exceeds the sample mean are over-dispersed and not Poisson.
Let Xn ~ Binomial(n, pn) with n pn → λ as n → ∞ and pn → 0 (many trials, each rarely a success). Then
P(Xn = k) → e−λ λk / k!
A sample of 800 chips, each defective with probability 0.005, independently. Then n p = 4. The number of defectives is essentially Poisson(λ = 4), so P(X = 0) ≈ e−4 ≈ 0.0183, P(X ≤ 2) ≈ 0.238.
E[X] = 4.00 , Var(X) = 4.00
Poisson PMF. For larger λ the mass spreads and becomes more symmetric — another road toward the Gaussian.
The Gaussian (normal) density on the real line is
f(x) = 1 / (σ √(2π)) · exp( − (x − μ)² / (2σ²) ) , x ∈ ℝ
E[X] = μ , Var(X) = σ²
μ locates the peak; σ stretches it. We write X ~ N(μ, σ²). The standard normal is Z ~ N(0, 1); any Gaussian is a location-scale copy X = μ + σ Z.
These are the familiar 68–95–99.7 percentages. They are why “within two standard deviations” is a default error bar.
If X1, …, Xn are i.i.d. with finite mean μ and variance σ², then
(X1 + … + Xn − nμ) / (σ √n) → N(0, 1)
in distribution as n → ∞. Sums of independent noise, measurement averages, binomial counts with large n — all become Gaussian. The Galton board is a mechanical CLT.
E[X] = 0.00 , Var(X) = 1.00 | P(|X−μ|≤σ) ≈ 0.68
Gaussian PDF. Shaded band is μ ± σ. Move the mean (slide) and the width (σ).
Bivariate isotropic Gaussian as a surface z ∝ exp(−(x² + y²)/(2σ²)). Drag to rotate; the level curves are circles.
The mean (expectation) is the probability-weighted average of X — the centre of mass of the distribution. The variance is the expected squared deviation from that centre — the moment of inertia of the same mass distribution.
Discrete: E[X] = Σx x p(x) , E[g(X)] = Σx g(x) p(x)
Continuous: E[X] = ∫ x f(x) dx , E[g(X)] = ∫ g(x) f(x) dx
Var(X) = E[(X − E[X])²] = E[X²] − (E[X])² , σ = √Var(X)
E[aX + b] = a E[X] + b , Var(aX + b) = a² Var(X)
If X, Y independent: E[XY] = E[X] E[Y] , Var(X + Y) = Var(X) + Var(Y)
Adding a constant shifts the mean and leaves the variance alone. Scaling by a scales the mean by a and the variance by a² (standard deviation by |a|).
Bernoulli(p): mean p , variance p(1 − p)
Binomial(n, p): mean n p , variance n p (1 − p)
Poisson(λ): mean λ , variance λ
Gaussian N(μ, σ²): mean μ , variance σ²
Matched means near 8: Binomial(20, 0.4), Poisson(8), Gaussian N(8, 4.8). Poisson is over-dispersed relative to the binomial with the same mean; the Gaussian here copies the binomial’s variance.
Everything in one pass. Keep this section nearby while solving problems.
Repeatable uncertain procedure. Ω = all outcomes. Event E ⊆ Ω. Complement, union, intersection. Exclusive ⇔ disjoint.
P ≥ 0, P(Ω)=1, additivity
P(E) = |E|/|Ω|
when outcomes are equally likely. Frequency: Nn/n → P(E).
P(E|F) = P(E∩F)/P(F)
Independent ⇔ P(E∩F)=P(E)P(F). Bayes reverses the bar.
X : Ω → ℝ. Discrete: PMF p(x), Σ p = 1. Continuous: PDF f(x), ∫ f = 1, P(a,b)=∫ab f.
C(n,k) pk(1−p)n−k
mean np , var np(1−p)
Count of successes in n independent Bernoulli trials.
e−λ λk / k!
mean = var = λ
Rare-event / binomial limit n→∞, p→0, np→λ.
f ∝ exp(−(x−μ)²/(2σ²))
mean μ , var σ²
68–95–99.7 rule. CLT: sums become Gaussian.
E[aX+b]=aE[X]+b
Var(aX+b)=a² Var(X)
Independent: variances add. Var = E[X²] − (E[X])².
Probability starts as counting in a well-chosen sample space and becomes a calculus of random variables once a PMF or PDF is written down. The binomial is the law of repeated independent trials; the Poisson is the law of rare independent counts; the Gaussian is the law of aggregated independent noise. Mean and variance are the two-number summary that those three — and essentially every other law in this course — carry.
From here the natural sequels are jointly distributed variables, covariance, moment generating functions, and the formal statement of the law of large numbers and the CLT.