Skip to main content

Continuous random variables: probability density functions, cumulative distributions, mean and variance

Syllabus dot point

“Use probability density functions and cumulative distribution functions to find probabilities, medians, modes, means and variances of continuous random variables”

HSCMaths AdvancedYear 12: Statistical Analysis15 min read

Quick answer

A continuous random variable is described by a pdf ff with ∫f=1\int f = 1; probabilities are areas found by integrating ff over intervals, the cdf is F(x)=∫−∞xfF(x) = \int_{-\infty}^{x} f, and the mean, variance, median and mode are computed by integrals or by solving F(m)=12F(m) = \frac{1}{2}.

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Exam-style questions
  4. Practice questions

What this dot point is asking

NESA wants you to work with continuous random variables defined by a probability density function (pdf). You must find unknown constants by enforcing total probability =1= 1, compute probabilities as definite integrals, build the cumulative distribution function, and find the mean, variance, median and mode using integrals. The thread running through all of it is one picture: the pdf is a curve, and the probability of any interval is the area under that curve, so every task here is an area or an integral.

Note

Think about how long the next bus takes to arrive. It could be any time at all, not just a whole number of minutes, so instead of listing chances for each exact time we describe the waiting time with a smooth curve. The height of that curve tells you where waits are bunched up, but the actual chance of waiting is the area beneath the curve over a stretch of time, like measuring the paint on a wall between two marks. Asking for the chance of waiting exactly 77 minutes to the nanosecond gives zero, because a single instant is a line with no width and no area. Everything on this page is really just measuring areas under that curve: to split the wait in half you find where half the area sits, and to find the typical wait you balance the curve like a see-saw.

The answer

A probability density functionThe density f of x equals x over 8 on the interval 0 to 4, a straight line rising from the origin; the whole triangular area beneath it equals 1.xf(x)01234area = 1f(x) = x/8Step 1A valid density encloses total area 1.Here ½ × 4 × 0.5 = 1, so f(x) = x/8 is valid.

Probability density functions

A continuous random variable XX is described by a probability density function ff satisfying

  • f(x)≥0f(x) \ge 0 for all xx (a density cannot be negative),
  • ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x) \, dx = 1 (the total area under the curve is 11).

In Maths Advanced, ff is non-zero only on a finite interval [a,b][a, b] called the support, and the total integral is taken over that interval. The value f(x)f(x) is a density, not a probability: it can exceed 11, and on its own it tells you nothing until you integrate it over an interval. This is the key shift from the discrete case, where each value carried its own probability pip_i.

The most important consequence is that for a continuous random variable, P(X=c)=0P(X = c) = 0 for any single value cc. A single point has no width, so it has no area, so it has no probability. Probabilities live on intervals only.

Probabilities as integrals

For any interval [c,d][c, d] inside the support, the probability is the area under the density over that interval:

P(c≤X≤d)=∫cdf(x) dx.P(c \le X \le d) = \int_c^d f(x) \, dx.

Because single points have zero probability, P(c≤X≤d)=P(c<X<d)P(c \le X \le d) = P(c < X < d). The strict and non-strict inequalities give the same value, so you never have to worry about whether the endpoints are included.

Probability is the area over an intervalThe same density with the region between x equals 1 and x equals 3 shaded; that area equals the probability that X lies between 1 and 3, which is one half.xf(x)01234P(1 ≤ X ≤ 3)= ½Step 2P(1 ≤ X ≤ 3) is the shaded area = ∫₁³ x/8 dx = ½.Single points have zero width, so they add no probability.

Cumulative distribution function

The cumulative distribution function (cdf) accumulates probability from the left:

F(x)=P(X≤x)=∫−∞xf(t) dt.F(x) = P(X \le x) = \int_{-\infty}^{x} f(t) \, dt.

Useful properties:

  • FF is non-decreasing, with F(−∞)=0F(-\infty) = 0 and F(∞)=1F(\infty) = 1 (and F=0F = 0 below the support, F=1F = 1 above it).
  • P(c≤X≤d)=F(d)−F(c)P(c \le X \le d) = F(d) - F(c), so once you have FF every interval probability is a subtraction.
  • Where ff is continuous, F′(x)=f(x)F'(x) = f(x): the pdf is the derivative of the cdf, the cdf is the integral of the pdf. They are two views of the same distribution.

Mean, variance, median, mode

The mean (expected value) weights each value xx by its density and integrates:

