SD3 - Medians and quartiles

SD3 - Medians and quartiles

A median splits probability into equal halves, while quartiles mark cumulative probabilities of one quarter and three quarters. SD3 finds these positions from a density or CDF. You will solve area equations, see how an asymmetric shape moves the median, and find numerical quantiles when an exact calculation is inconvenient.

Solving cumulative-area equations

For a density rising across [0,2][0,2], is the median halfway along the interval, at 1? Halfway along a horizontal axis need not mean halfway through the probability.

First use the simpler density f(x)=2xf(x)=2x on [0,1][0,1], zero otherwise. Its CDF is F(x)=x2F(x)=x^2 on that support. At x=0.5x=0.5 it has collected only 0.250.25 of the probability. We must move further right to collect half.

Median, quartiles and quantiles

For a continuous variable with CDF FF, a median mm satisfies F(m)=1/2F(m)=1/2. The lower quartile Q1Q_1 and upper quartile Q3Q_3 satisfy

F(Q1)=14,F(Q3)=34.F(Q_1)=\frac14,\qquad F(Q_3)=\frac34.

More generally, a pp-quantile has cumulative probability pp, where 0<p<10<p<1. On a strictly increasing part of the CDF, the solution of F(q)=pF(q)=p is unique.

If you are given a pdf, integrate it from the left of the support to the unknown boundary. If the CDF is supplied, use it directly. These quantile equations are required knowledge and are not printed in the AQA formula booklet.

Worked example 1: finding a median

Question. Find the median of XX, whose pdf is f(x)=2xf(x)=2x for 0≤x≤10\leq x\leq1, zero otherwise.

Plan. Set the accumulated area to 1/21/2, then retain the solution inside the support.

∫0m2x dx=12⟹m2=12⟹m=12.\int_0^m2x\,\mathrm{d}x=\frac12 \quad\Longrightarrow\quad m^2=\frac12 \quad\Longrightarrow\quad m=\frac1{\sqrt2}.

The other algebraic root, −1/2-1/\sqrt2, is outside [0,1][0,1]. The formula F(x)=x2F(x)=x^2 applies only on that interval.

Answer. m=1/2m=1/\sqrt2, approximately 0.7070.707.

Check. The probability to the right is ∫m12x dx=1−m2=1/2\int_m^1 2x\,\mathrm{d}x=1-m^2=1/2, so both halves have the required area.

Keep the density fixed and change only the target cumulative probabilities from 1/21/2 to 1/41/4 and 3/43/4.

Worked example 2: finding both quartiles

Question. For the same pdf f(x)=2xf(x)=2x on [0,1][0,1], zero otherwise, find Q1Q_1 and Q3Q_3.

Plan. Solve the same area equation twice, with the two quartile probabilities.

Q12=14⟹Q1=12,Q32=34⟹Q3=32.Q_1^2=\frac14\quad\Longrightarrow\quad Q_1=\frac12, \qquad Q_3^2=\frac34\quad\Longrightarrow\quad Q_3=\frac{\sqrt3}{2}.

Both positions lie in [0,1][0,1]; the negative roots do not.

Answer. Q1=1/2Q_1=1/2 and Q3=3/2Q_3=\sqrt3/2.

Check. The middle probability is Q32−Q12=3/4−1/4=1/2Q_3^2-Q_1^2=3/4-1/4=1/2, while the upper tail is 1−Q32=1/41-Q_3^2=1/4.

Quartile positions need not be equally spaced. Here the upper quarter is squeezed into a short interval where the density is high. A value exceeded by 10% instead has lower-tail probability 0.90.9: translate the wording before solving.

Watch out

Wrong: find the median by solving f(m)=1/2f(m)=1/2. A median splits area, so solve F(m)=1/2F(m)=1/2, or an equivalent density integral. Reject roots outside the branch used.

Use the same idea with a new power.

Asymmetry and the position of a median

A rising density packs more probability near the right-hand end. A median must then lie to the right of the interval's midpoint. A reflected density reverses that displacement.

[DIAGRAM: asset_name: Equal probability halves in asymmetric densities; asset_slug: aqa7367-quantile-halves; caption: The median is square root of two for the rising triangle and two minus square root of two for its reflection; description: Two coordinate graphs on zero to two show the densities x over two and (two minus x) over two. Each has pale blue area one half to the left of its median and pale sage area one half to the right. Median lines are labelled square root of two and two minus square root of two. A dashed midpoint line at x equals one is distinct from each median.]
The median is square root of two for the rising triangle and two minus square root of two for its reflection

We can now answer the opening question with an exact calculation.

Worked example 3: a median above the midpoint

Question. A variable has pdf f(x)=x/2f(x)=x/2 on 0≤x≤20\leq x\leq2, zero otherwise. Find its median.

Plan. Set the integral from 0 to mm equal to 1/21/2.

∫0mx2 dx=m24=12,m2=2.\int_0^m\frac{x}{2}\,\mathrm{d}x=\frac{m^2}{4}=\frac12, \qquad m^2=2.

Answer. m=2m=\sqrt2, the root in [0,2][0,2]. It is greater than the midpoint 1.

Check. The right-hand area is ∫22x/2 dx=(4−2)/4=1/2\int_{\sqrt2}^2 x/2\,\mathrm{d}x=(4-2)/4=1/2. Also F(1)=1/4F(1)=1/4, confirming that 1 cannot be the median.

Reflect the density but retain the same support. Only the direction of concentration changes.

Worked example 4: a median below the midpoint

Question. A variable has pdf f(x)=(2−x)/2f(x)=(2-x)/2 on 0≤x≤20\leq x\leq2, zero otherwise. Find its median.

Plan. Integrate the falling density and solve within [0,2][0,2].

∫0m2−x2 dx=m−m24=12.\int_0^m\frac{2-x}{2}\,\mathrm{d}x =m-\frac{m^2}{4}=\frac12.

Rearranging gives

m2−4m+2=0,m=2±2.m^2-4m+2=0,\qquad m=2\pm\sqrt2.

Only 2−22-\sqrt2 lies in the support; 2+2>22+\sqrt2>2 must be rejected.

Answer. m=2−2m=2-\sqrt2, approximately 0.5860.586.

Check. Reflection x↦2−xx\mapsto2-x takes the first density and its median 2\sqrt2 to this density and median 2−22-\sqrt2. The distances from the midpoint are equal and opposite.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account