From CDF to PDF
How does accumulated probability reveal local probability density?
How this lesson unfolds.
Begin with What is the probability that a uniform random point falls to the left of a target position $x$? The sequence then connects The CDF Records Accumulated Probability and builds toward Differentiate the CDF Piece by Piece.
What is the probability that a uniform random point falls to the left of a target position x?
Dropping an ideal dart onto the unit interval [0, 1] spreads probability uniformly across length: the likelihood of landing inside [0, x] matches the length x itself, providing a linear cumulative baseline.
- $$X \sim \text{Uniform}(0, 1) \implies P(X \le x) = x \quad (x \in [0, 1])$$
- Learning goalCalculate interval probabilities for standard uniform random variables using geometric length ratios.
- Helpful foundationsUniform random variables · Continuous intervals · Probability axioms · Foundations of the Theory of Probability (Kolmogorov, 1933) · An Essay towards solving a Problem in the Doctrine of Chances (Thomas Bayes, 1763)
- Common trapExact points carry zero probability: P(X=c)=0, while continuous intervals carry positive probability.
- Next connectionFormalize accumulated probability as a continuous function across the real line.
More context & mechanics
Consider selecting a point X entirely at random on the unit interval [0, 1]. Because the probability density is uniform (equal chance across equal lengths), the probability that X lands in the sub-interval [0, x] is given by the ratio of lengths: Length([0, x]) / Length([0, 1]) = x / 1 = x. As x sweeps from 0 to 1, the probability of falling to the left of x rises continuously from 0 to 1.
Every pseudo-random number generator in computing (e.g. `Math.random()` or Python's `random.random()`) draws standard uniform floats on [0, 1). Inverse Transform Sampling maps these uniform draws through inverse CDFs to simulate arbitrary distributions like Normal or Exponential in production Monte Carlo engines.
Georges-Louis Leclerc, Comte de Buffon, pioneered geometric probability in 1777 with his famous 'Buffon's Needle' problem, proving that continuous probabilities can be determined by geometric lengths and areas.
'Length is Chance': On the unit interval [0, 1], the probability of being to the left of x is literally just the distance x.
What does the Cumulative Distribution Function F(x) collect as its argument sweeps across the real line?
Sweeping across the real line from negative infinity acts like a financial balance ledger: the function F(x) = P(X ≤ x) starts at 0, climbs monotonically as mass is encountered, and tops out at 1.0.
- $$F_X(x) = P(X \le x), \quad \lim_{x\to-\infty} F(x) = 0, \; \lim_{x\to\infty} F(x) = 1$$
- $$The CDF $F(x) = P(X \le x)$ acts as a probability accumulator, starting at 0 at $-\infty$, monotonically climbing, and reaching 1 at $+\infty$.$$
- Learning goalConstruct and graph the Cumulative Distribution Function F(x) for a continuous random variable.
- Helpful foundationsContinuous probability · Piecewise functions · Monotonicity · Foundations of the Theory of Probability (Andrey Kolmogorov, 1933) · An Essay towards solving a Problem in the Doctrine of Chances (Thomas Bayes, 1763)
- Common trapBecause probabilities are non-negative, the CDF F(x) is monotonically non-decreasing everywhere.
- Next connectionExamine how rapidly the CDF grows across infinitesimal intervals.
More context & mechanics
The Cumulative Distribution Function (CDF), denoted F(x) = P(X ≤ x), measures the total probability mass accumulated from the far left up to coordinate x. For X ~ Uniform(0, 1):
- For x < 0, no mass has been encountered: F(x) = 0.
- Inside 0 ≤ x ≤ 1, mass accumulates at a steady linear rate: F(x) = x.
- For x > 1, all probability mass has been captured: F(x) = 1.
The CDF is continuous everywhere and non-decreasing.
In database query optimization and streaming analytics (e.g. Apache Kafka / Prometheus), percentile metrics (such as the p99 latency) are evaluated by inverting the empirical CDF: x_(p99) = F^(-1)(0.99).
Pafnuty Chebyshev and his student Andrey Markov introduced distribution functions in the late 19th century, recognizing that F(x) universally unifies discrete, continuous, and singular random variables under a single mathematical roof.
'The Snowplow': As you drive along the x-axis, the CDF snowplow accumulates probability mass behind its blade. It starts at 0, plows up to 1, and never rolls backward.
How much probability enters the CDF across an infinitesimal window Δ x, and what rate does this define?
Dividing the incremental accumulation ΔF across a narrow window [x, x + Δx] by the window width Δx converts raw probability into an instantaneous spatial concentration rate.
- $$\frac{\Delta F}{\Delta x} = \frac{F(x + \Delta x) - F(x)}{\Delta x}$$
- $$Across $[x, x + \Delta x]$, the probability gained is $\Delta F = F(x+\Delta x) - F(x)$; dividing by $\Delta x$ yields the local probability density (rate per unit length).$$
- Learning goalExpress probability density as the limiting difference quotient of accumulated cumulative probability.
- Helpful foundationsDifference quotients · Limits and derivatives · CDF properties · Foundations of the Theory of Probability (Andrey Kolmogorov, 1933) · An Essay towards solving a Problem in the Doctrine of Chances (Thomas Bayes, 1763)
- Common trapProbability density is a rate (probability per unit length) and can exceed 1.
- Next connectionContrast accumulated probability against local density systematically.
More context & mechanics
Consider an interval of width Δ x starting at x. The probability that X lands in this window is P(x < X ≤ x + Δ x) = F(x + Δ x) - F(x) = Δ F. If we divide this probability by the window length Δ x, we obtain the average probability concentration per unit length: Δ F / Δ x. Taking the limit as Δ x → 0 yields the instantaneous rate at which probability is accumulating at point x.
In financial quantitative risk models, high-frequency order books analyze trade execution density: dividing the fraction of orders placed in a narrow price band [p, p+Δ p] by the tick size Δ p computes the instantaneous liquidity density.
Sir Isaac Newton and Gottfried Wilhelm Leibniz independently recognized that rates of change of accumulated quantities yield instantaneous densities, founding the differential and integral calculus in the 1670s.
'Rise over Run': Δ F is the probability rise; Δ x is the spatial run. Rise over run is your local density.
What distinct operational questions do the CDF F(x) and the PDF f(x) answer?
A cumulative curve evaluates total mass accumulated up to a given boundary, while a density curve measures the instantaneous height of mass concentration per unit length at that exact spot.
- $$F(x) \in [0, 1] \quad \text{vs.} \quad f(x) = \lim_{\Delta x \to 0} \frac{\Delta F}{\Delta x} \in [0, \infty)$$
- Learning goalDifferentiate cumulative probability scale F(x) from localized probability density rate f(x).
- Helpful foundationsCumulative distribution function · Probability density function · Dimensional analysis in calculus
- Common trapDensity height f(x) is not probability; only integrals of f(x) produce actual probabilities.
- Next connectionConnect CDF slope geometrically to PDF height.
More context & mechanics
It is vital to contrast their mathematical units and roles:
- CDF F(x): Measures total mass up to x. It is dimensionless, strictly bounded in [0, 1], non-decreasing, and evaluated at a single point to give a direct probability.
- PDF f(x): Measures spatial density at x. It has dimensions of 1/(units of x), can take any nonnegative value (even ∞), and must be integrated over an interval to yield a probability.
In lidar autonomous driving systems, a sensor measures distance D. The safety supervisor queries the CDF F(5m) = P(D ≤ 5m) to check collision probability, while the Kalman filter uses the PDF f(d) to compute continuous observation likelihoods for state estimation.
Joseph Fourier's work on heat diffusion in 1822 established that continuous flux (density) and total accumulated heat energy require separate mathematical formulations, directly inspiring modern density formalization.
'Odometer vs. Speedometer': The CDF is your odometer (how many total miles accumulated so far); the PDF is your speedometer (how fast miles are accumulating right now).
Why does a linear, steady CDF produce a completely flat, constant probability density?
Where the cumulative curve climbs steeply, probability mass is densely concentrated, producing a tall density peak; where the cumulative curve flattens into a horizontal plateau, density drops to zero.
- $$f(x) = \frac{d}{dx} F(x) = F'(x)$$
- Learning goalExplain the geometric correspondence between the slope of F(x) and the height of f(x).
- Helpful foundationsDerivatives of linear functions · Slope interpretation · PDF definition
- Common trapA flat CDF implies zero density; constant positive density produces a linear ramp CDF.
- Next connectionFormulate the fundamental calculus relationship between CDF differentiation and PDF integration.
More context & mechanics
For X ~ Uniform(0, 1), F(x) = x on the interval (0, 1). Because equal steps in x yield identical increases in probability, the graph of F(x) is a straight ramp with slope Δ F / Δ x = 1. The slope of F(x) at any point is the derivative F'(x). Since the slope is everywhere 1 on (0, 1), the PDF f(x) = F'(x) = 1 is a horizontal, flat line across that interval.
In digital audio signal processing, dither noise is generated using uniform white noise. Engineers ensure the dither CDF is a linear ramp across quantization bins so that the resulting noise PDF is flat, eliminating harmonic distortion.
René Descartes revolutionized geometry in 1637 by linking curves to algebraic equations, establishing that slopes of tangent lines represent tangible physical and operational rates.
'Steepness Equals Height': Where the CDF climbs steeply, the PDF towers high. Where the CDF is a steady ramp, the PDF is flat. Where the CDF is horizontal, the PDF drops to zero.
Where does the PDF come from mathematically, and how does the Fundamental Theorem of Calculus link it to the CDF?
By the Fundamental Theorem of Calculus, taking the first derivative of the cumulative integral recovers the local density function: d/dx [∫_(-∞)^x f(t)dt] = f(x).
- $$f(x) = F'(x) \iff F(x) = \int_{-\infty}^x f(t)\,dt$$
- $$By the Fundamental Theorem of Calculus, differentiating accumulated probability recovers the local density: $f(x) = F'(x) = \frac{d}{dx} \int_{-\infty}^x f(t)\,dt$.$$
- Learning goalDerive continuous probability density functions by differentiating cumulative distribution functions.
- Helpful foundationsFundamental Theorem of Calculus · Derivatives · Definite integrals
- Common trapDifferentiation and integration are inverse operations bridging cumulative probability and local density.
- Next connectionDifferentiate piecewise continuous functions with jump boundaries.
More context & mechanics
The relationship between CDF and PDF is the classic pairing of accumulated quantity and rate from calculus. The CDF accumulates probability: F(x) = ∫_(-∞)^x f(t) dt. Differentiating both sides with respect to x by the Fundamental Theorem of Calculus strips away the integral, leaving the local density: F'(x) = f(x). Accumulation and local density are two sides of the same mathematical coin.
In survival analysis and medical biostatistics (such as analyzing cancer patient survival times), researchers fit empirical Kaplan-Meier cumulative survival curves S(t) = 1 - F(t), and differentiate them to obtain hazard rates and mortality density functions.
Augustin-Louis Cauchy formalized the rigorous epsilon-delta foundations of the Fundamental Theorem of Calculus in the 1820s, cementing the exact mathematical duality of differentiation and integration.
'Differentiate to Unpack, Integrate to Pack': Integrate the PDF to pack probability into the CDF; differentiate the CDF to unpack it back into local density.
How do you systematically differentiate a piecewise CDF across its entire domain, including boundary zones?
Evaluating a piecewise cumulative profile requires taking derivatives region by region: outside [0, 1] the flat slope yields 0, while inside [0, 1] the linear slope of x evaluates to a constant density of 1.
- $$f(x) = \begin{cases} 1 & 0 < x < 1 \\ 0 & \text{otherwise} \end{cases}$$
- $$Differentiate each piece independently: outside $[0,1]$ the CDF is flat so $f(x)=0$; inside $(0,1)$ the slope is 1 so $f(x)=1$; isolated boundary points carry zero continuous measure.$$
- Learning goalDifferentiate piecewise cumulative distribution functions to construct complete continuous density functions.
- Helpful foundationsPiecewise differentiation · Measure zero in integration · Uniform PDF support
- Common trapUndefined derivative points on sets of measure zero never alter continuous interval probabilities.
- Next connectionApply CDF-to-PDF transformations to non-linear functions of random variables.
More context & mechanics
A complete CDF is defined across all of R. We differentiate region by region:
- For x < 0: F(x) = 0 ⟹ f(x) = 0.
- For 0 < x < 1: F(x) = x ⟹ f(x) = 1.
- For x > 1: F(x) = 1 ⟹ f(x) = 0.
At the sharp corners x=0 and x=1, the derivative does not exist in the strict calculus sense. However, because the probability of individual points in continuous distributions is zero, we can define f(0) and f(1) arbitrarily without changing any integration results.
In robotic motion planning, piece-wise spline trajectory CDFs model uncertain obstacle distances. Planners differentiate the piecewise splines to compute spatial collision densities used in gradient-based path optimization.
Henri Lebesgue in 1904 introduced Lebesgue integration and measure theory, proving that functions differing only on sets of measure zero are indistinguishable under integration, resolving classical boundary derivative paradoxes.
'Slice and Derive': Differentiate each region separately. Flat floors give zero; sloping ramps give density; corners carry zero measure.