Given a probability density function find the mean, median and mode of the distribution.
Problem
A variable $X$ is distributed in the interval $\{x:0 \leq x \leq
3\}$ according to the probability density function $$\rho(x) =
{2\over 27}\big(6+x-x^2\big)$$ Find the mean, the median and the mode of the distribution.
Getting Started
The area under the graph of the probability density function
between $x=a$ and $x=b$ gives the probability that the outcome is
between $a$ and $b$ so the total area under the graph must be $1$,
in this example for $x$ between $0$ and $3$.
To find the median we have to find the value $t$ such that the area under the graph for $0\leq x \leq t$ is $0.5$. You will have to find the roots of a cubic equation (which you should be able to factorise) in this example and then identify the root which lies in the required interval.
To find the median we have to find the value $t$ such that the area under the graph for $0\leq x \leq t$ is $0.5$. You will have to find the roots of a cubic equation (which you should be able to factorise) in this example and then identify the root which lies in the required interval.
Student Solutions
Here is another excellent solution from Andrei at Tudor Vianu National College, Romania:
We have the probability distribution: $$\rho(x) = {2\over
27}\big(6+x-x^2\big)$$ for $\{0 \leq x \leq 3\}.$
The mean of this
distribution is $m$, where $$m=\int_0^3x\,\rho(x)\,dx$$ Thus $$m =
{2\over 27}\int_0^3x\big(6+x-x^2\big)\, dx ={2\over
27}\int_0^3(6x+x^2-x^3)\,dx$$ hence $$m={2\over 27}\Big[3x^2 +
x^3/3 - x^4/4\Big]_0^3 ={2\over 27}[27 +9 -81/4] = {7\over
6}$$
To calculate the median $t$ of the distribution I must
have: $$\text{Prob}\{0\leq X\leq t\} = \text{Prob} \{t \leq X \leq
3\}$$ But the total probability is 1, so each of the two
probabilities is 0.5. Then I have to solve the equation
$$\int_0^t\rho(x)\,dx = {1\over 2}$$ which gives: $${2\over
27}\int_0^t\left(6+x-x^2\right)dx = {1\over 2}.$$ I obtain the
following equation $$4t^3-6t^2-72t+81=0$$ which has the solutions:
$$t_1 = {9\over 2},\ t_2 = {3\over 2}\left(-1-\sqrt 3\right),\
{3\over 2}\left(-1 + \sqrt 3\right).$$ The only solution in the
interval $[0,3]$ is $t_3$ which is approximately $1.098$.
In a discrete distribution the mode is the value that occurs most
frequently. In a continuous distribution it is the value where the
probability density function takes its maximum value. To find this
maximum I shall calculate the derivative $\rho\prime(x)$ and then
$\rho \prime\prime(x)$: $$\rho^{\prime}(x)={2\over 27}(1 - 2x)$$
$$\rho^{\prime\prime}(x) = {-4\over 27}.$$ As the second derivative
is negative the function has indeed a maximum. The maximum value of
$\rho$ occurs at $x = 1/2$ so the mode is $1/2$.
Teachers' Resources
The advantage of using a continuous probability density function to model a set of statistical data is that instead of having to do calculations with all the separate values we can use calculus to find the required results.
The median is the point $t$ in the interval such that $$\text{Prob}\{0 \leq X \leq t\} = \text{Prob}\{t \leq X \leq 3\}$$
The mean of the distribution is $m$, where $$m=\int_0^3x\,\rho(x)\,dx.$$
In a discrete distribution the mode is the value that occurs most frequently. In a continuous distribution it is the value where the probability density function takes its maximum value.