Skip to content

9709 · Unit 30 · Paper 6: Probability and Statistics 2

Continuous random variables.

9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

Probability density: probability is area

§6.3 · Continuous random variables

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:

f(x)=x+116
1 ≤ x ≤ 5
f(x)=0
elsewhere

1Read a density: support, height and area

The support is where f is not zero: here 1 ≤ x ≤ 5. A density is never negative, and the total area under it is 1.
density f(x)012345600.1250.250.3750.5x1/83/8support: 1 ≤ x ≤ 5total area = 1density f(x)012345600.1250.250.3750.5x1/83/8support: 1 ≤ x ≤ 5total area = 1
  1. The region is a trapezium: half the sum of the parallel sides times the width
    total area=12×(18+38)×(5−1)
  2. Answer
    total area=1It is a valid density.
total area=12×(18+38)×(5−1)The region is a trapezium: half the sum of the parallel sides times the width.total area=1It is a valid density.
  1. This is a height, not a probability
    f(3)=14
  2. Answer
    P(X = 3) = 0One point has no width, so no area.
f(3)=14This is a height, not a probability.P(X = 3) = 0One point has no width, so no area.
Because single points carry no probability, < and ≤ give the same answer: P(2 < X < 4) = P(2 ≤ X ≤ 4).

2Find the constant: make the total area 1

Integrate over the whole support only, set the answer equal to 1, then check the density is never negative.
Worked example

X has density k(x + 1) for 1 ≤ x ≤ 5, and 0 elsewhere. Find k.

  1. Set the total area equal to 1
    ∫15k(1+x)dx=1
  2. Integrate
    antiderivative=k(12x2+x)
  1. Upper minus lower
    k×(522+5−(122+1))=116k=1
  2. Answer
    k = 1/16, so f(x) = (x + 1)/16
✓Check on 1 ≤ x ≤ 5, x + 1 ≥ 2 and k > 0, so f is positive there; it is 0 elsewhere
density f(x)0123456xa3asupport: 1 ≤ x ≤ 5
  1. From the graph: heights a and 3a, width 4
    12(a+3a)×4=1 ⇒ a=18
  2. Rise over run
    gradient=38−184 = 116
  3. Answer
    f(x)=116(x−1)+18 = x16+116The same density from its picture.
12(a+3a)×4=1 ⇒ a=18From the graph: heights a and 3a, width 4.gradient=38−184 = 116Rise over run.f(x)=116(x−1)+18 = x16+116The same density from its picture.

3Try it

Your turn

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. 1
    ∫ kx dx from 0 to 4 = 8k = 1, so k = 1/8
  2. 2
    no: its area is 1/2, not 1
  3. 3
    0: f(2) is a height, and one point has no area
Tick what you can do now
Practise with s26/63 Q3; s26/65 Q4(a); m26/62 Q6(a)
1 / 7
9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

Probabilities from areas: intervals, tails and conditions

§6.3 · Continuous random variables

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

density f(x)012345600.1250.250.3750.5x24area = 1/2
Worked example

X has density f(x) = (x + 1)/16 on 1 ≤ x ≤ 5. Find P(2 < X < 4).

  1. Set up the area
    P(2 < X < 4)=∫24(116+116x)dx
  2. Integrate
    antiderivative=132x2+116x
  3. Upper minus lower
    =24/32 − 8/32
  4. Answer
    P(2 < X < 4) = 1/2

2A tail: stop at the end of the support

Above 5 the density is zero, so P(X > 4) runs from 4 to 5. The complement gives the other side.
density f(x)012345600.1250.250.3750.5x4
  1. The support ends at 5
    P(X > 4)=∫45(116+116x)dx
  2. Same antiderivative at 5 and at 4
    P(X > 4)=35/32 − 24/32
  3. Answer
    P(X > 4)=1132About 0.344.
P(X > 4)=∫45(116+116x)dxThe support ends at 5.P(X > 4) = 35/32 − 24/32Same antiderivative at 5 and at 4.P(X > 4)=1132About 0.344.
So P(X < 4) = 1 − 11/32 = 21/32. A bound beyond 5 adds no probability, because f is zero there.

3A condition: divide by the given area

