Task:
Today's share price is $Q$. Every day, independently of other days, it grows to the value of $q(1+\epsilon)$ with probability $p$ or falls to the value of $q(1-\epsilon)$ with probability $1-p$, where $q$ is the price of the previous day and $0\leq\epsilon<1$ is a constant. Compute the expected value and variance of the share price after $n$ days.
How to solve this task? My attempt:
Let $X$ denote how many times the price grew. Then $X$ is clearly given by the binomial distribution, so we have $\operatorname{P}(X=k)={n\choose k}p^k(1-p)^{n-k}$ and $\operatorname{E}X=np$. Now let $f(X)$ compute the price after $n$ days, then $f(k)=Q(1+\epsilon)^k(1-\epsilon)^{n-k}$. Now I'd like to be able to say that $\operatorname{E}f(X)=f(\operatorname{E}X)=f(np)=Q(1+\epsilon)^{np}(1-\epsilon)^{n(1-p)}$, BUT...
I don't think if this is correct and even if it is correct I can't prove this. And unless I can prove why I can do something like that the only thing I have is the general formula for computing the expected value of a function of a random variable, and that is... $\operatorname{E}f(X)=\sum_k\operatorname{P}(X=k)f(k)$.
And this formula leads to a horrible sum...: $\operatorname{E}f(X)=\sum_{k=0}^n{n\choose k}p^k(1-p)^kQ(1+\epsilon)^k(1-\epsilon)^{n-k}={Q\sum^n_{k=0}{n\choose k}\bigl(p(1+\epsilon)\bigr)^k\bigl((1-p)(1-\epsilon)\bigr)^{n-k}}$
Whatever should I do with this sum? I have no idea. Or is there any other way to solve this task that wouldn't lead to this sum?
Using the law of total expectation we can avoid having to compute any complicated series for the expectation; that is we use the fact that
$$ \mathbf{E}[X_{n+1}] \, = \, \mathbf{E}[ \mathbf{E}[X_{n+1}\, | \, X_n ]]$$
If we denote $X_n$ to be the value on day $n$, then conditioned on $X_n$ the expectation of $X_{n+1}$ is
\begin{align*} \mathbf{E}[X_{n+1} \, | \, X_n] &= p(1 + \epsilon)X_n + (1-p)(1 - \epsilon)X_n \\ & = (1 - \epsilon + 2p\epsilon)X_n \end{align*}
Then the law of total expectation gives $$ \mathbf{E}[X_{n+1}] \, = \, \mathbf{E}[ \mathbf{E}[X_{n+1}\, | \, X_n ] ] \, = \, (1 - \epsilon + 2p \epsilon) \mathbf{E}[X_n],$$
And so iterating the above (i.e doing the same for $X_n$, etc.) we obtain
$$\mathbf{E}[X_{n+1}] = (1 - \epsilon + 2p \epsilon) \mathbf{E}[X_n] \, = \, \cdots \, = \, (1 - \epsilon + 2p\epsilon)^{n+1} \mathbf{E}[X_0].$$
Assuming that $X_0= Q$ then this simplifies to
$$\mathbf{E}[X_n] = Q(1- \epsilon + 2p \epsilon)^n.$$
Similarly one can apply the law of total variance to get an expression for the variance. That is
$$ \text{Var}(X_{n+1}) = \mathbf{E}[ \text{Var}(X_{n+1}\, | \, X_n)] + \text{Var}( \mathbf{E} [ X_{n+1} | X_{n} ] ).$$