4.9.7 · D2Probability Theory & Statistics

Visual walkthrough — Continuous random variables — PDF, CDF, percentiles

2,196 words10 min readBack to topic

Step 1 — What a "density curve" even is

WHAT. We draw a curve . Here is the value our random thing can take (say, a randomly chosen fraction that is twice as likely to land near as near ), and the height tells you how thickly probability is piled up right there.

WHY a curve and not a list of probabilities. A continuous thing (an exact length, an exact time) has infinitely many possible values. If each got a positive probability, the total would blow past . So no single value can carry probability — instead we spread probability like jam over bread, and describe the thickness of the jam at each spot. That thickness is the density, written .

PICTURE. The curve rises from at the left to at the right. Notice the height reaches bigger than 1 — and that is completely fine, because height is density, not probability.

Figure — Continuous random variables — PDF, CDF, percentiles

Step 2 — Why AREA is probability (the mass-density argument, drawn)

WHAT. Take a thin vertical strip of the curve between and . Its area is approximately height width . We claim that little area is the probability of landing in that strip.

WHY. Recall the rod analogy from the parent note: mass of a chunk density length. Same algebra here. Density has units "probability per unit "; multiply by a width (units of ) and the units cancel to leave pure probability. So:

WHY the integral, and not just multiplication. One thin strip is an approximation because changes across the strip. To get an interval exactly, slice it into infinitely many infinitely-thin strips and add their areas — that adding-up-of-infinitely-thin-slices is exactly what the integral means. That is why we reach for calculus and not ordinary multiplication.

PICTURE. One orange strip highlighted; below it, the strip is chopped finer and finer until it becomes smooth shaded area.

Figure — Continuous random variables — PDF, CDF, percentiles

Step 3 — The total area must equal 1 (and what "zero at a point" looks like)

WHAT. Something must happen, so all the probability added together equals . In area language:

Check our example: . ✓ The term is the antiderivative evaluated at the right edge minus the left edge.

WHY a single point has zero probability. A "point" is a strip of width . Area . So . This is the drawn reason the vs distinction never matters for continuous variables.

PICTURE. The whole region under on shaded (a triangle of area — you can even skip calculus and use the triangle-area formula here!), with a single red vertical line of "width zero" carrying no area.

Figure — Continuous random variables — PDF, CDF, percentiles

Step 4 — Sweeping the area to build the CDF

WHAT. Now stop asking about fixed intervals and instead ask a running question: "How much probability lies to the left of ?" Call that running total :

  • ::: the area accumulated from the far left up to — the Cumulative Distribution Function.
  • ::: a dummy sliding variable that runs from up to the endpoint . We rename the inside variable so it isn't confused with the moving right edge .

WHY. A running total turns every interval question into subtraction (Step 6) and, crucially, is the quantity we invert to find percentiles (Step 7). It's the master accumulator.

For our example, on :

The lower limit is (not ) because to the left of — no area accumulates there.

PICTURE. Left panel: the curve with a teal moving edge at position and the area behind it shaded. Right panel: the value of that shaded area plotted as a new curve — it climbs from up to , and that climbing curve is .

Figure — Continuous random variables — PDF, CDF, percentiles

Step 5 — Why can only rise, start at 0, and finish at 1

WHAT. Three shape-facts about every CDF, read straight from Step 4's picture:

  1. — nothing accumulated yet.
  2. — everything accumulated (Step 3's total).
  3. is non-decreasing — as the teal edge slides right it can only sweep in more area (because , area never gets subtracted).

WHY it also has no jumps (for a continuous RV). A jump in would mean a chunk of probability appears with zero width — that's exactly , which Step 3 forbade. So the graph of is an unbroken climb.

PICTURE. The curve traced left-to-right: flat at , a smooth rise, flat at — with arrows showing "only goes up."

Figure — Continuous random variables — PDF, CDF, percentiles

Step 6 — Undoing it: slope of gives back , and difference gives intervals

WHAT (differentiate). was built by piling up . So the rate at which climbs at a point is exactly how much density is being added there — that's the slope. By the Fundamental Theorem of Calculus:

Check: . ✓ The steeper is, the taller is.

WHAT (subtract). For a fixed interval, area between and = (area up to ) minus (area up to ):

Example:

PICTURE. Top: the slope (tangent line) of at some , with a caption "slope here height of there." Bottom: two shaded areas and whose difference is the middle strip.

Figure — Continuous random variables — PDF, CDF, percentiles

Step 7 — Reading percentiles by going sideways on

WHAT. A percentile flips the CDF question around. The CDF asks "given a position , how much area is behind it?" The percentile asks "given an amount of area , where is the position ?" Formally:

where is the inverse CDF (the quantile function).

  • ::: a target fraction of probability, e.g. for the median.
  • ::: the value on the -axis where that fraction has accumulated.

WHY it's always solvable here. Because across , strictly rises (never flat), so each height is hit at exactly one — a unique answer.

Median of our example: solve , so . Notice the median sits past the midpoint — because the density leans right, more of the "jam" is on the right, so the halfway split shifts right.

PICTURE. The curve: go UP the -axis to , travel RIGHT until you hit the curve, then DOWN to read off . Percentiles are a horizontal-then-vertical read; the CDF is a vertical-then-horizontal read.

Figure — Continuous random variables — PDF, CDF, percentiles

Step 8 — The degenerate cases you must still handle

WHAT. Real problems hand you flat spots, edges, and the outside of the support. Handle them explicitly:

  • Outside the support. For our example for and for . If someone asks for the " percentile," there is no such — percentiles only exist for .
  • A flat density (uniform). For the Uniform distribution on , (constant) and (a straight diagonal). Percentiles read off trivially: . This is the "no lean" case — median sits exactly at .
  • Endpoints carry no probability. and . Including or excluding the edge changes nothing (Step 3).
  • A gap where . If a density is zero on some stretch, is flat there — it briefly stops accumulating. Then is not strictly increasing on that gap, and a percentile landing exactly on the flat spot is not unique. (Our example avoids this since throughout the support.)

PICTURE. Two mini-panels side by side: left = uniform (flat , diagonal ); right = a density with a zero-gap producing a flat plateau in .

Figure — Continuous random variables — PDF, CDF, percentiles

The one-picture summary

Everything on one canvas: the density (orange) with a shaded strip = probability; the CDF (teal) built by sweeping that area; and the median read off by the sideways trick (plum). Three characters, one story: density spreads, cumulative collects, percentile asks where.

Figure — Continuous random variables — PDF, CDF, percentiles
Recall Feynman retelling — the whole walkthrough in plain words

Picture spreading 1 kg of jam on bread, but thicker on the right. The thickness at each spot is the PDF — and thickness can be huge (over "1") as long as the total jam is 1 kg. To find the chance of landing in a stretch of bread, you don't read the thickness; you scoop that strip and weigh it — that weight is the area, an integral. Now walk a knife from the far left edge toward the right and keep a running weight of everything scooped so far: that running total is the CDF . It starts at 0, only climbs (you can't un-scoop jam), and ends at 1 when you've swept it all. If you want the thickness back, look at how fast the running total is climbing — steep climb means thick jam; that's differentiating. Finally, to find the median, don't hunt on the thickness curve — go up the running-total curve to the height , slide across to the curve, drop down, and that spot has exactly half the jam on each side. Because the jam leaned right, that halfway spot () sits a little right of the middle.


Connections

Concept Map

give it width

add all strips

accumulate

differentiate

invert

density f x

thin strip area = f times width

probability = area under f

sweep area from left

CDF F x running total

slope of F returns f

percentile go sideways on F