The ruins of Nalanda iStock
Science & Technology

Book Excerpt: Of algorithms we use and a small town in Bihar

A new book chronicles the history of the ancient Buddhist university and its countless gifts to humanity

Abhay K

Based on Xuanzang’s account, Nalanda Mahavihara had an observatory tower, which could have been used to track the movement of the celestial bodies and calculate time accurately.

Pataliputra (Patna), was the place of congregation of the mathematicians in India since the early fifth century. The famous Indian mathematician and astronomer Aryabhata (476-550 CE) was thought to have lived in Patliputra, modern Patna in Bihar and studied and taught at Nalanda. His work, Aryabhatiya produced the first systematic compilation of Indian mathematical and astronomical knowledge in thirty-two Sanskrit verses covering arithmetic, squares, cubes, square roots, cube roots, triangles, the properties of a circle, algebra, fractions, quadratic equations, spherical trigonometry and sines as well as the decimal system with place value.

‘His extensive calculations and observations enabled him to calculate the value of pi–3.1416 –to the fourth decimal point.’

‘The ease of making calculations using this system had direct implications for astronomy and allowed Aryabhata to calculate the movements of the planet, eclipses, the size of the earth and, astonishingly, the exact length of the solar year to an accuracy of seven decimal points. Aryabhata correctly concluded, a full thousand years before Copernicus and Galileo, that the earth rotates about its axis daily, and that the apparent movement of the stars is a relative motion caused by the rotation of the earth, contrary to the prevailing view that it was the sky that rotated.’

A hundred years later Brahmgupta, the author of the Brahmasphuṭasiddhanta, corrected and improved the work of Aryabhata, treating the zero symbol as a number just like the other nine, rather than merely as a void or an absence, and developed rules for using zero with other numbers. Brahmasphuṭasiddhanta was translated into Arabic in the eighth century and became widely known as Sindhind.

Nalanda’s impact in the field of mathematics and astronomy was particularly significant in China as Amartya Sen notes: ‘Several Indian mathematicians and astronomers held high positions in China’s scientific establishment.’

Amartya Sen further elaborates, ‘One of the connections on which evidence of intellectual connections between China and India is plentiful is the impact of Buddhists in general, and of adherents of Tantric Buddhism in particular, on Chinese mathematics and astronomy in the seventh and eighth centuries, in the Tang period. Yiing, who was a student of Nalanda was one of the many translators of Tantric texts from Sanskrit into Chinese. Tantrism became a major force in China in the seventh and eighth centuries and had followers among Chinese intellectuals of the highest standing. Since many Tantric scholars had a deep interest in mathematics (perhaps connected, at least initially, with Tantric fascination with numbers), Tantric mathematicians had a significant influence on Chinese mathematics as well.’

Tantric Buddhist monk, Chinese Tantrist I-Hsing or Yi Xing (672–717 CE), the greatest Chinese astronomer and mathematician of his time, acquired great expertise in Indian writings on mathematics and astronomy, dealt with a variety of analytical and computational problems, particularly those concerned with calendrical calculations and even constructed, on imperial order, a new calendar for China in which Indian astronomers located in China were particularly involved and made a good use of the progress of trigonometry.

‘This was also about the time when Indian trigonometry was having a major impact on the Arab world (with widely used Arabic translations of the works of Aryabhata, Varahamihira, Brahmagupta and others), which would later influence European mathematics as well, through the Arabs’.

Beckwith writes in his book Warriors of the Cloisters that Yahyā ibn Khālid ibn Barmak (r. 786–803; d. 805), from the prominent Barmakid family who were hereditary Buddhist leaders (Pramukhs) of Kashmiri descent from Balkh, Afghanistan, the famous vizier of Harun al-Rashid, introduced Indian learning into the Arab world in the second half of the eighth century by bringing Sanskrit scientific books from India, along with Indian scholars to help translate them into Arabic. Under his direct, personal patronage, major works of Indian science were thus translated into Arabic in Baghdad. The works translated from Sanskrit included: The Brahmasphuṭasiddhanta (written c.628 CE) of Brahmagupta, which was the most advanced work of Indian astronomy available in the eighth century. It was translated into Arabic by al-Fazārī in 770 or 772, during the reign of the caliph al-Mansur (r.754–775), and became known as the Sindhind. It introduced Indian mathematics to the Arabs. Later philosopher and mathematician Muhammad ibn Musa Khwarizmi (780-850), who was from Persian-speaking Central Asia, translated the works of Aryabhata and Brahmagupta into clear Arabic prose. His most famous work titled The Compendious Book of Calculating by Completion and Balancing, According to Hindu Calculation, popularly known as Kitab al-Jabr became known as algebra. His sine table also derives from the trigonometrical chapter of the Sindhind. The Sindhind itself was reworked several times, most importantly by al-Khwarizmi, who based his Zīj al-Sindhind on it but ‘Ptolemaicized’ the Indian system and made accessible the Indian innovations, such as linear and quadratic equations, geometrical solutions, tables of sines, tangents and co-tangents, to all.

Khawarizmi’s name got associated with algorithm, an Indian idea that he introduced to the Arab world and subsequently to the west. The sources for Al-Khwarizmi’s book on Indian numerals and mathematics using them, which is now known as the Liber Algorithmi, were translated into Arabic at this time, which included explanation of the use of the zero, rules for basic decimal system mathematics using Indian numerals and how to perform operations with fractions, including sexagesimal fractions, which were used in astronomical calculation.

Excerpted with permission from Nalanda: How it Changed the World@2025Penguin