Example 1.3.12. Small Example - Quartiles.
Consider the data set
\begin{equation*}
\{2, 5, 8, 10 \}.
\end{equation*}
The 50th percentile should be a numerical value for which approximately 50% of the data is smaller. In this case, that would be some number between 5 and 8. For now, let’s just take 6.5 so that two numbers in the set lie below 6.5 and two lie above. This is a perfect 50% for the 50th percentile. In a similar manner, the 25th percentile would be some number between 2 and 5, say 2.75, so that one number lies below 2.75 and three numbers lie above.
Using the percentile definition 1.3.5, the 25th percentile is computed by considering
\begin{equation*}
(n+1)s = (4+1)0.25 = 5/4 = 1.25\text{.}
\end{equation*}
So, m = 1 and r = 0.25. Therefore
\begin{equation*}
P^{0.25} = 0.75 \times 2 + 0.25 \times 5 = 2.75
\end{equation*}
as noted above.
Similarly, the 75th percentile is given by
\begin{equation*}
(n+1)s = (4+1)0.75 = 15/4 = 3.75\text{.}
\end{equation*}
So, m = 3 and r = 0.75. Therefore
\begin{equation*}
P^{0.75} = 0.25 \times 8 + 0.75 \times 10 = 9.5
\end{equation*}
It is interesting to note that 3 also lies between 2 and 5 as does 2.75 and has the same percentages above (75 percent) and below (25 percent). However, it should designate a slightly larger percentile location. Indeed, going backward:
\begin{gather*}
3 = (1-r) \times 2 + r \times 5\\
\Rightarrow r = \frac{1}{3}\\
\Rightarrow (n+1)s = 1 + \frac{1}{3} = \frac{4}{3}\\
\Rightarrow s = \frac{4}{15} \approx 0.267
\end{gather*}
and so 3 would actually be at approximately the 26.7th percentile.
It should be noted that one might also use the alternate percentile definition 1.3.6, in which case the 25th percentile is computed by considering
\begin{equation*}
(n-1)s+1 = (4-1)0.25+1 = 7/4 = 1.75\text{.}
\end{equation*}
So, m = 1 and r = 0.75. Therefore
\begin{equation*}
P^{0.25} = 0.25 \times 2 + 0.75 \times 5 = 4.25
\end{equation*}
which is still between 2 and 5 but now closer to 5. So, it is pretty obvious that you would want to settle ahead of time which method for computing percentiles is preferred and stick with it. (Note, when working online exercises you might need to work some of them both ways since you have no idea perhaps what the author might have chosen.