Skip to content
Cambridge AS & A Level9231

Continuous random variables

Further Mathematics 9231 Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Continuous random variables notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Continuous random variables notes as text: skim, search, and jump between subtopics.

~10 min read

1. Probability density functions

A continuous random variable X has a probability density function f(x). It may be defined piecewise: one rule for each part of the range, and 0 otherwise.

Probabilities are areas. To find P(a<X<b), integrate f from a to b. If a boundary between two pieces lies inside (a,b), split the integral there.

The whole function must integrate to 1. This is how an unknown constant in f is found.

int_-∞^(∞) f(x) dx = 1

P(a<X<b)=int_a^(b) f(x) dx

Examiner insight

“This part was answered well, although a small number of candidates did not show sufficient working to justify the given answer.”

Worked example 16 marks

The continuous random variable X has probability density function f(x)=kx for 0≤ x≤ 2, f(x)=2k for 2<x≤ 4, and f(x)=0 otherwise.

(a) Find the value of k.

(b) Find P(1<X<3).

  1. 1

    Total area is 1: int₀² kx dx+int₂⁴ 2k dx=1 [1]

  2. 2

    2k+4k=6k=1 [1]

  3. 3

    k=1/6 [1]

  4. 4

    1<X<3 crosses the boundary at x=2: P(1<X<3)=int₁² ()/x6 dx+int₂³ 1/3 dx [1]

  5. 5

    =[x²/12]₁²+[()/x3]₂³=1/4+1/3 [1]

  6. 6

    =7/12 [1]

2. Expectation of a function of X

For any function g(X), the expected value is E(g(X))=int f(x) g(x) dx, taken over the range of X. The integrand uses the probability density function f, never F.

Put g(x)=x for the mean, g(x)=x² for E(X²), g(x)=√x for E(√X). If f is piecewise, integrate each piece and add.

For the variance, take E(X²) and subtract the mean squared.

E(g(X))=int f(x) g(x) dx

Var(X)=E(X²)-(E(X))²

Var(X²)=E(X⁴)-(E(X²))²

Examiner insight

“A few candidates used an incorrect expression for E(√X) often using F(x) rather than f(x) or using x rather than √x in the required integral.” “A few omitted the subtraction of the ‘mean squared’ from their calculation.”

Worked example 15 marks

The random variable X has cumulative distribution function F given by

F(x)=begincases0 & x<-2 1/12(x²+4x+4) & -2≤ x<0 1/15(x³+x+5) & 0≤ x≤ 2 1 & x>2endcases

Find Var(X²).

  1. 1

    Differentiate F: f(x)=()/x6+1/3 for -2≤ x<0, and f(x)=x²/5+1/15 for 0≤ x≤ 2 [1]

  2. 2

    E(X²)=int₋₂⁰x²(()/x6+1/3)dx+int₀² x²(x²/5+1/15)dx=2/9+328/225=42/25 [1]

  3. 3

    E(X⁴)=int₋₂⁰x⁴(()/x6+1/3)dx+int₀² x⁴(x²/5+1/15)dx [1]

  4. 4

    =16/45+2144/525=6992/1575 [1]

  5. 5

    Var(X²)=E(X⁴)-(E(X²))²=6992/1575-(42/25)²=1.62 [1]

3. Linking f and F

The cumulative distribution function F(x)=P(X≤x) comes from f by integrating. f comes back from F by differentiating.

When f is piecewise, build F one piece at a time. Every piece after the first needs a constant of integration, chosen so the pieces match at the boundary. Write F(x)=0 below the range and F(x)=1 above it. Write f(x)=0 outside the range too.

For a probability between two values, the simplest route is F(b)-F(a).

F(x)=int_-∞^(x) f(t) dt

f(x)=d/dxF(x)

P(a<X<b)=F(b)-F(a)

Examiner insight

“A common error was omitting to find the constant of integration. It was necessary to include F(x) = 0 for x < 0 and F(x) = 1 for x > 2 ln2, but often these were incorrectly combined as ‘F(x) = 0 otherwise’.” “A common error was to either omit or state incorrectly the value of the probability density function outside of the range (– 1, 1).”

