BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Probability: one random variable

Statistical physics speaks the language of probability. A random variable is described completely by its probability density p(x), or equivalently by its cumulative distribution P(x); delta functions let discrete and mixed variables use the same tools. Averages such as the mean and variance summarize a density, and the Gaussian, exponential and Poisson densities appear again and again.

On this page · 5 sections
  1. Random variables
  2. Delta functions: discrete and mixed variables
  3. The slides' examples
  4. Averages
  5. Summary

Statistical physics deals with systems of enormous numbers of particles, whose individual behaviour cannot be followed. Its language is probability. 8.044 begins with a short course in probability, from one random variable to sums of many, and this first lecture covers a single variable (slides 1–14, of which the opening overview and the closing Poisson plots are only described; notes pp. 1–18). (MIT's material for this lecture is Thomas Greytak's lecture slides and his lecture notes on probability, Chapter 1; this page follows them in its own words, with its own worked example. The notes' figures are not reproduced.)

Random variables#

A random variable is a quantity whose value cannot be predicted from the information at hand, although its behaviour follows the rules of probability (notes p. 1). The uncertainty has two sources: ignorance, as for the velocity of an atom picked at random from a gas whose individual atoms we have not followed, and quantum mechanics, as for the distance of a hydrogen atom's electron from its proton, random even when the atom's state is completely known (notes p. 1; slide 2). Random variables can be continuous (a velocity), discrete (the number of atoms in a small volume) or mixed (the energy of an electron in a hydrogen discharge, discrete for bound states and continuous above) (notes pp. 1–2).

Probability rests on an ensemble: a very large number MM of similarly prepared systems, everything specified about the system set alike in each, the rest left to chance (notes p. 2). Building a histogram of the values xnx_n they produce and letting M→∞M \to \infty defines the probability density (notes p. 3):

Probability density
px(ζ)≡lim⁡M→∞, dζ→0number of systems with ζ≤x<ζ+dζM dζp_x(\zeta) \equiv \lim_{M \to \infty,\ d\zeta \to 0}\frac{\text{number of systems with } \zeta \le x < \zeta + d\zeta}{M\,d\zeta}
In words

p sub x ( zeta ) is defined as the limit as M goes to infinity, d zeta goes to 0 of the quantity number of systems with zeta is less than or equal to x less than zeta plus d zeta, all over the quantity M d zeta

So px(ζ)dζp_x(\zeta)d\zeta is the probability that one such system gives a value between ζ\zeta and ζ+dζ\zeta + d\zeta. (The subscript names the variable and ζ\zeta is a dummy argument; when nothing is ambiguous one writes simply p(x)p(x).) From the histogram picture (notes p. 3; slide 3):

Properties of a density
px(ζ)≥0,probability(a<x≤b)=∫abpx(ζ) dζ,∫−∞∞px(ζ) dζ=1p_x(\zeta) \ge 0, \qquad \text{probability}(a < x \le b) = \int_a^bp_x(\zeta)\,d\zeta, \qquad \int_{-\infty}^{\infty}p_x(\zeta)\,d\zeta = 1
In words

p sub x ( zeta ) is greater than or equal to 0, probability (a less than x is less than or equal to b) equals the integral from a to b of p sub x ( zeta ) d zeta, the integral from minus infinity to infinity of p sub x ( zeta ) d zeta equals 1

The cumulative distribution (or probability distribution function) is the probability that xx does not exceed ζ\zeta (notes pp. 3–4):

Cumulative distribution
Px(ζ)≡probability(x≤ζ)=∫−∞ζpx(η) dη,px(ζ)=ddζPx(ζ)P_x(\zeta) \equiv \text{probability}(x \le \zeta) = \int_{-\infty}^{\zeta}p_x(\eta)\,d\eta, \qquad p_x(\zeta) = \frac{d}{d\zeta}P_x(\zeta)
In words

capital P sub x ( zeta ) is defined as probability (x is less than or equal to zeta ) equals the integral from minus infinity to zeta of p sub x ( eta ) d eta, p sub x ( zeta ) equals d over d zeta capital P sub x ( zeta )

Either one specifies the random variable completely: pxp_x contains all that can be known about xx for the given system (notes p. 4). The practical questions are how to find pxp_x, which is the subject of the rest of the course, and what can be extracted from it once known, the subject of these notes.

Waiting for a decay (notes pp. 4–6). A radioactive source behind a shutter gives detections at a mean rate 1/τ1/\tau. Opening the shutter at t=0t = 0, the waiting time to the first detection has the exponential density p(t)=τ−1e−t/τp(t) = \tau^{-1}e^{-t/\tau} for t≥0t \ge 0 (and zero before), which is normalized and has the cumulative P(t)=1−e−t/τP(t) = 1 - e^{-t/\tau}.

The exponential waiting-time density and its cumulative distribution, computed from the formulas above. The density starts at 1/τ1/\tau and falls; the cumulative rises from 0 towards 1, reaching 1−1/e≈0.631 - 1/e \approx 0.63 at t=τt = \tau.

Delta functions: discrete and mixed variables#

To treat continuous, discrete and mixed variables with one formalism, use the delta function δ(x)\delta(x): zero for x≠0x \ne 0, undefined at x=0x = 0, with unit area (notes pp. 6–7). It is the limit of narrow normalized functions, such as a rectangle of width ww and height 1/w1/w, or a Gaussian of width σ\sigma, as the width goes to zero. Its key property is (notes p. 7)

Sifting property of the delta function
∫−∞∞f(x) b δ(x−a) dx=b f(a)\int_{-\infty}^{\infty}f(x)\,b\,\delta(x - a)\,dx = b\,f(a)
In words

the integral from minus infinity to infinity of f(x) b delta the quantity x minus a, d x equals b f(a)

and its integral is a unit step at x=ax = a (notes p. 8). On a graph, a delta function is an arrow labelled with its weight.

A discrete variable is then a sum of weighted delta functions. The notes' example is the number of stars in a closely bound group, with illustrative probabilities 13\frac13, 12\frac12, 16\frac16 for single, binary and triple stars: p(x)p(x) is three delta functions, and P(x)P(x) is a staircase whose steps, 13\frac13, 12\frac12 and 16\frac16, are their weights; differentiating the staircase gives the delta functions back (notes pp. 8–9). A mixed variable has both: in a forest where one tree in six has been cut to a 4-foot stump, the height has a delta function at 4 feet plus a continuous part for the uncut trees (notes pp. 9–10). Light from a xenon discharge mixes sharp lines, from transitions between bound electron states, with a continuum, from transitions involving free electrons; its wavelength, as a random variable, has a mixed density too. Since photon energy is inversely proportional to wavelength, turning that density into one for energy needs the method of functions of a random variable, two lectures on (notes pp. 10–12).

The slides' examples#

The slides illustrate these ideas with gases and surfaces (slides 4–9). An atom leaving a surface after physical adsorption flies off at an angle θ\theta from the normal with density p(θ)=2sin⁡θcos⁡θp(\theta) = 2\sin\theta\cos\theta on 0≤θ≤π/20 \le \theta \le \pi/2, so most atoms leave neither straight up nor grazing the surface; per unit solid angle dΩ=sin⁡θ dθ dϕd\Omega = \sin\theta\,d\theta\,d\phi, the probability goes as cos⁡θ/π\cos\theta/\pi (slides 4–6). An atom bouncing around inside a cavity with a small hole escapes at each wall encounter with probability AH/ATA_H/A_T, the hole's share of the wall area, so the number nn of encounters before it escapes has the geometric (or Bose–Einstein) density

Geometric density
p(n)=AHAT(1−AHAT)n,n=0,1,2,…p(n) = \frac{A_H}{A_T}\left(1 - \frac{A_H}{A_T}\right)^n, \qquad n = 0, 1, 2, \dots
In words

p(n) equals capital A sub H over capital A sub T, times the quantity 1 minus capital A sub H over capital A sub T, all to the power n, n equals 0, 1, 2, and so on

a discrete variable written as delta functions at the integers (slides 7–8). And an atom that may be either physically or chemically adsorbed has a mixed density whose discrete part shrinks with time as e−t/τe^{-t/\tau} (slide 9).

Averages#

Often less than the full density is needed: an ensemble average of some function of xx (notes p. 12; slide 10):

Ensemble average
⟨f(x)⟩≡∫−∞∞f(ζ) px(ζ) dζ\langle f(x)\rangle \equiv \int_{-\infty}^{\infty}f(\zeta)\,p_x(\zeta)\,d\zeta
In words

the average of f(x) is defined as the integral from minus infinity to infinity of f( zeta ) p sub x ( zeta ) d zeta

The mean ⟨x⟩\langle x\rangle locates the density; the mean square ⟨x2⟩\langle x^2\rangle is often tied to energy or power; and the variance measures the spread about the mean (notes pp. 12–13):

Variance
Var(x)≡⟨(x−⟨x⟩)2⟩=⟨x2⟩−⟨x⟩2\text{Var}(x) \equiv \left\langle\left(x - \langle x\rangle\right)^2\right\rangle = \langle x^2\rangle - \langle x\rangle^2
In words

Var (x) is defined as the average of the quantity x minus the average of x, all squared equals the average of x squared minus the average of x squared

Its square root, the standard deviation, measures the width of the density.

The Gaussian (notes pp. 13–15; slide 11). The density

Gaussian density
p(x)=12πσ2exp⁡(−(x−a)22σ2)p(x) = \frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(x - a)^2}{2\sigma^2}\right)
In words

