The Thirsty Crow and the Number e
math

The Thirsty Crow and the Number e

A childhood fable, a workshop on randomness, and a surprising appearance of Euler's number.

6 min read Jul 4, 2026

You know the story. A crow, half-dead with thirst, finds a pitcher with a little water at the bottom — too little, and too deep, for its beak to reach. So the crow starts dropping pebbles in, one by one. Each pebble nudges the water level up a fraction, and eventually the water rises high enough to drink. Moral, depending on which version you grew up with: little by little does the trick, or necessity is the mother of invention.

I heard this story a hundred times as a kid. I did not expect to hear it again in a workshop on randomness, from a professor making a point about one of the most famous constants in mathematics: e ≈ 2.71828.

His claim, roughly, was this: if the crow's pebbles were random, the number it needs is e. I was skeptical. It sounded like the kind of cute-but-wrong thing people say to make math feel magical. So I went and checked. It turns out to be exactly true — you just have to state the problem carefully. This post is me working through why.

Turning a fable into a math problem

The fable, as told, has no numbers in it. To get to e, we have to make one modeling assumption, and it's the assumption that does all the work.

Imagine the pitcher needs the water to rise by one unit to reach drinkable height. Each pebble the crow drops raises the level by some random amount, uniformly distributed between 0 and 1. So one pebble might raise it by 0.3, the next by 0.8, the next by 0.05 — each value equally likely to be anywhere in that range, independent of the others.

The crow keeps dropping pebbles until the total rise first exceeds 1. Call the number of pebbles it needs N. Since N depends on a sequence of random draws, it's itself random — sometimes the crow gets lucky with two big values and needs just 2 pebbles, sometimes it needs 5 or 6.

The question is: on average, how many pebbles does the crow need?

Formally, let $X_1, X_2, X_3, \dots$ be independent random numbers, each uniform on $[0, 1]$. Define

$$ N = \min \{ n : X_1 + X_2 + \dots + X_n > 1 \}. $$

We want $\mathbb{E}[N]$, the expected value of N. And the answer is:

$$ \mathbb{E}[N] = e \approx 2.71828. $$

That's the whole claim. The expected number of uniform random numbers you must add together before the sum first crosses 1 is exactly Euler's number. The crow, on average, needs e pebbles.

The intuition (and a light proof)

Before the full proof, here's the version that fits in your head.

The key quantity is this: what's the probability that the first n pebbles are not yet enough — that is, that $X_1 + \dots + X_n \le 1$? Call that probability $p_n$.

There's a clean fact here. The chance that n independent uniform values on $[0,1]$ all sum to less than 1 is

$$ p_n = \Pr(X_1 + \dots + X_n \le 1) = \frac{1}{n!}. $$

Why $1/n!$? Geometrically, the set of points $(x_1, \dots, x_n)$ in the unit cube whose coordinates sum to less than 1 is a simplex — the n-dimensional generalization of a triangle. In 2D, "two numbers in $[0,1]$ summing to less than 1" is the lower triangle of the unit square, which has area exactly $\tfrac{1}{2}$. In 3D it's a corner tetrahedron of the unit cube with volume $\tfrac{1}{6}$. The pattern is $1/n!$, and it generalizes cleanly.

Now connect that to N. The crow needs more than n pebbles exactly when the first n weren't enough, i.e. $\Pr(N > n) = p_n = \tfrac{1}{n!}$. And there's a handy identity for the expectation of a positive whole-number random variable:

$$ \mathbb{E}[N] = \sum_{n=0}^{\infty} \Pr(N > n). $$

Plug in $\Pr(N > n) = \tfrac{1}{n!}$:

$$ \mathbb{E}[N] = \sum_{n=0}^{\infty} \frac{1}{n!} = \frac{1}{0!} + \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \dots = e. $$

That last sum is the definition of e — the Taylor series of $e^x$ evaluated at $x = 1$. So e doesn't appear by coincidence; it appears because the "not enough yet" probabilities are exactly the terms of e's series. That's the heart of it.

The full proof

If you want every step nailed down, here it is.

Step 1 — The simplex volume. We claim $p_n = \Pr(X_1 + \dots + X_n \le 1) = \tfrac{1}{n!}$.

The vector $(X_1, \dots, X_n)$ is uniformly distributed over the unit cube $[0,1]^n$, which has volume 1. So $p_n$ equals the volume of the region

$$ S_n = \lbrace (x_1, \dots, x_n) : x_i \ge 0, \ x_1 + \dots + x_n \le 1 \rbrace, $$

