This page is the workout for Continuous random variables — PDF, CDF, percentiles . The parent note built the ideas; here we drill every kind of question the topic can hand you, one worked example per case. Read the parent's [!definition] boxes first if any symbol below feels new.
Intuition What we mean by "every scenario"
A problem about continuous random variables is really a machine with three dials : (1) are you given the density f or the accumulation F ? (2) is the support a finite chunk, a half-line, or degenerate? (3) do they ask for an area (probability), a rate (density), or a location (percentile)? Every exam question is one setting of those three dials. Below we tour them all.
Recall the vocabulary from the parent, in one breath:
==f ( x ) == = the density — how thickly probability is spread at the point x . Height, not probability.
==F ( x ) = P ( X ≤ x ) == = the cumulative — the total area swept from the far left up to x .
The link: F ( x ) = ∫ − ∞ x f ( t ) d t and (backwards) f ( x ) = F ′ ( x ) by the Fundamental Theorem of Calculus .
The ==p -th percentile== x p solves F ( x p ) = p .
Each row is a case class — a kind of situation that behaves differently and can trip you if you never saw it. The final column names the example that covers it.
#
Case class
What's tricky about it
Covered by
C1
Given f , finite support , find F + interval prob
must state F = 0 below, F = 1 above
Ex 1
C2
Given f , half-line support (waiting time)
integral runs to ∞ ; percentile via logs
Ex 2
C3
Given F , recover f by differentiating
reverse direction; check total area
Ex 3
C4
Piecewise f (triangle) — probability crosses a corner
must split the integral at the corner
Ex 4
C5
Normalising constant unknown (f = c g )
solve for c first from total-area = 1
Ex 5
C6
Degenerate / zero inputs: P ( X = c ) , P ( X ≤ below support) , empty interval
answers are exactly 0 or 1
Ex 6
C7
Uniform — constant density, every percentile is linear
density > 1 is legal; check the "f ≤ 1 " myth
Ex 7
C8
Word problem with units + a real decision
translate "at least", carry units
Ex 8
C9
Exam twist : mixed conditional probability P ( X > a ∣ X > b )
use F ratios, not raw f
Ex 9
C10
Limiting behaviour : what f , F do as x → edges
sanity checks, not a full solve
Ex 10
Worked example Example 1 · linear density on
[ 0 , 2 ]
Let f ( x ) = 2 1 x for 0 ≤ x ≤ 2 , and f ( x ) = 0 elsewhere. Find F ( x ) (all x ), then P ( 0.5 ≤ X ≤ 1.5 ) .
Forecast: guess whether F ( 2 ) = 1 , and whether the answer to the interval is bigger or smaller than 2 1 .
Step 1 — Confirm it's a valid PDF. ∫ 0 2 2 1 x d x = [ 4 x 2 ] 0 2 = 1 , and 2 1 x ≥ 0 on [ 0 , 2 ] . ✓
Why this step? Nothing downstream is meaningful unless total area is 1 and density is non-negative.
Step 2 — Accumulate for 0 ≤ x ≤ 2 . F ( x ) = ∫ 0 x 2 1 t d t = [ 4 t 2 ] 0 x = 4 x 2 .
Why this step? F is the running area from the left edge of the support (here 0 ).
Step 3 — State F on the WHOLE line. F ( x ) = 0 for x < 0 ; F ( x ) = 4 x 2 for 0 ≤ x ≤ 2 ; F ( x ) = 1 for x > 2 .
Why this step? The #4 parent mistake: forgetting F must reach 0 below and 1 above the support.
Step 4 — Interval by subtraction. P ( 0.5 ≤ X ≤ 1.5 ) = F ( 1.5 ) − F ( 0.5 ) = 4 1. 5 2 − 4 0. 5 2 = 4 2.25 − 0.25 = 0.5.
Why this step? ∫ a b f = F ( b ) − F ( a ) — no need to re-integrate.
Verify: F ( 2 ) = 4 4 = 1 ✓, F ( 0 ) = 0 ✓. The answer 0.5 is a probability in [ 0 , 1 ] ✓, and since more density sits on the right, the middle strip grabbing half seems reasonable.
The figure below draws this density and shades the interval — look at how the shaded red strip is exactly the "area" our subtraction computed. The dashed mint lines mark where the support begins and ends (outside them f = 0 ), a visual reminder of Step 3.
Notice the density rises from left to right: that slope is why a middle strip still captures half the probability — the extra height on the right compensates for its distance from the peak.
Worked example Example 2 · exponential waiting time,
λ = 3 1
Bus gaps follow f ( x ) = 3 1 e − x /3 for x ≥ 0 (minutes). Find F , the median, and the 90th percentile.
Forecast: the median of a waiting time is usually less than the mean (= 3 min here). Guess above or below 3 .
Step 1 — CDF by integrating to x . F ( x ) = ∫ 0 x 3 1 e − t /3 d t = [ − e − t /3 ] 0 x = 1 − e − x /3 for x ≥ 0 .
Why this step? ∫ λ e − λ t d t = − e − λ t ; the support starts at 0 so we integrate from 0 .
Step 2 — Median: solve F ( m ) = 0.5 . 1 − e − m /3 = 0.5 ⇒ e − m /3 = 0.5 ⇒ m = 3 ln 2 ≈ 2.079 min.
Why this step? Median is the 50th percentile — invert F , don't touch f .
Step 3 — 90th percentile: solve F ( x ) = 0.9 . 1 − e − x /3 = 0.9 ⇒ e − x /3 = 0.1 ⇒ x = 3 ln 10 ≈ 6.908 min.
Why this step? Same inversion with p = 0.9 ; the log un-does the exponential.
Verify: median 2.079 < 3 ✓ (matches the forecast — waiting times are right-skewed). Plug x = 6.908 : e − 6.908/3 = e − 2.303 ≈ 0.100 , so F ≈ 0.900 ✓. See Exponential distribution for the memoryless twist used in Ex 9.
Worked example Example 3 · differentiate the CDF
F ( x ) = 1 − e − x 2 for x ≥ 0 and F ( x ) = 0 for x < 0 . Find f and verify total area.
Forecast: since F climbs from 0 toward 1 , its slope f should be positive and eventually shrink back to 0 .
Step 1 — Differentiate (FTC). f ( x ) = F ′ ( x ) = d x d ( 1 − e − x 2 ) = 2 x e − x 2 for x ≥ 0 ; f = 0 for x < 0 .
Why this step? PDF is the rate of accumulation — the derivative of F .
Step 2 — Non-negativity check. For x ≥ 0 , 2 x ≥ 0 and e − x 2 > 0 , so f ≥ 0 . ✓
Why this step? A recovered f is only a valid density if it never goes negative.
Step 3 — Total area check. ∫ 0 ∞ 2 x e − x 2 d x = [ − e − x 2 ] 0 ∞ = 0 − ( − 1 ) = 1. ✓
Why this step? Confirms F ( ∞ ) = 1 , i.e. all probability is accounted for.
Verify: f ( 0 ) = 0 , and as x → ∞ the term e − x 2 kills the growth so f → 0 — exactly the "starts at 0, peaks, decays" shape the forecast predicted.
Worked example Example 4 · triangle density
f ( x ) = x for 0 ≤ x < 1 , f ( x ) = 2 − x for 1 ≤ x ≤ 2 , 0 elsewhere. Find F ( 1.5 ) and P ( 0.5 ≤ X ≤ 1.5 ) .
Forecast: by symmetry the peak is at x = 1 ; guess whether F ( 1 ) = 0.5 .
Step 1 — First piece, 0 ≤ x ≤ 1 . F ( x ) = ∫ 0 x t d t = 2 x 2 . So F ( 1 ) = 2 1 .
Why this step? Accumulate area over the rising slope.
Step 2 — Second piece, 1 ≤ x ≤ 2 . Start from F ( 1 ) = 2 1 and add: F ( x ) = 2 1 + ∫ 1 x ( 2 − t ) d t = 2 1 + [ 2 t − 2 t 2 ] 1 x .
Evaluate: F ( x ) = 2 1 + ( 2 x − 2 x 2 ) − ( 2 − 2 1 ) = 2 x − 2 x 2 − 1.
Why this step? The corner at x = 1 forces a split ; we carry the area already collected.
Step 3 — Plug in. F ( 1.5 ) = 2 ( 1.5 ) − 2 1. 5 2 − 1 = 3 − 1.125 − 1 = 0.875.
P ( 0.5 ≤ X ≤ 1.5 ) = F ( 1.5 ) − F ( 0.5 ) = 0.875 − 2 0. 5 2 = 0.875 − 0.125 = 0.75.
Why this step? Interval prob straddles the corner but the CDF has already "healed" the split — one subtraction finishes it.
Verify: F ( 1 ) = 0.5 ✓ (matches symmetry forecast), F ( 2 ) = 4 − 2 − 1 = 1 ✓. Answer 0.75 lies in [ 0 , 1 ] ✓.
The figure below shows why this problem needs two integrals, not one: follow the dashed mint line at the corner x = 1 — to its left the density climbs as f = x , to its right it falls as f = 2 − x , so the shaded red region (our P = 0.75 ) is really two differently-shaped pieces glued at the corner. Trying to integrate one formula across the corner would miss the switch.
Worked example Example 5 · solve for
c first
f ( x ) = c x 2 on [ 0 , 3 ] , 0 elsewhere. Find c , then P ( X ≤ 1 ) .
Forecast: most of the area sits near x = 3 (bigger x 2 ). Guess whether P ( X ≤ 1 ) is well under 2 1 .
Step 1 — Impose total area = 1 . ∫ 0 3 c x 2 d x = c [ 3 x 3 ] 0 3 = c ⋅ 9 = 1 ⇒ c = 9 1 .
Why this step? A density must integrate to 1 ; that single equation pins the unknown constant.
Step 2 — Build F . F ( x ) = ∫ 0 x 9 1 t 2 d t = 27 x 3 for 0 ≤ x ≤ 3 .
Why this step? With c known, accumulate normally.
Step 3 — Evaluate. P ( X ≤ 1 ) = F ( 1 ) = 27 1 ≈ 0.037.
Why this step? P ( X ≤ x ) is the CDF — just read it off.
Verify: F ( 3 ) = 27 27 = 1 ✓. Answer 0.037 ≪ 0.5 ✓ — matches the forecast that mass hugs the right end.
Worked example Example 6 · the "trick" answers
Using f ( x ) = 2 1 x on [ 0 , 2 ] from Ex 1, evaluate: (a) P ( X = 1 ) , (b) P ( X ≤ − 4 ) , (c) P ( X ≤ 100 ) , (d) P ( 1.3 ≤ X ≤ 1.3 ) .
Forecast: three of these are exactly 0 or 1 with no integration needed. Spot which.
Step 1 — (a) single point. P ( X = 1 ) = ∫ 1 1 f = 0.
Why this step? A point has zero width, so zero area — the parent's core rule.
Step 2 — (b) below the support. − 4 < 0 , and F ( x ) = 0 for x < 0 , so P ( X ≤ − 4 ) = 0.
Why this step? No probability lives before the support begins.
Step 3 — (c) above the support. 100 > 2 , and F ( x ) = 1 for x > 2 , so P ( X ≤ 100 ) = 1.
Why this step? All the probability was collected by x = 2 ; nothing new can be added.
Step 4 — (d) empty-width interval. P ( 1.3 ≤ X ≤ 1.3 ) = F ( 1.3 ) − F ( 1.3 ) = 0.
Why this step? Same width-zero logic — the < vs ≤ distinction never matters here.
Verify: all four answers are exactly 0 , 0 , 1 , 0 — pure boundary behaviour, no integral evaluated ✓.
Worked example Example 7 · density above 1 is fine
X is uniform on [ 0.2 , 0.6 ] : f ( x ) = 0.6 − 0.2 1 = 2.5 on that interval, 0 elsewhere. Find F , P ( X ≤ 0.5 ) , and the 25th percentile.
Forecast: the density is 2.5 > 1 . Does that break anything? (No — watch.)
Step 1 — Height check via area. Area = 2.5 × ( 0.6 − 0.2 ) = 2.5 × 0.4 = 1 . ✓
Why this step? Only area must equal 1 ; a tall thin box is perfectly legal. This is the parent's #1 mistake, live.
Step 2 — CDF (a straight ramp). For 0.2 ≤ x ≤ 0.6 : F ( x ) = 2.5 ( x − 0.2 ) . Outside: 0 below 0.2 , 1 above 0.6 .
Why this step? Constant density ⇒ area grows linearly ⇒ F is a straight line (see Uniform distribution ).
Step 3 — P ( X ≤ 0.5 ) . F ( 0.5 ) = 2.5 ( 0.5 − 0.2 ) = 2.5 × 0.3 = 0.75.
25th percentile: solve 2.5 ( x − 0.2 ) = 0.25 ⇒ x − 0.2 = 0.1 ⇒ x = 0.3.
Why this step? Read the CDF for the probability; invert it for the percentile.
Verify: F ( 0.6 ) = 2.5 × 0.4 = 1 ✓, F ( 0.2 ) = 0 ✓. Percentile 0.3 ∈ [ 0.2 , 0.6 ] ✓, and f = 2.5 > 1 caused no trouble ✓.
Worked example Example 8 · battery lifetime
A battery's life (hours) has f ( t ) = 4 1 e − t /4 for t ≥ 0 . What fraction last at least 6 hours? What lifetime do only the top 5% exceed?
Forecast: mean life is 4 h, so "at least 6 h" should be a minority — guess under 25% .
Step 1 — CDF. F ( t ) = 1 − e − t /4 , t ≥ 0 (same form as Ex 2 with λ = 4 1 ).
Why this step? We need accumulated probability to answer any "how much lasts up to / beyond" question.
Step 2 — "At least 6 h" = upper tail. P ( T ≥ 6 ) = 1 − F ( 6 ) = e − 6/4 = e − 1.5 ≈ 0.223.
Why this step? "At least" means the complement of "≤ ": P ( T ≥ t ) = 1 − F ( t ) . Units: hours in, pure probability out.
Step 3 — "Top 5% exceed" = 95th percentile. Solve F ( t ) = 0.95 : 1 − e − t /4 = 0.95 ⇒ e − t /4 = 0.05 ⇒ t = 4 ln 20 ≈ 11.98 h.
Why this step? The value only 5% beat is the 95 th percentile — invert F at p = 0.95 .
Verify: 0.223 < 0.25 ✓ (matches forecast). Check t = 11.98 : e − 11.98/4 = e − 2.996 ≈ 0.050 so F ≈ 0.95 ✓. Units are hours throughout ✓.
Worked example Example 9 ·
P ( X > a ∣ X > b )
With the battery of Ex 8 (f ( t ) = 4 1 e − t /4 ), given a battery already survived 2 h, what is P ( T > 5 ∣ T > 2 ) ?
Forecast: exponential is memoryless . Guess P ( T > 5 ∣ T > 2 ) = P ( T > 3 ) .
Step 1 — Conditional-probability definition. P ( T > 5 ∣ T > 2 ) = P ( T > 2 ) P ( T > 5 and T > 2 ) = P ( T > 2 ) P ( T > 5 ) .
Why this step? "T > 5 " already implies "T > 2 ", so the joint event is just T > 5 .
Step 2 — Use tail probabilities. P ( T > t ) = e − t /4 , so e − 2/4 e − 5/4 = e − ( 5 − 2 ) /4 = e − 3/4 ≈ 0.472.
Why this step? Ratios of the CDF/tail, never raw f — the #3 parent mistake dodged.
Step 3 — Recognise the pattern. e − 3/4 = P ( T > 3 ) : the extra time needed forgot the 2 h already served.
Why this step? Confirms the memoryless property numerically.
Verify: e − 0.75 ≈ 0.4724 , and P ( T > 3 ) = e − 3/4 ≈ 0.4724 ✓ — identical, matching the forecast.
Worked example Example 10 · read the edges
For any continuous RV, describe what F and f do as x → − ∞ and x → + ∞ , using F ( x ) = 1 − e − x 2 (Ex 3) as the concrete case.
Forecast: F must sandwich between 0 and 1 ; f must fade to 0 at both far ends (else area would be infinite).
Step 1 — Far left. F ( x ) = 0 for x < 0 , so lim x → − ∞ F ( x ) = 0 and f = 0 there.
Why this step? No probability precedes the support; F starts flat at 0 .
Step 2 — Far right. lim x → ∞ ( 1 − e − x 2 ) = 1 − 0 = 1 , so F → 1 ; and f ( x ) = 2 x e − x 2 → 0 because e − x 2 crushes the linear 2 x .
Why this step? F must saturate at 1 (total probability), and f must vanish at the far edge for the area to stay finite.
Step 3 — General rule. Every CDF is a non-decreasing curve rising from 0 to 1 ; every PDF must integrate to a finite total of 1 , which forces f → 0 in both tails — if f stayed above some fixed positive height forever, the tail area would keep growing without bound and the total could never settle at 1 .
Why this step? This turns the two concrete limits of Steps 1–2 into a universal law you can use as an instant sanity check on any density: a PDF that does not decay to 0 in its tails cannot have total area 1 , so it is not a valid density.
Verify: F ( − ∞ ) = 0 , F ( + ∞ ) = 1 , f ( ± ∞ ) = 0 ✓ — the universal boundary conditions, matching the forecast.
Recall Which tool for which question?
Given f , asked for a probability ::: integrate / use F ( b ) − F ( a ) .
Given f , asked for a percentile ::: build F , then solve F ( x p ) = p .
Given F , asked for f ::: differentiate: f = F ′ .
Asked P ( X = c ) or a zero-width interval ::: it is exactly 0 .
Asked P ( X ≤ below support) / P ( X ≤ above support) ::: 0 / 1 .
Asked "at least a " ::: P ( X ≥ a ) = 1 − F ( a ) .
Asked P ( X > a ∣ X > b ) ::: ratio of tails 1 − F ( b ) 1 − F ( a ) .
"Given (f or F)? Support (box, ray, point)? Ask (area, rate, place)?" — set those three and every problem above tells you which formula to reach for.
Differentiate f = F prime
Integrate or F b minus F a
Zero width or off support