"Ask for whatever you like," said the Emperor.
Akbar ruled Mughal India from
1556 to 1605, and
Birbal was the wisest of the nine advisors at his court, a man remembered
in hundreds of folk tales for out-thinking everyone around him, the Emperor usually
included. One day Akbar decided to reward him, and told him to name any prize he liked.
Birbal asked for rice, and only rice, laid out on a chessboard.
One grain on the first square. Two on the second. Four on the third,
doubling all the way to the sixty-fourth. Akbar thought it a modest, almost insulting
request, and agreed at once.
sq 1201not yet doubled
sq 2212doubled once
sq 3224twice
sq 42383 times
sq 524164 times
sq 625325 times
sq 726646 times
sq 8271287 times
The first rank of the board. The exponent is not counting squares; it is counting
doublings. The first square has not been doubled at all, so it carries
\(2^{0}\); by the eighth the rice has doubled seven times, giving \(2^{7}\).
That is also the clearest reason \(2^{0} = 1\) and not \(0\): nothing has yet happened
to the single grain you started with.
By square 20
524,288
Half a million grains: a decent sack, and still less than a third of the way along.
Square 64 alone
263 = 9,223,372,036,854,775,808
Nine quintillion grains, on one square of one chessboard.
The whole board
264 − 1
About 535 billion tonnes of rice, roughly a thousand years of the entire world harvest.
Birbal was never going to be paid. But hidden in the story is the fact that makes exponents
worth learning at all:
every square holds one grain more than every square before it put together.
Square 64 needs 9,223,372,036,854,775,808 grains; squares 1 to 63 come to
9,223,372,036,854,775,807.
One less. Every time.
That is what doubling does, and it is why this notation exists. You cannot write those
numbers out, but you can write \(2^{63}\) in three characters, and every rule in this
module is about handling them at that size.
The story gets around. Very nearly every culture that plays chess tells
some version of it. The oldest surviving written account is Arabic: the historian
Ibn Khallikan set it down in the thirteenth century, with the inventor of chess asking an
Indian king for grains of wheat. It has been retold in Persian, European and East
Asian collections ever since, the reward changing from wheat to rice to gold depending on
who is telling it. India tells it about Akbar and Birbal.
The board holds \(2^{0} + 2^{1} + 2^{2} + \cdots + 2^{63}\), and there is a shortcut
hiding in that sum. Use the fact from the story, that
each square carries one
grain more than everything before it combined, and run it forwards. Add any
square to the total so far and you land one short of the
next power of two.
| square 1 | \(1\) | \(= 2^{1} - 1\) |
| squares 1–2 | \(1+2 = 3\) | \(= 2^{2} - 1\) |
| squares 1–3 | \(1+2+4 = 7\) | \(= 2^{3} - 1\) |
| squares 1–4 | \(1+2+4+8 = 15\) | \(= 2^{4} - 1\) |
| squares 1–8 | \(255\) | \(= 2^{8} - 1\) |
| all 64 squares | \(18{,}446{,}744{,}073{,}709{,}551{,}615\) | \(= 2^{64} - 1\) |
the pattern never breaks: n squares always total 2n − 1
Where the missing grain went
The \(-1\) is not a rounding fudge. It is the single grain you would need to
start a sixty-fifth square. Every doubling gets you agonisingly close to the
next power of two and always stops one grain short, which is exactly why the sum is
\(2^{64}\) minus one, and never \(2^{64}\) itself.