P(A | B) = P(A and B) ÷ P(B). Both are areas under the same density: the violet region is the given one, the blue region is the part that also meets the event.
density f(x)012345600.1250.250.3750.5xgiven: x > 2x > 4density f(x)012345600.1250.250.3750.5xgiven: x > 2x > 4
Worked example

Find P(X > 4 | X > 2).

  1. The given area, from 2 to 5
    P(X > 2)=35/32 − 8/32 = 27/32
  2. X > 4 already means X > 2
    P(X > 4 and X > 2)=1132
  1. Divide
    P(X > 4 | X > 2)=(11/32) ÷ (27/32)
  2. Answer
    P(X > 4 | X > 2) = 11/27 ≈ 0.407
✓Check bigger than 11/32: the given group leaves out the area below 2
The denominator is an area, P(X > 2), never the height of f at 2.

4Try it

Your turn

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. 1
    [x²/16] from 1 to 3 = 9/16 − 1/16 = 1/2
  2. 2
    16/16 − 9/16 = 7/16
  3. 3
    (7/16) ÷ (15/16) = 7/15
Tick what you can do now
Practise with m26/62 Q6(c)(i), Q6(c)(ii); m26/62 Q6(c)(ii) (related area practice)
2 / 7
9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

Median, quartiles and percentiles

§6.3 · Continuous random variables

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

Integrate from the start of the support to m, set it equal to 1/2, and keep the root that lies inside the support.
density f(x)012345600.1250.250.3750.5xmarea = 1/2
Worked example

X has density f(x) = (x + 1)/16 on 1 ≤ x ≤ 5. Find the median m.

  1. Area from 1 to m is a half
    ∫1m(116+116x)dx=12
  2. Integrate and tidy
    m2+2m−19=0
  3. Complete the square
    (m+1)2=20m=−1 ± 2√5
  4. Answer
    m = −1 + 2√5 ≈ 3.47
✓Check −1 − 2√5 is below 1, outside the support
The lower limit is 1, where the support starts, not 0. And the midpoint 3 is not the median: only 3/8 of the area lies below 3, because the density rises.

2Any percentile: replace 1/2 by p

  1. The area from 1 to q is p
    q2+2q−332=p
  2. Multiply by 32, then complete the square
    (q+1)2=4+32p
  3. Answer
    q=−1+4+32pFor 0 ≤ p ≤ 1 this root lies in [1, 5].
q2+2q−332=pThe area from 1 to q is p.(q+1)2=4+32pMultiply by 32, then complete the square.q=−1+4+32pFor 0 ≤ p ≤ 1 this root lies in [1, 5].

3Quartiles and the interquartile range

density f(x)012345600.1250.250.3750.5xQ₁area1/4
density f(x)012345600.1250.250.3750.5xQ₃area = 3/4
Worked example

Lower quartile: p = 1/4

  1. A quarter of the area lies below
    Q₁=−1+4+32×14
  2. Answer
    Q₁=−1+23 ≈ 2.46Put p = 1/4 into the formula.
Worked example

Upper quartile: p = 3/4

  1. Three quarters lies below
    Q₃=−1+4+32×34
  2. Answer
    Q₃=−1+27 ≈ 4.29Put p = 3/4 into the formula.
Lower quartile: p = 1/4
Q₁=−1+4+32×14A quarter of the area lies below.Q₁=−1+23 ≈ 2.46Put p = 1/4 into the formula.
Upper quartile: p = 3/4
Q₃=−1+4+32×34Three quarters lies below.Q₃=−1+27 ≈ 4.29Put p = 3/4 into the formula.
IQR = Q₃ − Q₁ = 2(√7 − √3) ≈ 1.83. The quartiles are not reflections of each other about 3: the density is not symmetric.

4Try it

Your turn

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.

  1. 1
    m²/16 = 1/2, so m = 2√2 ≈ 2.83
  2. 2
    q²/16 = 1/4, so q = 2
  3. 3
    q²/16 = 0.9, so q = √14.4 ≈ 3.79
Tick what you can do now
Practise with s26/62 Q7(b) (related median-area practice); s26/65 Q4(a) (related median-area practice)
3 / 7
9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

Mean and variance of a continuous variable

§6.3 · Continuous random variables

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

