Lesson 3 — Probability Density Function (PDF)
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:
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:
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:
| Interval | Width | Probability = width × 0.1 |
|---|---|---|
| 3 to 5.5 | 2.5 | 0.25 |
| 3 to 5 | 2 | 0.20 |
| 3 to 3.5 | 0.5 | 0.05 |
| 3 to 3.01 | 0.01 | 0.001 |
| 3 to 3 (one point) | 0 | 0 |
As the width goes to 0, the area goes to 0. In integral form, an integral over a single point is always zero:
Image note: the left panel labels the point "x = 3" although the variable is Y; read it as y = 3.
14. PDF rules, PMF vs PDF, and the CDF link
A function f is a valid PDF if and only if both hold:
- Non-negative: f(x) ≥ 0 for all x
- Total area 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
| Question | PMF | |
|---|---|---|
| Used for | Discrete RV | Continuous RV |
| The function gives | Probability at each value | Density (probability per unit) |
| Can exceed 1? | No | Yes |
| P(X = a) | Can be positive | Always 0 |
| Probability of an event | Sum | Integral (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:
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:
- Check non-negativity: x/2 ≥ 0 on [0, 2] ✔
- Integrate over the event:
- 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
| Idea | Formula | Remember |
|---|---|---|
| Valid PDF | f(x) ≥ 0 and ∫ f(x) dx = 1 | f(x) may exceed 1 |
| Interval probability | P(a ≤ X ≤ b) = ∫ₐᵇ f(x) dx | = F(b) − F(a); endpoints don't matter |
| Point probability | P(X = a) = 0 | Not impossible, just zero probability |
| Density meaning | P(x ≤ X ≤ x + Δx) ≈ f(x)Δx | Units: probability per unit |
| Uniform(a, b) | f = 1/(b − a) on [a, b] | Probability = width/(b − a) |
| CDF ↔ PDF | F(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.
