Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Maths Stories › Rice on a chessboard

The chessboard and the grains of rice: the power of doubling

One grain on the first square, two on the next, then four… The king thought it was a modest reward.

  • An old Indian legend
  • told for over 1,000 years
  • India

The story

The legend says that when the game of chess was invented in India, the king was so delighted that he offered the inventor any reward. The inventor asked for rice: one grain on the first square of the board, two on the second, four on the third, and so on, doubling each time until all 64 squares were filled.

The king laughed at such a small request and ordered the rice to be brought. But the grain-keepers soon came back pale. The first row needed only 255 grains. Halfway across the board the numbers were in the billions. The last square alone needed more than nine quintillion grains.

All the rice in the kingdom, and in the world, was not enough. The legend has many versions, sometimes with wheat, sometimes ending with the king cleverly asking the inventor to count the grains himself. All of them teach the same lesson: repeated doubling grows faster than anyone expects.

Play with it

How it works, step by step

  1. 1

    Square n holds 2ⁿ⁻¹ grains: 1, 2, 4, 8…

  2. 2

    Add up the first few: 1 = 2 − 1, 1 + 2 = 4 − 1, 1 + 2 + 4 = 8 − 1.

  3. 3

    The total after n squares is always one less than the next square: 2ⁿ − 1.

  4. 4

    For 64 squares that is 2⁶⁴ − 1 = 18,446,744,073,709,551,615 grains.

  5. 5

    At about 25 mg a grain, that is roughly 460 billion tonnes of rice.

1 + 2 + 4 + … + 2ⁿ⁻¹ = 2ⁿ − 1. Doubling grows explosively.

Try it yourself

  1. 1How many grains are on the 10th square?

  2. 2How many grains are on the first 10 squares together?

  3. 3Compared with the first 63 squares together, the 64th square holds…

Did you know?

  • This kind of growth is called exponential growth. It also describes compound interest and how infections can spread.
  • Ten doublings is about a thousand times (2¹⁰ = 1,024). Twenty is about a million.
  • Folding a sheet of paper doubles its thickness each time; 42 folds would reach past the Moon.
PreviousAchilles and the tortoiseNextFibonacci’s rabbits