E(X) = ∫ x f(x) dx over the support. It is an area under x f(x), not a probability.
density f(x)012345600.1250.250.3750.5xΔxarea ≈ f(x) Δxweighted height x f(x)012345600.511.52xΔxcontribution ≈ x f(x) Δxdensity f(x)012345600.1250.250.3750.5xΔxarea ≈ f(x) Δxweighted height x f(x)012345600.511.52xΔxcontribution ≈ x f(x) Δx
Worked example

X has density f(x) = (x + 1)/16 for 1 ≤ x ≤ 5, and 0 otherwise. Find E(X).

  1. Write the weighted integral
    E(X)=∫ x f(x) dx, from 1 to 5=(1/16) ∫ (x² + x) dx
  2. Integrate term by term
    =(1/16) [x³/3 + x²/2], from 1 to 5
  1. Upper minus lower
    =(1/16) [(125/3 + 25/2) − (1/3 + 1/2)]=(1/16) × 160/3
  2. Answer
    E(X) = 10/3 ≈ 3.33
✓Check between 1 and 5 and above the midpoint 3, as it should be for a rising density

2The variance: E(X²) minus the mean squared

Var(X) = E(X²) − [E(X)]², with E(X²) = ∫ x² f(x) dx.
weighted height x² f(x)01234560246810xshaded area = E(X²)
Worked example

For the same X, find Var(X) and the standard deviation.

  1. Weight by x²
    E(X2)=116×∫15(x3+x2)dx
  2. Integrate, upper minus lower
    E(X2)=116×(544+533−(14+13))E(X2)=373
  3. Subtract the mean squared
    Var(X)=373−(103)2 = 119
  4. Answer
    Var(X) = 11/9 ≈ 1.22 and SD = √11/3 ≈ 1.11

3Try it

Your turn

1 X has density x/8 for 0 ≤ x ≤ 4, and 0 elsewhere. Find E(X).

2 Find E(X²) and Var(X).

  1. 1
    ∫ x²/8 dx from 0 to 4 = 64/24 = 8/3
  2. 2
    E(X²) = ∫ x³/8 dx = 8, so Var = 8 − 64/9 = 8/9
Tick what you can do now
Practise with s26/62 Q7(a); s26/61 Q6(b) (related weighted-integral practice); s26/63 Q3
4 / 7
9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

Using the mean: symmetry and unknown constants

§6.3 · Continuous random variables

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

If the density and its support are symmetric about a line, the mean is on that line, and reflected tails have equal areas. A different variable S has this density, with total area 1:
g(x)=15⁢(1−(x−2)2)216
1 ≤ x ≤ 3
g(x)=0
elsewhere
density g(x)00.511.522.533.5400.250.50.751x53/51253/512reflection axis: x = 2
  1. Equal heights at equal distances from 2
    g(2−d)=g(2+d)
  2. The balance point is the centre
    E(S)=2
  3. Given P(S < 1.5) = 53/512; 2.5 reflects 1.5
    P(S > 2.5)=P(S < 1.5) = 53512
  4. Answer
    P(1.5 ≤ S ≤ 2.5)=2032561 − 2 × 53/512.
g(2−d)=g(2+d)Equal heights at equal distances from 2.E(S)=2The balance point is the centre.P(S > 2.5)=P(S < 1.5) = 53512Given P(S < 1.5) = 53/512; 2.5 reflects 1.5.P(1.5 ≤ S ≤ 2.5)=2032561 − 2 × 53/512.
f(x) = (x + 1)/16 is not symmetric: its ends have heights 1/8 and 3/8. Its midpoint 3 is not its mean; the mean is 10/3.

2Two unknowns, two conditions

When the support itself is unknown, use both facts: total area 1 and the given mean. Solve them together and reject any boundary outside the stated range.
density f(x)x2kk(b + 1)1b > 1density f(x)x2kk(b + 1)1b > 1
Worked example

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.

  1. Total area 1
    k(12b2+b−32)=1k=2b2+2b−3
  2. Mean, with that k
    E(X)=2b2+5b+53(b+3)
  1. Set it equal to 10/3
    2b2−5b−25=0(b−5)(2b+5)=0
  2. Answer
    b = 5 and k = 1/16 (b = −5/2 breaks b > 1)
✓Check area (1/16) × 16 = 1 and mean (50 + 25 + 5)/24 = 10/3

3Try it

