Computing a complicated expected value I want to compute the following expected value:
$$ \mathbb{E}\left(\sum_k^K \left(\widetilde{T_k}-\frac{\varepsilon k}{v}\right)^2\right)$$
with $\widetilde{T_k}=\sum_i^k T_i$, the $T_i$ being continuous random variables, that are exponentially distributed (with $\mathbb{E}(T_i)=1/\sigma$, with $\sigma$ a constant) and $v,\varepsilon >0$ constants.
I am quite confused by having these two sums and the product which I don't really know how to deal with:
$$\mathbb{E}\left[\sum_k^K \left(\left(\sum_i^k T_i\right)-\frac{\varepsilon k}{v}\right)^2\right] =  \mathbb{E}\left[\sum_k^K \left(\left(\sum_i^k T_i\right)-\frac{\varepsilon k}{v}\right)\cdot\left(\left(\sum_i^k T_i\right)-\frac{\varepsilon k}{v}\right)\right] $$
I know that in general it holds that:
$\mathbb{E}\left( \widetilde{T_k}\right) = \mathbb{E}\left(\sum_{i=1}^{k}T_i \right) = \mathbb{E}\left(T_1 \right) +\dots +\mathbb{E}\left(T_k \right) = \frac{k}{\sigma}$ but in my case I am not sure if I can use something like that...
I am very gladful for any help!
 A: I assume that the exponential variables are also independent. If this is not the case, I believe we cannot answer the question because we need their covariance structure.
By computing the square,using the linearity of the expectation and the independence, we get:
$$
\begin{align}
\mathbb{E}\bigg[\sum_{k=1}^{K}\bigg[ \sum_{i=1}^{k}\sum_{j=1}^{k}T_i T_j + \frac{\epsilon^2 k^2}{v^2} -2\frac{\epsilon k}{v} \sum_{i=1}^{k}T_i\bigg]\bigg] &\overset{\mathrm{lineariy}}{=} \\
\sum_{k=1}^{K}\bigg[ \sum_{i=1}^{k}\sum_{j=1}^{k}\mathbb{E}[T_i T_j] + \frac{\epsilon^2 k^2}{v^2} -2\frac{\epsilon k}{v} \sum_{i=1}^{k}\mathbb{E}[T_i]\bigg] &\overset{\mathrm{indep.}}{=} \\
\sum_{k=1}^{K}\bigg[ \sum_{i \ne j}\mathbb{E}[T_i]\mathbb{E}[ T_j] + \mathbb{E}[T_{i}^{2}] + \frac{\epsilon^2 k^2}{v^2} -2\frac{\epsilon k}{v} \sum_{i=1}^{k}\mathbb{E}[T_i]\bigg] = \\
\sum_{k=1}^{K} \bigg(\frac{\epsilon^2}{v^2} - \frac{2 \epsilon}{v \sigma}\bigg)k^2 +\frac{(k-1)^2}{\sigma^2}+\frac{2}{\sigma^2}= \\
\frac{K(K+1)(2K+1)}{6}\bigg(\frac{1}{\sigma^2}+\frac{\epsilon^2}{v^2} - \frac{2 \epsilon}{v \sigma}\bigg) + \frac{K(2-K)}{\sigma^2}
\end{align}
$$