E(X)=μ=∫−∞∞xf(x) dx.E(X) = \mu = \int_{-\infty}^{\infty} x f(x) \, dx.

The variance integrates the squared deviation from the mean, and is almost always computed via the shortcut on the right:

Var(X)=σ2=∫−∞∞(x−μ)2f(x) dx=E(X2)−μ2,\text{Var}(X) = \sigma^2 = \int_{-\infty}^{\infty} (x - \mu)^2 f(x) \, dx = E(X^2) - \mu^2,

where E(X2)=∫x2f(x) dxE(X^2) = \int x^2 f(x) \, dx. The standard deviation is σ=Var(X)\sigma = \sqrt{\text{Var}(X)}.

The median mm splits the area in half:

∫−∞mf(x) dx=12,equivalentlyF(m)=12.\int_{-\infty}^{m} f(x) \, dx = \frac{1}{2}, \quad \text{equivalently} \quad F(m) = \frac{1}{2}.

The mode is the value of xx where ff is largest. If ff is differentiable on the interior of the support, look for a critical point of ff; if ff is monotone on the support, the mode is at the endpoint where ff is highest.

Why every technique here is an integral

Continuous random variables are where the calculus and statistics strands of Maths Advanced meet. A probability is an integral, the cdf is an integral with a variable upper limit, the mean weights xx by the density and integrates, and the variance integrates the squared deviation. So the practical skill being tested is your integration: setting up the right definite integral over the support, finding the antiderivative, and evaluating cleanly. The statistics is the interpretation wrapped around the calculus, which is also why this dot point pairs so naturally with the integration techniques from the calculus strand.

The standard problem types

NESA questions on this dot point fall into a small number of recognisable shapes, and naming the type tells you the first move:

  • "Find the value of the constant kk": enforce ∫f=1\int f = 1 over the support.
  • "Find P(a≤X≤b)P(a \le X \le b)": integrate ff from aa to bb (or use F(b)−F(a)F(b) - F(a)).
  • "Find the mean / expected value": integrate xf(x)x f(x).
  • "Find the variance / standard deviation": compute E(X2)E(X^2), then use Var(X)=E(X2)−μ2\text{Var}(X) = E(X^2) - \mu^2.
  • "Find the median": solve F(m)=12F(m) = \frac{1}{2}.
  • "Find the mode": maximise ff on the support.

Sketching the density

A quick sketch of ff over its support guides the work. The total area under the curve must be 11, the median splits that area in half, and the mode sits under the highest point of the curve. For a symmetric density the mean, median and mode coincide at the centre of symmetry, which can save an integral if you spot the symmetry early.

Key fact

A continuous random variable is described by a pdf ff with f≥0f \ge 0 and ∫f=1\int f = 1. A probability is the area under ff, found by integrating over the interval, so P(X=c)=0P(X = c) = 0 for any single point. The cdf is F(x)=∫−∞xfF(x) = \int_{-\infty}^{x} f, with F′=fF' = f; the mean is ∫xf\int x f, the variance is E(X2)−μ2E(X^2) - \mu^2, and the median solves F(m)=12F(m) = \tfrac12.

Worked example

This example runs through the full continuous-variable toolkit: first pinning down an unknown constant, then computing the mean and variance, building the cdf, and finally finding the median and mode of a density. Steps 3 and 4 use the density f(x)=x/8f(x) = x/8 on [0,4][0,4] pictured above.

Finding a constant and a probability

f(x)=c(1−x2)f(x) = c(1 - x^2) for −1≤x≤1-1 \le x \le 1, 00 elsewhere. Find cc, then P(X>0)P(X > 0).

A valid density must enclose a total area of 11, so we integrate ff over its support and set the result equal to 11 to solve for cc:

∫−11c(1−x2) dx=c[x−x33]−11=c(23−(−23))=4c3=1  ⇒  c=34.\int_{-1}^{1} c(1 - x^2) \, dx = c \left[ x - \frac{x^3}{3} \right]_{-1}^{1} = c \left( \frac{2}{3} - \left(-\frac{2}{3}\right) \right) = \frac{4 c}{3} = 1 \;\Rightarrow\; c = \frac{3}{4}.

The density 1−x21 - x^2 is symmetric about x=0x = 0, so exactly half the area lies on each side and P(X>0)=12P(X > 0) = \frac{1}{2} without further integration.

Computing the mean and variance