Worked example 13 marks

The continuous random variable X has cumulative distribution function F given by

F(x)=begincases0 & x<0 -1/108x³+1/12x² & 0≤ x≤ 3 -1/32x²+7/16x+a & 3<x≤ b 1 & x>bendcases

Show that a=-17/32 and find the value of b.

  1. 1

    The first piece gives F(3)=0.5, so the second must too: -1/32(3)²+7/16(3)+a=0.5, hence a=-17/32 [1]

  2. 2

    F(b)=1: -1/32b²+7/16b-17/32=1 [1]

  3. 3

    b²-14b+49=0, so (b-7)²=0 and b=7 [1]

4. Percentiles: median and quartiles

To find a percentile, solve F(x)=p. The median m has F(m)=0.5. The lower quartile has F(Q₁)=0.25 and the upper quartile has F(Q₃)=0.75.

If F is piecewise, first find which piece holds the value. Evaluate F at the boundaries and compare with p. Solve in that piece only.

Solving may give a quadratic. Reject any root outside the range of the piece.

F(m)=0.5

F(Q₁)=0.25, F(Q₃)=0.75

interquartile range=Q₃-Q₁

Examiner insight

“The main cause of error was omitting to find in which region of the piecewise probability density function the median must lie.” “A common error was to offer also the second value of y obtained from the quadratic equation; this second value was out of the range of possible values.”

Worked example 12 marks

The random variable X has cumulative distribution function F given by

F(x)=begincases0 & x<-2 1/12(x²+4x+4) & -2≤ x<0 1/15(x³+x+5) & 0≤ x≤ 2 1 & x>2endcases

