SECTION 03 / 5

Lesson 3 — Probability Density Function (PDF)

6 min read
On this page 10 headings

A PDF does not give probabilities directly: it gives a density, and the probability of an interval is the area under the PDF over that interval.

12. Why we need a PDF: density = probability per unit

For discrete X we can write P(X = 1) = 1/2 directly. For continuous Y every single value has probability 0 (Lesson 2), so a PMF would be zero everywhere. We need a function that tells us how probability is spread along the line — the probability density function f(y).

Example. Y = bus waiting time, uniformly distributed on [0, 10] minutes: equal-length intervals are equally likely, so waiting 1–2 minutes is as likely as waiting 7–8 minutes. The total probability 1 is spread evenly over 10 minutes:

fY(y)={110=0.10≤y≤100otherwisef_Y(y) = \begin{cases} \dfrac{1}{10} = 0.1 & 0 \le y \le 10 \\ 0 & \text{otherwise} \end{cases}

Illustration description: Uniform(0, 10): density 0.1 per minute; 3–5 minutes gives 0.20, 3–3.5 minutes gives 0.05

The height 0.1 is a rate: 0.1 probability per minute. Multiply by a width to get a probability:

  • 3 to 5 minutes: 2 × 0.1 = 0.20
  • 3 to 3.5 minutes: 0.5 × 0.1 = 0.05

Same density, different widths, different probabilities. In general, for a small width Δy:

P(y≤Y≤y+Δy)≈fY(y) ΔyP(y \le Y \le y + \Delta y) \approx f_Y(y)\,\Delta y

This is why density has units (per minute, per kg…), while probability has none.

13. Probability is area: interval vs single point

The PDF's height at a point is not the probability of that point. For the uniform bus model, f(3) = 0.1 but P(Y = 3) = 0.

Illustration description: f(3) = 0.1 but P(Y = 3) = 0; P(3 ≤ Y ≤ 5) = 2 × 0.1 = 0.2

Why the point probability is 0. Fix the start at 3 and shrink the end towards 3:

IntervalWidthProbability = width × 0.1
3 to 5.52.50.25
3 to 520.20
3 to 3.50.50.05
3 to 3.010.010.001
3 to 3 (one point)00

As the width goes to 0, the area goes to 0. In integral form, an integral over a single point is always zero:

P(Y=3)=∫33fY(y) dy=0P(Y = 3) = \int_3^3 f_Y(y)\,dy = 0

Image note: the left panel labels the point "x = 3" although the variable is Y; read it as y = 3.

A function f is a valid PDF if and only if both hold:

  • Non-negative: f(x) ≥ 0 for all x
  • Total area 1:
∫−∞∞f(x) dx=1bus example: ∫0100.1 dy=0.1×10=1\int_{-\infty}^{\infty} f(x)\,dx = 1 \qquad \text{bus example: } \int_0^{10} 0.1\,dy = 0.1 \times 10 = 1

There is no rule that f(x) ≤ 1. Uniform on [0, 0.5] has f = 2 everywhere on its range and is perfectly valid (area 0.5 × 2 = 1).

Illustration description: PMF assigns probability to a single value; a PDF is a density whose area gives probability

QuestionPMFPDF
Used forDiscrete RVContinuous RV
The function givesProbability at each valueDensity (probability per unit)
Can exceed 1?NoYes
P(X = a)Can be positiveAlways 0
Probability of an eventSumIntegral (area)
NormalisationΣ p(x) = 1∫ f(x) dx = 1

The CDF link (used constantly in GATE). The CDF of a continuous variable is the accumulated area, and the PDF is its derivative:

F(x)=∫−∞xf(t) dt,f(x)=dF(x)dx,P(a≤X≤b)=F(b)−F(a)F(x) = \int_{-\infty}^{x} f(t)\,dt, \qquad f(x) = \frac{dF(x)}{dx}, \qquad P(a \le X \le b) = F(b) - F(a)

Bus example: F(y) = 0 for y < 0, y/10 for 0 ≤ y ≤ 10, and 1 for y > 10. Check: F(5) − F(3) = 0.5 − 0.3 = 0.2 ✔. Unlike the discrete staircase of Lesson 1, this CDF is a continuous ramp with no jumps — which is exactly why no single point has positive probability.

15. GATE numericals on PDFs

Example A — rectangular PDF

f(x) = 0.2 for 0 ≤ x ≤ 5, and 0 otherwise. Find P(1 ≤ X ≤ 4). Options: (A) 0.2 (B) 0.4 (C) 0.6 (D) 0.8.

Illustration description: Check validity (area 5 × 0.2 = 1), then P(1 ≤ X ≤ 4) = 3 × 0.2 = 0.6

  • Valid? f ≥ 0 and area = 5 × 0.2 = 1 ✔
  • Area over [1, 4]: width 3 × height 0.2 = 0.6 → (C)

Example B — non-rectangular PDF with unknown k

When the PDF is not flat, "width × height" fails; you must integrate. f(x) = kx for 0 ≤ x ≤ 2, and 0 otherwise. Find k, P(X ≤ 1) and P(X = 1).

  • Normalise:
∫02kx dx=k[x22]02=2k=1  ⇒  k=12\int_0^2 kx\,dx = k\left[\frac{x^2}{2}\right]_0^2 = 2k = 1 \;\Rightarrow\; k = \tfrac12
  • Check non-negativity: x/2 ≥ 0 on [0, 2] ✔
  • Integrate over the event:
P(X≤1)=∫01x2 dx=[x24]01=14P(X \le 1) = \int_0^1 \frac{x}{2}\,dx = \left[\frac{x^2}{4}\right]_0^1 = \tfrac14
  • Point probability: P(X = 1) = 0, even though f(1) = 0.5.

Trap: [0, 1] is half the support, but the probability is only 1/4, not 1/2 — the density is low near 0 and high near 2. Half the width gives half the probability only for a uniform PDF.

Method to memorise: normalise (∫ f = 1) → check f ≥ 0 → integrate f over the event (or use F(b) − F(a)) → ignore endpoints.

16. Lesson 3 practice

  • ☐ Q1. Y ~ Uniform(0, 10). Find P(Y > 7) and P(2 < Y ≤ 2.5).
  • ☐ Q2. f(x) = k for 2 ≤ x ≤ 6, 0 otherwise. Find k and P(X < 3).
  • ☐ Q3. f(x) = 3 for 0 ≤ x ≤ 1/3, 0 otherwise. Is it a valid PDF? Find P(X = 0.1) and P(X ≤ 0.1).
  • ☐ Q4. f(x) = c(1 − x) for 0 ≤ x ≤ 1, 0 otherwise. Find c and P(X > 1/2).
  • ☐ Q5. f(x) = kx² for 0 ≤ x ≤ 3, 0 otherwise. Find k and P(1 ≤ X ≤ 2).
  • ☐ Q6. A continuous X has CDF F(x) = x² for 0 ≤ x ≤ 1 (0 below, 1 above). Find its PDF and P(0.5 < X ≤ 1).
  • ☐ Q7. Which is a valid PDF? (A) f(x) = 2x on [0, 1] (B) f(x) = x − 1 on [0, 2] (C) f(x) = 1/2 on [0, 3]

Answers

  • 0.3 and 0.05. Widths 3 and 0.5, each × 0.1.
  • k = 1/4, P(X < 3) = 1/4. Width 4 × k = 1; then width 1 × 1/4.
  • Valid (3 ≥ 0, area (1/3) × 3 = 1 — a density above 1 is fine). P(X = 0.1) = 0, P(X ≤ 0.1) = 0.1 × 3 = 0.3.
  • c = 2, P(X > 1/2) = 1/4. ∫₀¹ c(1 − x) dx = c/2 = 1. Then ∫ from 1/2 to 1 of 2(1 − x) dx = 2 × 1/8. (A triangle: the right half holds only a quarter of the area.)
  • k = 1/9, P(1 ≤ X ≤ 2) = 7/27. ∫₀³ kx² dx = 9k = 1. Then (1/9)(2³ − 1³)/3 = 7/27.
  • f(x) = 2x on [0, 1]; P = 0.75. Differentiate F; then F(1) − F(0.5) = 1 − 0.25.
  • (A). (B) is negative on [0, 1); (C) has total area 1.5, not 1.

17. Lesson 3 revision sheet

IdeaFormulaRemember
Valid PDFf(x) ≥ 0 and ∫ f(x) dx = 1f(x) may exceed 1
Interval probabilityP(a ≤ X ≤ b) = ∫ₐᵇ f(x) dx= F(b) − F(a); endpoints don't matter
Point probabilityP(X = a) = 0Not impossible, just zero probability
Density meaningP(x ≤ X ≤ x + Δx) ≈ f(x)ΔxUnits: probability per unit
Uniform(a, b)f = 1/(b − a) on [a, b]Probability = width/(b − a)
CDF ↔ PDFF(x) = ∫ f, f = F′Continuous CDF has no jumps

Common mistakes

  • Reading f(a) as P(X = a).
  • Rejecting a PDF because some value is above 1.
  • Using width × height when the PDF is not flat — integrate instead.
  • Assuming half the range means half the probability for a non-uniform PDF.
  • Forgetting to check f ≥ 0 after finding k.

Next: Lesson 4 — Solving PDFs using integration.

YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