For f(x)=x8f(x) = \frac{x}{8} on [0,4][0, 4], the mean weights each value xx by its density and integrates, while the variance is found most easily via Var(X)=E(X2)−μ2\text{Var}(X) = E(X^2) - \mu^2. We therefore need both E(X)E(X) and E(X2)E(X^2):

E(X)=∫04x⋅x8 dx=18⋅643=83,E(X) = \int_0^4 x \cdot \frac{x}{8} \, dx = \frac{1}{8} \cdot \frac{64}{3} = \frac{8}{3},

E(X2)=∫04x2⋅x8 dx=18⋅2564=8.E(X^2) = \int_0^4 x^2 \cdot \frac{x}{8} \, dx = \frac{1}{8} \cdot \frac{256}{4} = 8.

Subtracting the square of the mean from E(X2)E(X^2) gives the variance, and its square root the standard deviation:

Var(X)=8−(83)2=8−649=89  ⇒  σ=223.\text{Var}(X) = 8 - \left(\frac{8}{3}\right)^2 = 8 - \frac{64}{9} = \frac{8}{9} \;\Rightarrow\; \sigma = \frac{2\sqrt{2}}{3}.

Cdf from a pdf

For f(x)=x8f(x) = \frac{x}{8} on [0,4][0, 4], the cdf accumulates probability from the left endpoint up to xx, so we integrate the density with a variable upper limit:

F(x)=∫0xt8 dt=x216,0≤x≤4.F(x) = \int_0^x \frac{t}{8} \, dt = \frac{x^2}{16}, \quad 0 \le x \le 4.

Having a formula for FF turns any "less than" probability into a single substitution, for example P(X≤2)=F(2)=416=14P(X \le 2) = F(2) = \frac{4}{16} = \frac{1}{4}. The diagram below plots this cdf rising from 00 to 11.

The cumulative distribution functionThe cdf F of x equals x squared over 16, rising from 0 at x equals 0 to 1 at x equals 4. Dashed lines show that F equals one half at the median, x equals 2 root 2, about 2.83.xF(x)012340.512√2F(x)=x²/16Step 3F(x) accumulates area from the left: F(x)=∫₀ˣ t/8 dt = x²/16.The median solves F(m)=½, giving m = 2√2 ≈ 2.83.

Median and mode

For f(x)=x8f(x) = \frac{x}{8} on [0,4][0, 4], the median is the value that leaves half the area on each side, so we set the cdf equal to 12\frac{1}{2} and solve (the dashed lines in the diagram above show exactly this):

m216=12  ⇒  m2=8  ⇒  m=22≈2.83.\frac{m^2}{16} = \frac{1}{2} \;\Rightarrow\; m^2 = 8 \;\Rightarrow\; m = 2 \sqrt{2} \approx 2.83.

The mode is where the density is largest. Since f(x)=x8f(x) = \frac{x}{8} increases steadily across [0,4][0, 4], its highest value is at the right endpoint, so the mode is x=4x = 4. Note the mean (83≈2.67\frac{8}{3} \approx 2.67), median (2.832.83) and mode (44) are all different here, because the density is not symmetric.

How exam questions ask about continuous random variables

  • "Show that k=…k = \dots" or "find the value of kk." Set ∫supportf=1\int_{\text{support}} f = 1 and solve.
  • "Find P(X>a)P(X > a) / P(a≤X≤b)P(a \le X \le b)." Integrate ff over the interval, or use FF. For a "greater than" question, integrate up to the top of the support (or use 1−F(a)1 - F(a)).
  • "Find the expected value / mean." Integrate xf(x)x f(x) over the support.
  • "Find the variance / standard deviation." Find E(X2)=∫x2fE(X^2) = \int x^2 f, then Var(X)=E(X2)−μ2\text{Var}(X) = E(X^2) - \mu^2, then square-root for σ\sigma.
  • "Find the cumulative distribution function." Integrate ff with a variable upper limit; remember to state F=0F = 0 below the support and F=1F = 1 above it.
  • "Find the median / mode." Solve F(m)=12F(m) = \frac12 for the median; maximise ff for the mode.

Edge cases worth knowing

  • A piecewise density. If ff is defined in pieces, integrate each piece over its own sub-interval and add. The cdf is then also piecewise, continuous at the joins.
  • The mode at an endpoint. When ff is monotone on the support there is no interior critical point, so the mode is the endpoint where ff is largest. Do not chase a derivative that never vanishes.
  • A density that exceeds 11. This is fine: ff is a density, not a probability. On a narrow support the height can be well above 11 while the area stays 11.
  • Spotting symmetry. If ff is symmetric about a centre cc, then E(X)=E(X) = median =c= c immediately, and P(X>c)=12P(X > c) = \frac12, saving you an integral.
