Calculator And Computer Technology User Service with Hartley Hyde [email protected] An Old Tale If we consider the number of grains on each square and the accumulated total we can construct the following Excel 5 spreadsheet. I asked my class to consider the following story, based on an extract from Kasner and Newman's Mathematics and the Imagination, which describes adding wheat grains to a chess board. I chose to use rice because my students were more likely to find rice in their home pantry. The Grand Vizier Sissa Ben Dahir was granted a boon for hav ing invented chess for the Indian King, Shirhâm. Since this game is played on a board with 64 squares, Sissa addressed the king: “Majesty, give me a grain of rice to place on the f irst square, and two grains of rice to place on the second square, and four grains of rice to place of the third square, and eight grains of rice to place on the fourth, and so, Oh, King, let me cover each of the 64 squares of the board.” The students were asked to find how much grain Sissa was talking about and to describe this is more meaningful terms. Karen and Lisa counted and weighed 100 grains of rice and then they weighed a metric cup (250 ml) of rice. From this they found that a metric cup holds about 11 300 grains. Because the grains are ellipsoidal, the number varies with how much the cup is shaken as it is filled. Assuming that a cup of rice would feed one person for a day, they hoped to find how many days the rice would feed all the people of India. They found that there would be enough rice to sustain the present world population for over seven hundred years! Karen and Lisa weigh a cup of rice Spreadsheet 1 To build this spreadsheet, use the first row for titles and enter 1 in the three cells of Row 2. The cells of Row 3 each contain a formula: A3 = 1 + A2, B3 = 2 * B2 and C3 = C2 + B3. We then select these three cells and copy them down to Row 65 as shown above. Clearly there are 2n-1 grains on the nth square and 2 n–1 grains have accumulated. Thus when the task is completed there should be 264–1 grains on the board. Karen and Lisa found that the average weight of a grain of rice is 0.00198 gram. This means that Sissa was describing 3.653 × 1010 tonne of rice. The students quickly realised that the chess board would long since have disappeared and some rice would have drifted off the board. Suppose it drifted evenly across the land masses of the earth. The rice would cover the surface to a depth of 2.7 metre. Knowing that rice swells as it absorbs water we did not trouble to calculate the effects of tipping the rice into the oceans. This much rice is certainly more than Shirhâm had to offer. Several students were disappointed that the larger numerals of the first spreadsheet were expressed in scientific notation using the E format: they wanted to know the exact value of 264–1. One student did the calculation by hand and probably spent less time than some of the other students whose efforts are described on this page. Using the first spreadsheet, select the cells of Columns B and C, choose the Format Menu and selected a number format with zero decimal places. At first glance it appears that we have obtained an exact value. However, on closer inspection (Spreadsheet 2) we find that the values beyond the fiftieth square have been rounded to fifteen significant figures. I guess the good folk at Microsoft think that this should be enough to calculate the boss’s income for the foreseeable future. Spreadsheet 2 And so began the search for a spreadsheet which allowed the calculation of more significant figures. We acquired Excel 98 but despite a number of interesting improvements, there has been no change of precision. An Apple dealer recommended WingZ, but although it claimed 64 digits, fifteen figures was the best we could conjure from it. Eventually we tried Microsoft Works 2 on a Mac Plus and the result is shown on the third spreadsheet. Works 2 has calculated precisely up to cell B64 and has made an error when adding B64 to C63. It then admits defeat when asked to find C65 which has twenty significant figures. At any rate, this was close enough to find that 264–1 = 18 446 744 073 709 551 615 by doing one pencil and paper addition. The real limitation is determined at a binary level. The version of Works 2 written for the eight-bit 8088 machines overflows at 232 and we have seen that the version written for the sixteen-bit Mac Plus overflows at 264. Clearly the code for both versions used four memory locations to store the value of each cell. The software then performs multiple-precision arithmetic on all four locations whenever the value of a cell changes. Why, I wonder, do later versions of Works follow the Excel policy of rounding to only fifteen significant figures? Spreadsheet 3 This type of thinking led us to explore some simple multiple precision arithmetic using two cells to store each value of the spreadsheet. In Spreadsheet 4, Columns A and B are the same as those of Spreadsheet 2. We can then used Columns C and D to perform some very simple 12-digit multiple-precision doubling. Down to Row 41, Column D is the same as Column B, but in Row 42, the thirteenth digit must overflow into Column C. To do this we change the following cells: C42 = 2*C41+((2*D41)>10^12) and D42 = 2*D41–10^12*((2*D41)>10^12) The key to understanding these entries is the boolean expression (2*D41)>10^12. If this expression were allocated its own cell it would appear as either ‘True’ or ‘False’ but, when it is incorporated in a more extensive expression, it takes the value 1 when ‘True’ and 0 when ‘False’. Thus, if doubling the value in D41 exceeds the 12-digit limit, the value in C42 is increased by 1 and the value in D42 is decreased by 10 12. These cells are then copied down to Row 66 to give us an accurate value of 264. All of the cells have been given a (# ##0) number format so that the digits are grouped in threes. This helps us to see where the leading zeros are missing in Column D. And so we were able to find 264 precisely, but it was Karen and Lisa who helped us understand how large this number is. Reference: Kasner, E. and Newman, J., 1949, Mathematics and the Imagination, London: G. Bell and Sons, Ltd.
© Copyright 2026 Paperzz