Hello I am working on an assignment and I am a little stuck on how to progress on a particular question.
So here's the question specifics:
A coffee shop prides itself on only selling beans that have been freshly roasted the same morning. The amount of beans that the coffee shop roasts each morning,R(’00 kg), is a random variable described by the probability density function
$f(r) = -6(r-1)^2+1.5, 0.5 < r < 1.5$
Given that the roasted amount on an arbitrary day is $R=r$, the amount sold in any particular day,S(’00 kg), is uniformly distributed such that $S < r$. Find $E[S]$.
What I have is that
$\begin{align}E[S] &= E[E[S|R]]\\ &=E[-6(R^2-2R+1)+1.5]\\ &=E[-6R^2+12R-6] + 1.5\\ &=-6E[R^2]+12E[R] -4.5\\ &=-6\int_{0.5}^{1.5}r^2(-6r^2+12r-6)dr+12\int_{0.5}^{1.5}r(-6r^2+12r-6)dr)dr -4.5\\ &=3.45 - 6-4.5\\ &=-7.05\end{align}$
but this result doesn't make any sense to the question so clearly I am doing something wrong. If someone could give me a nudge in the right direction I would greatly appreciate it.
The sales $S$ conditional on $R=r$ has a uniform distribution from 0 to $r$. Therefore, the conditional mean of $S|R=r$ is $r/2$. So
$$E(S)=E_R(E(S|R))=E_R(R/2)=\int_{1/2}^{3/2} (r/2)(-6(r-1)^2+3/2)dr=1/2$$