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 :)

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!

**Appendix**

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

References:

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 Seeds, *The Journal of The Royal Asiatic Society for 1904, pp. 355-356, 1904.