I recently came across the following beautiful and seemingly out-of-the-blue appearance of $e$:

$E[\xi]=e$, where $\xi$ is a random variable that is defined as follows. It's the minimum number of $n$ such that $\sum_{i=1}^n r_i>1$ and $r_i$ are random numbers from uniform distribution on $[0,1]$.

I can think of several more almost magical applications of $e$,$^\dagger$ but I would like to hear of some instances where you were surprised that $e$ was involved.

I would like to collect the best examples so as to be able to give some of the high-school students I tutor in math a sense of some of the deep connections between different areas of math that only really become apparent at the university level. These deep connections have always made me want to learn more about math, and my hope is that my students would feel the same way.

EDIT (additional question): A lot of the answers below come from statistics and/or combinatorics. Why is $e$ so useful in these areas? In general, I'd very much appreciate if answerers included some pointers as to how one can get an intuition about why $e$ appears in their case (or indeed, how they themselves make sense of it) - this would greatly help me in presenting these great examples.

$^\dagger$For instance that its exponential function is its own derivative, its relation to the trigonometric functions, its use in Fourier transformation, transcendence, etc., all of which I must admit I don't really understand (perhaps except for the first one, which I take to be the definition of $e$), as in "what is it about $e$ that makes it perfect for representing complex numbers, or changing from one basis to another, etc.?"