Your turn

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.

  1. 1
    4
  2. 2
    P(X > 5) = 0.15 too, so 1 − 0.3 = 0.7
  3. 3
    mean = (kb³/3) ÷ (kb²/2) = 2b/3 = 2, so b = 3; kb²/2 = 1, so k = 2/9
Tick what you can do now
Practise with m26/62 Q6(b), Q6(c)(ii); s26/63 Q3; s26/65 Q4(b); m26/62 Q6(a)
5 / 7
9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

A density on an infinite interval

§6.3 · Continuous random variables

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 → ∞

A separate variable Y has density c(x + 2)/(x + 1)⁵ on x ≥ 0, and 0 elsewhere. Find c.
density h(x)0123401234xLIntegrate to L, then take L → ∞
  1. 1
    Integrate from 0 to a finite L: call the area IL.
  2. 2
    Substitute u = x + 1, so x + 2 = u + 1 and the limits become 1 and L + 1.
  3. 3
    Let L → ∞: every fraction with L in it shrinks to 0.
  4. 4
    Set the limit equal to 1 and solve for c.
  1. Start with a finite upper limit L
    IL=∫0Lc(1+x)−5(2+x)dx
  2. u = x + 1, so x + 2 = u + 1; change both limits
    IL=c∫11+L(u−4+u−5)du
  3. Integrate each power
    antiderivative=(−c)(13u3+14u4)
  4. Upper value minus the value −7c/12 at u = 1
    IL = c(712 − 13(L+1)3 − 14(L+1)4)
  5. Both fractions in L tend to zero
    total area=limL→∞IL = c×712 = 1
  6. Answer
    c=127The constant is positive.
IL=∫0Lc(1+x)−5(2+x)dxStart with a finite upper limit L.IL=c∫11+L(u−4+u−5)duu = x + 1, so x + 2 = u + 1; change both limits.antiderivative=(−c)(13u3+14u4)Integrate each power.
IL = c(712 − 13(L+1)3 − 14(L+1)4)
Upper value minus the value −7c/12 at u = 1.total area=limL→∞IL = c×712 = 1Both fractions in L tend to zero.c=127The constant is positive.
h(x)=12⁢(x+2)7⁢(x+1)5
x ≥ 0
h(x)=0
elsewhere
h(0) = 24/7, more than 1. That is allowed: a density is a height, and only areas are probabilities.

2An upper tail: the same limit, from r

P(Y > r) is the area from r to L, as L → ∞. Find it once as a formula, then use any r.
h(x), tail view x ≥ 112345600.050.10.150.2xShading continues to the right, to ∞area = 11/112
  1. T(r) names the tail area
    T(r)=limL→∞∫rLh(x)dx
  2. Integrate h
    antiderivative = −47(x+1)3 − 37(x+1)4
  3. Answer
    T(r)=4r+77(1+r)4The L terms vanish; combine the rest.
T(r)=limL→∞∫rLh(x)dxT(r) names the tail area.
antiderivative = −47(x+1)3 − 37(x+1)4
Integrate h.T(r)=4r+77(1+r)4The L terms vanish; combine the rest.
Now use the formula at an actual boundary. Put r = 1:
  1. Put r = 1
    P(Y > 1)=4×1+77×(1+1)4
  2. Answer
    P(Y > 1)=11112About 0.0982.
P(Y > 1)=4×1+77×(1+1)4Put r = 1.P(Y > 1)=11112About 0.0982.
So P(0 ≤ Y ≤ 1) = 101/112, the complement within the support. T(0) = 1, the whole area, and T(r) → 0 as r grows. The shaded tail in the figure goes on to the right.

3Try it

Your turn

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. 1
    ∫ from 0 to L = (c/2)[1 − 1/(L + 1)²] → c/2 = 1, so c = 2
  2. 2
    1/(1 + 1)² = 1/4
  3. 3
    1/(3 + 1)² = 1/16
Tick what you can do now
Practise with s26/61 Q6(a) (related finite-support normalisation); m26/62 Q6(c)(i), Q6(c)(ii) (related bounded-area practice)
6 / 7
9709 · Unit 30 · Continuous random variables
Revisionbyexamplicity

Mean and variance on an infinite interval

§6.3 · Continuous random variables

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:

h(x)=12⁢(x+2)7⁢(x+1)5
x ≥ 0
h(x)=0
elsewhere

1The mean, by parts