the standard n-simplex. We can compute its volume by induction. Integrate over the last coordinate:

$$ \text{vol}(S_n) = \int_0^1 \text{vol}\big(S_{n-1} \text{ scaled by } (1 - x_n)\big), dx_n = \int_0^1 (1 - x_n)^{n-1} , \text{vol}(S_{n-1}) , dx_n. $$

Scaling an $(n-1)$-dimensional region by a factor $(1-x_n)$ multiplies its volume by $(1-x_n)^{n-1}$. With $\text{vol}(S_1) = 1$ and the integral $\int_0^1 (1-x)^{n-1}dx = \tfrac{1}{n}$, induction gives

$$ \text{vol}(S_n) = \frac{1}{n} \cdot \frac{1}{(n-1)!} = \frac{1}{n!}. $$

So $p_n = \tfrac{1}{n!}$. ∎

Step 2 — The tail of N. By definition, $N > n$ means the first n draws did not yet exceed 1, i.e. $X_1 + \dots + X_n \le 1$. Therefore

$$ \Pr(N > n) = p_n = \frac{1}{n!}, \qquad n = 0, 1, 2, \dots $$

(Check the edge case: $\Pr(N > 0) = \tfrac{1}{0!} = 1$, which is correct — you always need at least one pebble.)

Step 3 — The tail-sum identity for expectation. For any random variable N taking values in ${1, 2, 3, \dots}$,

$$ \mathbb{E}[N] = \sum_{n=1}^{\infty} \Pr(N \ge n) = \sum_{n=0}^{\infty} \Pr(N > n). $$

(This is standard: rewrite $\mathbb{E}[N] = \sum_n n\Pr(N=n)$ and swap the order of summation.)

Step 4 — Put it together.

$$ \mathbb{E}[N] = \sum_{n=0}^{\infty} \Pr(N > n) = \sum_{n=0}^{\infty} \frac{1}{n!} = e. $$

∎ The expected number of pebbles is exactly e.

Don't trust me — simulate it

Proofs are convincing, but there's a special satisfaction in watching the number fall out of an actual experiment. Here's the whole thing in a few lines of Python: repeatedly add uniform random numbers until the sum exceeds 1, count how many it took, and average over millions of trials.

import random

def pebbles_until_overflow():
    total, count = 0.0, 0
    while total <= 1.0:
        total += random.random()   # a uniform draw in [0, 1)
        count += 1
    return count

trials = 5_000_000
average = sum(pebbles_until_overflow() for _ in range(trials)) / trials
print(average)   # -> about 2.7183

Running this, the average converges right onto e:

Trials Average pebbles
10,000 2.7226
100,000 2.7190
1,000,000 2.7201
5,000,000 2.71851
e (exact) 2.718281828

The more trials, the closer it hugs 2.71828. The fable was telling the truth all along.

The bigger surprise: it's e to the x

Here's the part that made me actually sit up in the workshop. We asked for the water to rise by 1 unit. What if it only needs to rise by some amount x between 0 and 1? Define $N_x$ as the number of draws needed for the sum to first exceed x. The same argument generalizes beautifully:

$$ \mathbb{E}[N_x] = e^x. $$

So the threshold x and the expected count are linked by the exponential function across the board — our crow with threshold 1 is just the special case $e^1 = e$. I checked this too: with a threshold of $x = 0.5$, the simulation gives an average of 1.64872, and $e^{0.5} = 1.64872$ to five decimals. Exact again.

This is the thing I love about it. The exponential function and e tend to show up where there's continuous growth — compound interest, radioactive decay, population models. But here there's no growth at all. There's just a crow, some pebbles, and the simple act of adding random things until you've added enough. And out walks e.

So, is it actually true?

Yes — with one honest caveat. Aesop was not encoding a probability theorem; the original fable has no randomness in it, and a real crow drops real pebbles of roughly known sizes, not uniform random ones. The professor's version is a reframing: model each pebble's contribution as a uniform random number, ask how many you need to cross the threshold, and e falls out exactly. The math is airtight. The link to the fable is a teaching device — but a genuinely good one, because it takes a constant that usually feels abstract and pins it to something you can picture: pebbles plinking into a pitcher until the water spills over.

That's a good trade. Next time someone tells you e only lives in calculus and compound interest, tell them about the thirsty crow.


The simulation results above were generated with the Python snippet shown; your numbers will wobble slightly with a different random seed but will converge to the same place.

Stay in the loop

Get the latest insights on web development, design systems, and tech trends delivered straight to your inbox.