p(x) equals 1 over the square root of 2 pi sigma squared, times exp (- the quantity x minus a, all squared over the quantity 2 sigma squared, )

appears whenever a variable contributes quadratically to the energy in thermal equilibrium (a velocity component of a gas atom), or is the sum of many small independent contributions (a random walk). It has ⟨x⟩=a\langle x\rangle = a and Var(x)=σ2\text{Var}(x) = \sigma^2: two separate parameters set its position and its width (notes p. 14). Its cumulative distribution has no closed form; it is the tabulated error function (notes p. 15). By contrast, the exponential density has mean τ\tau and variance τ2\tau^2, both set by the same parameter (slide 11). Averages over the angle density above give, for instance, the mean path ⟨L⟩\langle L\rangle of an atom crossing a layer of thickness dd in a straight line from its surface: L=d/cos⁡θL = d/\cos\theta, and ⟨L⟩=∫0π/2dcos⁡θ2sin⁡θcos⁡θ dθ=2d\langle L\rangle = \int_0^{\pi/2}\frac{d}{\cos\theta}2\sin\theta\cos\theta\,d\theta = 2d (slide 12).

The Poisson density (notes pp. 15–18; slide 13). Suppose events occur along a line so that, in a short stretch ΔX\Delta X, exactly one event happens with probability rΔXr\Delta X, independently of all other stretches. Then the number of events in a length LL follows (notes p. 15)