Use u = x and dv = h(x) dx. The upper tail T(x) = P(Y > x) = (4x + 7)/[7(x + 1)⁴] has T′(x) = −h(x), so v = −T(x).
weighted height x h(x)0123400.10.20.30.40.5xLIntegrate to L, then take L → ∞
  1. 1
    Write the mean up to a finite L: IL = ∫ x h(x) dx from 0 to L.
  2. 2
    Parts: uv − ∫ v du gives −L T(L) + ∫ T(x) dx.
  3. 3
    Integrate T, then put in L and 0.
  4. 4
    Let L → ∞: the terms in L go to 0, leaving the lower-limit value.
  1. The mean, up to L
    IL=∫0Lxh(x)dx
  2. uv − ∫ v du; at 0 the product is 0
    IL=(−L)T(L)+∫0LT(x)dx
  3. Integrate T; differentiate to check
    antiderivative of T = −27(x+1)2 − 17(x+1)3
  4. The 3/7 comes from the lower limit
    IL = −L(4L+7)7(L+1)4 − 27(L+1)2 − 17(L+1)3 + 37
  5. Answer
    E(Y)=limL→∞IL = 37Every term in L tends to zero.
IL=∫0Lxh(x)dxThe mean, up to L.IL=(−L)T(L)+∫0LT(x)dxuv − ∫ v du; at 0 the product is 0.
antiderivative of T = −27(x+1)2 − 17(x+1)3
Integrate T; differentiate to check.
IL = −L(4L+7)7(L+1)4 − 27(L+1)2 − 17(L+1)3 + 37
The 3/7 comes from the lower limit.E(Y)=limL→∞IL = 37Every term in L tends to zero.
Never write “∞” into the working as if it were a number. Evaluate at L, then take the limit.

2The second moment and variance

Put u = x + 1, so x = u − 1 and x²(x + 2) = (u − 1)²(u + 1) = u³ − u² − u + 1. Keep all four terms.
weighted height x² h(x)0123400.10.20.30.40.5xLIntegrate to L, then take L → ∞
  1. 1
    Write E(Y²) up to a finite L: JL = ∫ x² h(x) dx from 0 to L.
  2. 2
    Substitute u = x + 1 and split into four powers of u.
  3. 3
    Integrate each power, put in L + 1 and 1, then let L → ∞.
  4. 4
    Var(Y) = E(Y²) − [E(Y)]², with E(Y) = 3/7.
  1. The second moment, up to L
    JL=∫0Lx2h(x)dx
  2. Divide each term by u⁵; change both limits
    JL =127∫11+L(u−2−u−3−u−4+u−5)du
  3. Integrate each power
    antiderivative = 127(−1u + 12u2 + 13u3 − 14u4)
  4. BL is the bracket at u = L + 1; at u = 1 it is −5/12
    JL=127(BL+512)
  5. BL → 0 as L → ∞
    E(Y2)=limL→∞JL = 127×512 = 57
  6. Subtract the mean squared
    Var(Y)=57−(37)2
  7. Answer
    Var(Y)=2649; SD=1726Variance ≈ 0.531; SD ≈ 0.728.
JL=∫0Lx2h(x)dxThe second moment, up to L.
JL =127∫11+L(u−2−u−3−u−4+u−5)du
Divide each term by u⁵; change both limits.
antiderivative = 127(−1u + 12u2 + 13u3 − 14u4)
Integrate each power.JL=127(BL+512)BL is the bracket at u = L + 1; at u = 1 it is −5/12.E(Y2)=limL→∞JL = 127×512 = 57BL → 0 as L → ∞.Var(Y)=57−(37)2Subtract the mean squared.Var(Y)=2649; SD=1726Variance ≈ 0.531; SD ≈ 0.728.
One density, three areas: under h it is 1, under x h(x) it is 3/7, under x² h(x) it is 5/7.

3Try it

Your turn

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. 1
    ∫ 3(u − 1)/u⁴ du from 1 to ∞ = 3(1/2 − 1/3) = 1/2
  2. 2
    ∫ 3(u − 1)²/u⁴ du = 3(1 − 1 + 1/3) = 1
  3. 3
    1 − (1/2)² = 3/4
Tick what you can do now
Practise with s26/61 Q6(b) (related exponential integration-by-parts practice); s26/63 Q3 (related bounded second-moment practice)
7 / 7