Evaluate $\lim\limits_{n \to \infty}\left(\sum\limits_{k=0}^{n}\left(\frac{\left(k-n\right)^k}{k!}\cdot e^{n-k}\right)-2n\right)$

expected valuelimitssummation

Evaluate $\lim\limits_{n \to \infty}\left(\sum\limits_{k=0}^{n}\left(\frac{\left(k-n\right)^k}{k!}\cdot e^{n-k}\right)-2n\right)$.

By plugging in large values for $n$, I noticed that the limit is most likely $\frac{2}{3}$, but I can't prove it.

Update

Over a year has passed since I asked this question, but recently it was closed out of the blue because it lacks additional context. So let me explain where this limit comes from. I was studying the following problem:

Let's consider a sequence of random numbers. Each number is uniformly distributed between $0$ and $1$. We add up the terms of this sequence one by one until their sum exceeds a certain number $x \in \mathbb{R}$. Let $E_x$ be the expected number of terms needed for that.

The original question asked for the value of $E_1$, which turns out to be $e$. After I solved this by using differential equations, I wanted to find a formula for all $E_x$. Before I had found one, I thought:
"Well, each term of the sequence increases the sum by an expected value of $\frac{1}{2}$, so the sum should exceed $x$ after roughly $2x$" terms. For large $x$, this approximation should get better and $E_x$ will get closer and closer to $2x$." In other words, I thought that $\lim\limits_{x \to \infty}\left(E_x-2x\right)=0$. This turned out to be wrong later.

Finding a nice formula for $E_x$ is not easy and the only explicit formula I could come up with was a piecewise-defined function with infinitely many pieces. The first piece ranges from $0$ to $1$, the second from $1$ to $2$, the third from $2$ to $3$, and so on. This makes it really hard to evaluate the limit, so I decided to look at only integer values of $x$. And indeed, you can find a nice for those, namely:

$$E_n=\sum\limits_{k=0}^{n}\left(\frac{\left(k-n\right)^k}{k!}\cdot e^{n-k}\right)$$

Plugging this into $\lim\limits_{x \to \infty}\left(E_x-2x\right)$, we get the limit in the title of this question. And apparently, this limit is equal to $\frac{2}{3}$ and not $0$.

So, there you go. Hopefully, this will be enough to open this question again.

Best Answer

Consider the generating function (here $z\in\mathbb{C}$, $|z|$ sufficiently small) \begin{align*} F(z)=\sum_{n=0}^{\infty}F_n z^n&:=\sum_{n=0}^{\infty}z^n\sum_{k=0}^{n}\frac{(k-n)^k}{k!}e^{n-k} \\\color{gray}{[\text{replacing }k\text{ with }n-k]}\quad &=\sum_{n=0}^{\infty}z^n\sum_{k=0}^{n}e^k\frac{(-k)^{n-k}}{(n-k)!} \\\color{gray}{[\text{switching summations}]}\quad &=\sum_{k=0}^{\infty}\sum_{n=k}^{\infty}z^n e^k\frac{(-k)^{n-k}}{(n-k)!} \\\color{gray}{[\text{replacing $n$ with $n+k$}]}\quad &=\sum_{k=0}^{\infty}(ez)^k\sum_{n=0}^{\infty}\frac{(-kz)^n}{n!} \\\color{gray}{[\text{evaluating known sums}]}\quad &=\sum_{k=0}^{\infty}(ze^{1-z})^k=\frac{1}{1-ze^{1-z}}. \end{align*} $F(z)$ has a double pole at $z=1$, with Laurent expansion $F(z)=2(z-1)^{-2}+(4/3)(z-1)^{-1}+\ldots$, and a sequence of simple poles (with the smallest in absolute value at $z\approx 3.0888\pm7.4615\mathrm{i}$). Thus, $$F(z)-\frac{2}{(1-z)^2}+\frac{4/3}{1-z}=\sum_{n=0}^{\infty}(F_n-2n-2/3)z^n$$ is regular in $|z|<r$ for some $r>1$ (we may take $r=8$ from the numerical value above).

In particular, the last series converges at $z=1$, which implies $\color{blue}{\lim\limits_{n\to\infty}(F_n-2n-2/3)=0}$.


In response to the comment by Gottfried Helms, here is a sketch of the analysis of $$y_k(x)=\sum_{n=0}^{\infty}\left\langle\begin{matrix}n\\k\end{matrix}\right\rangle\frac{x^n}{n!}\qquad(x\neq 0)$$ involving Eulerian numbers (denoted by $A(n,k)$ there). We consider the known $$Y(x,z):=\sum_{k=0}^{\infty}y_k(x)z^k=\frac{1-z}{e^{x(z-1)}-z}$$ as a function of $z$ (that is, with $x$ fixed); the denominator vanishes when $$(-xz)e^{-xz}=-xe^{-x}\iff z=z_m(x):=-W_m(-xe^{-x})/x\qquad(m\in\mathbb{Z})$$ where $W_m$ denotes the $m$-th branch of the Lambert W-function. Thus, $Y(x,z)$ has simple poles at these points, excluding $z=1$ if $x\neq 1$.

Now, an alternative representation of $y_k(x)$ comes from the partial fraction expansion of $Y(x,z)$, obtained using an approach going back to Cauchy, applicable to a meromorphic function $f(z)$ such that there is a positive integer $p$ and a sequence $\{C_n\}$ of simple contours, containing arbitrarily large circles inside, and $$\lim_{n\to\infty}\sup_{z\in C_n}|z^{-p}f(z)|=0.$$

In the case when $f(z)$ has only simple poles $z=z_m\neq 0$ with residues $a_m$, this approach yields $$f(z)=\sum_{k=0}^{p-1}\frac{f^{(k)}(0)}{k!}z^k+\sum_m\frac{a_m(z/z_m)^p}{z-z_m}.$$ For $f(z)=Y(x,z)$, the premise holds with $p=1$; computing $a_m$, we obtain $$y_k(x)=\sum_{m\in\mathbb{Z}}\frac{z_m(x)-1}{xz_m(x)-1}\big(z_m(x)\big)^{-k-1}\qquad(k>0)$$ which can be used to check the "empirical" results in the article being discussed.

Related Question