Probability density: probability is area
A time or a length can take any value in a range, so the chance of hitting one exact value is zero. Probability has to live somewhere else: in the area under a curve, the probability density f(x). One density runs through this unit:
1Read a density: support, height and area
2Find the constant: make the total area 1
X has density k(x + 1) for 1 ≤ x ≤ 5, and 0 elsewhere. Find k.
- Set the total area equal to 1
- Integrate
- Upper minus lower
- Answerk = 1/16, so f(x) = (x + 1)/16
3Try it
1 X has density kx for 0 ≤ x ≤ 4, and 0 elsewhere. Find k.
2 Is (3 − x)/4 for 1 ≤ x ≤ 3, 0 elsewhere, a probability density? Give a reason.
3 A density has f(2) = 1/4. What is P(X = 2)?
- 1∫ kx dx from 0 to 4 = 8k = 1, so k = 1/8
- 2no: its area is 1/2, not 1
- 30: f(2) is a height, and one point has no area
Probabilities from areas: intervals, tails and conditions
Every probability question about X becomes one question about f: which area? Draw the event on the x-axis, keep it inside the support, then integrate. A condition just changes which area you divide by.
1An interval: integrate between its ends
X has density f(x) = (x + 1)/16 on 1 ≤ x ≤ 5. Find P(2 < X < 4).
- Set up the area
- Integrate
- Upper minus lower=24/32 − 8/32
- AnswerP(2 < X < 4) = 1/2
2A tail: stop at the end of the support
3A condition: divide by the given area
Find P(X > 4 | X > 2).
- The given area, from 2 to 5P(X > 2)=35/32 − 8/32 = 27/32
- X > 4 already means X > 2
- DivideP(X > 4 | X > 2)=(11/32) ÷ (27/32)
- AnswerP(X > 4 | X > 2) = 11/27 ≈ 0.407
4Try it
1 X has density x/8 for 0 ≤ x ≤ 4, and 0 elsewhere. Find P(1 < X < 3).
2 Find P(X > 3).
3 Find P(X > 3 | X > 1).
- 1[x²/16] from 1 to 3 = 9/16 − 1/16 = 1/2
- 216/16 − 9/16 = 7/16
- 3(7/16) ÷ (15/16) = 7/15
Median, quartiles and percentiles
Turn an area question round. Instead of “how much area lies below 4?”, ask “where must I cut so that half the area lies below?” That cut is the median. Cut at a quarter or three quarters for the quartiles, at any p for a percentile.
1The median: half the area below m
X has density f(x) = (x + 1)/16 on 1 ≤ x ≤ 5. Find the median m.
- Area from 1 to m is a half
- Integrate and tidy
- Complete the squarem=−1 ± 2√5
- Answerm = −1 + 2√5 ≈ 3.47
2Any percentile: replace 1/2 by p
3Quartiles and the interquartile range
Lower quartile: p = 1/4
- A quarter of the area lies below
- Answer≈ 2.46Put p = 1/4 into the formula.
Upper quartile: p = 3/4
- Three quarters lies below
- Answer≈ 4.29Put p = 3/4 into the formula.
4Try it
1 X has density x/8 for 0 ≤ x ≤ 4, and 0 elsewhere. Find the median.
2 Find the lower quartile.
3 Find the 90th percentile, to 3 significant figures.
- 1m²/16 = 1/2, so m = 2√2 ≈ 2.83
- 2q²/16 = 1/4, so q = 2
- 3q²/16 = 0.9, so q = √14.4 ≈ 3.79
Mean and variance of a continuous variable
The mean is the balance point of the area. Each thin strip of width Δx carries probability about f(x) Δx and pulls with weight x, so the mean is the integral of x f(x). Weight by x² instead and you are one step from the variance.
1The mean: weight each strip by x
X has density f(x) = (x + 1)/16 for 1 ≤ x ≤ 5, and 0 otherwise. Find E(X).
- Write the weighted integralE(X)=∫ x f(x) dx, from 1 to 5=(1/16) ∫ (x² + x) dx
- Integrate term by term=(1/16) [x³/3 + x²/2], from 1 to 5
- Upper minus lower=(1/16) [(125/3 + 25/2) − (1/3 + 1/2)]=(1/16) × 160/3
- AnswerE(X) = 10/3 ≈ 3.33
2The variance: E(X²) minus the mean squared
For the same X, find Var(X) and the standard deviation.
- Weight by x²
- Integrate, upper minus lower
- Subtract the mean squared=
- AnswerVar(X) = 11/9 ≈ 1.22 and SD = √11/3 ≈ 1.11
3Try it
1 X has density x/8 for 0 ≤ x ≤ 4, and 0 elsewhere. Find E(X).
2 Find E(X²) and Var(X).
- 1∫ x²/8 dx from 0 to 4 = 64/24 = 8/3
- 2E(X²) = ∫ x³/8 dx = 8, so Var = 8 − 64/9 = 8/9
Using the mean: symmetry and unknown constants
Sometimes the mean is given away by the picture: a density that is the same on both sides of a line balances on that line. Sometimes the mean is given and something else is missing. Then the mean becomes an equation, and with total area 1 you have two equations for two unknowns.
1Symmetry gives the mean without integrating
2Two unknowns, two conditions
A density is k(x + 1) for 1 ≤ x ≤ b, and 0 elsewhere, with b > 1. Its mean is 10/3. Find b and k.
- Total area 1
- Mean, with that k
- Set it equal to 10/3
- Answerb = 5 and k = 1/16 (b = −5/2 breaks b > 1)
3Try it
1 A density is symmetric about x = 4 on 2 ≤ x ≤ 6. Write down its mean.
2 For the same density, P(X < 3) = 0.15. Find P(3 < X < 5).
3 A density is kx for 0 ≤ x ≤ b, and 0 elsewhere, with mean 2. Find b and k.
- 14
- 2P(X > 5) = 0.15 too, so 1 − 0.3 = 0.7
- 3mean = (kb³/3) ÷ (kb²/2) = 2b/3 = 2, so b = 3; kb²/2 = 1, so k = 2/9
A density on an infinite interval
A waiting time has no upper limit, so its density runs on for ever. The area can still be 1 if the curve falls fast enough. You cannot put ∞ into a formula, so integrate to a finite L, then let L grow without bound.
1Total area to infinity: integrate to L, then let L → ∞
- 1Integrate from 0 to a finite L: call the area IL.
- 2Substitute u = x + 1, so x + 2 = u + 1 and the limits become 1 and L + 1.
- 3Let L → ∞: every fraction with L in it shrinks to 0.
- 4Set the limit equal to 1 and solve for c.
2An upper tail: the same limit, from r
3Try it
1 X has density c/(x + 1)³ for x ≥ 0, and 0 elsewhere. Find c.
2 Find P(X > 1).
3 Find P(X > 3).
- 1∫ from 0 to L = (c/2)[1 − 1/(L + 1)²] → c/2 = 1, so c = 2
- 21/(1 + 1)² = 1/4
- 31/(3 + 1)² = 1/16
Mean and variance on an infinite interval
The mean and variance still come from x f(x) and x² f(x); only the limit is new. Keep the finite L until every term has been evaluated, and then let L → ∞. The variable is Y with density h:
1The mean, by parts
- 1Write the mean up to a finite L: IL = ∫ x h(x) dx from 0 to L.
- 2Parts: uv − ∫ v du gives −L T(L) + ∫ T(x) dx.
- 3Integrate T, then put in L and 0.
- 4Let L → ∞: the terms in L go to 0, leaving the lower-limit value.
2The second moment and variance
- 1Write E(Y²) up to a finite L: JL = ∫ x² h(x) dx from 0 to L.
- 2Substitute u = x + 1 and split into four powers of u.
- 3Integrate each power, put in L + 1 and 1, then let L → ∞.
- 4Var(Y) = E(Y²) − [E(Y)]², with E(Y) = 3/7.
3Try it
1 X has density 3/(x + 1)⁴ for x ≥ 0, and 0 elsewhere. Find E(X). (Hint: put u = x + 1.)
2 Find E(X²).
3 Find Var(X).
- 1∫ 3(u − 1)/u⁴ du from 1 to ∞ = 3(1/2 − 1/3) = 1/2
- 2∫ 3(u − 1)²/u⁴ du = 3(1 − 1 + 1/3) = 1
- 31 − (1/2)² = 3/4