Poisson density
p(n)=1n!(rL)ne−rL,n=0,1,2,…p(n) = \frac{1}{n!}\left(rL\right)^ne^{-rL}, \qquad n = 0, 1, 2, \dots
In words

p(n) equals 1 over the quantity n factorial, times (r L ) to the power n e to the power minus r L, n equals 0, 1, 2, and so on

(derived in the next lecture, with the tools for two random variables). Examples: the number of decays from a radioactive sample in a time short compared with its mean life; the number of helium-3 atoms in a small patch of a monolayer of natural helium; the number of atoms within some distance of a given atom in a dilute gas (notes p. 16). Summing the series, with a derivative trick for the sums weighted by nn and n2n^2, gives normalization, ⟨n⟩=rL\langle n\rangle = rL (rate times interval) and ⟨n2⟩=⟨n⟩+⟨n⟩2\langle n^2\rangle = \langle n\rangle + \langle n\rangle^2, so (notes pp. 16–18)

Poisson mean and variance
⟨n⟩=rL,Var(n)=⟨n⟩,p(n)=1n!⟨n⟩ne−⟨n⟩\langle n\rangle = rL, \qquad \text{Var}(n) = \langle n\rangle, \qquad p(n) = \frac{1}{n!}\langle n\rangle^ne^{-\langle n\rangle}
In words

