Proving $\mathbb{E}(S_{\tau}|\tau)=\tau \mathbb{E}(\xi_1)$ and $\mathbb{E}S_{\tau}=\mathbb{E}\tau \mathbb{E}\xi_1$ Let $\xi_1, x_2,...,\xi_n$ and $\tau$ be independent random variables in $(\Omega, \mathcal{F}, \mathbb{P})$. $\xi_1, x_2,...,\xi_n$ are uniformly distributed and $\tau=\{0,1,2,...,n\}$. Let $S_{\tau}=\xi_1+\xi_2+...+\xi_{\tau}$ be a random sum of random variables.
I need to show that 
1)  $\mathbb{E}(S_{\tau}|\tau)=\tau \mathbb{E}(\xi_1)$ and $\mathbb{E}S_{\tau}=\mathbb{E}\tau \mathbb{E}\xi_1$.
2) $\mathbb{D}(S_{\tau}|\tau)= \tau \mathbb{D}\xi_1$ and $\mathbb{D}S_{\tau}=\mathbb{E}\tau \mathbb{D}\xi_1+\mathbb{D}\tau (\mathbb{E}\xi_1)^2$.
So for the first part I think I can use this
$\mathbb{E}S_{\tau}=\mathbb{E}\mathbb{E}(S_{\tau}|\tau)=\sum_{n\geq1}\mathbb{E}(\xi_1+\xi_2+...+\xi_{\tau}|\tau)\mathbb{P}(\tau=n)=\sum_{n\geq 1}n\mathbb{E}\xi_i\mathbb{P}(\tau=n)=\mathbb{E}\xi_i \sum_{n\geq1}\mathbb{P}(\tau=n)=\mathbb{E}\xi_1\mathbb{E}\tau .$
So am I right?
For the second part I am really not sure what to do.
 A: For the first question, note that
$$
S_\tau = \sum_{i=1}^n 1_{(\tau \leq i)} \xi_i
$$
therefore
$$
\mathbb{E}(S_\tau \ | \ \tau) = \mathbb{E}\left(\sum_{i=1}^n 1_{(\tau \leq i)} \xi_i \ \Big| \ \tau \right) = \sum_{i=1}^n \mathbb{E}\left( 1_{(\tau \leq i)} \xi_i \ \big| \ \tau \right)
$$
Note now that $1_{(\tau \leq i)}$ is measurable when given $\tau$ and that $\xi_i$ are all independent from $\tau$ so
$$
\mathbb{E}\left( 1_{(\tau \leq i)} \xi_i \ | \ \tau \right) = 1_{(\tau \leq i)} \mathbb{E}(\xi_i)
$$
In total we get (since $\xi_i$ are identically distributed)
$$
\mathbb{E}(S_\tau \ | \ \tau) =\sum_{i=1}^n \mathbb{E}\left( 1_{(\tau \leq i)} \xi_i \ \big| \ \tau \right) = \sum_{i=1}^n 1_{(\tau \leq i)} \mathbb{E}(\xi_i) = \mathbb{E}(\xi_1)\sum_{i=1}^n 1_{(\tau \leq i)}  = \mathbb{E}(\xi_1)\tau
$$
Taking expectations on both sides yields the second part of the first question.
Assuming by $\mathbb{D}$ you mean the variance, you can perform the exact same calculations as above to get
$$
\mathbb{D}(S_{\tau}|\tau)= \tau \mathbb{D}\xi_1
$$
Then using the law of total variance, we get
$$
\mathbb{D}(S_\tau) = \mathbb{D}(\mathbb{E}(S_\tau | \tau)) + \mathbb{E}(\mathbb{D}(S_\tau | \tau)) = \mathbb{D}(\tau) (\mathbb{E}(\xi_1))^2 + \mathbb{E}(\tau) \mathbb{D}(\xi_1)
$$
as desired.
