Category Archives: Indian History

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.