Exam technique

Name the problem type first; it dictates the move. Always integrate over the support only, since f=0f = 0 outside it contributes nothing. State the median condition as F(m)=12F(m) = \frac12 (or ∫lowermf=12\int_{\text{lower}}^{m} f = \frac12) explicitly before solving. For the variance, build E(X2)E(X^2) and use E(X2)−μ2E(X^2) - \mu^2, never E(X2)−E(X)E(X^2) - E(X). When defining a cdf, give the full piecewise definition including 00 below and 11 above the support. A quick sketch of ff catches sign errors and reveals symmetry.

Common traps
Treating P(X=c)>0P(X = c) > 0
For a continuous random variable, single points have zero probability. The pdf value f(c)f(c) is a density, not a probability.
Forgetting to enforce total probability
When a pdf has an unknown constant, the first step is always ∫f=1\int f = 1.
Confusing pdf and cdf
ff is the density (can exceed 11), FF is the cumulative probability (always between 00 and 11). f=F′f = F' where FF is differentiable.
Integrating xf(x)x f(x) over the wrong range
When computing E(X)E(X), integrate only over the support. Outside the support, f=0f = 0 contributes nothing.
Picking an interior critical point that is actually a minimum
The mode is the maximum of ff. If ff is monotone, the mode is at an endpoint of the support.

Exam-style questions

Questions in the style of NESA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

HSC-style5 marks
A continuous random variable XX has probability density function f(x)=kxf(x) = k x for 0≤x≤40 \le x \le 4 and 00 elsewhere. Find kk, P(1≤X≤3)P(1 \le X \le 3), and the mean E(X)E(X).
Show worked answer →

Total probability: ∫04kx dx=k⋅x22∣04=8k=1\int_0^4 k x \, dx = k \cdot \frac{x^2}{2} \Big|_0^4 = 8 k = 1, so k=18k = \frac{1}{8}.

P(1≤X≤3)=∫13x8 dx=18⋅x22∣13=116(9−1)=816=12P(1 \le X \le 3) = \int_1^3 \frac{x}{8} \, dx = \frac{1}{8} \cdot \frac{x^2}{2} \Big|_1^3 = \frac{1}{16} (9 - 1) = \frac{8}{16} = \frac{1}{2}.

Mean: E(X)=∫04x⋅x8 dx=18∫04x2 dx=18⋅x33∣04=6424=83E(X) = \int_0^4 x \cdot \frac{x}{8} \, dx = \frac{1}{8} \int_0^4 x^2 \, dx = \frac{1}{8} \cdot \frac{x^3}{3} \Big|_0^4 = \frac{64}{24} = \frac{8}{3}.

Markers reward solving for kk using the total probability, computing the probability as a definite integral, and using E(X)=∫xf(x) dxE(X) = \int x f(x) \, dx over the support.

HSC-style4 marks
A continuous random variable has probability density function f(x)=38x2f(x) = \frac{3}{8} x^2 for 0≤x≤20 \le x \le 2. Find the median of XX.
Show worked answer →

The median mm satisfies ∫0mf(x) dx=12\int_0^m f(x) \, dx = \frac{1}{2}.

∫0m38x2 dx=38⋅m33=m38\int_0^m \frac{3}{8} x^2 \, dx = \frac{3}{8} \cdot \frac{m^3}{3} = \frac{m^3}{8}.

Set m38=12\frac{m^3}{8} = \frac{1}{2}, so m3=4m^3 = 4 and m=43≈1.587m = \sqrt[3]{4} \approx 1.587.

Markers expect the median condition stated as a definite integral equal to 12\frac{1}{2}, the antiderivative, and the cube root taken cleanly.

Practice questions

Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.

foundation2 marks
A continuous random variable XX has probability density function f(x)=29xf(x) = \frac{2}{9} x for 0≤x≤30 \le x \le 3 and 00 elsewhere. Find P(X≤1)P(X \le 1).
Show worked solution →

The probability is the area under ff from 00 to 11, so integrate the density over that interval:

P(X≤1)=∫0129x dx=29⋅x22∣01=19(1−0)=19.P(X \le 1) = \int_0^1 \frac{2}{9} x \, dx = \frac{2}{9} \cdot \frac{x^2}{2} \Big|_0^1 = \frac{1}{9} (1 - 0) = \frac{1}{9}.

So P(X≤1)=19P(X \le 1) = \dfrac{1}{9}.

Marker's note: one mark for setting up the definite integral of ff over [0,1][0, 1], one for the correct value 19\frac{1}{9}. Integrating over the whole support [0,3][0, 3] instead of [0,1][0, 1] is the slip to avoid.

foundation2 marks
A continuous random variable is uniformly distributed with constant density f(x)=kf(x) = k for 2≤x≤72 \le x \le 7 and 00 elsewhere. Find kk, then find P(X>5)P(X > 5).
Show worked solution →

Enforce total probability =1= 1 to pin down kk. The support has width 7−2=57 - 2 = 5, so

∫27k dx=k(7−2)=5k=1  ⇒  k=15.\int_2^7 k \, dx = k (7 - 2) = 5k = 1 \;\Rightarrow\; k = \frac{1}{5}.

Integrate over [5,7][5, 7] for the tail probability.

P(X>5)=∫5715 dx=15(7−5)=25.P(X > 5) = \int_5^7 \frac{1}{5} \, dx = \frac{1}{5} (7 - 5) = \frac{2}{5}.

So k=15k = \dfrac{1}{5} and P(X>5)=25P(X > 5) = \dfrac{2}{5}.

Marker's note: one mark for k=15k = \frac{1}{5} from ∫f=1\int f = 1, one for P(X>5)=25P(X > 5) = \frac{2}{5}. For a uniform density every probability is just density times interval width, so no antiderivative is strictly needed.

foundation3 marks
The density f(x)=29xf(x) = \frac{2}{9} x on 0≤x≤30 \le x \le 3 has cumulative distribution function F(x)=x29F(x) = \frac{x^2}{9} on that interval. Find the median of XX, giving an exact value and a decimal to two decimal places.
Show worked solution →

The median mm splits the area in half, so set F(m)=12F(m) = \frac{1}{2}:

m29=12  ⇒  m2=92.\frac{m^2}{9} = \frac{1}{2} \;\Rightarrow\; m^2 = \frac{9}{2}.

Take the positive root (the median lies in the support [0,3][0, 3]):

m=32=322≈2.12.m = \frac{3}{\sqrt{2}} = \frac{3 \sqrt{2}}{2} \approx 2.12.

Marker's note: one mark for stating F(m)=12F(m) = \frac{1}{2}, one for m2=92m^2 = \frac{9}{2}, one for the exact value 322\frac{3\sqrt{2}}{2} (and rounding to 2.122.12). Rejecting the negative root is expected since mm must lie in the support.

core4 marks
A continuous random variable is uniformly distributed with density f(x)=15f(x) = \frac{1}{5} for 2≤x≤72 \le x \le 7. Find the mean E(X)E(X) and the variance Var(X)\text{Var}(X).
Show worked solution →

Mean: integrate xf(x)x f(x) over the support.

E(X)=∫27x⋅15 dx=15⋅x22∣27=110(49−4)=4510=92.E(X) = \int_2^7 x \cdot \frac{1}{5} \, dx = \frac{1}{5} \cdot \frac{x^2}{2} \Big|_2^7 = \frac{1}{10} (49 - 4) = \frac{45}{10} = \frac{9}{2}.

Variance: build E(X2)E(X^2), then use Var(X)=E(X2)−μ2\text{Var}(X) = E(X^2) - \mu^2.

E(X2)=∫27x2⋅15 dx=15⋅x33∣27=115(343−8)=33515=673.E(X^2) = \int_2^7 x^2 \cdot \frac{1}{5} \, dx = \frac{1}{5} \cdot \frac{x^3}{3} \Big|_2^7 = \frac{1}{15} (343 - 8) = \frac{335}{15} = \frac{67}{3}.

Var(X)=673−(92)2=673−814=268−24312=2512.\text{Var}(X) = \frac{67}{3} - \left(\frac{9}{2}\right)^2 = \frac{67}{3} - \frac{81}{4} = \frac{268 - 243}{12} = \frac{25}{12}.

So E(X)=92E(X) = \dfrac{9}{2} and Var(X)=2512≈2.08\text{Var}(X) = \dfrac{25}{12} \approx 2.08.

