datarekha

Continuous RVs: PDF, CDF & Uniform

When outcomes form a continuum, probability lives in areas under a density curve — not in single points. The gateway to every continuous distribution GATE tests.

8 min read Intermediate GATE DA Lesson 11 of 122

What you'll learn

  • A PDF f(x) is non-negative and integrates to 1; probability is area under it
  • P(a ≤ X ≤ b) is the integral of f from a to b; P(X = a) = 0 for continuous X
  • The CDF F(x) is the integral of f 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. They might say “about eight minutes.” Not 8.0000 minutes. The bus arriving at exactly one specific instant has, in a sense, zero chance — there are infinitely many instants in any window. So how do you talk about probability for a continuous quantity at all? You stop pinning probability to individual points and start spreading it as area under a curve. The curve is the probability density function, and once you can read areas off it you can answer every continuous-RV question GATE throws at you — and it is the same density picture behind every loss curve and likelihood you will later fit in machine learning.

Density, not probability

The PDF f(x) describes how thickly probability is packed near each value. Two rules define it:

  • f(x) ≥ 0 everywhere (density is never negative), and
  • the total area under it is 1: the integral of f over all x equals 1.

Probability is then the area over an interval:

P(a ≤ X ≤ b) = ∫ from a to b of f(x) dx
abarea = P(a ≤ X ≤ b)f(x)total area under the whole curve = 1
Probability is the shaded area, found by integrating the density between the limits.

Two consequences trip people up. First, the probability of any single value is zero: the area over a point of zero width is zero, so P(X = a) = 0 for a continuous RV. (That is why P(a ≤ X ≤ b) and P(a < X < b) are equal — the endpoints add nothing.) Second, f(x) is a density, not a probability: it can exceed 1. On the interval [0, 0.5] a valid density could reach a height of 2, because what must stay ≤ 1 is the area, not the height.

CDF: the running total

The cumulative distribution function F(x) = P(X ≤ x) accumulates probability from the left — it is the integral of f up to x:

F(x) = ∫ from −∞ to x of f(t) dt

So F runs from 0 up to 1, never decreasing. Going the other way, the density is the derivative of the CDF: f(x) = F prime(x). PDF and CDF are an integrate/differentiate pair — given either one you can recover the other.

Drag the two handles to bracket a region and watch the shaded area — that area is the probability P(a < X < b), no integration by hand. Flip between Normal, Exponential, Beta, and Uniform to see how the same idea (probability = area) works for every continuous distribution you will meet on the exam.

The continuous uniform

The simplest continuous distribution: X is uniform on [a, b] when its density is flat. To enclose area 1 over a width of b − a, the 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): mean = 5, variance = 100/12 ≈ 8.33.

How GATE asks this

A reliable NAT. Three flavours recur: (1) find the constant that makes a given f(x) a valid PDF (set its total integral to 1 and solve); (2) compute a probability P(a ≤ X ≤ b) by integrating the density; (3) find the median m from the CDF by solving F(m) = 0.5. Continuous uniform questions are pure plug-in once you write f = 1/(b − a).

Worked example

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

A valid PDF must integrate to 1 over its support:

∫ from 0 to 2 of c·x dx = c · [x²/2] from 0 to 2 = c · (4/2) = 2c

Set 2c = 1  ⟹  c = 0.5

Now integrate the density up to 1 to get the probability:

P(X ≤ 1) = ∫ from 0 to 1 of 0.5·x dx = 0.5 · [x²/2] from 0 to 1
         = 0.5 · (1/2) = 0.25

So c = 0.5 and P(X ≤ 1) = 0.25. (Note f(2) = 0.5·2 = 1 here, and a density can even exceed 1 on a narrower interval — only the total area is pinned to 1.)

Quick check

Quick check

0/6
Q1Find c so that f(x) = c on [2, 6] (and 0 elsewhere) is a valid PDF. (give a decimal)numerical answer — type a number
Q2X is uniform on [0, 10]. What is its median? (the value m with P(X ≤ m) = 0.5)numerical answer — type a number
Q3For f(x) = 0.5·x on [0, 2], what is P(X ≤ 1)? (decimal)numerical answer — type a number
Q4X is uniform on [0, 10]. What is Var(X)? (decimal, 2 places)numerical answer — type a number
Q5Which statements about continuous random variables are TRUE? (select all that apply)select all that apply
Q6If F(x) is the CDF and f(x) the PDF of a continuous RV, which is correct?

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.

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.

Explore further

Related lessons

Skip to content