the average of n equals r L, Var (n) equals the average of n, p(n) equals 1 over the quantity n factorial, times the average of n to the power n e to the power minus the average of n

A single parameter, the mean, specifies everything.

Worked example

Three densities at work

(a) A detector registers events at a mean rate of 0.5 per second. What is the probability that the first event comes within 1 s of opening the shutter, and what are the mean and standard deviation of the waiting time? (b) In a fixed time the number of counts is Poisson with mean 2.5. Find the probabilities of no counts, exactly two counts, and at least one count. (c) For a Gaussian, what fraction of values lies within one standard deviation of the mean?

(a) Waiting time

τ=2\tau = 2 s, so P(1 s)=1−e−0.5≈0.393P(1\ \text{s}) = 1 - e^{-0.5} \approx 0.393. The mean is τ=2\tau = 2 s and the standard deviation τ2=2\sqrt{\tau^2} = 2 s: for an exponential, the spread is as large as the mean.

(b) Counting

p(0)=e−2.5≈0.082p(0) = e^{-2.5} \approx 0.082; p(2)=2.522e−2.5≈0.257p(2) = \frac{2.5^2}{2}e^{-2.5} \approx 0.257; and 1−p(0)≈0.9181 - p(0) \approx 0.918. The variance is 2.5, so the standard deviation is about 1.6 counts.

(c) Within one sigma

∫a−σa+σp(x) dx=1−erfc(1/2)≈0.683\int_{a-\sigma}^{a+\sigma}p(x)\,dx = 1 - \text{erfc}(1/\sqrt2) \approx 0.683: about two thirds of the values lie within one standard deviation.

Summary#

  • A random variable reflects ignorance or quantum mechanics; it is specified completely by its density p(x)p(x) or its cumulative distribution P(x)P(x), with p=dP/dxp = dP/dx.
  • Delta functions let discrete and mixed variables use the same formalism.
  • Averages: ⟨f⟩=∫f p dx\langle f\rangle = \int f\,p\,dx; the mean, the mean square and the variance ⟨x2⟩−⟨x⟩2\langle x^2\rangle - \langle x\rangle^2.
  • Key densities: the Gaussian (mean and variance set separately), the exponential (both set by τ\tau) and the Poisson (Var(n)=⟨n⟩=rL\text{Var}(n) = \langle n\rangle = rL).

Symbols on this page

