1.3.5 · D2Probability & Statistics

Visual walkthrough — Random variables (discrete and continuous)

2,001 words9 min readBack to topic

The parent note told you a startling thing: for a continuous random variable, the probability of hitting any single exact value is zero, yet the variable clearly does land somewhere. This page rebuilds that idea from the ground up and shows — picture by picture — why we must switch from adding dots to measuring area, and why the master formula

is the only sensible thing it could be. Every symbol is earned before it appears.

We will use only ideas from Random variables (discrete and continuous) and lean lightly on Probability Space and Expectation and Variance. The star of the show — the Gaussian — appears at the end.


Step 1 — Start with something we already trust: a histogram

WHAT. Suppose we measure the height of many people. We can't list "every possible height" the way we listed the six faces of a die. So we cheat: we chop the height-axis into bins of equal width, count how many people fall in each bin, and draw a bar.

WHY. A histogram turns a messy continuous measurement into something discrete — a finite list of bins — so we can use the safe old rule from discrete random variables: probability of a bin = (count in bin) ÷ (total count).

PICTURE. Look at the magenta bars below. The height of a bar is the fraction of data in that bin.

Figure — Random variables (discrete and continuous)

The symbol (read "delta x") just means "a small width." is the Greek letter D, standing for "Difference" — here, the difference between the left and right edge of a bin.


Step 2 — The bar's height misbehaves when we change the bin width

WHAT. Take the same data and make the bins half as wide. Each bar now holds roughly half as many people, so every bar gets shorter.

WHY. This is a warning. If the bar height changes just because we changed the bin width, then bar height is not a stable property of the data — it depends on our arbitrary choice. We need a quantity that doesn't flinch when shrinks.

PICTURE. Violet bars (narrow) sit at half the height of the magenta bars (wide) — same shape, squashed down.

Figure — Random variables (discrete and continuous)

Step 3 — Divide by the width: introducing density

WHAT. Instead of plotting the fraction, plot the fraction per unit width:

WHY. When we halved the width in Step 2, the fraction halved and halved. Their ratio stays the same. So dividing by width cancels the arbitrary choice — density is a stable feature of the data.

PICTURE. After dividing by , the wide and narrow histograms snap to the same height. That common height is the density.

Figure — Random variables (discrete and continuous)

Now the crucial book-keeping. For one bin:

Read it term by term: is how tall the smear is at position ; is how wide the slice is; multiplying gives back the honest probability of landing in that slice.


Step 4 — Shrink the bins to zero: bars become a smooth curve

WHAT. Keep making smaller and smaller. The jagged tops of the bars settle down into one smooth curve. We name that curve and call it the probability density function (PDF).

WHY. In real life a height can be cm or cm or anything between — there is no natural smallest bin. The only honest limit is , and in that limit the density stops depending on binning entirely. That limiting curve is the true object.

PICTURE. Watch the orange staircase relax onto the navy curve as the bins vanish.

Figure — Random variables (discrete and continuous)

Notice what just happened to a single point. Its width is , so its probability is . That is exactly the parent note's shocking claim, now with a reason: a single value has zero width, hence zero probability. The density can be huge there — but huge times zero is still zero.


Step 5 — Add up the slices: the sum turns into an integral

WHAT. To get the probability of landing between and , add the probabilities of all the thin slices between them:

WHY. The slices between and are mutually exclusive (a measurement lands in one and only one), and for exclusive events probabilities add — this is the addition rule from Probability Space. Each term is (height × width) = the area of one skinny rectangle.

PICTURE. Highlighted skinny rectangles between and ; their heights come from the curve, and we are stacking their areas.

Figure — Random variables (discrete and continuous)

Now let the slice width shrink to zero. A sum of infinitely many infinitely thin rectangles has a name and a symbol — the integral:

WHY an integral and not a plain sum? A plain sum () works when there are countably many pieces — the discrete world. Here there are uncountably many points with zero width each; the only tool that adds "infinitely many things of size zero" and gets a finite answer is the integral. That is precisely the question it was invented to answer.


Step 6 — Sanity check on the whole line and on a point

WHAT. Two edge cases must come out right.

Case A — the whole line. Set , . The reader lands somewhere, so this probability must be : That is the normalization rule from Step 4, now falling out of the master formula.

Case B — a single point. Set . The interval has zero length, so zero area: The two limits are the same, so there's no rectangle at all — width zero, area zero. This re-confirms Step 4's result.

WHY. A formula you can't stress-test is a formula you can't trust. Both extremes agree with common sense, so the machinery is sound.

PICTURE. Left panel: the whole shaded area = 1. Right panel: a single vertical line has no width, so no area.

Figure — Random variables (discrete and continuous)

Step 7 — The same picture gives the mean

WHAT. The expected value is the balance point of the density. Slice again; each slice contributes its position weighted by its probability :

WHY. It is the exact same "weight each value by how likely it is" idea from the discrete mean — but the weight is replaced by the area of a slice, , because point-probabilities are all zero.

PICTURE. Balance a cardboard cut-out of the density on a knife edge; it tips level exactly at for the symmetric Gaussian.

Figure — Random variables (discrete and continuous)

The one-picture summary

Figure — Random variables (discrete and continuous)

Bars → divide by width → shrink width → smooth curve area between and is the probability, the whole area is , a single point has area , and the balance point is the mean.

Recall Feynman retelling — say it back in plain words

Imagine spreading a fixed pound of butter along a ruler. Where the butter is thick, values are common; where it's thin, values are rare. The thickness at a spot is — that's density, not probability, so it can be as thick as you like. To find the probability of a range, you don't read the thickness; you weigh the butter sitting over that range — thickness times length, which is the area under the curve. Weigh the whole ruler and you always get one pound (total probability 1). Ask for the butter over a single razor-thin point and you get nothing, because a point has no length — that's why . And if you balanced the buttered ruler on a knife, it would tip level right at the mean. That single mental image — area is probability — is the entire continuous story.

Recall

Why does a single exact value have probability 0? ::: Its width is zero, so its area — probability is area, and a point has no width. What makes stable while raw histogram-bar heights are not? ::: Dividing the bin fraction by the bin width cancels the arbitrary choice of width, so density doesn't change when bins shrink. Why an integral instead of a sum? ::: There are uncountably many zero-width slices; only the integral can add infinitely many infinitesimal areas into a finite total. Can exceed 1? ::: Yes — it's a height/density; only the total area must equal 1.


Connects to: Random variables (discrete and continuous) · Probability Space · Expectation and Variance · Gaussian Distribution · Central Limit Theorem · 1.3.05 Random variables (discrete and continuous) (Hinglish)