Skip to content

Almost Surely

Definition

Fix a sample space SS with a probability function P\mathbb{P}. An event AA happens almost surely (a.s.), or with probability one (w.p.1), if

P(A)=1.\mathbb{P}(A)=1.

Equivalently, its complement has probability zero. More generally, a statement about outcomes holds almost surely if the set of outcomes where it fails is contained in an event of probability zero.

Two random variables XX and YY on the same sample space are equal almost surely, written X=YX=Y a.s., if

P(X=Y)=1.\mathbb{P}(X=Y)=1.

In the same way, X≤YX\le Y a.s. means P(X≤Y)=1\mathbb{P}(X\le Y)=1, and XX is almost surely constant if P(X=c)=1\mathbb{P}(X=c)=1 for some number cc.


Interpretation

"Almost" is there because the exceptional set need not be empty: it may contain outcomes that are perfectly possible, yet carry total probability zero. Probability one is therefore not the same as "for every outcome", and probability zero is not the same as "impossible".

Graph over outcomes u in (0,1) of U and Y, which agree except at u = 1/2 where Y = 0, together with the dashed line 1 − U, which meets U only at u = 1/2.

The figure takes the sample space (0,1)(0,1) with probability equal to length, and U(u)=uU(u)=u, so U∼Unif⁡(0,1)U\sim\operatorname{Unif}(0,1). The variable YY from the Examples follows the same line as UU except at the single outcome u=12u=\tfrac{1}{2}, where it drops to 00. The outcome u=12u=\tfrac{1}{2} is perfectly possible, yet the event {Y≠U}={U=12}\{Y\neq U\}=\{U=\tfrac{1}{2}\} has probability zero, so Y=UY=U almost surely. The dashed line 1−U1-U shows the reverse situation: it has the same distribution as UU but meets it only at u=12u=\tfrac{1}{2}, so UU and 1−U1-U are almost surely different.

Shrink the window around cc: its probability is at most 2ε2\varepsilon, so P(U=c)=0\mathbb{P}(U=c)=0 although cc is a possible value. The second event compares UU with 1−U1-U, which have the same distribution yet are almost surely different.

For expectations, variances and distributions, what happens on an event of probability zero is invisible, so random variables that are equal almost surely can be treated as the same.

The phrase is essential for limit statements such as the strong law of large numbers, which concern the whole sequence X1,X2,…X_1,X_2,\ldots at once. "The sample mean converges to μ\mu almost surely" allows some outcomes on which it does not converge, as long as together they have probability zero.

Equality almost surely is much stronger than equality in distribution. Equal distributions only say that XX and YY take values with the same probabilities; almost-sure equality says that they take the same value on (almost) every outcome.


Key Results

  • If A1,A2,…A_1,A_2,\ldots each happen almost surely, then so does ⋂nAn\bigcap_{n}A_n, because the union of countably many probability-zero events has probability zero. In particular, X=YX=Y a.s. and Y=ZY=Z a.s. give X=ZX=Z a.s.
  • If X=YX=Y a.s., then XX and YY have the same distribution, and EX=EY\mathbb{E}X=\mathbb{E}Y whenever either side exists. The converse fails: the same distribution does not imply almost sure equality.
  • If X≤YX\le Y a.s. and both expectations exist, then EX≤EY\mathbb{E}X\le\mathbb{E}Y (monotonicity of expectation).
  • If X≥0X\ge0 and EX=0\mathbb{E}X=0, then X=0X=0 a.s. By the Markov inequality, P(X≥1/n)≤n EX=0\mathbb{P}(X\ge1/n)\le n\,\mathbb{E}X=0 for every nn, and {X>0}=⋃n{X≥1/n}\{X>0\}=\bigcup_n\{X\ge1/n\} is a countable union of null events.
  • Var⁡(X)=0\operatorname{Var}(X)=0 if and only if X=EXX=\mathbb{E}X a.s. (variance). This is the previous result applied to (X−EX)2(X-\mathbb{E}X)^2, or equivalently the Chebyshev inequality with σ2=0\sigma^2=0.
  • A sequence converges almost surely when the event {lim⁡n→∞Xn=X}\{\lim_{n\to\infty}X_n=X\} happens almost surely; the strong law of large numbers is a statement of this kind. Almost-sure convergence implies convergence in probability, which is the mode of the weak law.

Examples

  • If XX is a continuous random variable, then P(X=c)=0\mathbb{P}(X=c)=0 for every fixed c∈Rc\in\mathbb{R}, so X≠cX\neq c a.s., even though cc may be a possible value. Taking a countable union, a U∼Unif⁡(0,1)U\sim\operatorname{Unif}(0,1) variable is irrational a.s., since P(U∈Q)=∑qP(U=q)=0\displaystyle \mathbb{P}(U\in\mathbb{Q})=\sum_{q}\mathbb{P}(U=q)=0.
  • Toss a fair coin infinitely often. The first nn tosses are all tails with probability 2−n2^{-n}, so the event "never heads" has probability at most 2−n2^{-n} for every nn, hence probability 00. Heads appears eventually almost surely, even though the all-tails sequence is a possible outcome.
  • For U∼Unif⁡(0,1)U\sim\operatorname{Unif}(0,1), the variables UU and 1−U1-U have the same distribution, but P(U=1−U)=P(U=1/2)=0\mathbb{P}(U=1-U)=\mathbb{P}(U=1/2)=0: they are almost surely different.
  • Let Y=UY=U except that Y=0Y=0 when U=1/2U=1/2. Then Y=UY=U a.s., so EY=EU=1/2\mathbb{E}Y=\mathbb{E}U=1/2 and Var⁡(Y)=Var⁡(U)=1/12\operatorname{Var}(Y)=\operatorname{Var}(U)=1/12.
  • On a finite sample space in which every outcome has positive probability, the only event of probability zero is ∅\varnothing, so "almost surely" there means "for every outcome". The distinction only matters when some outcomes carry probability zero.

Prerequisites

Sources

Aliases: almost sure, with probability one, a.s., with probability 1, almost certainly Keywords: w.p.1, null event, probability zero, equal almost surely, probability zero is not impossible, almost surely constant Symbols: element of, epsilon, infinity, mu, rational numbers, real numbers, sigma, sum

Last updated: 17 October 2026 21:53