The wheat and chessboard problem explained
One grain on the first square, two on the second, four on the third: it sounds like nothing, and that is the point of the legend. Doubling starts small and ends beyond imagination. Here is the story, the mathematics behind it and why the second half of the chessboard matters far beyond the game.
The legend
A wise man invents the game of chess and shows it to his king. The king, delighted, tells him to name his reward. The inventor asks for grain: one grain on the first square of the chessboard, two on the second, four on the third, and on every square twice as many as on the square before, all sixty-four squares. The king laughs at such a small request and orders it paid at once. A few days later his treasurers come back pale: there is not enough grain in the kingdom, nor in the world. The story is told of an inventor often called Sessa and of Indian or Persian kings, with wheat or with rice; in a South Indian version the guest is the god Krishna in disguise, and the temple of Ambalappuzha still serves rice pudding to pilgrims to pay off the debt.
One square at a time
Square 1 holds 1 grain, square 2 holds 2, square 3 holds 4, square 4 holds 8. Square k holds 2^(k−1) grains: a power of two. Square 10 holds 512, square 20 holds 524,288, square 30 over half a billion. The last square, the sixty-fourth, holds 2⁶³ = 9,223,372,036,854,775,808 grains, more than nine quintillion. On a real board the first few squares fit their grains easily; around square 11 a thousand grains already form a heap that covers the square.
The sum of the whole board
Add the squares up: 1 + 2 = 3, 1 + 2 + 4 = 7, 1 + 2 + 4 + 8 = 15. Each total is one less than the next power of two, so the first k squares hold 2^k − 1 grains, and the whole board 2⁶⁴ − 1 = 18,446,744,073,709,551,615. A short proof: call the sum S = 1 + 2 + … + 2⁶³. Then 2S = 2 + 4 + … + 2⁶⁴, and subtracting S leaves 2⁶⁴ − 1. The same trick works for any geometric series, a sum where each term is the one before times a fixed factor r: 1 + r + r² + … + r^(n−1) = (rⁿ − 1)/(r − 1).
How much grain that is
A grain of wheat weighs about 45 milligrams. Half the board, 32 squares, holds 4,294,967,295 grains, about 193 tonnes: several truckloads, a fortune but within a king's means. The whole board holds about 830 billion tonnes. The world harvests about 800 million tonnes of wheat a year, so the inventor's reward is more than a thousand years of the whole world's harvest. Piled up, it would make a heap about 6 kilometres high and 25 kilometres across. In rice, at about 20 milligrams a grain, it is still about 370 billion tonnes.
Every square beats all the ones before
Because the first k squares hold 2^k − 1 grains and square k + 1 holds 2^k, each square holds exactly one grain more than all the squares before it put together. That is the real surprise of doubling. When half the board is done, the king has paid less than a billionth of what he owes; the last square alone is half of the whole debt. Any process that keeps doubling behaves this way: most of what it will ever produce comes in its last few steps.
The second half of the chessboard
Ray Kurzweil, in his 1999 book The Age of Spiritual Machines, called the moment when doubling leaves everyday scales behind the second half of the chessboard. Computer chips doubled their transistors about every two years for decades, and the steps of the second half brought far bigger changes than all those before. Doubling also explains why a pond half covered by a water plant that doubles every day will be fully covered tomorrow, why compound interest makes old savings grow so fast, and why an epidemic that looks small can overwhelm hospitals within weeks.
Doubling in everyday life
The rule of 70 estimates how long something takes to double: divide 70 by its growth rate in percent. At 7 % a year that is about ten years, at 2 % about 35 years. Ten doublings multiply by 1,024, twenty by about a million, thirty by about a billion. Fold a sheet of paper 0.1 millimetres thick in half 42 times, if you could, and the stack would reach past the Moon. In computing, 2⁶⁴ is the number of values a 64-bit number can take, so 18,446,744,073,709,551,615, the grains of the whole board, is the largest 64-bit unsigned integer.
Explore it
Open Wheat and Chessboard to watch the board fill square by square on a wooden chessboard, with loose grains on the first squares and, on the later ones, heaps beside things of about their height, from a coin and a car to the Eiffel Tower and the Matterhorn, while a scale of powers of ten climbs past a bag, a sack, a truckload and a ship to the world's harvest of a year and the whole board. Switch between wheat and rice and read the weight, the world harvest time and the height of the heap as you go.
Frequently asked questions
How many grains are on the chessboard in the wheat and chessboard problem?
18,446,744,073,709,551,615 grains, or 2⁶⁴ − 1. Square k holds 2^(k−1) grains, so the 64 squares together hold one less than 2⁶⁴.
Who first told the story?
Its oldest written form is in the biographical dictionary of the historian Ibn Khallikan, written in 1256, where it is told of the inventor of chess and an Indian king. Dante alluded to the doubling of the chessboard around 1320 in his Paradiso, and the story has been retold in many lands since.
What is the second half of the chessboard?
A phrase coined by Ray Kurzweil for the point at which something that keeps doubling becomes enormous. On the board, the first 32 squares hold about 4.3 billion grains, while the next 32 hold over four billion times as many.
Would the board fit in a granary?
No. About 830 billion tonnes of wheat would fill more than a thousand cubic kilometres; piled up, it would make a heap about 6 kilometres high. It is more than a thousand years of the world's wheat harvest.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Open Wheat and Chessboard