5. A random variable X, which represents the weight (in ounces) of an article, has a density function
\begin{equation*}
f(z) = \begin{cases} z - 1, & 1 \le z \le 2\\ 3 - z, & 2 \le z \le 3 \\ 0, & \text{otherwise} \end{cases}
\end{equation*}
Calculate the mean and variance of the random variable X.
The mean and variance of the random variable X are 1 and $\frac{1}{6}$, respectively.
The mean and variance of the random variable X are 2 and $\frac{1}{6}$, respectively.
The mean and variance of the random variable X are 2 and $\frac{1}{2}$, respectively.
The mean and variance of the random variable X are 1 and $\frac{1}{2}$, respectively.