Lesson 4 — Solving PDFs Using Integration
On this page 8 headings
When a PDF's height changes along the range, probability is still area, but the area must be found by integration: P(a ≤ X ≤ b) = ∫ₐᵇ f(x) dx.
18. Changing density: why we integrate
With a flat PDF, probability = width × height. With f(x) = 2x on [0, 1], the height changes with x, so there is no single height to multiply by.
| x | 0 | 0.25 | 0.5 | 0.75 | 1 |
|---|---|---|---|---|---|
| f(x) = 2x | 0 | 0.5 | 1.0 | 1.5 | 2.0 |
The density rises to the right, so equal-width intervals near 1 hold more probability than those near 0.
Illustration description: Constant height: rectangle area 2 × 0.1 = 0.2. Changing height: add thin strips, i.e. integrate
Integration slices the region into very thin strips of width dx and height f(x), and adds their areas f(x)·dx:
The one rule you need for most GATE PDFs is the power rule:
19. Worked numerical: f(x) = 2x
Question. f(x) = 2x for 0 ≤ x ≤ 1, 0 otherwise. Is it a valid PDF? Find P(0 ≤ X ≤ 0.5).
Illustration description: f(x) = 2x: P(0 ≤ X ≤ 0.5) = 0.25 by integration and by triangle area; total area = 1
- Validity. 2x ≥ 0 on [0, 1], and
- Integrate over the event. The antiderivative of 2x is x²; evaluate at the upper limit minus the lower limit:
- Geometric check. The shaded region is a triangle with base 0.5 and height f(0.5) = 1: area = ½ × 0.5 × 1 = 0.25 ✔. (The image's "Height =" label is missing its value — it is 1.)
Observation. Half the range [0, 0.5] holds only 25% of the probability; the other half holds 75%. In general here P(X ≤ a) = a², so F(x) = x² on [0, 1] — the same CDF you met in Lesson 3, Q6.
f(1) = 2 is fine: density can exceed 1, only total area must be 1.
20. Support: where the distribution lives
The support is the set of values X can actually take: a list of points for a discrete X, an interval (or union of intervals) where f > 0 for a continuous X.
Illustration description: Discrete support {0, 1, 2} vs continuous support [0, 1] for f(x) = 2x
Why it matters in numericals: outside the support f = 0, so integrals only run over the part of the event that overlaps the support. Clip the limits first.
Example with f(x) = x/2 on [0, 2]:
- P(X ≤ 3) = ∫₀² (x/2) dx = 1 — the upper limit 3 is clipped to 2.
- P(−1 ≤ X ≤ 1) = ∫₀¹ (x/2) dx = 1/4 — the lower limit −1 is clipped to 0.
For a piecewise PDF, split the integral at each break point and use the right formula on each piece (see Q7 below).
On the image's footnote: f(0) = 0 does not exclude 0 from the support — it is the boundary of [0, 1]. For a continuous X this makes no difference to any probability, since single points carry zero probability.
21. GATE numerical: find k, then the probability
Question. f(x) = kx for 0 ≤ x ≤ 2, 0 otherwise. Find k and P(1 ≤ X ≤ 2). (Same PDF as Lesson 3, Example B — here we ask for the other half.)
Illustration description: Find k = 1/2 from total area 1; draw f(x) = x/2; P(1 ≤ X ≤ 2) = 3/4
- Total area = 1:
- Integrate over [1, 2]:
- Cross-check: Lesson 3 found P(0 ≤ X ≤ 1) = 1/4, and 1/4 + 3/4 = 1 ✔. A second check: the green region is a trapezium with parallel sides 0.5 and 1 and width 1, area ½(0.5 + 1)(1) = 0.75 ✔.
Exam shortcut: when the question asks for most of the range, compute the small complement and subtract from 1.
22. Lesson 4 practice
- ☐ Q1. f(x) = 3x² for 0 ≤ x ≤ 1, 0 otherwise. P(0 ≤ X ≤ 0.5) = ? (A) 0.125 (B) 0.25 (C) 0.375 (D) 0.50
- ☐ Q2. For f(x) = 2x on [0, 1], find P(0.5 ≤ X ≤ 1) and P(0.25 ≤ X ≤ 0.75).
- ☐ Q3. f(x) = kx³ for 0 ≤ x ≤ 2. Find k and P(X ≤ 1).
- ☐ Q4. f(x) = k(2 − x) for 0 ≤ x ≤ 2. Find k and P(X ≤ 1).
- ☐ Q5. f(x) = x/2 on [0, 2]. Find P(X ≤ 3) and P(X > 2.5).
- ☐ Q6. Is f(x) = 6x(1 − x) on [0, 1] a valid PDF? If so, find P(X ≤ 1/2).
- ☐ Q7. Piecewise PDF: f(x) = x for 0 ≤ x ≤ 1, f(x) = 2 − x for 1 < x ≤ 2, 0 otherwise. Find P(0.5 ≤ X ≤ 1.5).
Answers
- (A) 0.125. ∫₀^0.5 3x² dx = [x³]₀^0.5 = 0.125. Trap: 0.375 is width × height at the right end (0.5 × f(0.5)), which overcounts because the curve is lower to the left.
- 0.75 and 0.5. [x²] from 0.5 to 1 = 1 − 0.25; from 0.25 to 0.75 = 0.5625 − 0.0625.
- k = 1/4, P(X ≤ 1) = 1/16. ∫₀² kx³ dx = k·2⁴/4 = 4k = 1. Then (1/4)·(1⁴/4).
- k = 1/2, P(X ≤ 1) = 3/4. ∫₀² k(2 − x) dx = k(4 − 2) = 2k. Then ½[2x − x²/2]₀¹ = ½(1.5). Mirror image of f = x/2, so the answer flips from 1/4 to 3/4.
- 1 and 0. Both events are clipped by the support [0, 2].
- Valid, P = 1/2. f ≥ 0 on [0, 1]; ∫ (6x − 6x²) dx = [3x² − 2x³]₀¹ = 1. At 1/2: 3/4 − 1/4 = 1/2 (the PDF is symmetric about 1/2).
- 0.75. Split at 1: ∫ from 0.5 to 1 of x dx = 0.375, plus ∫ from 1 to 1.5 of (2 − x) dx = 0.375. Geometric check: the whole triangle has area 1, and the two cut-off corner triangles each have area ½ × 0.5 × 0.5 = 0.125, so 1 − 0.25.
23. Lesson 4 revision sheet
- Find k: set ∫ over the support of f(x) dx = 1, solve for k.
- Check f ≥ 0 on the whole support with that k.
- Clip the event to the support, split at any piecewise break points.
- Integrate: antiderivative at upper limit minus at lower limit.
- Check: triangle or trapezium area for straight-line PDFs, or confirm complements add to 1.
Common mistakes
- Using width × height on a sloping PDF.
- Forgetting to divide by n + 1 in the power rule (∫ x³ dx = x⁴/4, not x⁴).
- Integrating past the support instead of clipping the limits.
- Using one formula across a piecewise PDF instead of splitting.
- Swapping the limits (lower − upper) and getting a negative "probability".
Next: Lesson 5 — The CDF of a continuous random variable.
