Infinite sum and partial sum not equal in Wolframalpha

$\begingroup$

$$\sum_{n=0}^{\infty} |(-0.8)^n \theta(n)-(-0.8)^{n-1} \theta(n-1)|$$$\theta(n) = 1$ for $n \geq 0$ and 0 otherwise.

My attempt to calculate this summation numerically with Python yielded 10. To ensure correctness I tried to verify this answer by calling Wolframalpha within Mathematica with the following query:Sum[Abs[UnitStep[n]*(-0.8)^(n) - UnitStep[n-1]*(-0.8)^(n-1)],{n,0,Infinity}]

It returned 3.6 as primary answer but it's partial sum converged to 10. I am now wondering which answer is correct.

$\endgroup$

2 Answers

$\begingroup$

The answer is $10$.

Note that you can rewrite$$\begin{align} \sum_{n=0}^{\infty} |(-0.8)^n \theta(n)-(-0.8)^{n-1} \theta(n-1)| &= |(-0.8)^0-0|+\sum_{n=1}^{\infty} |(-0.8)^n \theta(n)-(-0.8)^{n-1} \theta(n-1)|\\ &= 1+\sum_{n=1}^{\infty} |(-0.8)^n -(-0.8)^{n-1} |\\ &= 1+\sum_{n=1}^{\infty} |(-0.8)^{n-1}| |(-0.8) -1 |\\ &= 1+1.8\cdot\sum_{n=1}^{\infty} 0.8^{n-1} = 1+1.8\cdot\sum_{n=0}^{\infty} 0.8^{n}\\ &= 1+1.8\cdot 5 = 1+9\\ &= \boxed{10} \end{align}$$

It looks like WolframAlpha really does not like the mix of absolute values and alternating power signs. It has nothing to do with the $\theta(\cdot)$ function itself, as seen here with Sum[Abs[(-8/10)^(n) - (-8/10)^(n-1)],{n,1,Infinity}]+1.

Mathematica, on the other hand, is fine with it.enter image description here

$\endgroup$ $\begingroup$

Your summation is a geometric series in disguise. Write $r:=0.8$. Plugging in the definition of $\theta(\cdot)$, we see that the $n=0$ term must be handled separately. Your summation is then written$$ 1 + \sum_{n\ge1}|r^n-r^{n-1}|=1+\sum_{n\ge1}|r-1||r|^{n-1}. $$The rightmost sum is $9$, by the formula for the sum of a geometric series.

Not sure what it means for Wolfram's "primary answer" to be 3.6. Can you show the output?

$\endgroup$ 2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like