pdf-and-cdf-basics
The sitting in one line For a continuous random variable, probability lives on small segments, never on points. The density is the CDF's slope, , every probability is an area under , and any single point carries exactly zero.
From staircase to ramp
In the discrete world (probability-distributions-and-random-variables) the CDF is a staircase and the PMF lives in the jumps: , the jump height at . A continuous CDF is a smooth ramp with no jumps at all. Apply the same jump formula and it forces for every single . Nothing is left over for any individual point.
The interesting part is what falls out on the way. Writing the small difference at gives , and as . It is the chapter's central object: , the probability density function.
One cheap consequence worth pocketing: since endpoints carry zero, , and every half-open version in between. No more vs anxiety.
Probability lives on segments (the dx view)
is not a probability. is: the probability that lands in a tiny window of width around . Density is probability per unit length, which means it carries units. My waiting-time example: uniform on half an hour has density height 2 measured in hours and height 1/30 measured in minutes. Same random variable, same probabilities, different heights. Only height times width is real.
That also settles why a density can exceed 1. The only validity conditions are everywhere and total area 1. Height 2 (or 3, or 100) is fine as long as the support is narrow enough. sits at height 3 everywhere and is a perfectly legal distribution. The mantra: height is probability per unit length, only area is probability.
The same view is the right way to think about transformations. To understand , don't ask where a point goes, ask what happens to a small segment. The map sends to a segment around , and the probability mass riding on it is conserved. If the segment gets stretched, that mass spreads over more length, so the density drops. Compressed, the density rises.
3blue1brown has a video on exactly this segment intuition, from his probability playlist.
Working with densities
The practical workflow: differentiate the CDF when you want the shape, use the CDF directly when you want a probability. The Rayleigh warm-up shows both. Its CDF is for , so the density is by the chain rule, and the tail needs no integral at all: . The CDF already did the integrating.
Everything from the discrete world translates with one mechanical dictionary: sums become integrals, becomes . So and LOTUS reads . Linearity, LOTUS, and the variance identity from lotus-and-variance all carry over unchanged.
The Uniform
formalizes "a completely random number between and ": a flat density on the support, forced by area 1, and a ramp CDF there. My first CDF attempt failed the standard sanity checks, so they are worth naming: must be 0 at the left edge, 1 at the right edge, and it must stay at those values outside the support. Writing "0 otherwise" claims for , which no CDF can do.
For , probability literally is length: . Its moments are and . The general case needs zero new integrals: (stretch, then shift), so and . The variance contains only the width . Where the interval sits doesn't matter, only how wide the room is.
Same support is not same distribution: the U² trap
A friend argues: still lands in , so it is still completely random there. The test comes from the Uniform section: completely random means flat PDF, which means linear CDF. Compute it: . Not linear. Same support, different distribution.
The segment view says where the mass went. Squaring pulls every value in downward, compressing segments near 0, so the density piles up there. About 70% of draws land below 1/2, since .
This is exactly the classic nonce-bias bug in ECDSA and Schnorr. Reduce a uniform 256-bit number mod the group order and every residue is still possible, but residues below get hit slightly more often. The support looks fine, the distribution is not uniform, and with enough signatures lattice attacks turn that tiny skew into the secret key. The flat-PDF test is the formal version of the check that catches it.
Universality of the Uniform
One theorem, two directions, both riding on the Uniform's special property: its CDF is the identity, , so can hand you an event of any probability you name.
Universality of the Uniform Let be a continuous, strictly increasing CDF and let . Then:
- Manufacture. is a random variable whose CDF is exactly .
- Flatten. If is a random variable with CDF , then .
Direction 1: has CDF . I want with . Solve for instead of verifying a given answer:
so matching against forces , that is . The first step silently used that is increasing, which is why the theorem assumes strictly increasing.
My own reading of what the proof does: we have a family of events whose probabilities we want to be . The Uniform has the special property , so in particular , an event with exactly the right probability, sitting there pre-made. Setting just lines up with . The important property is realizing . That is the core of the proof.
The percentile reading makes the result feel obvious: a CDF converts values to percentiles, is the percentile-to-value lookup, and to draw from any distribution you draw a percentile uniformly and look up which value owns it.
The picture is uniform rain on the percentile axis:
Where is steep, a wide band of percentiles gets squeezed into a narrow window of values, so landings pile up exactly where the density is tall. The slope is the local compression ratio of this transport, the segment view from above, one more time. And was already this machine running: target gives .
Direction 2: . Feed into its own CDF and it flattens, whatever distribution had. One line, using that a strictly increasing makes and the same event:
You never invert inside a probability, you just rename the event: both descriptions represent the same values underneath, because is a simple one-one mapping . Strict monotonicity is what makes the renaming valid in both directions.
Why and not some ? In direction 2 it is forced: outputs probabilities, so physically lives in . In direction 1 it is just the canonical choice. From a source, standardize first and use . Direction 1 is what simulation libraries call inverse transform sampling: computers only generate uniform bits, and this is how uniform bits become samples from anything with a tractable .
What stayed shaky
The sitting's one real miss: I claimed neither probability nor has units. Probability is a pure number, but is a length in 's units, and that is what makes density a per-unit-length quantity. The re-test for next week: is the hours-to-minutes rescaling (height 2 vs height 1/30) still obvious? If yes, the density concept is durably in.