Category Archives: Mathematics

Probability Theory, Gambling and the Mahabharata

I was recently listening to lectures from a Yale course on financial markets. I was pleasantly surprised to find the instructor mentioning (Lecture 2, first 10 minutes) the occurrence of concepts from probability theory in Mahabharata, specifically in the story of Nala and Damayanti (nalopAkhyAna). The instructor only makes a passing reference to the story. In this blog post, I will elaborate and make explicit the connections between probability theory and gambling as understood by ancient Indians, a couple of thousands of years before the European Age of Enlightenment.

The specific instance he referred to was where Nala, incognito in the service of King RituparNa, trades his skill as a charioteer for instruction in the art of gambling from Rituparna. Earlier in the story, Nala- a righteous king with a serious weakness for gambling, gambled away to his brother, everything he had, resulting in his present predicament.  At a crucial point in the story, King Rituparna needs to ride fast on his chariot to get to Damayanti’s swayamvara in the capital city of the Vidarbha kingdom within a day. His servant Nala, disguised as VAhuka in his agnAtavAsa , has his own motive behind going with Rituparna, as he wishes to be reunited with Damayanti who was his wife before becoming separated during the exile. King Rituparna was apparently highly skilled in gambling. When Rituparna thus sought Nala’s favor, Nala saw in it an opportunity to learn about gambling from the king. A literal reading of nalopAkhyAna tells us that what Nala sought and what Rituparna offered was skill in numbers/estimation (sankhyAna). However, consider the context- after they reached Vidarbha, etc., Nala sought a rematch with his brother and won back whatever he had lost, remarrying Damayanti ending the story with a ‘happily ever after.’ Heck, the entire context in which Nala’s story appears in Mahabharata is as a story narrated to Yudhishtira telling him that there is a precedent to his actions of gambling away one’s privileges. Thus we can conclude that the author intended a connection between sankhyAna and gambling. By extension, the people of ancient India may have understood the connections between sankhyAna, i.e., mathematics/probability theory/combinatorics, and gambling. Rituparna says to Nala at one point,

अक्ष- root word referring to dice, सङ्ख्याने – numbers

“Knowledge I possess of the game of dice, thus is my skill in numbers”

It is well known among historians that the relation between gambling, counting, and by implication probability [edit. typo] theory was not known until the 14th or 15th century (ref. ‘Drunkard’s Walk’ by Leonard Mlodinow).The eccentric polymath Gerolamo Cardano (who is also famous for his closed form solution to certain cubic polynomial equations, recall, for example 9th/10th standard Karnataka State syllabus 😉 ) was in all likelihood the first person to study gambling from a mathematical perspective in the 16th century.  His exposition on games of chance introduced the mathematical concept of probability. Subsequently, the other stalwarts of mathematics and science- Fermat, Pascal, and Huygens rediscovered (or reinvented, depending on how you view mathematics) the basics of probability theory.

Back to ancient India. Gambling plays an important role in our Puranic and historical stories. One of the significant events in Mahabharata is Yudhishtira getting fubar after agreeing to a game of dice against the Kauravas who have Shakuni on their side. Shakuni has a pair of dice made from his own father’s [edit.] bones, which are magical, or using more prosaic terminology- loaded. Gambling also plays a role in Puranic stories and subsequent Sanskrit literature.

Now back to nalopAkhyAna. Continuing where we left off, King Rituparna decides to teach the art (science) of gambling to Nala, aka VAhuka. Here’s where the most interesting part comes. Nala asks King Rituparna to teach him numerical skills. What is intriguing is the example chosen by Rituparna for imparting his skills. King Rituparna points to a Vibhitaka tree, and says that he is capable of estimating the number of leaves and fruits on the tree without actually counting them. This is where I hope the reader will join me on a leap of faith. This kind of sankhyAna was/is apparently a common skill among farmers who routinely estimate the number of crops, fruits, etc. However, what is curious is that this skill is imparted to Nala who was clearly seeking knowledge about how to gamble. This kind of estimation is clearly a problem in statistical estimation/statistical sampling, and has explicit connections with combinatorics and probability. I am not saying that ancient Indians knew everything about probability- just that they may have understood that combinatorics/probability could be used to study gambling systems. This way, they had used unsophisticated, rudimentary, combinatorics/probability/statistics in a way no one did till 17th-century-enlightenment-era-Europe.