Find the exact value of the lower quartile of X.

  1. 1

    F(0)=1/3>1/4, so the lower quartile L lies in -2≤ x<0. Solve F(L)=0.25: 1/12(L²+4L+4)=1/4 [1]

  2. 2

    (L+2)²=3, so L=√3-2 (the root -√3-2 is below -2, so rejected) [1]

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. A continuous random variable X has probability density function f(x)=kx for 0≤ x≤ 3, and f(x)=0 otherwise. Find the value of k.2 marks
    Answer
    1. The total area under f is 1: int₀³ kx dx=1.
    2. 9k/2=1, so k=2/9.

    Trap: Setting f(3)=1 gives k=1/3. The area must equal 1, not the height.

  2. A continuous random variable X has probability density function f(x)=1/4 for 0≤ x<2, f(x)=(4-x)/4 for 2≤ x≤ 4, and f(x)=0 otherwise. Find P(1<X<3).4 marks
    Answer
    1. The interval crosses the boundary at x=2, so split the integral there.
    2. int₁²1/4 dx=1/4.
    3. int₂³(4-x)/4 dx=1/4[4x-x²/2]₂³=1/4(7.5-6)=3/8.
    4. P(1<X<3)=1/4+3/8=5/8.

    Trap: Using (4-x)/4 over the whole interval from 1 to 3 gives 1, a probability for the wrong piece.

  3. A continuous random variable X has probability density function f(x)=3x²/8 for 0≤ x≤ 2, and f(x)=0 otherwise. Find E(X) and Var(X).4 marks
    Answer
    1. E(X)=int₀² x·3x²/8 dx=3/8[x⁴/4]₀²=3/2.
    2. E(X²)=int₀² x²·3x²/8 dx=3/8[x⁵/5]₀²=12/5.
    3. Var(X)=12/5-(3/2)²=3/20.

    Trap: Stopping at E(X²)=12/5 leaves out the subtraction of the mean squared.

  4. A continuous random variable X has probability density function f(x)=3x²/8 for 0≤ x≤ 2, and f(x)=0 otherwise. Find E(1/X).3 marks
    Answer
    1. E(1/X)=int₀²1/x·3x²/8 dx.
    2. =int₀²3x/8 dx=[3x²/16]₀²=3/4.

    Trap: Taking E(1/X)=1/(E(X))=2/3. The expected value of a function is not the function of the expected value.

  5. A continuous random variable X has probability density function f(x)=1/5 for 0≤ x≤ 1, f(x)=()/x5 for 1<x≤ 3, and f(x)=0 otherwise. Find the cumulative distribution function of X.5 marks
    Answer
    1. For 0≤ x≤1: F(x)=int₀^(x)1/5 dt=()/x5.
    2. For 1<x≤3: F(x)=1/5+int₁^(x)()/t5 dt=1/5+(x²-1)/10=(x²+1)/10.
    3. Check: F(3)=1.
    4. F(x)=0 for x<0, and F(x)=1 for x>3.

    Trap: Writing F(x)=x²/10 for the second piece leaves out the constant. Then F(1)=1/10 from this piece but 1/5 from the first.

  6. A continuous random variable X has cumulative distribution function F(x)=begincases0 & x<0 (x²+x)/6 & 0≤ x≤ 2 1 & x>2endcases (a) Find the probability density function of X. (b) Find P(X>1.5).4 marks
    Answer
    1. (a)
    2. f(x)=d/dxF(x)=(2x+1)/6 for 0≤ x≤2, and f(x)=0 otherwise.
    3. (b)
    4. P(X>1.5)=1-F(1.5)=1-(2.25+1.5)/6=1-0.625=0.375.

    Trap: F(1.5)=0.625 is P(X<1.5). Answering with it gives the wrong tail.

  7. A continuous random variable X has cumulative distribution function F(x)=begincases0 & x<0 x²/8 & 0≤ x≤ 2 ()/x4 & 2<x≤ 4 1 & x>4endcases Find the interquartile range of X.4 marks
    Answer
    1. Lower quartile: F(2)=0.5>0.25, so it lies in 0≤ x≤2. x²/8=0.25 gives Q₁=√2.
    2. Upper quartile: 0.75>F(2), so it lies in 2<x≤4. ()/x4=0.75 gives Q₃=3.
    3. Interquartile range =3-√2=1.59 (3 s.f.).

    Trap: Solving x²/8=0.75 for Q₃ gives x=√6≈2.45, which is outside 0≤ x≤2.

  8. A continuous random variable X has cumulative distribution function F(x)=x²/16 for 0≤ x≤ 4, with F(x)=0 for x<0 and F(x)=1 for x>4. The random variable Y is defined by Y=X². (a) Find the cumulative distribution function of Y. (b) Find P(Y>9).4 marks
    Answer
    1. (a)
    2. G(y)=P(X²≤ y)=P(X≤√y)=F(√y)=()/y16 for 0≤ y≤16.
    3. G(y)=0 for y<0, and G(y)=1 for y>16.
    4. (b)
    5. P(Y>9)=1-G(9)=1-9/16=7/16.

    Trap: Writing P(X²≤ y)=P(X≤ y) gives y²/16. The square root is missing.

  9. A machine makes metal cubes. The edge length X cm of a cube has cumulative distribution function F(x)=(x²+2x)/8 for 0≤ x≤ 2, with F(x)=0 for x<0 and F(x)=1 for x>2. The volume of a cube is Y cm³. (a) Find the cumulative distribution function of Y, and hence its probability density function. (b) Find the exact median volume.7 marks
    Answer
    1. (a)
    2. Y=X³, so G(y)=P(X³≤ y)=P(X≤ y^(1/3))=F(y^(1/3)).
    3. G(y)=(y^(2/3)+2y^(1/3))/8 for 0≤ y≤ 8, with G(y)=0 for y<0 and G(y)=1 for y>8.
    4. g(y)=d/dyG(y)=1/8(2/3y^(-1/3)+2/3y^(-2/3))=1/12(y^(-1/3)+y^(-2/3)) for 0<y≤8, and g(y)=0 otherwise.
    5. (b)
    6. Solve G(m)=0.5. Put u=m^(1/3): u²+2u=4, so u=-1±√5.
    7. u is a length, so reject -1-√5: u=√5-1.
    8. m=(√5-1)³=8√5-16, which is 1.89 cm³.

    Trap: Equating the probability density function g(y) to 0.5 instead of G(y), or keeping the root -1-√5, which is outside the range of X.

  10. The time T hours taken to repair a machine has probability density function f(t)=kt for 0≤ t≤ 2, f(t)=(k(6-t))/2 for 2<t≤ 6, and f(t)=0 otherwise. A repair costs 10T² dollars. (a) Show that k=1/6. (b) Find the median repair time. (c) Find the expected cost of a repair.9 marks
    Answer
    1. (a)
    2. int₀² kt dt+int₂⁶(k(6-t))/2 dt=2k+4k=6k=1, so k=1/6.
    3. (b)
    4. P(T≤2)=int₀²()/t6 dt=1/3<0.5, so the median m lies in 2<t≤6.
    5. 1/3+1/12[6t-t²/2]₂^(m)=1/2, so 6m-m²/2-10=2.
    6. m²-12m+24=0, so m=6±2√3. Reject 6+2√3=9.46, which is above 6.
    7. m=6-2√3=2.54 hours.
    8. (c)
    9. E(T²)=int₀² t²·()/t6 dt+int₂⁶ t²·(6-t)/12 dt=2/3+8=26/3.
    10. Expected cost =10E(T²)=260/3, which is 86.67 dollars.

    Trap: Using 10(E(T))²=10×(8/3)²=71.11. The expected cost needs E(T²), which is larger.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
