# Calculating value of series by taking the difference

Apologies if this is a basic question!

I'm trying to understand a solution to a problem I was solving. The author suggests a trick to calculate expected value by multiplying the expected value series by 0.5 (line 2) and taking the difference (line 3):

$$E(X) = 0.5^1 + 2 \cdot0.5^2 + 3\cdot 0.5^3...\\$$

$$0.5E(X) = 0.5^2 + 2 \cdot0.5^3 + 3\cdot 0.5^4...\\$$

$$0.5E(X) = 0.5^1 + 0.5^2 + 0.5^3...$$

My question: how did he calculate the difference on line 3?

• This method is called "错位相减法" in Chinese, i.e. "Dislocation Subtraction", which is "almost everywhere" used to calculate the values of seires of the form $\sum P(n)q^n$ where $P$ is a polynoimal. See baike.baidu.com/item/… – Feng Shao Aug 7 at 1:12

We have $$E = 0.5^1 + 2\cdot0.5^2 + 3\cdot0.5^3 + 4\cdot0.5^4+\cdots$$ $$0.5E = 0.5^2 + 2\cdot0.5^3 + 3\cdot0.5^4+\cdots$$ Combining terms with equal powers of $$0.5$$,$$E - 0.5E = 0.5^1 + 0.5^2(2-1) + 0.5^3(3-2) + 0.5^4 (4-3) \cdots$$ $$\implies 0.5E = 0.5^1 + 0.5^2+0.5^3\cdots$$

Subtract the second line from the first line

$$0.5E(X)=E(x)-0.5E(X)=$$

$$0.5^1 + 2 \cdot0.5^2 + 3\cdot 0.5^3...\\$$

$$- 0.5^2 - 2 \cdot0.5^3 - 3\cdot 0.5^4...=$$

$$0.5^1 + 0.5^2 + 0.5^3...$$

Here's a more "formal" way to write what you have, so it doesn't seem like so much of a trick. Since $$E(X) = \sum_{k \geq 1} \frac{k}{2^k},$$ we have \begin{align*} \frac{E(x)}{2} &= \sum_{k \geq 1} \frac{k}{2^{k + 1}} \\ &= \sum_{k \geq 2} \frac{k - 1}{2^k} \\ &= \sum_{k \geq 2} \frac{k}{2^k} - \sum_{k \geq 2} \frac{1}{2^k} \\ &= E(x) - \frac{1}{2} - \frac{1}{2}. \end{align*} From this we can see that $$\begin{equation*} E(x) = 2E(x) - 2, \end{equation*}$$ or $$E(x) = 2$$.

This is something like a particularly nice example of the perturbation method to evaluate sums, which you can learn more about here or in various other sources online.

• I think the reason for writing the OP in the way it was written is: to be understood by someone who does not know the $\Sigma$ notation. – GEdgar Aug 7 at 0:32
• @GEdgar Almost certainly. I only hoped to "peel back the curtain" a little bit, though perhaps I should direct OP to the relevant Wikipedia article to learn more about what I've said if they're interested. – rwbogl Aug 7 at 0:34
• Something’s not right here. In the OP, E(x) is 2, not 1. – Chris Johnson Aug 8 at 12:46
• @ChrisJohnson You were absolutely right; I had left off the $k$ factor from OP's sum. Fortunately this only makes it a slightly more complicated example. – rwbogl Aug 8 at 16:43