datarekha

Continuous RVs: PDF, CDF & Uniform

Ask how long someone waited for the bus and they say 'about eight minutes', never 8.0000 — an exact instant has no chance, because a range holds infinitely many. So chance stops living at points and spreads out as area under a density curve. The gateway to every continuous distribution.

8 min read Intermediate GATE DA Lesson 11 of 122

What you'll learn

  • A PDF f(x) ≥ 0 with total area 1; probability is area under it
  • P(a ≤ X ≤ b) is the area from a to b; P(X = a) = 0 for continuous X
  • The CDF F(x) is the area up to x, and f = F prime
  • Continuous uniform(a,b): f = 1/(b−a), mean (a+b)/2, variance (b−a)²/12

Before you start

Ask a friend how long they waited for the bus. “About eight minutes,” they say — not 8.0000 minutes, and not 8.0001. The bus arriving at one exact instant has, in a real sense, no chance at all, because there are infinitely many instants packed into any single minute. So how can we speak of the probability of something that lands anywhere in a range? The trick is to stop pinning chance to single points and start spreading it out as area.

Density, not probability

The curve we spread the chance along is the probability density function, f(x). It only has to obey two rules, both echoes of the axioms: the density is never negative, f(x) ≥ 0, and the total area under the whole curve is one. Chance for a continuous variable is then read as the area over an interval:

P(a ≤ X ≤ b) = area under f(x) between a and b
abarea = P(a ≤ X ≤ b)f(x)total area under the whole curve = 1
Probability is the shaded area between the limits; the whole curve encloses area 1.

Two things about this trip people up, and both come straight from “chance is area”. A single point has zero width, so it encloses zero area — P(X = a) = 0 for a continuous variable. (That is why P(a ≤ X ≤ b) and P(a < X < b) are equal: the endpoints add nothing.) And f(x) is a density, not a probability — it can rise above 1, because what must stay capped at one is the area, not the height. A density of 2 over an interval of width 0.5 is perfectly valid; its area is just 1.

The running total, again

Just as before, the cumulative distribution function F(x) = P(X ≤ x) accumulates chance from the left — now the area under f up to x. It still climbs from 0 to 1 and never falls. Going the other way, since F adds up f, the density is the slope of the CDF: f(x) = F prime(x). PDF and CDF are an integrate-and-differentiate pair — hand me either and I can recover the other.

Drag the two handles below to bracket a region, and the shaded area is the chance P(a < X < b) — no integration by hand. Flip between Normal, Exponential, and Uniform to watch the same idea, chance-is-area, hold for every continuous shape you will meet.

Trydistribution explorer

Drag the handles to read off a probability

PDFP = 0.683
-4.0-2.00.02.04.0
P(-1.00 < X < 1.00)
CDFcumulative
-4.0-2.00.02.04.0
P(a < X < b)0.683F(b) − F(a) = 0.841 − 0.159
0 draws

The simplest continuous shape

The flat one. X is uniform on [a, b] when its density is constant across the interval. To enclose an area of 1 over a width of b − a, that constant height must be 1/(b − a):

  • f(x) = 1/(b − a) for x in [a, b], and 0 outside,
  • mean = (a + b)/2 (the midpoint, by symmetry),
  • variance = (b − a)²/12.

For uniform(0, 10): density 1/10, mean 5, variance 100/12 ≈ 8.33.

A worked example

Find the constant c that makes f(x) = c·x on [0, 2] (and 0 elsewhere) a valid PDF. Then compute P(X ≤ 1).

A valid PDF must enclose total area 1. The region under c·x from 0 to 2 is a triangle of base 2 and height 2c:

area = ½ · base · height = ½ · 2 · 2c = 2c
set 2c = 1   ⟹   c = 0.5

Now the chance up to 1 is the smaller triangle, base 1 and height 0.5·1 = 0.5:

P(X ≤ 1) = ½ · 1 · 0.5 = 0.25

So c = 0.5 and P(X ≤ 1) = 0.25. Notice f(2) = 0.5·2 = 1 here — a density brushing up against 1 — and it could even rise past 1 on a narrower interval; only the total area is pinned.

A question to carry forward

The flat uniform was the easy case — every value equally dense. But the bus-wait we opened with is not flat at all: short waits are common, very long ones rare, so its density slopes down from the start. Here is the thread onward: what is the density of a pure waiting time, and what strange “the bus is no more due now than a minute ago” property does it have?

In one breath

  • For a continuous RV, probability is area under the density f: P(a ≤ X ≤ b) is that area, with f ≥ 0 and total area 1.
  • A single point has zero chance (P(X=a)=0), so and < agree; and f is a density that can exceed 1 — only the area is capped.
  • CDF F(x) = P(X ≤ x) = area up to x; conversely f = F′. PDF and CDF are an integrate/differentiate pair.
  • Continuous uniform[a,b]: f = 1/(b−a), mean (a+b)/2, variance (b−a)²/12.
  • GATE moves: find the constant (set total area = 1), a probability (area over the interval), or a median (solve F(m)=0.5).

Practice

Quick check

0/6
Q1Recall: for a continuous random variable, what is P(X = 5), the chance of exactly the value 5?
Q2Trace: find c so that f(x) = c on [2, 6] (and 0 elsewhere) is a valid PDF.numerical answer — type a number
Q3Trace: for f(x) = 0.5·x on [0, 2], compute P(X ≤ 1).numerical answer — type a number
Q4Apply: X is uniform on [0, 10]. Find its median (the m with P(X ≤ m) = 0.5) and its variance.
Q5Apply: which statements about continuous random variables are TRUE? (select all that apply)select all that apply
Q6Create: a density is proposed as f(x) = k on [0, 3] and f(x) = k on [5, 6], zero elsewhere (two flat pieces). Find k, and state the one rule you used.

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Practice this in an interview

All questions
When does each common distribution arise — Bernoulli, Binomial, Poisson, Normal, Exponential, Uniform?

Each distribution has a natural generative story: Bernoulli is a single coin flip; Binomial sums Bernoullis; Poisson counts rare arrivals; Normal emerges from sums of many small effects; Exponential models waiting times between Poisson events; Uniform assigns equal probability across a range. Choosing correctly comes from matching that story to the data-generating process.

When do you use the Poisson distribution versus the Binomial, and how do they relate?

Binomial counts successes in a fixed number of independent trials with a fixed success probability. Poisson counts events in a continuous interval when events are rare and arrive independently at a constant average rate. Poisson is the limiting case of Binomial as n → ∞ and p → 0 with np = λ fixed.

Explain joint, marginal, and conditional distributions and how to move between them.

The joint distribution P(X, Y) fully specifies two random variables together. Marginals P(X) and P(Y) are obtained by summing (or integrating) the joint over the other variable. Conditionals P(X|Y=y) are the joint sliced at a fixed y value, renormalized by the marginal P(Y=y).

What makes the Normal distribution so central in statistics, and when does it fail?

The Normal distribution is justified by the Central Limit Theorem — averages of large i.i.d. samples converge to Normal regardless of the underlying distribution. It is fully characterized by mean and variance, enabling closed-form inference. It fails for heavy-tailed data, skewed outcomes, bounded quantities, and rare extreme events.

Related lessons

Explore further

Skip to content