Marker's note: one mark for E(X)=92E(X) = \frac{9}{2}, one for setting up E(X2)E(X^2), one for E(X2)=673E(X^2) = \frac{67}{3}, one for Var(X)=2512\text{Var}(X) = \frac{25}{12}. The check is the uniform-variance formula (b−a)212=2512\frac{(b-a)^2}{12} = \frac{25}{12}; using E(X2)−E(X)E(X^2) - E(X) instead of E(X2)−μ2E(X^2) - \mu^2 is the classic trap.

core4 marks
A study guide plots the probability density function of a continuous random variable XX as a single straight-line segment falling from the point (0,1)(0, 1) on the vertical axis down to the point (2,0)(2, 0) on the horizontal axis, with f(x)=0f(x) = 0 everywhere outside 0≤x≤20 \le x \le 2. (a) Confirm the graph shows a valid density. (b) Find P(X<1)P(X < 1). (c) State the mode of XX.
Show worked solution →

Part (a): the region under the line is a triangle, and a valid density encloses total area 11. The triangle has base 22 (from x=0x = 0 to x=2x = 2) and height 11 (the value f(0)=1f(0) = 1), so

area=12×2×1=1,\text{area} = \frac{1}{2} \times 2 \times 1 = 1,

which confirms the graph is a valid density. Its equation is the line through (0,1)(0, 1) and (2,0)(2, 0), namely

f(x)=1−x2,0≤x≤2.f(x) = 1 - \frac{x}{2}, \quad 0 \le x \le 2.

Part (b): P(X<1)P(X < 1) is the area under the line from 00 to 11.

P(X<1)=∫01(1−x2)dx=[x−x24]01=1−14=34.P(X < 1) = \int_0^1 \left(1 - \frac{x}{2}\right) dx = \left[ x - \frac{x^2}{4} \right]_0^1 = 1 - \frac{1}{4} = \frac{3}{4}.

Part (c): the mode is where ff is largest. The line falls steadily across [0,2][0, 2], so its highest value is at the left endpoint, giving mode =0= 0.

Marker's note: one mark for confirming area 11 (or reading f(x)=1−x2f(x) = 1 - \frac{x}{2} off the graph), two for the integral setting up and evaluating P(X<1)=34P(X < 1) = \frac{3}{4}, one for mode =0= 0. Reading the line's equation off the two labelled points is the skill being tested; a symmetric guess for the mode misses that this density is not symmetric.

exam5 marks
A continuous random variable XX has probability density function f(x)=ksin⁡xf(x) = k \sin x for 0≤x≤π0 \le x \le \pi and 00 elsewhere, where kk is a constant. (a) Show that k=12k = \frac{1}{2}. (b) Hence find P(X≤π3)P\left(X \le \frac{\pi}{3}\right) as an exact value. (c) Find the median of XX, justifying your answer.
Show worked solution →

Part (a): enforce total probability =1= 1 over the support [0,π][0, \pi].

∫0πksin⁡x dx=k[−cos⁡x]0π=k(−cos⁡π+cos⁡0)=k(1+1)=2k.\int_0^\pi k \sin x \, dx = k \left[ -\cos x \right]_0^\pi = k \left( -\cos \pi + \cos 0 \right) = k (1 + 1) = 2k.

Setting 2k=12k = 1 gives k=12k = \dfrac{1}{2}, as required.

Part (b): integrate the density from 00 to π3\frac{\pi}{3}.

P(X≤π3)=∫0π/312sin⁡x dx=12[−cos⁡x]0π/3=12(−cos⁡π3+cos⁡0).P\left(X \le \frac{\pi}{3}\right) = \int_0^{\pi/3} \frac{1}{2} \sin x \, dx = \frac{1}{2} \left[ -\cos x \right]_0^{\pi/3} = \frac{1}{2} \left( -\cos \frac{\pi}{3} + \cos 0 \right).

Since cos⁡π3=12\cos \frac{\pi}{3} = \frac{1}{2},

P(X≤π3)=12(1−12)=12⋅12=14.P\left(X \le \frac{\pi}{3}\right) = \frac{1}{2} \left( 1 - \frac{1}{2} \right) = \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}.

Part (c): the median mm solves F(m)=12F(m) = \frac{1}{2}. The cdf is

F(m)=∫0m12sin⁡x dx=12(1−cos⁡m).F(m) = \int_0^m \frac{1}{2} \sin x \, dx = \frac{1}{2} (1 - \cos m).