According to nalopAkhyAna, King Rituparna estimated accurately, the number of leaves to be panchakoti, which can be translated as fifty million. The number of fruits were estimated to be 2095. The accuracy of these numbers is unimportant to the purpose of this blog post, for two reasons- 1) panchakoti may be a poetic exaggeration, (2) the poet/author may likely have not been skilled in numbers to provide reliable information about this. The ability to estimate large numbers from a few measurements is in a sense, equivalent to understanding the behavior of a gambling situation from experimental trials and probabilities. This equivalence is good to the extent of what can be inferred from nalopAkhyAna 🙂


Verses from nalopAkhyAna that talk about this episode

Above is a snippet of Sir Monier Monier-Williams’ version of nalopAkhyAna ‘Story of Nala’. It contains the relevant verses in Sanskrit and their English translations. Enjoy!


Below is an inadequate explanation of the leaf-counting episode, IMO this is quite sucky! It is by an Indic scholar from the 1900s.

Some Indic scholars understanding of the episode.


1. Leonard Mlodinow, Drunkard’s Walk: How Randomness Rules Our World, Pantheon, 2008.

2. Sir Monier Monier-Williams, Story of Nala, late 1800s/early 1900s.

3. George A. Grierson, Guessing the Number of VibhITaka SeedsThe Journal of The Royal Asiatic Society for 1904, pp. 355-356, 1904.

Fighting over the Nature of the Indus Valley Symbols

The most competent research is usually done by the scientist with the best right hook and feint.

If you are talking about research related to the Indus Valley symbols, that is.

A Brief Introduction

As most of us know, the Indus Valley civilization existed for more than half a millennium, about 4500 years ago. They were a rather sophisticated urban peoples and left behind quite a few clues about how they lived. But not enough to settle the most puzzling questions about the ancient history of the Indian subcontinent. They suddenly disappeared, almost overnight in historic terms, after nearly 700 years of city-dwelling, over an extensive region extending from modern Af-Pak to Madhya Pradesh.

Of all the toys they left us- pottery, bricks, bath complexes, drainage systems, statuettes etc.- the most intriguing is the thousands of tablets with several symbols and illustrations.  Ever since they were excavated in late 19th century, archeologists and linguists have attempted to explain what these symbols mean.

The two most famous successes in deciphering ancient scripts have been the deciphering of the ancient Egyptian script and the Linear-B from Mycanean Greece. The key to deciphering the Egyptian script was the discovery of the Rosetta stone, a set of inscriptions which consisted of Egyptian language script written alongside their Greek translations. The Linear-B was deciphered thanks to the fact that the symbols represented a pronounciation and syntax almost identical to ancient Greek. Unfortunately for those studying Indian history, the Indus equivalent of a Rosetta stone is yet to be found. It is unlikely that a Rosetta stone will be found on this side of Af-Pak, as extensive inscriptions of Indian languages don’t occur till Asoka, a full one and a half millennia after the ancient Indus peoples disappeared. However, archeological evidence tells us that the Indus Valley civilization conducted trade with Mesopotamia and other ancient civilizations of the near-East. Perhaps, one day we will come across a tablet with the Indus symbols written alongside the languages of ancient Mesopotamia. A Linear-B type decipherment, however, can be attempted only after a few problems described in the following paragraphs are resolved.

An example of the Indus symbols.

An example of the Indus symbols.

Cutting to the Chase

The most important problem yet to be resolved concerns the fundamental nature of these symbols. Do they represent a language, say, like Devanagari, or do they represent a set of symbols, like say, a set of smileys. For over a hundred years this question had been debated the way most scientific issues are- through rigorous research and conjecturing. Recently, in 2004, a paper was published by Steve Farmer, an independent language researcher, Richard Sproat, a Professor of linguistics and EE from UIUC and Michael Witzel, an Indologist from Harvard. I first came across the paper last year about the same time, following an interesting discussion with Vishwesha who had referred me to an article that had appeared in the journal Science, on 6 June 2008.

