From bars to curves

In the discrete world, every outcome has its own probability. Roll a die: P(3) = 1/6. Count heads: P(X = 5) is a number you can write down. But what if outcomes are real numbers — like measuring the exact time a bus arrives, or the precise length of a phone call?

What do you think?
You pick a completely random real number between 0 and 1. What is the probability of picking exactly 0.5?

In the continuous world, the probability of any exact value is zero. Instead, probabilities live in intervals.

Probability density functions

For discrete random variables, we listed probabilities with a PMF. For continuous random variables, we describe how probability is "smeared" across the number line using a density function.

Probability Density Function (PDF)

A continuous random variable XX has a probability density function f(x)f(x) satisfying:

  1. f(x)0f(x) \geq 0 for all xx
  2. f(x)dx=1\int_{-\infty}^{\infty} f(x)\, dx = 1
  3. For any interval [a,b][a, b]: P(aXb)=abf(x)dxP(a \leq X \leq b) = \Large\int_a^b f(x)\, dx

The PDF is not a probability itself — it's a density. The height of the curve tells you how concentrated probability is near that value. Actual probability only comes from the area under the curve over an interval.

PDF Explorer
02468100f(x)81.8%
010
010
P(a < X < b)
0.8176
Interval
[3.0, 7.0]

Drag the interval endpoints around. The shaded area is the probability.

Discrete vs. continuous: a side-by-side

FeatureDiscreteContinuous
OutcomesCountable (integers, categories)Uncountable (real numbers)
DistributionPMF: P(X=k)P(X = k)PDF: f(x)f(x)
Probabilities fromSumming: P(X=k)\sum P(X = k)Integrating: f(x)dx\int f(x)\, dx
P(X = exact value)Can be positiveAlways 0
TotalkP(X=k)=1\sum_k P(X=k) = 1f(x)dx=1\int_{-\infty}^{\infty} f(x)\, dx = 1

Because P(X = a) = 0 for continuous RVs, it doesn't matter whether intervals are open or closed: P(a<X<b)=P(aXb)P(a \lt X \lt b) = P(a \leq X \leq b).

The cumulative distribution function

Just like in the discrete case, the CDF accumulates probability from the left:

CDF (Continuous)

F(x)=P(Xx)=xf(t)dtF(x) = P(X \leq x) = \Large\int_{-\infty}^x f(t)\, dt The PDF and CDF are related by differentiation: f(x)=F(x)f(x) = F'(x) wherever FF is differentiable.

Properties of the CDF (same as in the discrete case):

  • FF is non-decreasing
  • F(x)0F(x) \to 0 as xx \to -\infty
  • F(x)1F(x) \to 1 as x+x \to +\infty
If f(x) = 2x on [0,1] and 0 elsewhere, what is P(0 ≤ X ≤ 0.5)? (decimal, e.g. 0.42)
For the same PDF, what is P(X > 0.5)? (decimal, e.g. 0.42)

Explore the connection between PDF and CDF — drag a point and watch area accumulate, or compute interval probabilities:

PDF ↔ CDF Explorer
Distribution
Mode
-3.53.5
PDF: f(x) — shaded area = probability
0.000.230.46
CDF: F(x) = P(X ≤ x) — non-decreasing from 0 to 1
0.000.250.500.751.00
f(x)
0.3521
F(x) = P(X ≤ x)
0.6915
Slope F'(x) = f(x)
0.3521

Is it discrete or continuous?

Discrete or Continuous?

Can you list all possible values? If yes, it's discrete. If the values form a continuous range, it's continuous.

Question 1 of 6 | Score: 0/0

Number of emails you receive today

Expectation and variance

The formulas from the discrete case carry over — just replace sums with integrals:

Continuous Expectation & Variance

E[X]=xf(x)dxE[X] = \Large\int_{-\infty}^{\infty} x\, f(x)\, dx Var(X)=E[X2](E[X])2=(xμ)2f(x)dx\text{Var}(X) = E[X^2] - (E[X])^2 = \Large\int_{-\infty}^{\infty} (x - \mu)^2 f(x)\, dx

All the rules you learned still hold:

  • Linearity: E[aX+b]=aE[X]+bE[aX + b] = aE[X] + b
  • Variance scaling: Var(aX+b)=a2Var(X)\text{Var}(aX + b) = a^2 \text{Var}(X)
  • Independence: If XYX \perp Y, then E[XY]=E[X]E[Y]E[XY] = E[X]E[Y] and Var(X+Y)=Var(X)+Var(Y)\text{Var}(X+Y) = \text{Var}(X) + \text{Var}(Y)

Summary

ConceptKey Idea
PDFDensity function; height ≠ probability
ProbabilityArea under the curve over an interval
P(X = exact value)Always 0 for continuous RVs
CDFF(x)=xf(t)dtF(x) = \int_{-\infty}^x f(t)\, dt
ExpectationReplace \sum with \int

Mental shift: In the continuous world, stop asking "what's the probability of this value" and start asking "what's the probability of this region."

What's next

Now that we know what continuous distributions look like, let's meet the simplest one: the Uniform distribution — where every interval of the same length is equally likely.