Rice on a Chessboard - Exponential Numbers

Updated on October 10, 2018
David3142 profile image

I am a former maths teacher and owner of Doingmaths. I love writing about maths, its applications and fun mathematical facts.



Rice on a Chessboard - An Exponential Story

This is a story about a chessboard, a game of chess and the incredible power of exponential numbers.

Ambalappuzha Sri Krishna Temple

Ambalappuzha Sri Krishna Temple
Ambalappuzha Sri Krishna Temple | Source

At the Ambalappuzha Sri Krishna Temple in South India is a Hindu temple built some time during the 15th-17th century which today has a very curious tradition, with an even more curious story behind it.

All pilgrims to the temple are served a dish known as paal payasam, a sweet pudding made of rice and milk. But why? The tradition has some very mathematical origins.

The Legend of Payasam at Ambalappuzha

Once upon a time, the king who ruled over the region of Ambalappuzha was visited by a travelling sage, who challenged the king to a game of chess. The king was well known for his love of chess and so he readily accepted the challenge.

Before the game started, the king asked the sage what he would like as a prize if he won. The sage, being a travelling man with little need for fine gifts, asked for some rice, which was to be counted out in the following way:

Give me one grain of rice on the first square of this chessboard, then two grains on the second square, four grains on the third square, eight grains on the fourth square and so on, so that each square contains double the amount of rice of the previous square.

Now the king was taken aback by this. He had expected for the sage to request gold or treasures or any of the other fine things at his disposal, not just a few handfuls of rice. He asked the sage to add other things to his potential prize, but the sage declined. All he wanted was the rice.

So the king agreed and the chess game was played. The king lost and so, being true to his word, the king told his courtiers to collect some rice so that the sage's prize could be counted out.

The rice arrived and the king started counting it out onto the chess board; one grain on the first square, two grains on the second square, four grains on the third square and so on. He completed the top row, putting 128 grains of rice on the eighth square.

He then moved onto the second row; 256 grains on the ninth square, 512 on the the tenth square, then 1024, then 2048, doubling each time until he needed to put 32 768 grains of rice on the last square of the second row.

The king now started to realise that something was amiss. This was going to cost more rice than he had originally thought and there was no way he would be able to fit it all onto the chessboard, but he continued counting. By the end of the third row, the king would have needed to put 8.4 million grains of rice down. By the end of the fourth row, 2.1 billion grains were needed. The king brought his best mathematicians in, who calculated that the final square of the chessboard would require more than 9 x 10^18 grains of rice (9 followed by 18 zeroes) and that in total the king would be required to give 18 446 744 073 709 551 615 grains to the sage.

The first four rows of the chessboard

It was at this point that the sage revealed himself to be the God Krishna in disguise. He told the king that he did not have to pay him his prize all in one go, but instead could pay it over time. The king agreed to this and that is why to this day, pilgrims to the Ambalapuzzha temple are served paal payasam as the king continues to pay his debt.

How much rice was this?

The total number of grains of rice needed to fill the chessboard would have been 18 446 744 073 709 551 615. This is more than 18 quintillion grains of rice which would weigh approximately 210 billion tonnes and would be enough rice to cover the entire country of India with a metre high layer of rice.

To put this into perspective, India currently grows approximately 100 million tonnes of rice per year. At this rate it would take over 2 000 years to grow enough rice to pay the kings debt.

Rice on a Chessboard - An Exponential Story

The Maths Part

In case you were wondering how the numbers in this article were calculated, here's the maths part.

The number of grains of rice on each square follows the following pattern; 1, 2, 4, 8, 16, 32, 64 etc. These are the powers of two (2 = 2, 4 = 2 x 2, 8 = 2 x 2 x 2 etc). With a little closer investigation we can see that the first square is 2^0, the second square is 2^1, the third square is 2^2 and so, giving us an nth term of 2^(n-1). This means that for any particular square on the chessboard, we can work out how much rice is needed by doing two to the power of one less than the square's position. E.g. the 20th square contains 2^(20 - 1) grains of rice which equals 524 288.

To work out how many grains are needed in total, we could work out each square and add all 64 squares together. This would work, but would take a very long time. The quicker way is by making use of the following quirk of powers of two. Starting at the beginning, if you add consecutive powers of two together, you will notice that your total is always one short of the next power of two. E.g. the first three powers of two, 1+2+4 = 7 which is one below the next power, 8. 1+2+4+8 = 15 which is one below the next power 16. This can be proven to be true for all powers of two and by using this we get that the total number of grains on the chessboard is (2^64)-1 which gives the total quoted above.

Questions & Answers


      0 of 8192 characters used
      Post Comment

      No comments yet.


      This website uses cookies

      As a user in the EEA, your approval is needed on a few things. To provide a better website experience, owlcation.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

      For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://maven.io/company/pages/privacy

      Show Details
      HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
      LoginThis is necessary to sign in to the HubPages Service.
      Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
      AkismetThis is used to detect comment spam. (Privacy Policy)
      HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
      HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
      Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
      CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
      Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
      Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
      Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
      Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
      Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
      Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
      VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
      PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
      Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
      MavenThis supports the Maven widget and search functionality. (Privacy Policy)
      Google AdSenseThis is an ad network. (Privacy Policy)
      Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
      Index ExchangeThis is an ad network. (Privacy Policy)
      SovrnThis is an ad network. (Privacy Policy)
      Facebook AdsThis is an ad network. (Privacy Policy)
      Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
      AppNexusThis is an ad network. (Privacy Policy)
      OpenxThis is an ad network. (Privacy Policy)
      Rubicon ProjectThis is an ad network. (Privacy Policy)
      TripleLiftThis is an ad network. (Privacy Policy)
      Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
      Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
      Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
      Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
      ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
      Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
      ClickscoThis is a data management platform studying reader behavior (Privacy Policy)