What struck me when I first saw the paper (in Electronic Journal of Vedic Studies) by Farmer, et al., was the title, which appeared rather arrogant to me- ‘The Collapse of the Indus Script Hypothesis: The Myth of a Literate Harappan Civilization‘. From the title, I thought that the paper was perhaps a survey of all the published work thus far, and that these overwhelmingly pointed towards the fact that the Indus symbols were non-linguistic and did not representing any underlying language. As I read on I realized that the authors were talking about their own work, and proclaiming the ‘collapse’ of an opposing point of view based on their own rigorous and extensive studies. Now, I am not competent in archeology/linguistics/history to comment about the academic merit of their paper. But what disturbed me was the ad hominem attacks that were included in the paper. The paper employed no subtlety in downplaying opposing points of view, and in discrediting researchers who didn’t toe the line of the paper. The paper repeatedly linked the personal/political opinions of the authors from the opposing camp to their research. In addition to presenting arguments supporting their own work, the authors alleged that researchers who thought that the Indus valley script represents a language were motivated by their political affiliations. They repeatedly used words such as “Hindu nationalists” and “Dravidian nationalists”. I agree, the work done by some of the researchers working in that field is trash, but one should counter bad or incomplete research through logical, coherent arguments, which are not adulterated by accusations of the persons intentions. I believe that when arguing about academic work published in peer reviewed journals, it is unprofessional to question the intentions of the author, no matter how bad their research is. Such personal attacks are not permissible in the academic literature. It surprised me how this paper was published in a peer reviewed journal. Perhaps because Michael Witzel is its editor :O ?  I wonder if it does any good for the academic merit of one’s arguments to make personal accusations against other researchers in peer-reviewed journal papers!

That said, there are some on the other side of the argument who make similar allegations of ‘imperialist’ research- like N. S. Rajaram, N. Jha etc. But few people take them seriously. They are not as scholarly as Farmer, et al, and their research is far from rigorous. Add to that, the fact that their work is mostly presented in self-published books. However, with a sweeping generalization, Farmer, et al., intended their barbs to all researchers who propose that the Indus symbols represent a language. My suspicion to this effect was confirmed following recent academic backs-and-forths between the Indus-script and the Indus-non-script camps.

Conditional Entropy and the Indus Script

The reputed journal Science, on 23 April 2009, published a paper by Rajesh P.N. Rao, an Associate Professor of Computer Science at UWash, Nisha Yadav and Mayank Vahia from TIFR, Hrishikesh Joglekar, R. Adhikari from IMSc, Chennai, and the reputed linguist Iravatham Mahadevan. The paper was titled, with a humility characteristic of most academic literature, as ‘Entropic Evidence for Linguistic Structure in the Indus Script’. Any EE/CS graduate student will have enough exposure to Information Theory to understand the work presented in Rao, et al. Then again, I am not sure if I can competently judge the direct link they draw between conditional entropy and the nature of the Indus symbols. I am convinced (with some skepticism, though) by their argument that the Indus symbols represent a language. However, I believe it would have been good if Rao, et al. had included an analysis of the conditional entropy of non-linguistic symbols too, rather than just abstract symbols. It would have helped convince the archeologists/linguists to some extent, of the discriminatory ability of conditional entropy, with respect to the linguistic/non-linguistic nature of a set of symbols. The basic premise of Rao, et al. is that symbols representing languages, like say Devanagari or English, form a Markov process with a regularity and sequential order that is somewhere in between that of repetitive non-linguistic symbols (what they refer to as Type 2 non-linguistic symbols) and random non-linguistic symbols (Type 1). The paper goes on to show, as in the figure below, that the conditional entropy of the Indus symbols follows a trend similar to scripts that represent a language (like Tamil or English) rather than non-linguistic. The sequential order is captured by the modelling of symbols as a 1st order Markov process with various transition probabilities. Markov processes are basically characterized by the fact that the future state is dependent only on the present state, irrespective of the past states. Symbols of a language are often modeled as Markov processes. Languages as Markov processes(like the opening roll of Star Wars 😐 ) is the opening sequence of Claude E. Shannon’s seminal paper ‘A Mathematical Theory of Communication‘, in the sections ‘The Series of Approximations to English’ and ‘Graphical Representation of a Markoff Process’. As I understand, the conditional entropy used in the paper by Rao, et al. is the event ‘Symbol j follows Symbol i’ or ‘Symbol j occurs given Symbol i has occured’. The data used was the 417 Indus symbol corpus of Iravatham Mahadevan.

Conditional Entropies

Plot of conditional entropy of symbols of various languages. Image borrowed from the paper by Rao, et al. Science, 23 April 2009

