# Find the simplest counterexample against exchanging limit and summation

I would need a very simple counterexample to show that $$\lim_{M\to\infty}\sum_{t=1}^M f(t,M)$$ may not necessarily be equal to $$\sum_{t=1}^\infty \lim_{M\to\infty}f(t,M)\ .$$ The situation here is (slightly) different from the commonly asked question about interchanging limits and infinite summation, as $M$ is itself driving the upper limit of the sum. Can you exhibit a simple function $f$ which does the job? [Note that it should depend explicitly on $M$!]. I could only come up with an overly complicated situation, but I think I am missing something potentially very simple... Many thanks for you help.

• Are you looking for an example for which both expressions are finite? Jan 10, 2018 at 17:31
• @Servaes that would be ideal, yes! Jan 10, 2018 at 17:32
• This works by using the standard sum $\sum_{k=1}^{n}1/n=1$. Just take $f(x, y) =1/y$ Jan 11, 2018 at 6:22
• It's not the simplest, but one important example is the Eisenstein series $G_{2k}$. (It's dealing with exchanging two sums rather than a sum and a limit, but the principle is the same). For $2k \geq 4$, the sum invovled converges uniformly, and the sums can be freely exchanged. For $2k = 2$ it fails, and extra term pops out that ruins the behavior under the modular group. (I mention it because a lot of students think that issues like this are pedantry or simply methods that are correct but verboten because they haven't been covered in class.) Jan 11, 2018 at 19:30

Using Iverson brackets, $$f(k,M)=[k=M]$$ $$%f(k,M)=\left\{\begin{array}{} %0&\text{if }k\ne M\\ %1&\text{if }k=M %\end{array}\right.$$

• Nice. Are the limits 1 and 0? Jan 11, 2018 at 1:23
• @EricDuminil: indeed, the limits are $1$ and $0$.
– robjohn
Jan 11, 2018 at 4:36
• In fact, you can get any two limits $a$ and $b$ you want by this method: $f(k, M) = 0$ for $M < k$, $a$ for $M = k$, and $b$ for $M > k$. Jan 11, 2018 at 15:30
• @MichaelSeifert: the sum of the limits is infinite for that unless $b=0$, is it not?
– robjohn
Jan 11, 2018 at 15:37
• @MichaelSeifert: $f(k,M)=a2^{-k}+(b-a)[k=M]$ or something like that would work.
– robjohn
Jan 11, 2018 at 16:45

Let $f(t,M) =\frac{t}{M}$, then

$\lim_{M\rightarrow \infty} \sum_{t=1}^{M} \frac{t}{M} = \infty$

as it is just the arithmetic series over M,

$\lim_{M \rightarrow \infty} \frac{M(M+1)}{2M} = \lim_{M\rightarrow \infty} \frac{M+1}{2}$

while

$\sum^\infty_{t=1} \lim_{M\rightarrow \infty} \frac{t}{M} = 0$,

as every summand is zero for every finite $t$.

• I so far like this one the most. It's easy, well-known and natural to people new in calculus.
– yo'
Jan 11, 2018 at 22:40

You can get a family of counterexamples by considering $$f(t,M)=\frac1M g(\frac tM)$$ where $$g$$ is continuous on $$[0,1]$$ and $$\int_0^1 g \neq 0$$:

• Setting $$g \equiv 1$$ yields $$\lim_{M\rightarrow \infty}\sum_{t=0}^{M} \frac1M = 1$$ while $$\sum_{t=0}^{\infty}\lim_{M\rightarrow \infty} \frac1M = 0$$
• Setting $$g(x) = x$$ yields $$\lim_{M\rightarrow \infty}\sum_{t=0}^{M} \frac{t}{M^2} = 1/2$$ while $$\sum_{t=0}^{\infty}\lim_{M\rightarrow \infty} \frac{t}{M^2} = 0$$

Explanation:
$$g$$ has Riemann series $$\int_0^1 g(x)\,\mathrm{d}x = \lim_{M\rightarrow \infty}\sum_{t=0}^{M}f(t,M)$$ while $$\sum_{t=0}^{\infty}\lim_{M\rightarrow \infty}f(t,M)= \sum_{t=0}^{\infty}\lim_{x\rightarrow 0} x \cdot g(x) =0$$

Similar to @cgrudz's answer but a bit simpler. $$f(t,M)=1/M$$ Then $\lim_{M\to\infty}\sum_{t=1}^M1/M=1$ while $\sum_{t=1}^\infty\lim_{M\to\infty}1/M=0$.