F(x)=0 otherwiseF(x)=0 for x<0 and F(x)=1 for x>2ln 2
Var(X)=E(X²)Var(X)=E(X²)-(E(X))², the mean squared subtracted
Solve int₂^(m) k(6-x) dx=0.5, leaving out the probability below 2Find which piece holds the median: int₀² kx(4-x) dx=0.4<0.5, so solve int₂^(m) k(6-x) dx=0.5-0.4
Equate the probability density function to 0.3Equate the cumulative distribution function G(y) to 0.3, then reject the root outside the range of y

Frequently asked questions

How do I find the unknown constant in a probability density function?
The whole function must integrate to 1, so the total area under f is 1. For a piecewise function, integrate each piece over its own range and add the results. For f(x)=kx on 0≤ x≤3, int₀³ kx dx=9k/2=1, so k=2/9. Set the area to 1, not the height of the function at one point.
How do I find a probability from a probability density function?
Probabilities are areas, so P(a<X<b)=int_a^(b)f(x) dx. If a boundary between two pieces lies inside the interval, split the integral at that boundary. For example, with f(x)=1/4 on 0≤ x<2 and f(x)=(4-x)/4 on 2≤ x≤4, P(1<X<3)=5/8.
How do I find E(X) and Var(X) for a continuous random variable?
The expected value of g(X) is int f(x) g(x) dx, using the probability density function f, never the cumulative distribution function F. Take g(x)=x for the mean and g(x)=x² for E(X²). Then Var(X)=E(X²)-(E(X))², which subtracts the mean squared. For f(x)=3x²/8 on 0≤ x≤2, E(X)=3/2 and Var(X)=3/20.
How do I find a cumulative distribution function from a probability density function, and back again?
The cumulative distribution function F(x)=P(X≤ x) comes from f by integrating, and f comes back by differentiating. Build F one piece at a time: every piece after the first needs a constant of integration, chosen so the pieces match at each boundary. Write F(x)=0 below the range and F(x)=1 above it. For f(x)=1/5 on 0≤ x≤1 and f(x)=()/x5 on 1<x≤3, F(x)=(x²+1)/10 on the second piece.
How do I find the median or a quartile from a cumulative distribution function?
Solve F(x)=p with p=0.5 for the median, 0.25 for the lower quartile and 0.75 for the upper quartile. If F is piecewise, first find which piece holds the value by evaluating F at the boundaries, and solve in that piece only. Reject any root outside the range of that piece. For F(x)=x²/8 on 0≤ x≤2 and F(x)=()/x4 on 2<x≤4, the upper quartile is 3 and the interquartile range is 3-√2.
Why do I lose marks on a cumulative distribution function?
The most common error was omitting the constant of integration in the second part of a cumulative distribution function. Students also wrote "F(x)=0 otherwise" instead of giving F(x)=0 below the range and F(x)=1 above it. For Y=X², writing P(X²≤ y)=P(X≤ y) loses the square root, so the cumulative distribution function of Y is wrong.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters