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

Probability: functions of a random variable

If x is random, so is any function f(x), and its density follows in three steps: find where f is below a given value, integrate the density of x over that region to get the cumulative distribution of f, and differentiate. The method gives the intensity of thermal light, the position of an oscillator of unknown phase, the wavelength spectrum of black-body photons, and densities of functions of two variables.

You need this first

Full reading path (2 pages)
  1. Probability: one random variable (8.044)
  2. Probability: two or more random variables (8.044)
On this page · 6 sections
  1. The method
  2. The intensity of thermal light
  3. Harmonic motion with a random phase
  4. Functions of two variables, and changes of variable
  5. The slides' examples
  6. Summary

If xx is a random variable, any function of it is one too. Knowing the density of an atom's speed, say, one may want the density of its kinetic energy, not just its average. This lecture gives one method for finding the density of a function, a method that always works and is the most useful in physics, and applies it to several examples (slides 1–17; notes pp. 35–46). (MIT's material for this lecture is Greytak's slides and his probability notes, Chapter 3; this page follows them in its own words, with its own worked example. The notes' figures are not reproduced.)

The method#

Given px(ζ)p_x(\zeta) and a function f(x)f(x), find pf(η)p_f(\eta) in three steps (notes p. 35; slide 2):

  • A. Sketch f(x)f(x) and find the region of xx where f(x)<ηf(x) < \eta.
  • B. Integrate pxp_x over that region: this is the cumulative distribution Pf(η)P_f(\eta).
  • C. Differentiate Pf(η)P_f(\eta) to get pf(η)p_f(\eta).

The integral in step B rarely needs to be done, because of a rule for differentiating an integral whose limits and integrand depend on the variable (notes p. 35; slide 4):

Derivative of an integral
ddy∫a(y)b(y)g(y,x) dx=g(y,b(y))dbdy−g(y,a(y))dady+∫a(y)b(y)∂g(y,x)∂y dx\frac{d}{dy}\int_{a(y)}^{b(y)}g(y, x)\,dx = g\left(y, b(y)\right)\frac{db}{dy} - g\left(y, a(y)\right)\frac{da}{dy} + \int_{a(y)}^{b(y)}\frac{\partial g(y, x)}{\partial y}\,dx
In words

d over d y the integral from a(y) to b(y) of g(y, x) d x equals g (y, b(y) ) d b over d y minus g (y, a(y) ) d a over d y plus the integral from a(y) to b(y) of partial g(y, x) over partial y, times d x

The intensity of thermal light#

The instantaneous intensity of a linearly polarized wave is I=aE2I = aE^2; the same square law appears for power in electrical and acoustic systems (notes p. 36). For thermal radiation, the field has a Gaussian density with zero mean and variance σ2\sigma^2. The mean intensity is easy, ⟨I⟩=aσ2\langle I\rangle = a\sigma^2, but the density needs the method (notes pp. 36–38; slides 3–5). I<ηI < \eta when ∣E∣<η/a|E| < \sqrt{\eta/a}, so PI(η)=∫−η/aη/apE(ζ) dζP_I(\eta) = \int_{-\sqrt{\eta/a}}^{\sqrt{\eta/a}}p_E(\zeta)\,d\zeta, and differentiating the limits:

Density of the intensity
pI(η)=12aη(pE(η/a)+pE(−η/a))=12πaσ2Iexp⁡(−I2aσ2),I>0p_I(\eta) = \frac{1}{2\sqrt{a\eta}}\left(p_E\left(\sqrt{\eta/a}\right) + p_E\left(-\sqrt{\eta/a}\right)\right) = \frac{1}{\sqrt{2\pi a\sigma^2I}}\exp\left(-\frac{I}{2a\sigma^2}\right), \quad I > 0
In words

p sub I ( eta ) equals 1 over the quantity 2 the square root of a eta, times the quantity p sub E ( the square root of eta over a, end of root, ) plus p sub E (- the square root of eta over a, end of root, ), equals 1 over the square root of 2 pi a sigma squared I, times exp (- I over the quantity 2 a sigma squared, ), I greater than 0

The first form holds for any density of EE; the second for the Gaussian. The density diverges at I=0I = 0, though integrably, for two reasons: the square law crowds small fields into small intensities, and the Gaussian gives small fields a finite weight (notes pp. 38–39). Such crowding returns later as the density of states.

Harmonic motion with a random phase#

Let x=x0sin⁡ϕx = x_0\sin\phi with ϕ\phi uniform on [0,2π)[0, 2\pi): an oscillator of fixed energy observed at a random time, or a binary star seen edge-on at a random moment (notes p. 39). For 0<η<x00 < \eta < x_0, x<ηx < \eta except for ϕ\phi between arcsin⁡(η/x0)\arcsin(\eta/x_0) and π−arcsin⁡(η/x0)\pi - \arcsin(\eta/x_0), so Px(η)=12+1πarcsin⁡(η/x0)P_x(\eta) = \frac12 + \frac1\pi\arcsin(\eta/x_0); the case x<0x < 0 follows the same way or by symmetry. Differentiating (notes pp. 40–42):

Position of an oscillator with random phase
px(η)=1πx02−η2,−x0<η<x0p_x(\eta) = \frac{1}{\pi\sqrt{x_0^2 - \eta^2}}, \qquad -x_0 < \eta < x_0
In words

p sub x ( eta ) equals 1 over the quantity pi the square root of x nought squared minus eta squared, end of root, minus x nought less than eta less than x nought

It diverges at the turning points ±x0\pm x_0, where the oscillator moves slowest.

The density of an oscillator's position at a random time, computed from the formula above: lowest, 1/π, at the centre, where it moves fastest, and rising without bound at the turning points.

Functions of two variables, and changes of variable#

The same three steps work for a function of two variables (notes pp. 42–44). For the product z=xyz = xy, the region where z<ηz < \eta is bounded by the hyperbolas y=η/xy = \eta/x; differentiating gives, for either sign of η\eta (the notes' closing line says "for all z < 0", a slip for all z),

Density of a product
pz(η)=∫−∞∞dζ∣ζ∣ px,y(ζ,ηζ)p_z(\eta) = \int_{-\infty}^{\infty}\frac{d\zeta}{|\zeta|}\,p_{x,y}\left(\zeta, \frac{\eta}{\zeta}\right)
In words

p sub z ( eta ) equals the integral from minus infinity to infinity of d zeta over the absolute value of zeta, times p sub x y ( zeta, eta over zeta )

A common use is a change of variables (notes pp. 45–46). For points uniform in a unit disk, the fraction with radius below rr and angle below θ\theta is r2θ/(2π)r^2\theta/(2\pi), so p(r,θ)=r/πp(r, \theta) = r/\pi, and then p(r)=2rp(r) = 2r for r<1r < 1 and p(θ)=1/(2π)p(\theta) = 1/(2\pi). Now p(r)p(θ)=p(r,θ)p(r)p(\theta) = p(r, \theta): in polar coordinates the two variables are independent, although xx and yy were not.

The slides' examples#

Black-body photons (slides 6–9). The frequency of a photon in black-body radiation at temperature TT has the density p(ν)=12.4041ν0(ν/ν0)2exp⁡(ν/ν0)−1p(\nu) = \frac{1}{2.404}\frac{1}{\nu_0}\frac{(\nu/\nu_0)^2}{\exp(\nu/\nu_0) - 1}, with ν0=kT/h\nu_0 = kT/h (the slide writes the constant as 2ζ(3)=2.4042\zeta(3) = 2.404; slide 6). With λ=c/ν\lambda = c/\nu, step B gives P(λ)=∫c/λ∞p(ν) dνP(\lambda) = \int_{c/\lambda}^{\infty}p(\nu)\,d\nu, and step C (slide 8):

Black-body photons per wavelength
p(λ)=cλ2 pν(cλ)=12.404 1λ0 (λ/λ0)−4exp⁡((λ/λ0)−1)−1,λ0=cν0p(\lambda) = \frac{c}{\lambda^2}\,p_\nu\left(\frac{c}{\lambda}\right) = \frac{1}{2.404}\,\frac{1}{\lambda_0}\,\frac{(\lambda/\lambda_0)^{-4}}{\exp\left((\lambda/\lambda_0)^{-1}\right) - 1}, \qquad \lambda_0 = \frac{c}{\nu_0}
In words

p( lambda ) equals c over lambda squared, times p sub nu ( c over lambda ) equals 1 over 2.404, times 1 over lambda nought, times the quantity the quantity lambda over lambda nought, all to the power minus 4, all over the quantity exp ( the quantity lambda over lambda nought, all to the power minus 1 ) minus 1, lambda nought equals c over nu nought

At long wavelengths it falls as (λ/λ0)−3(\lambda/\lambda_0)^{-3}; at short ones as (λ/λ0)−4e−λ0/λ(\lambda/\lambda_0)^{-4}e^{-\lambda_0/\lambda} (slide 9).

The larger of two random numbers (slides 10–12). If xx and yy are independent and uniform on (0,1)(0, 1), z=max⁡(x,y)z = \max(x, y) is below η\eta only when both are, so Pz(η)=η2P_z(\eta) = \eta^2, pz=2ηp_z = 2\eta, ⟨z⟩=23\langle z\rangle = \frac23, ⟨z2⟩=12\langle z^2\rangle = \frac12, Var(z)=118\text{Var}(z) = \frac1{18} and the standard deviation is about 0.24.

A desorbing atom (slides 13–17). An atom leaving a surface has independent speed, polar angle and azimuth, with p(v)=12σ4v3e−v2/(2σ2)p(v) = \frac{1}{2\sigma^4}v^3e^{-v^2/(2\sigma^2)} and p(θ)=2sin⁡θcos⁡θp(\theta) = 2\sin\theta\cos\theta. Its velocity along the normal, vz=vcos⁡θv_z = v\cos\theta, comes out after a substitution in the angle integral as (slides 15–17)

Normal velocity of a desorbing atom
p(vz)=vzσ2exp⁡(−vz22σ2),vz>0p(v_z) = \frac{v_z}{\sigma^2}\exp\left(-\frac{v_z^2}{2\sigma^2}\right), \qquad v_z > 0
In words

p( v sub z ) equals v sub z over sigma squared, times exp (- v sub z squared over the quantity 2 sigma squared, ), v sub z greater than 0

Worked example

Three transformations

(a) A gas atom's velocity component vv is Gaussian with zero mean and variance σ2=kT/m\sigma^2 = kT/m. Find the density of its kinetic energy K=12mv2K = \frac12mv^2 and check that ⟨K⟩=12kT\langle K\rangle = \frac12kT. (b) A pointer spins to a uniformly random angle ϕ\phi; let y=cos⁡ϕy = \cos\phi. What fraction of spins give ∣y∣>0.9|y| > 0.9? (c) For two independent uniform numbers on (0,1)(0, 1), find the density and mean of the smaller one.

(a) Kinetic energy

This is the intensity example with a=m/2a = m/2: p(K)=1πkTKe−K/(kT)p(K) = \frac{1}{\sqrt{\pi kTK}}e^{-K/(kT)} for K>0K > 0. Its mean is aσ2=m2⋅kTm=12kTa\sigma^2 = \frac m2\cdot\frac{kT}{m} = \frac12kT, one half kTkT per quadratic term, a result met again in the canonical ensemble.

(b) A cosine

As for the oscillator, p(y)=1π1−y2p(y) = \frac{1}{\pi\sqrt{1 - y^2}}. Then prob(∣y∣>0.9)=1−2πarcsin⁡0.9≈1−0.713=0.287\text{prob}(|y| > 0.9) = 1 - \frac2\pi\arcsin 0.9 \approx 1 - 0.713 = 0.287: more than a quarter of the spins land in the outer tenth of the range.

(c) The smaller number

The smaller one, ww, exceeds η\eta only if both do, so 1−Pw(η)=(1−η)21 - P_w(\eta) = (1 - \eta)^2, pw=2(1−η)p_w = 2(1 - \eta) and ⟨w⟩=∫012η(1−η) dη=13\langle w\rangle = \int_0^12\eta(1 - \eta)\,d\eta = \frac13; with the larger one's 23\frac23, the two average to 12\frac12, as they must.

Summary#

  • The density of f(x)f(x) follows from three steps: find where f<ηf < \eta, integrate pxp_x there, differentiate; the rule for differentiating an integral avoids doing it.
  • Thermal light: p(I)∝I−1/2e−I/(2aσ2)p(I) \propto I^{-1/2}e^{-I/(2a\sigma^2)}, divergent but integrable at I=0I = 0; an oscillator of random phase: p(x)=1/(πx02−x2)p(x) = 1/(\pi\sqrt{x_0^2 - x^2}).
  • The method extends to functions of two variables, such as a product, and to changes of variables, like polar coordinates in a disk.
  • Changing from frequency to wavelength reshapes the black-body density: p(λ)=(c/λ2)pν(c/λ)p(\lambda) = (c/\lambda^2)p_\nu(c/\lambda).

Symbols on this page

Show the 61 symbols used here
ζ\zeta zeta.
A dummy variable standing for a value of x. Say it: “zeta” (sounds like “zay-ta or zee-ta”).
θ\theta theta.
An angle. Say it: “theta” (sounds like “thay-ta or thee-ta”).
λ\lambda lambda.
The wavelength of a photon. Unit: m. Say it: “lambda”.
ν\nu nu.
The frequency of a photon. Unit: Hz. Say it: “nu” (sounds like “new”).
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
σ\sigma sigma.
The standard deviation of a Gaussian (of E, or of a velocity component); in p(v), a velocity scale. Say it: “sigma”.
ϕ\phi phi.
A uniformly random phase or angle. Unit: rad. Say it: “phi” (sounds like “fye”).
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
∝\propto proportional to.
Is proportional to: doubling one doubles the other. Say it: “is proportional to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
⟨\langle angle brackets.
The average (mean value) of what is inside, ⟨…⟩. Say it: “the average of”.
∂\partial partial.
Partial derivative: the rate of change with one variable, holding the others fixed. Say it: “partial”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
max⁡\max maximum.
Maximum: the largest value. Say it: “max”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
arcsin⁡\arcsin arcsine.
Inverse sine: the angle whose sine is the given number. Say it: “arc sine”.
aa a.
The lower limit a(y) of an integral; in I = aE², a constant. Say it: “a”.
zz z.
A function of two random variables (the product xy, or the larger of x and y). Say it: “z”.
cc c.
The speed of light. Unit: m/s. Say it: “c”.
kk k.
Boltzmann's constant. Unit: eV/K. Say it: “k”.
TT T.
The temperature. Unit: K. Say it: “T”.
exp⁡\exp exponential.
The exponential function. Say it: “exp”.
xx x.
A random variable (in the oscillator example, the position). Unit: m (as a position). Say it: “x”.
yy y.
The variable on which the limits depend; in the examples, a second random variable or cos φ. Say it: “y”.
dd d.
The d of an integral or derivative. Say it: “d”.
ee e.
Euler's number. Say it: “e”.
mm m.
The mass of an atom. Unit: kg. Say it: “m”.
ff f.
A function of the random variable. Say it: “f”.
gg g.
The integrand g(y, x). Say it: “g”.
vv v.
A speed or velocity component. Unit: m/s. Say it: “v”.
rr r.
The radius in the disk. Unit: m. Say it: “r”.
PP P.
A cumulative distribution. Say it: “capital P”.
bb b.
The upper limit b(y) of an integral. Say it: “b”.
hh h.
Planck's constant. Unit: J s. Say it: “h”.
pp p.
A probability density. Say it: “p”.
x0x_{0} x nought.
The amplitude of the oscillation. Unit: m. Say it: “x nought”.
EE E.
The electric field amplitude. Unit: V/m. Say it: “capital E”.
ww w.
The smaller of two random numbers. Say it: “w”.
KK K.
The kinetic energy ½mv². Unit: J. Say it: “capital K”.
λ0\lambda_{0} rest wavelength.
The wavelength c/ν₀. Unit: m. Say it: “lambda nought”.
η\eta eta.
A dummy variable standing for a value of the function. Say it: “eta”.
II I.
The instantaneous intensity aE². Unit: W/m². Say it: “I”.
pxp_{x} p x.
The probability density of x. Say it: “p sub x”.
pzp_{z} p z.
The probability density of z. Say it: “p sub z”.
pfp_{f} p f.
The probability density of f(x). Say it: “p final”.
vzv_{z} v z.
The velocity component along the surface normal. Unit: m/s. Say it: “v sub z”.
PxP_{x} P sub x.
The cumulative distribution of x. Say it: “capital P sub x”.
PzP_{z} P sub z.
The cumulative distribution of z. Say it: “capital P sub z”.
ν0\nu_{0} nu nought.
The frequency kT/h. Unit: Hz. Say it: “nu nought”.
px,yp_{x,y} p x y.
The joint density of x and y. Say it: “p sub x y”.
pIp_{I} p I.
The probability density of the intensity I. Say it: “p sub I”.
pEp_{E} p E.
The probability density of the electric field E. Say it: “p sub E”.
pνp_{\nu} p nu.
The probability density of a photon's frequency. Say it: “p sub nu”.
PfP_{f} P f.
The cumulative distribution of f(x). Say it: “capital P sub f”.
PIP_{I} P I.
The cumulative distribution of the intensity. Say it: “capital P sub I”.
PwP_{w} P w.
The cumulative distribution of the smaller number w. Say it: “capital P sub w”.
pwp_{w} p w.
The probability density of the smaller number w. Say it: “p sub w”.

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

Words on this page

Show the 33 words used here

Also used

random variable.
A quantity whose value cannot be predicted from what is known, although its behaviour follows the rules of probability. Explained in Probability: one random variable.
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.
kinetic energy.
The energy a body has because it is moving. Explained in Kinetic energy and the work–energy theorem.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
cumulative distribution.
The probability that a random quantity does not exceed a given value, as a function of that value. Explained in Probability: one random variable.
differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
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.
integrand.
The function being integrated: the f(x) in ∫ f(x) dx. Explained in The logarithm from an integral, and areas between curves.
intensity.
How much energy a wave, or a beam of particles, carries each second through each square metre of a surface facing it. Explained in Sound and intensity.
linear polarization.
The state of light in which the electric field always points along one fixed line, swinging back and forth along it. Explained in Polarization.
field.
Something that has a value at every point of space, such as the temperature, the wind velocity or the electric field at each place. Explained in Newton's law of gravitation.
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.
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.
diverge.
To fail to settle on a finite value: a series or integral diverges when its partial results grow without limit or never settle. Explained in Improper integrals.
weight.
How much one value counts in a weighted average or sum, compared with the others. Explained in Average value, weighted averages and probability.
density of states.
The number of quantum states, or of possible arrangements, per unit range of energy. Explained in Statistical mechanics and the microcanonical ensemble.
uniform.
The same at every point, or unchanging in time: a uniform rod has the same density all along it. Explained in The electric field.
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.
symmetry.
A change, such as a reflection, a rotation or a shift, that leaves something looking exactly the same. Explained in The derivative: slope of the tangent line and rate of change.
turning point.
A place where a moving body stops for an instant and turns back, because there all its energy is potential energy. Explained in Quadratics and power laws.
hyperbola.
An open curve with two separate branches: the set of points whose distances from two fixed points differ by the same amount. Explained in Quadratics and power laws.
cosmic microwave background.
The faint glow of microwaves filling the universe, left over from when it was hot and dense, now at 2.7 kelvin. Explained in Towards the universe: light-travel time and looking back in time.
black-body radiation.
The radiation given off by a body in thermal equilibrium, whose spread over wavelengths depends only on its temperature. Explained in Black-body radiation in statistical physics.
frequency.
How often something repeats: the number of cycles, turns or waves each second, measured in hertz. Explained in Circular motion.
wavelength.
The distance from one crest of a wave to the next. Explained in Waves: speed, frequency, wavelength.
spectrum.
The spread of light or other radiation over its wavelengths, or the full set of values a quantity such as energy can take. Explained in Light and the electromagnetic spectrum.
black body.
An ideal object that absorbs all light falling on it; when hot, it gives off radiation whose spectrum depends only on its temperature. Explained in Thermal radiation and Planck's photons.
CMB.
Short for cosmic microwave background, the leftover radiation from the hot early universe. Explained in The spectrum of the cosmic microwave background.
velocity.
How fast and in which direction something moves: the change in position in each unit of time. Explained in Speed and velocity.
canonical ensemble.
The description of a system kept at a fixed temperature by contact with a large bath, with a fixed number of particles but varying energy. Explained in Refrigerators, the third law and the canonical ensemble.
change of variables.
Rewriting a problem in new variables suited to it; in an integral this needs a factor, the Jacobian, for how areas or volumes stretch. Explained in Change of variables in double integrals.
polar coordinates.
Coordinates in a flat plane that give a point's distance r from the origin and its angle θ from a fixed direction. Explained in Vectors.

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. What are the three steps for finding the density of f(x)f(x)?
  2. The intensity of thermal light is I=aE2I = aE^2 with a Gaussian field EE. Where is the density of II largest?
  3. Two independent numbers are uniform on (0,1)(0, 1). What is the mean of the larger one?
  4. An oscillator x=x0sin⁡ϕx = x_0\sin\phi has a uniformly random phase. Where is it most likely to be found?
0 of 4 answered

Flashcards

1 / 3