Tuesday, March 12, 2013

The circle that danced: The story of Pi

Madhava was a troubled man. He mumbled to himself. He was pacing up and down his house muttering angrily. Something was eluding this Malyalee that nobody understood.  (People from the state of Kerala, in South India are often called "Malyalees") The fact that he mumbled to himself was quite well known in that household. All the children in that traditional "naal-kettu" (house with a courtyard) sometimes giggled in the background at this eccentricity. But not loudly. For Madhava can suddenly stop his pacing and give that angry glare of his, another well-know trait, which can strike fear in any child. 
Every once in a while, people would see him suddenly dart into his room. Nobody knew what he really did there, because he was quite an intense, private person who  had resigned himself to the fact that nobody understood him. Only a few trusted and loyal students, knew what he did there. They were privy to his work: he would scribble some notes on "ola" (coconut leaf) which was the medium for writing in ancient Kerala. He was a mathematician and an astronomer; terms that the ancient people had not fully understood or defined.
Everything keeps moving in Kerala. Every leaf trembles. Each and every branch sways. In Kerala, there is always movement all around. It was Nature's way of teaching the concept of iteration (cyclic repetition and re-examination) to this mathematician, Madhava; who often used  such a device in his work. However, during sunsets, the effervescence due to these natural iterations dies down a little bit.
The quiet hush of a Kerala twilight comes in quickly in the evening. The dappled shadows of the gently swaying trees that shrouded the horizon soon morphs into darkness. It is almost akin to the sudden sunset in a valley: For the thick greenery which enveloped every horizon around any given space in Kerala was akin to being inside a valley; a valley of thick, ever-moving greenery.

Madhava paused his pacing as he saw the silhouetted giggling children prancing in the traditional Kerala house courtyard that evening.
A child came with a lamp. "Deepam, Deepam, Deepam"  ... she chanted as she carefully manoeuvred  into the courtyard, with one palm gently shielding the flickering flame on the lamp from the evening breeze.
That traditional chant  "lamp, lamp, lamp ... " echoed around the house. 
It was a warning to  the demons: Darkness will not conquer that household. The lamp will now serve the purpose of throwing light into that house making the dusk really beautiful.
The child kept the lamp right at the centre of the courtyard. Seeing this, all the cousins came rushing towards it; throwing long shadows all around the courtyard. There were many children in that large household. They were a joint family ... As if on cue, the children formed a circle around the lamp and bowed respectfully to the lamp, moving together in rhythm. They did this most evenings, as a ritual.

That evening, however, was different. 
The children's excitement could not be contained. For just a few days back the festival of Onam had just ended and they were all mesmerised by a dance they had seen the women-folk performing. Onam was the festival where the much beloved mythical Kerala king, Mahabali is said to visit every household in Kerala. Malyalees believed that Mahabali was so close to them that he wanted to ensure that they were doing well at least once a year. That was Onam. The legend of Mahabali is yet another story, which I will not get into as that would be a digression from this quaint little story that unfolded that evening.

The children had seen many ladies perform the traditional "kai kotti kalli" (Literal translation: a play involving clapping of hands) during the festival. And they had confabulated among themselves to perform that dance that evening. The dance started with the ladies gathering in a circle around a lamp, gracefully stepping back to form a circle; and dancing around the lamp in a curious rhythmic fashion.
That is what the children did. They started this dance. As there were no photographers around to capture that event that day, here is the video from YouTube which shows such a dance performed by ladies. The tradition continues even today by many women-folk of Kerala, especially during Onam.





Madhava stood transfixed as he witnessed the little children dancing. The children had learnt every step of the dance, and he saw them stepping a few steps in one direction (clockwise) around the lamp, and then turn back and step in the opposite direction (counter-clockwise) Every now and then they would clap their hands in rhythm to the song they were singing. The clapping gave a momentary pause in the dance so that every dancer could correct herself and catch up, in case there were errors. Every once in a while, they would step towards the centre of the circle, the lamp; and then step back once again to resume the iterations around the lamp.

If one could only capture the smile that slowly occupied Madhava's stern face... It would have captured that very moment when Madhava got enlightened. His smile was brighter than the lamp in the courtyard. He chuckled as he ran into his room to scribble some more notes into his "ola"

The original "ola" written by Madhava was lost in time. Luckily, some of the students had preserved the work in their own notes. Subsequently, many scholars pored over Madhava's work and they have been wonderstruck for quite sometime now. He was possibly the first mathematician who discovered a remarkably accurate method to calculate the value of Pi.  

In Madhava's text, they saw a series written down and they were mystified why one term was a negative -- going in one direction, and the other one was a positive one -- going in the other direction, and the entire series kept stepping rhythmically in that fashion into an infinite series. They were most mystified by the fact that once in a while, the series corrected itself; eventually rendering the value of Pi with amazing accuracy. 

Many centuries later; something called the Internet happened in this world and a website on the Internet gave the essence of these scholars' interpretation of Madhava's work. I now quote the appropriate section of Wikipedia verbatim below. 
It seems they are still not sure how Madhava managed to write the equation for Pi. Moreover, they still are not sure how Madhava got the correction terms. Maybe if they were present that evening at Madhava's household witnessing the little children dance in the courtyard, the Wikipedia entry would have been different.

Start of quote:

Madhava's work on the value of π is cited in the Mahajyānayana prakāra ("Methods for the great sines"). While some scholars such as Sarma feel that this book may have been composed by Madhava himself, it is more likely the work of a 16th century successor. This text attributes most of the expansions to Madhava, and gives the following infinite series expansion of π, now known as the Madhava-Leibniz series:
\frac{\pi}{4} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \cdots + \frac{(-1)^n}{2n + 1} + \cdots
which he obtained from the power series expansion of the arc-tangent function. However, what is most impressive is that he also gave a correction term, Rn, for the error after computing the sum up to n terms. Madhava gave three forms of Rn which improved the approximation,namely
Rn = 1/(4n), or
Rn = n/ (4n2 + 1), or
Rn = (n2 + 1) / (4n3 + 5n).
where the third correction leads to highly accurate computations of π.
It is not clear how Madhava might have found these correction terms.The most convincing is that they come as the first three convergents of a continued fraction which can itself be derived from the standard Indian approximation to π namely 62832/20000 (for the original 5th c. computation, see Aryabhata).
He also gave a more rapidly converging series by transforming the original infinite series of π, obtaining the infinite series
\pi = \sqrt{12}\left(1-{1\over 3\cdot3}+{1\over5\cdot 3^2}-{1\over7\cdot 3^3}+\cdots\right)
By using the first 21 terms to compute an approximation of π, he obtains a value correct to 11 decimal places (3.14159265359). The value of 3.1415926535898, correct to 13 decimals, is sometimes attributed to Madhava, but may be due to one of his followers. These were the most accurate approximations of π given since the 5th century
The text Sadratnamala, usually considered as prior to Madhava, appears to give the astonishingly accurate value of π =3.14159265358979324 (correct to 17 decimal places). Based on this, R. Gupta has argued that this text may also have been composed by Madhava.