Setting this equal to 12\frac{1}{2}:

12(1−cos⁡m)=12  ⇒  1−cos⁡m=1  ⇒  cos⁡m=0  ⇒  m=π2.\frac{1}{2} (1 - \cos m) = \frac{1}{2} \;\Rightarrow\; 1 - \cos m = 1 \;\Rightarrow\; \cos m = 0 \;\Rightarrow\; m = \frac{\pi}{2}.

This matches the symmetry of sin⁡x\sin x about x=π2x = \frac{\pi}{2} on [0,π][0, \pi], which splits the area evenly.

Marker's note: one mark for the integral in (a), one for k=12k = \frac{1}{2}; one for the setup and one for 14\frac{1}{4} in (b); one for solving F(m)=12F(m) = \frac{1}{2} to reach m=π2m = \frac{\pi}{2} in (c). Work in radians throughout, since ddx(−cos⁡x)=sin⁡x\frac{d}{dx}(-\cos x) = \sin x holds only in radian measure.

exam5 marks
A continuous random variable XX models a machine setting with probability density function f(x)=k x(4−x)f(x) = k\,x(4 - x) for 0≤x≤40 \le x \le 4 and 00 elsewhere. (a) Show that k=332k = \frac{3}{32}. (b) Explain, using the symmetry of ff, why the mean of XX is 22. (c) Find the variance of XX.
Show worked solution →

Part (a): total probability =1= 1 over [0,4][0, 4]. Expand and integrate:

∫04k x(4−x) dx=k∫04(4x−x2)dx=k[2x2−x33]04.\int_0^4 k\,x(4 - x) \, dx = k \int_0^4 \left( 4x - x^2 \right) dx = k \left[ 2x^2 - \frac{x^3}{3} \right]_0^4.

Evaluate at x=4x = 4:

k(2(16)−643)=k(32−643)=k⋅96−643=32k3.k \left( 2(16) - \frac{64}{3} \right) = k \left( 32 - \frac{64}{3} \right) = k \cdot \frac{96 - 64}{3} = \frac{32k}{3}.

Setting 32k3=1\dfrac{32k}{3} = 1 gives k=332k = \dfrac{3}{32}, as required.

Part (b): ff is symmetric about x=2x = 2. Replacing xx by 4−x4 - x leaves x(4−x)x(4 - x) unchanged, so the curve is a mirror image about the midpoint x=2x = 2 of the support. For a symmetric density the mean sits at the centre of symmetry, so E(X)=2E(X) = 2.

Part (c): use Var(X)=E(X2)−μ2\text{Var}(X) = E(X^2) - \mu^2 with μ=2\mu = 2. First find E(X2)E(X^2):

E(X2)=∫04x2⋅332x(4−x) dx=332∫04(4x3−x4)dx=332[x4−x55]04.E(X^2) = \int_0^4 x^2 \cdot \frac{3}{32} x(4 - x) \, dx = \frac{3}{32} \int_0^4 \left( 4x^3 - x^4 \right) dx = \frac{3}{32} \left[ x^4 - \frac{x^5}{5} \right]_0^4.

Evaluate at x=4x = 4 (using 44=2564^4 = 256 and 45=10244^5 = 1024):

E(X2)=332(256−10245)=332⋅1280−10245=332⋅2565=245.E(X^2) = \frac{3}{32} \left( 256 - \frac{1024}{5} \right) = \frac{3}{32} \cdot \frac{1280 - 1024}{5} = \frac{3}{32} \cdot \frac{256}{5} = \frac{24}{5}.

Then

Var(X)=245−22=245−4=24−205=45.\text{Var}(X) = \frac{24}{5} - 2^2 = \frac{24}{5} - 4 = \frac{24 - 20}{5} = \frac{4}{5}.

So Var(X)=45\text{Var}(X) = \dfrac{4}{5}.

Marker's note: one mark for the integral in (a), one for k=332k = \frac{3}{32}; one for the symmetry argument giving μ=2\mu = 2 in (b); one for E(X2)=245E(X^2) = \frac{24}{5} and one for Var(X)=45\text{Var}(X) = \frac{4}{5} in (c). Spotting the symmetry saves a full mean integral; using E(X2)−μ2E(X^2) - \mu^2 (not E(X2)−E(X)E(X^2) - E(X)) is essential.

Practise this

Sources & how we know this

ExamExplained