Show the 43 symbols used here
δ\delta delta.
The Dirac delta function. Say it: “delta”.
Δ\Delta capital delta.
A change or difference in a quantity, e.g. Δx = x₂ − x₁. Say it: “capital delta”.
ζ\zeta zeta.
A dummy variable standing for a value of x. Say it: “zeta” (sounds like “zay-ta or zee-ta”).
θ\theta theta.
The angle from the surface normal at which an atom leaves. Unit: rad. Say it: “theta” (sounds like “thay-ta or thee-ta”).
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
σ\sigma sigma.
The standard deviation of the Gaussian; σ² is its variance. Say it: “sigma”.
τ\tau tau.
The mean waiting time: the inverse of the event rate. Unit: s. Say it: “tau” (sounds like “rhymes with cow”).
ϕ\phi phi.
The azimuthal angle around the normal. Unit: rad. Say it: “phi” (sounds like “fye”).
Ω\Omega capital omega.
Solid angle; dΩ is a small solid angle. Unit: sr. Say it: “capital omega”.
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≡\equiv identical to.
Is defined as (or is identically equal to). Say it: “is defined as”.
≤\le less than or equal.
Is less than or equal to. Say it: “is less than or equal to”.
≥\ge greater than or equal.
Is greater than or equal to. Say it: “is greater than or equal to”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
⟨\langle angle brackets.
The average (mean value) of what is inside, ⟨…⟩. Say it: “the average of”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
lim⁡\lim limit.
Limit: the value approached as the variable written below approaches its target. Say it: “the limit”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
aa a.
A value of x; in the Gaussian, its mean. Say it: “a”.
exp⁡\exp exponential.
The exponential function. Say it: “exp”.
xx x.
A random variable (or the axis on which its values lie). Say it: “x”.
tt t.
The waiting time to the first event. Unit: s. Say it: “t”.
dd d.
The d of an integral or derivative. Say it: “d”.
nn n.
A whole number of events (Poisson); x_n is the value from the nth system. Say it: “n”.
ee e.
Euler's number. Say it: “e”.
ff f.
Any function of the random variable. Say it: “f”.
rr r.
The rate of events per unit length (or time). Unit: 1/m (or 1/s). Say it: “r”.
PP P.
The cumulative distribution, P(t) or P(x). Say it: “capital P”.
bb b.
A value of x; in the sifting property, the weight of the delta function. Say it: “b”.
LL L.
The length (or duration) of the interval in which events are counted. Unit: m (or s). Say it: “L”.
pp p.
A probability density, p(x), p(t) or p(n). Say it: “p”.
MM M.
The number of systems in the ensemble. Say it: “M”.
ww w.
The width of the rectangle that tends to a delta function. Say it: “w”.
XX X.
The position along the line on which events occur. Unit: m. Say it: “capital X”.
xnx_{n} x n.
The value of x produced by the nth member of the ensemble. Say it: “x sub n”.
η\eta eta.
A dummy variable of integration. Say it: “eta”.
pxp_{x} p x.
The probability density of the random variable x. Say it: “p sub x”.
PxP_{x} P sub x.
The cumulative distribution of x: the probability that x ≤ ζ. Say it: “capital P sub x”.
AHA_{H} A H.
The area of the hole in the cavity wall. Unit: m². Say it: “capital A sub H”.
ATA_{T} A T.
The total wall area of the cavity. Unit: m². Say it: “capital A sub T”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 42 words used here

New here

random variable.
A quantity whose value cannot be predicted from what is known, although its behaviour follows the rules of probability.
ensemble.
An imagined, very large collection of copies of a system, all prepared alike, used to define probabilities and averages.
cumulative distribution.
The probability that a random quantity does not exceed a given value, as a function of that value.
standard deviation.
A measure of how widely values are spread around their average, in the same units as the values: the square root of the variance.

Also used

statistical mechanics.
The branch of physics that explains the large-scale behaviour of matter, such as temperature and pressure, from the laws governing its atoms, using probability. Explained in Thermodynamic variables, temperature and work.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
velocity.
How fast and in which direction something moves: the change in position in each unit of time. Explained in Speed and velocity.
continuous.
Without breaks, gaps or jumps: a continuous graph can be drawn without lifting the pen; a continuous quantity can take every value in a range. Explained in The rocket equation.
energy.
A quantity, measured in joules, that a body or field has because of its motion, position or state; a closed system keeps its total. Explained in Conservation of energy.
bound state.
A state in which a particle stays trapped near a potential, such as an electron held in an atom. Explained in The infinite and finite square wells.
probability density.
Probability per unit length, area or volume: multiplied by a small interval, it gives the chance that the value falls there. Explained in Normalization, Hermitian operators and the probability current.
density.
How much of something (mass, charge, energy, particles or probability) there is in each unit of volume, area, length or other variable. Explained in Density and pressure.
delta function.
An idealised spike: zero everywhere except at one point, yet with total area one. It describes a sudden kick or a point source. Explained in The Fourier transform and AM radio.
limit.
The value a quantity gets closer and closer to, as near as we like, as its input approaches some value, without having to reach it. Explained in Rates of change and area under a graph.
Gaussian.
The bell-shaped curve e to the minus x squared, or a quantity spread out with that shape; also called a normal distribution. Explained in Probability: sums of random variables and the central limit theorem.
integral.
A sum of very many very small pieces, such as the area under a graph; it undoes taking a derivative. Explained in Rates of change and area under a graph.
unit step function.
The function that is 0 before time zero and 1 after it, used to switch inputs on. Explained in The unit step and discontinuous inputs.
graph.
The picture of a function: the curve y = f(x) for one variable, or the surface z = f(x, y) for two. Explained in Graphs, straight lines and slope.
weight.
How much one value counts in a weighted average or sum, compared with the others. Explained in Average value, weighted averages and probability.
differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
continuum.
The smooth, unbroken part of a spectrum, light spread over all wavelengths, as opposed to its sharp lines.
wavelength.
The distance from one crest of a wave to the next. Explained in Waves: speed, frequency, wavelength.
photon.
A particle of light: the smallest amount of energy that light of a given frequency can carry. Explained in Thermal radiation and Planck's photons.
proportional.
Of two quantities: always in the same ratio, so that doubling one doubles the other. Explained in Graphs, straight lines and slope.
solid angle.
The three-dimensional version of an angle: how much of the view around a point an object covers, measured in steradians. Explained in Gauss's law.
variance.
A measure of spread: the average of the squared distance of each value from the mean. Explained in Observables, the measurement postulate and uncertainty.
thermal equilibrium.
A state in which energy is shared out evenly and nothing changes on average, so the system can be described by a single temperature. Explained in Temperature and thermal energy.
random walk.
A path made of steps in random directions; after N steps of length λ the typical distance from the start is only about λ√N. Explained in Mean free path, effusion, sound and diffusion.
error function.
The function erf(x): the area under a bell curve from 0 to x, scaled so that it tends to 1; it has no simpler formula. Explained in The second fundamental theorem of calculus.
event.
One of the possible outcomes of a random process, or a set of them, to which a probability can be given. Explained in Probability: two or more random variables.
mean lifetime.
The average time an unstable particle survives before decaying; after one mean lifetime about 37 per cent of a sample is left. Explained in Big Bang nucleosynthesis: the first nuclei.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
interval.
A stretch between two values or two moments; in maths, all the numbers between two end points. Explained in Time dilation, length contraction and the interval.
galaxy.
A huge system of stars, gas and dust, from thousands to over a trillion stars, held together by gravity inside a dark matter halo. Explained in Towards the universe: weighing the Sun and the Galaxy with orbits.
Gaussian random field.
A random pattern of values in space whose value at each point, and any combination of values, follows a bell-shaped normal distribution. Explained in How many halos? The Press–Schechter mass function.
density contrast.
How much denser or thinner than average a region is, as a fraction of the average density. Explained in How small ripples grow: linear perturbation theory.
Press–Schechter.
A simple method for predicting how many dark matter halos of each mass exist, from the statistics of the smoothed early density ripples. Explained in How many halos? The Press–Schechter mass function.
halo.
A large, roughly round cloud of dark matter, held together by its own gravity, inside which a galaxy or a cluster of galaxies sits. Explained in When ripples collapse: the spherical collapse model.

Academic

argument.
A chain of reasoning that leads to a conclusion; in maths also the input of a function, such as x in sin x.
ambiguous.
Open to more than one meaning, so it is unclear which is intended.
formalism.
A particular mathematical way of writing and working with a theory.
derive.
To obtain a result by reasoning or calculation from other known results.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

Pages that build on this

Practise

Check your understanding

  1. Which of these is NOT a property of every probability density p(x)p(x)?
  2. A random variable has ⟨x⟩=3\langle x\rangle = 3 and ⟨x2⟩=13\langle x^2\rangle = 13. What is its standard deviation?
  3. Counts in a detector follow a Poisson density with mean 4. What is their variance?
  4. How is a discrete random variable, taking the value 2 with probability 1/2, written as a density?
0 of 4 answered

Flashcards

1 / 3