Here’s a question that came into my mind as I was falling asleep last night: What’s the discrete equivalent of the exponential function $\exp(x) = \mathrm{e}^x$?

What did my brain mean by this question? Maybe something like this: If you take a definition of the exponential, what is the most plausible (or a plausible) generalisation of that where more naturally continuous operations are replaced by more naturally discrete ones? This is not, of course, a formally precisely stated question, but seemed intriguing enough to think about for as long as I remained awake.

Two definitions of the exponential I thought of were these. First, the exponential is the solution to the differential equation $f’(x) = f(x)$. Second, the exponential is defined by the Taylor series

\[\exp(x) = \sum_{n=0}^\infty \frac{x^n}{n!} .\]

Let’s start with the first, the differential equation definition. The derivative $f’$ is a “naturally continuous” operation; a more natural discrete equivalent is the discrete difference $\Delta f(x) = f(x+1)-f(x)$. So if the “continuous exponential” satisfies $f’(x) = f(x)$, perhaps the “discrete exponential” should satisfy $\Delta f(x) = f(x)$. A few moments thought should be enough to convince you that the solution is $f(x) = 2^x$, since

\[2^{x+1} - 2^x = 2^x(2 - 1) = 2^x .\]

What about the second, the Taylor series equation definition. I would argue that to get a discrete equivalent it makes sense to replace the power $x^n$ by the falling factorial power $x^{\underline{n}} = x(x-1)\cdots(x-n+1)$ – this came up in my discussion of sums of powers a while ago. In that case we get

\[f(x) = \sum_{n=0}^\infty \frac{x^{\underline{n}}}{n!} = \sum_{n=0}^\infty \binom{x}{n} ,\]

which has become a sum of binomial coefficients. For integer $x$, this is the total number of subsets from a collection of $x$ items, summed over the subsets of size $n = 0, 1, 2, \dots$. This total number of subsets is $2^x$ (each item can be either included in the subset or not), giving $f(x) = 2^x$ again. (This also true non-integer $x$, by the binomial theorem.)

So the two different definitions have both suggested to us that $2^x$ is the discrete equivalent of $\mathrm{e}^x$: or that “2 is discrete e”, as I put it (slightly facetiously) in the title of this blogpost.

More generally, we could look at a discrete equivalent of $\mathrm{e}^{\alpha x} = \exp(\alpha x)$, thinking of $\alpha$ as a fixed constant and $x$ as the argument of the function. This satisfies the differential equation $f’(x) = \alpha f(x)$; moving to the discrete equivalent $\Delta f(x) = \alpha f(x)$ gives $f(x) = (1 + \alpha)^x$, since

\[(1+\alpha)^{x+1} - (1+\alpha)^x = (1+\alpha)^x(1 + \alpha - 1) = \alpha(1+\alpha)^x .\]

Similarly, the Taylor series approach suggests

\[f(x) = \sum_{n=0}^\infty \frac{\alpha^n x^{\underline{n}}}{n!} = \sum_{n=0}^\infty \binom{x}{n} \alpha^n = (1+\alpha)^x ,\]

too. (Since $\alpha$ is the constant, I don’t think it needs to be “discretised” from the power $\alpha^n$ to any falling factorial.) Both ways, we get the same equivalent $(1 + \alpha)^x$; of course, setting $\alpha = 1$ gets back $2^x$, as before.

Two appendices

I mentioned this to Pete and Ben at lunchtime, and they thought of two interesting extra directions to take this.

Pete asked what if we look for a discrete equivalent not on the integers but on a mesh of width $h$. That would suggest using the discrete difference

\[\Delta_h f(x) = \frac{f(x + h) - f(x)}{h}\]

instead. It’s easy to check that $\Delta_h f(x) = f(x)$ gives $(1 + h)^{x/h}$, since

\[\frac{(1 + h)^{(x+h)/h} + (1 + h)^{x/h}}{h} = \frac{(1 + h)^{x/h}\big((1+h)^{1} - 1\big)}{h} = \frac{h}{h}(1 + h)^{x/h} = (1 + h)^{x/h} .\]

Note that setting $h = 1$ gets back $(1 + 1)^{x/1} = 2^x$, while sending $h \to 0$ gives the limiting value

\[(1 + h)^{x/h} = \big( (1 + h)^{1/h} \big)^x \to \mathrm{e}^x ,\]

the continuous exponential. The same argument suggests the width-$h$ discrete equivalent of $\mathrm{e}^{\alpha x}$ is $(1+\alpha h)^{x/h}$.

Ben pointed out there’s a “mirror image” way to discretise things: instead of the discrete forward difference $\Delta f(x) = f(x+1) - f(x)$ you use the discrete backward difference $\nabla f(x) = f(x) - f(x-1)$ and instead of the falling factorial $x^{\underline n} = x(x-1) \cdots (x-n+1)$ you use the rising factorial $x^{\overline n} = x(x+1) \cdots (x+n-1)$.

The backward difference equation $\nabla f(x) = \alpha f(x)$ has solution $f(x) = (1 - \alpha)^{-x}$, since

\[(1 - \alpha)^{-x} - (1-\alpha)^{-(x-1)} = (1-\alpha)^{-x}\big(1 - (1 - \alpha)\big) = \alpha (1-\alpha)^{-x} .\]

Similarly, the Taylor series gives

\[f(x) = \sum_{n=0}^\infty \frac{\alpha^n x^{\overline{n}}}{n!} = \sum_{n=0}^\infty \binom{x+n-1}{n} \alpha^n = (1-\alpha)^{-x} ,\]

by a moderately famous result I’m not going to prove here. Either way, we get $(1 - \alpha)^{-x}$ the mirror-image way, compared to $(1 + \alpha)^x$ the usual way. But here, you can’t set $\alpha = 1$ to get back “discrete e”, because at $\alpha = 1$ you get $0^{-x} = (1/0)^x$, and division by 0 isn’t allowed.