A footnote: Entropy as you may know, is universally and simplistically speaking, a measure of disorder/uncertainty/randomness. Consider two discrete random variables X and Y. The conditional entropy is a measure of the uncertainty/randomness in choosing a value for the random variable Y, given that the event ‘X = x’ has occurred. If Y is completely determined by X, then there is no uncertainty in ‘Y given X = x’, and the conditional entropy will be zero. On the other hand, if X contains no information about Y, then ‘Y given X = x’ is  ‘Y’, and the conditional entropy is equal to the simple entropy of ‘Y’.

This is a common problem in cryptanalysis, where you try to determine if a sequence of symbols is a language.

So all’s well – an interesting paper with potentially groundbreaking work published in a reputed journal like Science, etc. Now Farmer, et al. have come up with their refutation of Rao, et al. The refutation is again characteristic of ad hominem attacks against other researchers, and the outright dismissal of  opposing viewpoints! A technicality: Farmer, Sproat and Witzel fail to note the novelty of the sequential modeling. I quote a few lines from the acerbic and rather grating refutation by Farmer, Sproat and Witzel below. Your opinions, please:

If the paper (by Rao, et al.) had been properly peer reviewed it would not have been published

Why are Farmer, Sproat and Witzel (FSW) so bellicose in defending their work? If their work has the academic merit, there is absolutely no reason for them to cry this way. I am surprised and disturbed. Is this is the kind of mudslinging that characterizes research on Indian history? Now, I am not alleging ‘imperialist’ suppression of our history,  but seriously, why do FSW write like angry little kids who have just been told that they may be wrong?

It is a matter of concern that attempts at conducting objective research about Indian history are scuttled this way- by reputed scientists like Farmer, Sproat and Witzel writing in the language of politicians.

As an EE guy, to me, Rao, et al.’s conclusions are rather convincing. Perhaps an archeologist/linguist would think otherwise. There are many who do, for criticisms of Rao, et al. please refer: Michael Libermann of UPenn, Steve Farmer’s condescension.

Here is Iravatham Mahadevan’s article in the Hindu (which was actually published as I was writing this blog).

Perhaps there are more blogs which support Rao, et al.’s work. I will put up links as and when I find them.

Moral Policing, Socialistalgia and Millikan’s Special Drops, Fussing About Speed Math and Thanks to Gowtham

Firstly, a thanks:

Many thanks to S. Gowtham for his encouragement and tagging me on his blog. 🙂 I am honored to be tagged by such a photography/net/computers/physics/ football-fan whiz as Gowtham!

Secondly, an addendum to my last blog:


The Government should realize its responsibility to safeguard the individual rights of its citizens, as guaranteed by the Constitution. The opinions of Yeddyurappa, Ghelot, Thackerey, etc. are little more than frustrated attempts seeking to subvert the Constitutional rights of the people. Such concerns for the “Indian culture”, may or may not be legitimate, according to your point of view, but they are most certainly illegal and/or un-Constitutional. Moral policing is an intrusion into the fundamental rights that the Republic of India stood for, when it was created by the visionaries of the Constituent Assembly.

Thirdly, a criticism:

Of late, I’ve seen a lot of people talking about this: . Much like today’s TV media, Sagarika Ghose presents only those facts which support her point of view. Let’s first ignore the fact that it is a personal blog, which is anyway considered as veda vakya, given Sagarika Ghose’s reputation as a journalist. If there was a rigorous framework for journalistic ethics (like there is for academic ethics) this would consitute gross malpractice, in the spirit of Robert A. Millikan’s special oil drops.


Choose your heroes.

It is an utter insult to the collective intelligence of Indians that this blog is popular. Now, like Mrs. Ghose, I would like to clarify at the outset that I don’t support the actions of Sri Rama Sene, or any other self-styled Sene (except the Indian Military 🙂 ).  But this article is too much! It is ridiculously socialistalgic (new word alert: socialist + nostalgic) about the Nehruvian utopia that India was.  After a tough decision to ignore the following…

  1. A silly Historical example about the “foreign hand” of the Portuguese in the preparation of mithai
  2. The gross generalization of the “Sex and the City” lifestyle of today’s urban youth (as opposed to the pathos of the “then” youth, whose lives were inspired by, Maxim Gorky’s works, I suppose)
  3. Authoritative descriptions of Iran’s recent socio-political history. a loud WTF for her proposition that what happened in an autocratic Iran ruled by a puppet presidency in 1970s is what is happening to India today. Sigh, media watchdogs where are you?
  4. Curious use of “rootless cosmopolitanism” – a word with a very curious, soviet, anti-semitic history, with reference to Karnataka’s “migrant workers”.  In effect, she is dismissing the “roots” of 45 million non-(Indiranagar, Koramangala, Electronic City) Karnatakians
  5. An alarmist, sensationalist, so-CNN-IBN-NDTV-TV9-AajTak’ish cry about how “Every aspect of public life that is characterized by freedom and affluence is under threat and a potential target of violence.

…I will cut to the chase and say “WTF?” about this (I quote):

Which is why the battle for freedom and the battle for progress must be a sensible and a rational one; it can’t be a trivial battle where we fling coloured underwear at maniacs. We must learn from the Nehruvians of the 40s and 50s who were incredibly westernised, but deeply rooted; many of whom were rich but lived modest tasteful lives. They drank, they smoked and they romanced, yet they were discreet and embodied a tradition of Indian elitism that was rooted in both excellence as well as tradition. C. Rajagopalachari was considered a scholar in three languages-Sanskrit, Tamil and English. Rukmini Devi Arundale may have been deeply influenced by the Theosophical Movement but dedicated her life to reviving Indian dance and music by founding the Kalakshetra academy. Sarojini Naidu’s favourite poet was Shelley but she took pride in the fact that she could speak Urdu, Telegu and Bengali. However westernized their minds, India’s nationalist elite could not be accused of living in a cocoon of extravagant privilege or having their pleasure spots guarded by armed commandos

It looks like Mrs. Ghose completely missed the point about why people are flinging pink underwear! Not surprising coming from the kind of “insight” we get from her programs on cnn-IBN. Nothing hurts a bigot more than the fact that others don’t take them seriously (eg. Freakonomics description of how KKK was brought down). It is only when people start taking bigoted idiots seriously that you feed their egos and give them legitimacy. Besides, the much derided “today’s youth” are not flinging their underwear to achieve development. They are smartly doing it only to trivialize the role of Sri Rama Sene in the society.

And what better time to get socialistalgic than when capitalists are faltering.  (let’s forget that Public Sector Companies, those pillars of socialism, never made any money; with their only significant contribution to the society being housing colonies in Bangalore, which are now generating big income for lucky old employees)

Seriously,  the upper middle class elite of the 1940s , represented by Nehru (!) and co.were in-tell-ehhhk-chual.

They read Shelley. We like P. Diddy.

They knew Telugu, Urdu and English. We live in India without knowing our own mother tongues.

They lived tasteful lives, drank tea on teak tables in their back yards, and sipped from the finest transluscent Chinaware, attended by the most sofishtikated butlerrgaLu’s and Badmashes. We? Jusht drink coffee at work places from Made in China polysterene cups. How tasteless.

Isn’t it silly to compare aam admi like you and I to Mr. J. Nehru, Rukmini Arundale, Rajaji, Sarojini Naidu and co, and make nostalgic references to the supposed elite of socialist India?  If this isn’t socialistalgia, what is? All right, we will try to emulate them… only because Mrs. Ghose has read about their lives and feels socialistalgic.

And now, you can get back to watching ibnlive… err, not quite, there is some more:

Fourthly, fussing about speed math:

Can you consider the ability to do “speed math”, a serious, extraordinary feat of mathematics? (Ref.: Discussion with my friend)

The contexts were these: [here], [here] and [funnily, here]

The person in question claims that he can mentally calculate “Factorial value of a 10 digit number”. The factorial of a ten digit number would have 10^9-10^10, i.e billions of digits. Let’s say he does calculate it. Then to write it down, it would take years. And who will have the patience to verify it? He is probably using Stirling’s approximation, which would still be a tall claim that you did (7,655,167,881^(7,655,167,881)) in your mind… Yet, we get back to the question – so what? Of what use are you to the mathematical sciences and all the other sciences and engineerings which rest on this, if you can multiply 7,655,167,881 7,655,167,881 times in your head? Try proving the Reimann conjecture instead.

Cartoon credits and courtesy:

(No offense intended. I do respect speed mathematicians for their extraordinary talent.)