Question
A shop sells chocolates. The weight, in kilograms, of chocolates bought by a random customer can be modelled by a continuous random variable $X$ with probability density function $f$ defined by:
$f(x) = \begin{cases}
\frac{6}{85}(4 + 3x – x^2), & 0.5 \leq x \leq 3 \\
0, & \text{otherwise}
\end{cases}$
(a) Find the mode of $X$.
(b) Find $P(1 \leq X \leq 2)$.
(c) Find the median of $X$.
The shop sells chocolates to customers at $25 per kilogram.
However, if the weight of chocolate bought by a customer is at least 0.75 kilograms, the shop sells chocolate at a discounted rate of $24 per kilogram.
(d) Find the probability that a randomly selected customer spends at most $48.
(e) Find the expected amount spent per customer. Give your answer correct to the nearest cent.
▶️Answer/Explanation
DetailedSolution
Step 1: Verify that \( f(x) \) is a valid PDF
The PDF is:
\[
f(x) = \begin{cases}
\frac{6}{85}(4 + 3x – x^2), & 0.5 \leq x \leq 3 \\
0, & \text{otherwise}
\end{cases}
\]
For \( f(x) \) to be a valid PDF, it must satisfy two conditions:
1. \( f(x) \geq 0 \) for all \( x \).
2. The total probability over the support must be 1, i.e., \( \int_{-\infty}^{\infty} f(x) \, dx = 1 \).
**Check non-negativity:**
The support is \( 0.5 \leq x \leq 3 \). The factor \( \frac{6}{85} > 0 \), so we need \( 4 + 3x – x^2 \geq 0 \) in this interval. Consider the quadratic:
\[
g(x) = -x^2 + 3x + 4
\]
Find its roots:
\[
-x^2 + 3x + 4 = 0 \implies x^2 – 3x – 4 = 0
\]
\[
x = \frac{3 \pm \sqrt{9 + 16}}{2} = \frac{3 \pm 5}{2}
\]
\[
x = 4 \quad \text{or} \quad x = -1
\]
The parabola opens downward (since the coefficient of \( x^2 \) is negative). At the vertex, \( x = \frac{-3}{2(-1)} = 1.5 \):
\[
g(1.5) = -(1.5)^2 + 3(1.5) + 4 = -2.25 + 4.5 + 4 = 6.25 > 0
\]
At the boundaries:
– \( x = 0.5 \): \( g(0.5) = -(0.5)^2 + 3(0.5) + 4 = -0.25 + 1.5 + 4 = 5.25 > 0 \)
– \( x = 3 \): \( g(3) = -(3)^2 + 3(3) + 4 = -9 + 9 + 4 = 4 > 0 \)
Since \( g(x) \geq 0 \) for \( 0.5 \leq x \leq 3 \), \( f(x) \geq 0 \).
Check the integral equals 1:
\[
\int_{0.5}^{3} \frac{6}{85} (4 + 3x – x^2) \, dx = 1
\]
\[
\frac{6}{85} \int_{0.5}^{3} (4 + 3x – x^2) \, dx = 1
\]
Compute the integral:
\[
\int (4 + 3x – x^2) \, dx = 4x + \frac{3}{2} x^2 – \frac{1}{3} x^3
\]
Evaluate from 0.5 to 3:
\[
\left[ 4x + \frac{3}{2} x^2 – \frac{1}{3} x^3 \right]_{0.5}^{3}
\]
At \( x = 3 \):
\[
4(3) + \frac{3}{2} (3)^2 – \frac{1}{3} (3)^3 = 12 + \frac{3}{2} \cdot 9 – \frac{1}{3} \cdot 27 = 12 + 13.5 – 9 = 16.5
\]
At \( x = 0.5 \):
\[
4(0.5) + \frac{3}{2} (0.5)^2 – \frac{1}{3} (0.5)^3 = 2 + \frac{3}{2} \cdot 0.25 – \frac{1}{3} \cdot 0.125 = 2 + 0.375 – 0.04167 \approx 2.33333
\]
\[
16.5 – 2.33333 = 14.16667 = \frac{85}{6}
\]
\[
\frac{6}{85} \cdot \frac{85}{6} = 1
\]
The integral equals 1, so \( f(x) \) is a valid PDF.
Part (a): Find the mode of \( X \)
The mode of a continuous random variable is the value of \( x \) that maximizes the PDF. Since \( \frac{6}{85} > 0 \), we maximize:
\[
h(x) = 4 + 3x – x^2
\]
This is a quadratic function with a negative \( x^2 \) coefficient, so it opens downward, and the maximum occurs at the vertex:
\[
x = -\frac{3}{2(-1)} = 1.5
\]
Since \( 1.5 \) is within the interval \( [0.5, 3] \), the mode is:
\[
\text{Mode} = 1.5
\]
Part (b): Find \( P(1 \leq X \leq 2) \)
This is the probability over the interval \( [1, 2] \):
\[
P(1 \leq X \leq 2) = \int_{1}^{2} f(x) \, dx = \frac{6}{85} \int_{1}^{2} (4 + 3x – x^2) \, dx
\]
Use the antiderivative from Step 1:
\[
\left[ 4x + \frac{3}{2} x^2 – \frac{1}{3} x^3 \right]_{1}^{2}
\]
At \( x = 2 \):
\[
4(2) + \frac{3}{2} (2)^2 – \frac{1}{3} (2)^3 = 8 + \frac{3}{2} \cdot 4 – \frac{1}{3} \cdot 8 = 8 + 6 – \frac{8}{3} = 14 – \frac{8}{3} = \frac{42 – 8}{3} = \frac{34}{3}
\]
At \( x = 1 \):
\[
4(1) + \frac{3}{2} (1)^2 – \frac{1}{3} (1)^3 = 4 + \frac{3}{2} – \frac{1}{3} = 4 + 1.5 – 0.3333 = 5.16667 = \frac{31}{6}
\]
\[
\frac{34}{3} – \frac{31}{6} = \frac{68}{6} – \frac{31}{6} = \frac{37}{6}
\]
\[
P = \frac{6}{85} \cdot \frac{37}{6} = \frac{37}{85}
\]
So:
\[
P(1 \leq X \leq 2) = \frac{37}{85}
\]
Part (c): Find the median of \( X \)
The median \( m \) satisfies:
\[
P(X \leq m) = 0.5
\]
\[
\int_{0.5}^{m} \frac{6}{85} (4 + 3x – x^2) \, dx = 0.5
\]
\[
\frac{6}{85} \int_{0.5}^{m} (4 + 3x – x^2) \, dx = 0.5
\]
\[
\int_{0.5}^{m} (4 + 3x – x^2) \, dx = \frac{0.5 \cdot 85}{6} = \frac{85}{12} \approx 7.0833
\]
\[
\left[ 4x + \frac{3}{2} x^2 – \frac{1}{3} x^3 \right]_{0.5}^{m} = \frac{85}{12}
\]
At \( x = m \):
\[
4m + \frac{3}{2} m^2 – \frac{1}{3} m^3
\]
At \( x = 0.5 \):
\[
2.33333 \quad (\text{from Step 1})
\]
\[
4m + \frac{3}{2} m^2 – \frac{1}{3} m^3 – 2.33333 = \frac{85}{12}
\]
\[
4m + \frac{3}{2} m^2 – \frac{1}{3} m^3 = \frac{85}{12} + \frac{7}{3} = \frac{85}{12} + \frac{28}{12} = \frac{113}{12}
\]
Multiply through by 3:
\[
12m + \frac{9}{2} m^2 – m^3 = \frac{113}{4}
\]
\[
-m^3 + \frac{9}{2} m^2 + 12m – \frac{113}{4} = 0
\]
\[
4m^3 – 18m^2 – 48m + 113 = 0
\]
Solve this cubic equation. Test possible rational roots (\( \pm 1, \pm \frac{1}{2}, \pm \frac{1}{4}, \pm 113, \ldots \)):
\( m = 1 \):
\[
4(1)^3 – 18(1)^2 – 48(1) + 113 = 4 – 18 – 48 + 113 = 51 > 0
\]
\( m = 2 \):
\[
4(2)^3 – 18(2)^2 – 48(2) + 113 = 32 – 72 – 96 + 113 = -23 < 0
\]
The root is between 1 and 2. This cubic is complex to solve analytically, so we may need numerical methods, but let’s estimate:
\( m = 1.5 \):
\[
4(1.5)^3 – 18(1.5)^2 – 48(1.5) + 113 = 4(3.375) – 18(2.25) – 72 + 113 = 13.5 – 40.5 – 72 + 113 = 14 > 0
\]
– \( m = 1.7 \):
\[
(1.7)^3 = 4.913, \quad 4(4.913) \approx 19.652, \quad (1.7)^2 = 2.89, \quad -18(2.89) \approx -52.02, \quad -48(1.7) = -81.6
\]
\[
19.652 – 52.02 – 81.6 + 113 \approx -0.968 < 0
\]
The median is between 1.5 and 1.7, approximately 1.69 (via numerical solver), but we’ll leave it exact or note the need for numerical approximation unless the problem expects a simpler form.
Part (d): Find the probability that a customer spends at most $48
The pricing structure is:
\( 25 \) per kg if \( X < 0.75 \)
\( 24 \) per kg if \( X \geq 0.75 \)
Let \( S \) be the amount spent. We need \( P(S \leq 48) \).
Case 1: \( X < 0.75 \)**
Cost = \( 25X \):
\[
25X \leq 48 \implies X \leq \frac{48}{25} = 1.92
\]
But \( X < 0.75 \), so \( X \leq 0.75 \). Since \( 0.5 \leq X < 0.75 \), compute:
\[
P(0.5 \leq X < 0.75) = \frac{6}{85} \int_{0.5}^{0.75} (4 + 3x – x^2) \, dx
\]
\[
\left[ 4x + \frac{3}{2} x^2 – \frac{1}{3} x^3 \right]_{0.5}^{0.75}
\]
At \( x = 0.75 \):
\[
4(0.75) + \frac{3}{2} (0.75)^2 – \frac{1}{3} (0.75)^3 = 3 + \frac{3}{2} (0.5625) – \frac{1}{3} (0.421875) \approx 3.703125
\]
At \( x = 0.5 \):
\[
2.33333
\]
\[
3.703125 – 2.33333 \approx 1.36979
\]
\[
\frac{6}{85} \cdot 1.36979 \approx 0.0967
\]
**Case 2: \( X \geq 0.75 \)**
Cost = \( 24X \):
\[
24X \leq 48 \implies X \leq \frac{48}{24} = 2
\]
So, \( 0.75 \leq X \leq 2 \):
\[
P(0.75 \leq X \leq 2) = \frac{6}{85} \int_{0.75}^{2} (4 + 3x – x^2) \, dx
\]
At \( x = 2 \):
\[
\frac{34}{3} \quad (\text{from part b})
\]
At \( x = 0.75 \):
\[
3.703125
\]
\[
\frac{34}{3} – 3.703125 = \frac{34}{3} – \frac{118.5}{32} \approx 7.625
\]
\[
\frac{6}{85} \cdot 7.625 \approx 0.5382
\]
Total probability:
\[
0.0967 + 0.5382 = 0.6349
\]
Part (e): Find the expected amount spent, to the nearest cent
Expected amount spent \( E[S] \):
\[
E[S] = \int_{0.5}^{0.75} (25x) f(x) \, dx + \int_{0.75}^{3} (24x) f(x) \, dx
\]
\[
= \frac{6}{85} \left[ 25 \int_{0.5}^{0.75} x (4 + 3x – x^2) \, dx + 24 \int_{0.75}^{3} x (4 + 3x – x^2) \, dx \right]
\]
Compute \( x (4 + 3x – x^2) = 4x + 3x^2 – x^3 \):
\[
\int (4x + 3x^2 – x^3) \, dx = 2x^2 + x^3 – \frac{1}{4} x^4
\]
First integral:
\[
\left[ 2x^2 + x^3 – \frac{1}{4} x^4 \right]_{0.5}^{0.75}
\]
At \( x = 0.75 \):
\[
2(0.5625) + (0.421875) – \frac{1}{4} (0.31640625) \approx 1.46484375
\]
At \( x = 0.5 \):
\[
2(0.25) + (0.125) – \frac{1}{4} (0.0625) \approx 0.609375
\]
\[
1.46484375 – 0.609375 = 0.85546875
\]
\[
25 \cdot 0.85546875 \approx 21.3867
\]
Second integral:
\[
\left[ 2x^2 + x^3 – \frac{1}{4} x^4 \right]_{0.75}^{3}
\]
At \( x = 3 \):
\[
2(9) + 27 – \frac{1}{4} (81) = 18 + 27 – 20.25 = 24.75
\]
At \( x = 0.75 \):
\[
1.46484375
\]
\[
24.75 – 1.46484375 = 23.28515625
\]
\[
24 \cdot 23.28515625 \approx 558.84375
\]
\[
\frac{6}{85} (21.3867 + 558.84375) \approx 40.96
\]
To the nearest cent:
\[
E[S] = 40.96
\]
………………………Markscheme………………………
Solution: –
(a) recognizes that the mode is a value of x at which $f’$ has a maximum value
a clearly labelled graph of $f$ OR states $f'(x)=0$ OR considers the axis of symmetry
mode is 1.5 (kg)
(b) attempts to find $\int_{-\infty}^{\infty} f(x) dx$
$= 0.435294…$
$= 0.435 (\frac{37}{85})$
(c) METHOD 1
recognizes that $\int_{m}^{\infty}f(x)dx=0.5$
$m=1.68701…$
$m=1.69 (kg)$
METHOD 2
recognizes that $\int_{m}^{\infty}f(x)dx=0.5$
$\frac{6}{85}(\frac{4m^3}{3}+\frac{3m^2}{2}-\frac{m^3}{3})-\frac{6}{85}(\frac{2}{8}+\frac{3}{8}-\frac{1}{24})=0.5$
$m=1.68701…$
$m=1.69 (kg)$
(d) $0.5 \leq x \leq 2$ (can be seen in a definite integral)
attempts to evaluate their definite integral
$\int_{0.5}^{2}f(x)dx=0.635294…$
= 0.635
(e) an attempt at forming an expected value integral $\int_{0.5}^{2}xf(x)dx$
$\int_{0.5}^{0.75}xf(x)dx = -0.60592…$ OR $\int_{0.5}^{0.75}25xf(x)dx = -1.51482…$
$\int_{0.75}^{2}xf(x)dx = -1.64345…$ OR $\int_{0.75}^{2}24xf(x)dx = 39.4428…$
sums their two definite integrals
(expected amount spent per customer is) = $\int_{0.5}^{0.75}25xf(x)dx+\int_{0.75}^{2}24xf(x)dx$
= 40.9576…
(expected amount spent per customer is) $40.96