Bobson Dugnutt
  • 10,499
  • 3
  • 24
  • 43
  • 4
    Btw: "With your permission" isn't required, because content here is licensed under CC BY-SA 3.0. In particular, it may be used with attribution for commercial applications, as long as the result is licensed under CC BY-SA 3.0 or a compatible licence. – Patrick Stevens Feb 08 '16 at 14:30
  • You may find something interesting here:https://en.wikipedia.org/wiki/E_(mathematical_constant) – NoChance Feb 08 '16 at 14:41
  • The range of $2^{2^x}-2^x$ is $[\log_2(e)-\log_2(\log_2(e)),\infty)$. – Akiva Weinberger Feb 08 '16 at 16:25
  • @AkivaWeinberger What does "range" mean in this context? Thanks. – Bobson Dugnutt Feb 08 '16 at 16:32
  • @Lovsovs The range of a function $f$ is the set of numbers $y$ such that $y=f(x)$ for some $x$. – Akiva Weinberger Feb 08 '16 at 16:58
  • [Here](http://math.stackexchange.com/questions/689315/interesting-and-unexpected-applications-of-pi/) is a similar question, about $\pi$. – Watson Feb 08 '16 at 19:17
  • @AkivaWeinberger I don't understand why the range isn't $[1,\infty)$, since "plugging in" $x=-\infty$ gives $2^0-0=1$, and the first term is always greater than the second? If you want to, I'd be happy to upvote an answer if you post one about this. – Bobson Dugnutt Feb 10 '16 at 00:28
  • @Lovsovs For $x<-0.919$, $f(x)$ is actually _decreasing_. At $x=-0.919$, where $f(x)=0.914=\log_2(e)-\log_2(\log_2(e))$, it reaches its minimum, and then it starts increasing. – Akiva Weinberger Feb 10 '16 at 00:31
  • @Lovsovs The first term _is_ always bigger than the second; notice that the minimum value of $f(x)$ is positive. – Akiva Weinberger Feb 10 '16 at 00:32
  • One reason $e$ arises in prob. and statistics so much is that the graph of a binomial distribution $ f(x)=\binom {n}{x} $ , when normalized, approaches the bell curve $g(x)=A e^{-B x^2}$ (with suitable $A,B$) for very large $n$. – DanielWainfleet Feb 10 '16 at 20:57
  • 1
    From the prime number theorem, if $P(x)$ is the product of the primes less than $x$ then $ P(x)=e^{x(1+d_x)}$ where $d_x\to 0$ as $x\to \infty $. The prime number theorem has a "log" in it. Under every log, there's an "$e$" . – DanielWainfleet Feb 10 '16 at 21:08
  • 1
    @Lovsovs: [this one](http://math.stackexchange.com/questions/99324) can be interesting. – Watson Aug 16 '16 at 11:45
  • Related to your edit: https://math.stackexchange.com/questions/4023 – Watson Dec 04 '16 at 12:54
  • I stumbled upon [this interesting fact](https://stats.stackexchange.com/questions/114152/) : « When the circle is cut at a sequence of random points, the resulting gaps are exponentially distributed. » (quoted from _ Gaps in $\sqrt n$ mod 1 and ergodic theory_ by Noam D. Elkies and Curtis T. McMullen). – Watson Dec 03 '18 at 17:40

26 Answers26


We have


where LCM stands for least common multiple. The proof can be found here.

  • 46,778
  • 1
  • 77
  • 148

$e$ appears in the number of derangements

The formula for the number of derangements of length $n$ turns out to be $$n! \cdot \sum_{j=0}^n \frac{(-1)^j}{j!}$$

Since the second part is just the standard series for $e^{-1}$ this can also be written as $$\bigl[ \frac{n!}{e} \bigr]$$ where $[ . ]$ denotes the closest integer.

This also implies that the percentage of derangements among all permutations approaches, as $n \to \infty$ the number $\frac{1}{e}$.

N. S.
  • 128,896
  • 12
  • 138
  • 247
  • 6
    Equivalently, if one has a $\frac{1}{n}$ chance of winning the lottery, where $N$ is large, and plays the lottery $N$ times, the odds of winning zero times is $\sim \frac{1}{e}$. – Travis Willse Feb 08 '16 at 14:36
  • 1
    Another nice example in the same vein: the probability that a rearrangement of 112233...nn has no two consecutive numbers the same approaches $1/e$. – Jair Taylor Feb 09 '16 at 17:23
  • Equivalently, shuffle two standard decks of playing cards. Simultaneously remove one card from the top of each deck and compare the two cards. Repeat until you have turned over every card in both decks. The probability that you will turn over two cards of the exact same rank and suit at the same time, at least once during this procedure, is $1-1/e$; the probability this will _not_ happen is $1/e$. (You actually only need to shuffle one of the decks, but shuffling both works just as well.) – David K Feb 10 '16 at 21:36
  • Damn, beat me to it! :) I wasn't on Math SE when this question was posted, but [**I discovered this *independently* in Feb 2015**](http://fora.xkcd.com/viewtopic.php?f=17&t=111107), having worked out the math of "derangements" without ever using that word. Oh well, at least I get bragging rights. As I wrote then: *"The ratio of the total number of permutations of N distinct numbered items to the number of permutations of those same items such that no item is in a position matching its index number tends toward e as N approaches infinity."* – Wildcard Jul 03 '17 at 20:54

My favourite, also in the area of probability, is the secretary problem. Copied (with editing) from the Wikipedia site:

The task is to hire the best of $n$ applicants for a position. The applicants are interviewed one by one in random order. A decision about each one must be made immediately after the interview. Once rejected, an applicant cannot be recalled. During the interview, the interviewer can rank the applicant among all those interviewed so far, but is unaware of the quality of yet unseen applicants.

If you interview all applicants, then you are obliged to pick the last one. Is there a better strategy?

The answer is yes: interview $n$/e of the candidates (to the nearest whole number) and then choose the first of the remaining candidates who is better than any of those interviewed before; if none of them are, up to candidate $n-1$, then you still have to choose candidate $n$.

John Bentin
  • 16,449
  • 3
  • 39
  • 64
  • Does this have any relation to @N.S.'s answer, which involves $n!/e$ (instead of just $n$) also rounded to the nearest integer, or are the similarities just a coincidence? – Bobson Dugnutt Feb 08 '16 at 15:40
  • @Lovsovs: Intriguing thought, although I don't see how to make the connection straight off. – John Bentin Feb 08 '16 at 15:46

An almost magical appearance of $e$ comes from Pascal's Triangle. Let $s_n$ be the product of the terms on the $n$-th row of the Pascal's Triangle, that is:



$$\lim_{n\to \infty}\frac{s_{n-1}s_{n+1}}{s_n^2}=e$$ A proof of this fact can be found here. I think it's one of the things that struck me the most about Pascal's Triangle, and nowadays, it stills surprises me.

  • 4
    Here are some references on MSE about this limit : [(1)](https://math.stackexchange.com/questions/1183705/find-the-pascals-limit) and [(2)](http://math.stackexchange.com/q/700946). In particular, a comment in the second link points out that $$\frac{s_{n-1} \cdot s_{n+1}}{s_n^2} = \left(1+\frac{1}{n}\right)^n$$ – Watson Feb 08 '16 at 15:32
  • 1
    That is amazing! I understand the proof, but *why* $e$ have anything to do with Pascal's triangle is what boggles my mind! +1 – Bobson Dugnutt Feb 08 '16 at 16:27
  • 1
    @Lovsovs $\lim_{n \rightarrow \infty} (1+1/n)^n$ is a common definition for $e$; In light of that, I don't think there's anything surprising about binomial coefficients being connected to $e$. – Chris Chudzicki Feb 10 '16 at 22:06
  • @mrc Good point, hadn't thought about that! – Bobson Dugnutt Feb 10 '16 at 22:10
  • Here are links to the original papers and proof the discovery: [Math Bite: Finding e in Pascal's Triangle](https://www.researchgate.net/publication/305756185_Math_Bite_Finding_e_in_Pascal's_Triangle) and, in more detail, [Pascal's triangle: The hidden stor-e](https://www.jstor.org/stable/23249540) – Harlan Aug 04 '21 at 03:10

Here's a nice (longish) one.

A sequence of numbers $x_1,x_2,...$ is generated randomly from $[0,1]$. This process is continued so long as the sequence is monotonically increasing or monotonically decreasing.

Q: What is the the expected length of the monotonic sequence?

The probability that the length $L$ of the monotonic sequence is greater than $k$ is given by $$P(L>k) = P(x_1<x_2<\cdots<x_{k+1})+P(x_1>x_2>\cdots>x_{k+1})$$

$$ = \frac{1}{(k+1)!} + \frac{1}{(k+1)!}$$

$$ = \frac{2}{(k+1)!}$$

If we now call $P(L=k)$ by $p_k$, the expected length of the monotonic sequence is $$E(L) = 2p_2+3p_3+\cdots+np_n+\cdots$$

We can write this as,

$$E(L) = 1+1+P(L>2)+P(L>3)+P(L>4)\cdots$$

$$ = 1+1+2\bigg(\frac{1}{3!}+\frac{1}{4!} +\frac{1}{5!} +\frac{1}{6!}+\cdots\bigg)$$


$$= 2e-3$$


  • 6,208
  • 1
  • 18
  • 45

I kind of think this is cheating, but Euler's Identity comes to mind:


This is a specific case of $e^{ix}=\cos x+i\sin x$ when $x=\pi$. Deriving the formula requires only a knowledge of the Taylor expansions of $e^x$, $\sin x$, and $\cos x$.

I suppose this is not particularly surprising, but it reveals a very deep connection between the trigonometric functions, exponential functions, and even basic arithmetic.

EDIT: I wanted to add this as an afterthought:

In $e^{ix}=\cos x+i\sin x$ let $x=\frac{\pi}{2}$.

$\displaystyle e^{i\frac{\pi}{2}}=0+i$. Now exponentiate both sides by $i$.

$\displaystyle (e^{i\frac{\pi}{2}})^i=i^i \Longrightarrow e^{-{\frac{\pi}{2}}}=i^i$

$i^i$ is a real number, expressible in terms of $e$.

  • 6,362
  • 7
  • 23
  • 40

In section 1.3 of Mathematical Constants by S.R. Finch we find this connection to prime number theory \begin{align*} \lim_{n\rightarrow \infty}\left(\prod_{{p\leq n}\atop{p \text{ prime}}}p\right)^{\frac{1}{n}}=e \end{align*}

and also some Wallis-like infinite products \begin{align*} e=&\frac{2}{1}\cdot\left(\frac{4}{3}\right)^{\frac{1}{2}}\cdot \left(\frac{6\cdot 8}{5\cdot 7}\right)^{\frac{1}{4}}\cdot \left(\frac{10\cdot12\cdot14\cdot16}{9\cdot11\cdot13\cdot15}\right)^{\frac{1}{8}}\cdots,\\ &\frac{e}{2}=\left(\frac{2}{1}\right)^{\frac{1}{2}}\cdot\left(\frac{2\cdot4}{3\cdot3}\right)^{\frac{1}{4}} \cdot\left(\frac{4\cdot6\cdot6\cdot8}{5\cdot5\cdot7\cdot7}\right)^{\frac{1}{8}}\cdots \end{align*}

  • 94,265
  • 6
  • 88
  • 219

$e$ finds itself in formulas involving $\pi$. Ramanujan's constant $$e^{\pi \sqrt{163}} = 262537412640768743.99999999999925\ldots \approx 640320^3+744$$

is related to Heegner numbers and has deep connections to number theory.

The Gaussian integral $$\int_{-\infty}^{+\infty} e^{-x^2}\,dx = \sqrt{\pi}$$ is related to polar coordinates and thus Euler's famous formula.

  • 9,834
  • 4
  • 38
  • 70

Pick non-overlapping pairs $(x,x+1)$ of integers from $[1,n]$ until no more pairs can be picked (i.e., until no more consecutive integers remain), and let $p$ be the number of integers that were picked (i.e. $w$ is twice the number of picked intervals). Then you have for the expected value $\mathbb{E}\ p$ of picked integers that $$ \lim_{n\to\infty} \frac{1}{n}\mathbb{E}\ p = 1-e^{-2}. $$

This is a discrete version of Renyi's car parking constant, which is due to Page (1958), "The distribution of vacancies on a line", J. R. Statist. Soc. B 21, 364–374.

  • 20,082
  • 2
  • 30
  • 48

I don't know if this is relevant, but the fact that both $e$ and $\pi$ appear in the Gaussian function defining the normal distribution (which is very important in probability and in statistics) is something I find beautiful :

$$f(x) = \frac{1}{\sqrt{2π}}e^{-\frac{x^2}{2}}$$

Another example : $e$ appears in the definition of the moment-generating function $M_X(t)=E[e^{tX}]$ which is also very useful in probability and in statistics.

Here is an another interesting appearance of $e$: $$y=[1,3,5,7,9,11,\cdots]=1+\dfrac{1}{3+\dfrac{1}{5+\dfrac{1}{7+\dfrac{1}{9+\cdots}}}}=\dfrac{e^2+1}{e^2-1}$$

This is a particular case of the Continued Fraction Expansion of $\tanh(\cdot)$, see (1) or (2).

Other continued fractions involving $e$ can be found here, for instance: $$1+\dfrac{1}{1+\dfrac{1}{2+\dfrac{2}{3+\dfrac{3}{4+\cdots}}}}=e-1$$

  • 22,738
  • 12
  • 43
  • 107

The graph of $$y=x^x, x>0$$ has minimum value $$y=\left(\frac 1e\right)^{\frac 1e}$$ when $x=\frac 1e$

David Quinn
  • 30,738
  • 2
  • 17
  • 47

The arithmetic mean of the first $N$ positive integers is about $N/2$. This is easy to justify without any computation. Less obviously, the geometric mean of the first $N$ positive integers is about $N/e$.

Julian Rosen
  • 15,329
  • 3
  • 34
  • 64
  • I'm assuming that if you take the limit $N \rightarrow \infty$ the geometric mean *is* $N/e$? In that case, the result is strikingly similar to the one posted by Lucian! Any explicit relation that you can think of? – Bobson Dugnutt Feb 09 '16 at 17:10
  • 1
    My example is a consequence of Stirling's formula. Lucian's example is equivalent to the Prime Number Theorem. PNT is a deeper result than Stirling, so maybe we shouldn't expect a simple relationship between the two examples. – Julian Rosen Feb 09 '16 at 17:21

Throw $N$ balls into $N$ bins at random. The probability that any given bin is empty is $e^{-1}$, and thus with high probability the fraction of empty bins is close to $e^{-1}$.

  • 62,206
  • 36
  • 276
  • 489

$e$ appears in the basic Stirling's approximation for the factorial.

$$n!\approx\left(\frac ne\right)^n$$ hence

$$e\approx\frac n{\sqrt[n]{n!}}.$$


What is the radius of convergence of the power series $$ f(x)=\sum_{n=0}^\infty \frac{n! x^n}{n^n}? $$ Answer. Exactly $\mathrm{e}$.

Yiorgos S. Smyrlis
  • 78,494
  • 15
  • 113
  • 210

I would add to the list Dobiński's formula for the $n^{\rm th}$ Bell's number (the number of partitions of an $n$-element set) which is given by

$$B_n = {1 \over e}\sum_{k=0}^\infty \frac{k^n}{k!}.$$

When I first saw this formula I was amazed by an appearance of $e$ in a formula for a very concrete natural number.

Tomasz Kania
  • 15,266
  • 1
  • 27
  • 60

I have a silly one, which is mine and even if it's not really correct, it's quite cute!


$\pi$ the famous constant we all know $\phi$ the golden ratio $\gamma$ = Euler-Mascheroni constant


$$e \approx \frac{\pi + \phi + \gamma}{\pi\phi\gamma -1}$$

Anyway, as I said it's not really correct because

$$\frac{\pi + \phi + \gamma}{\pi\phi\gamma -1} - e = 0.0410(...)$$

  • 23,646
  • 9
  • 34
  • 53
  • 2
    That's pretty close! It reminds of [the fine-structure constant](https://en.wikipedia.org/wiki/Fine-structure_constant) $ \approx 1/137$! – Bobson Dugnutt Feb 10 '16 at 21:38
  • @Lovsovs: 2% relative accuracy is not "pretty close". –  Jul 09 '17 at 08:01

Take a conventional s-wave superconductor, then if we are looking into its bulk one might find (details):

$$ \frac{\Delta_0}{k_b T_c}=\pi e^{-\gamma} $$

where $k_b$ is the Boltzmann constant, $\Delta_0$ is the gapsize at zero temperature and $T_c$ is the critical temperature. Note that the r.h.s. of the formula above is independent of any material parameter but instead given by this wonderful combination of mathematical constants. This was very surprising to me when i saw it the first time. There is another very similar relation if we put our superconductor additionally into an magnetic field. This case can also be found in the reference above.

  • 12,020
  • 1
  • 26
  • 51

You could look up some interesting topics such as Bernoulli trials, which use Euler's number to approximate probabilities involving large numbers, and Stirling's approximation which provides an approximation for factorials.

I always liked the inequality rule that e is the only real number for which the following is true: $$\left(1+\frac{1}{x}\right)^x < e < \left(1+\frac{1}{x}\right)^{x+1}$$

Patrick Thorpe
  • 151
  • 1
  • 2
  • 13

Rather in the same area as the example you give in your question, but in this case an open problem rather than a theorem, is Feige's conjecture:

Let $X_1,...,X_n$ be independent non-negative random variables with unit expectation. Then $$\mathrm P[X_1+\cdots+X_n\leqslant n+1]\!\geqslant\frac1{\mathrm e}.$$

The non-negativity and unit expectation are obviously essential conditions, and independence is important too, but note that there are no other restrictions on the distributions of the random variables.

John Bentin
  • 16,449
  • 3
  • 39
  • 64

I have two approximation of almost an integers involving e

$$10e^{\pi\phi\over 2}\approx 126.99998...$$

$$\left({6\over 5}\phi^2-\pi\right)^{-2^{-2}}-\left({10\over \pi}+10\right)^{-2}-e^{-\phi\pi{e}}\approx 11.99999989...$$

  • 7,762
  • 6
  • 15
  • 61

Here is another one that can be founded in the book Escapades Arithmétiques written by Frédéric Laroche :

$$1+\frac 1{1\cdot 3}+\frac 1{1\cdot 3\cdot 5}+\cdots+\frac 1{1+\frac 1{1+\frac 2{1+\frac 3{1+\cdots}}}}=\sqrt{\frac{e\pi}2}.$$

Perhaps in a more explicit way:

$$\sum_{k=0}^\infty \left(\prod_{j=0}^k (2j+1)\right)^{-1}=\sqrt{\frac{e\pi}2}.$$

E. Joseph
  • 14,453
  • 8
  • 36
  • 67

Euler's integral formula (Gamma function) impressed me a lot:


where natural exponential of the negative and $n$-th power mix up in a simple and complicated way to give the $n$ factorial (generalized).

  • 4,636
  • 1
  • 11
  • 23

I think the appearance of the exponential function (so not exactly $e$) in linear differential equations is pretty amazing. We are very much used to it because we use it so often, but it is interesting that all linear first order dynamics are depending on the exponential function.

If we have $$\sum_{n=0}^{N}a_ny^{(n)}(x)=0$$

then the solution is given by

$$y(x)=\sum_{m=1}^{M}p_m(x)e^{\lambda_m x}$$

In which $p_m(x)$ is a polynomial of degree $a_m$ which is the multiplicity of the eigenvalue $\lambda_m$.

Sure we could choose another base but the natural base is $e$.

  • 15,530
  • 3
  • 18
  • 47

Probably and happily, this is an important one $$e^{tA}=1\!\!1+tA+\frac{1}{2!}t^2A^2+\cdots$$ for a squared matrix $A$ and each parameter $t$.

  • 9,556
  • 4
  • 24
  • 39

The minimum value of the function $f(x) = x^x$ is $f \left( \frac{1}{e} \right) = \left( \frac{1}{e} \right)^{\frac{1}{e}} \approx f(0.368) \approx 0.692$.

  • 5,421
  • 1
  • 17
  • 51