Algorithmic edge of Indian math

The ancient text of Sanskrit prosody, the Chandahsastra of Pingala (c 300 BCE) presents algorithms for con- verting a number to its binary form and vice versa. In Sanskrit prosody, any pada (line or foot) of a verse is analysed as a sequence of guru (long) and laghu (short) syllables, so that Pingala could essentially char- acterise it as a binary sequence. Pingala also gives an efficient algo- rithm for finding the n-th power of a number, which involves only around log2 (n) operations of squaring and multiplications (in contrast to the standard method which involves n multiplications), and was, therefore, adopted by all the later Indian math- ematicians. Pingala’s work also contains a cryptic sutra, which has been explained by later commentators, such as Halayudha (c 900 CE), as a rule for the computation of binomial coefficients using a tabular form, Meru, which is a version of the famous Pascal triangle. Pingala’s work set the stage for subsequent developments in combinatorics, which were initiated in texts of prosody and music and were formu- lated in a general mathematical set- ting by later mathematicians, Mahaviracharya (c 850), Bhas- karacharya II (b 1114) and especially Narayana Pandita (c 1356). In ancient times, ganita formed an important part of the science of astronomy (jyotisha). The Ary- abhatiya (c 499 CE) of Aryabhata is a great classical work which sum- marised the entire subject of mathe- matical astronomy in 121 aphoristic verses, of which the section on mathematics, Ganitapada, com- prised just 32 verses. We can see that, by that time, Indian mathe- maticians had systematised most of the basic procedures of arithmetic (such as place value system, the standard algorithms for square-roots and cube-roots), algebra (solution of linear and quadratic equations), geometry (standard properties of planar and solid figures), commer- cial mathematics (rule of three, cal- culation of interest) and trigonome- try, that are generally taught in schools today — and many more that are more advanced (such as the kut- taka method of solving linear inde- terminate equations and computa- tion of sine-tables) which are of importance in astronomy. Several detailed commentaries (bhashyas) were written on the cryptic verses of Aryabhatiya, of which the most important ones are those of Bhaskara I (c 629 CE) and the great Kerala astronomer Nilakantha Somayaji (c 1444-1544). The commentary of Bhaskara I pro- vides detailed explanations (along with examples) for the various results and procedures given in Aryabhatiya. The Aryabhatiya- bhashya of Nilakantha presents detailed demonstrations (upapatti, yukti). Occasionally, Nilakantha also discusses some important refinements or modifications. We may cite, for instance, Nilakantha’s discussion of the more accurate table of sines (due to Madhava), and more importantly, his famous dictum based on the latitudi- nal motion of the planets Mercury and Venus, that: “The earth is not circumscribed by their orbits (the orbits of Mercury and Venus), the earth is always outside of them.” This led Nilakantha to formulate a modified planetary model according to which the five planets Mercury, Venus, Mars, Jupiter and Saturn go around the mean sun, which in turn goes around the earth. This was nearly a hundred years prior to a similar model being proposed by Tycho Brahe in Europe. We shall not go into the contribu- tions of the long tradition of illustri- ous astronomers and mathemati- cians who followed Aryabhata — and the tradition continued to flourish till the 19th century. We instead present some illustrations to show how the algorithmic approach of the Indian mathematicians led them to discover optimal and efficacious algorithms for diverse problems. The most famous example is, of course, the Chakravala algorithm for the solu- tion of the quadratic indeterminate equation (the so called Pell’s equa- tion): X 2 – DY 2 = 1. Here, D is a given positive inte- ger which is not a square and the problem is to solve for X, Y in inte- gers. This problem (called var- gaprakriti) was first explicitly posed by Brahmagupta in his Brahmasphutasiddhanta (c 628 CE), though the ancient Sul- vasutras seem to have used the solution X=577, Y=408 for the case D=2, to get the rational approxima- tion 577/408 for the square-root of 2. Brahmagupta also gave a rule of composition (called bhavana) which allows one to obtain an infi- nite number of solutions once a particular solution is found. The Chakravala method for solving the above equation has been presented in the famous text- book of algebra, Bijaganita, of Bhaskaracharya (b 1114), though it is now known that the algorithm also appears in an earlier work by Acharya Jayadeva (prior to c 1050). Bhaskara used this method to solve 2 2 the equation: X – 61Y = 1, and showed that the smallest solution is given by X=1766319049 and Y=226153980. What is intriguing is that the same example was posed as a challenge by the famous French mathematician, Pierre de Fermat, in February 1657 to his col- leagues in France. He later posed this and other var- gaprakriti equations (with different values of D) as a challenge to British mathematicians. To cut the story short, British mathematicians Wallace and Brouncker did come up with a method of solution, which was later systematised as an algo- rithm, based on the so-called regular continued fraction development of the square-root of D, by Euler and Lagrange in the 1770s. In 1929, AA Krishnaswamy Ayyangar showed that the Cha- kravala algorithm corresponds to a so-called semi-regular continued fraction expansion and is also opti- mal in the sense that it takes much fewer steps to arrive at the solution than the Euler-Lagrange method. It is now known that on the average the Euler-Lagrange method takes about 40 per cent more number of steps than the Chakravala. Finally, we make a brief mention of the infinite series for Pi (the ratio of the circumference to the diameter of a circle) discovered by Sangamagrama Madhava (c 1380-1460), founder of the Kerala School of Astronomy. For instance, Madhava presents the fol- lowing series (the so-called Gregory- Leibniz series rediscovered in the 1670s): Pi/4 = 1 – 1/3 + 1/5 – 1/7 +… However, Madhava is not con- tent with merely enunciating this elegant result, as it is not of any use in actually calculating the value of Pi. Summing say 50 terms in this series does not give a value of Pi accurate even to two decimal places. The famous verses of Madhava which present the above series also go on to give a set of end-correction terms which can be used to obtain better approxima- tions. Using only 50 terms of the above series, with the accurate end-correction term of Madhava, leads to a value of Pi accurate to 11 decimal places. Madhava also used these correction terms to transform the above series into more rapidly convergent versions. Systematic proofs of all the infinite series dis- covered by Madhava and their transformations may be found in the famous Malayalam work Ganitayuktibhasha (c 1530) of Jyeshthadeva. The great astronomer Nila- kantha was a third generation dis- ciple of Madhava and the tradition of Kerala School continued (albeit at a modest level due to the greatly disturbed political situation of Kerala after the 1550s) till early 19th century. However, a century later, the algorithmic approach of Indian mathematics was in evi- dence again in the work of another great mathematician, Srinivasa Ramanujan (1888-1920), who seems to have been a worthy suc- cessor of Madhava in his extraordi- nary felicity to work with infinite series and their transformations.

(MD Srinivas is the chairman of Centre for Policy Studies, Chennai)

mdsrinivas50@gmail.com

Author: myscuddy

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.