A class of 60 students has three sections. Summary statistics for scores on a quiz:
- Section 1: 25 students, mean $\mu_1$ = 23, SD $\sigma_1 = 3$
- Section 2: 20 students, mean $\mu_2$ = 25, SD $\sigma_2 = 2$
- Section 3: 15 students, mean $\mu_3$ = 27, SD $\sigma_3 = 4$
Let $S$ be the quiz score of a student picked at random from the class.
Found this problem in a textbook. The question was looking for something else, but I want to find $E(S)$ and $Var(S)$. How would I do that? This is what I think so far:
Let $\mathbb{I}_x$ be the event that Section $x$ is picked from the 3 sections with probability $p$, where $p$ is the $\frac{\text{number of students in that section}}{60}$ and $x \in [1,2,3]$.
Then, $$ E(S) = E(E(S|\mathbb{I}_1) + E(S|\mathbb{I}_2)+ E(S|\mathbb{I}_3)) $$
$$ = \frac{25}{60} \cdot 23 + \frac{20}{60} \cdot 25 + \frac{15}{60} \cdot 27 $$
Then, to find $Var(S)$:
$$ Var(S) = (\mu^2_1 + \sigma^2_1)\frac{25}{60} +(\mu^2_2 + \sigma^2_2)\frac{20}{60} + (\mu^2_3 + \sigma^2_3)\frac{15}{60} - E(S)^2 $$
$$ = (23^2 + 3^2)\frac{25}{60} + (25^2 + 2^2) \frac{20}{60} + (27^2 + 4^2) \frac{15}{60} - E(S)^2 $$
Does this look correct?
Yes, the Law of Total Expectation is $$\begin{align}\mathsf E(S)~&=~\mathsf E(\mathsf E(S\mid \Bbb I_K)) \\[1ex] &= \mathsf E(\mu_K)\end{align}$$
Where $K$ is the random variable of the section selected. You have correctly used the definition of expectation to find the expectation of the mean, $$\mathsf E(\mu_K)=\sum_{k=1}^3 \mu_k~\mathsf P(\Bbb I_k)~=~\tfrac{23\cdot 25}{60}+\tfrac{25\cdot 20}{60}+\tfrac{27\cdot 15}{60} \qquad\color{green}\checkmark$$
In a similar, but somewhat more complicated, vein, the Law of Total Variance is: $$\begin{align}\mathsf {Var}(S) ~&=~ \mathsf E(\mathsf {Var}(S\mid \Bbb I_K))+\mathsf {Var}(\mathsf E(S\mid \Bbb I_K)) \\[1ex] &=~ \mathsf E(\sigma_K^2)+\mathsf {Var}(\mu_K)\end{align}$$
Again, you have used your definitions of expectation and variance to find the sum these values. $~\color{green}\checkmark$
$$\mathsf E(\sigma_K^2)+\mathsf {Var}(\mu_K)=\sum_{k=1}^3 (\sigma^2_k+\mu_k^2)\mathsf P(\Bbb I_k) -\mathsf E(S)^2$$