Pingala - 2nd or 3rd BC

Ever wake up one day and think, 'you know what would be a good idea? What if while trying to write poetry I accidently write the earliest form of the binary numeral system, and simultaneously find the pattern for Pascal's triangle and Fibonacci sequence?' No?
Well, Acharya Pingala was a poet/mathematician who did all three while writing the Chhanda Shastra, which was the earliest known treatise on Sanskrit prosody. While analysing the complicated world of Sanskrit and investigating how many beats there can be in each shloka (or line) for there to be a repeated rhythm, Pingala found a version of the binary numeral system. Where he used light (laghu/ लघु स्वर) and heavy (guru/गुरु स्वर) rather than 0 and 1 (because it fit the context of poetry better) to describe the syllables. The image below helps understand how close Pingala was to the modern binary system used today:

The question that probably arises is how did Pingala use the binary number system in poetry? To fully understand that, we have to first understand what he was doing. Pingala was trying to see how many different arrangements of laghu and guru you could have in a quarter of Bhavani ashtakam (a type of poem form) which consists of 12 letters. For a quarter having 12 letters, one can have 2^12 = 4096 different combinations. Pingala had developed technique (pratyay, प्रत्याय) or algorithm called Prastaar (प्रस्तार , meaning to unfold or to open up) for enlisting all the possible combinations of syllables for a quarter with length and letters.
Now if you replace all the 0's with guru and all the 1's with laghu, you can see all the possible combination Pingala came up with for a quarter.
Following this, Pingala’s sutra given in Chandas Shastra from Pare Purnamiti (परे पुर्णमिति) | – Chhandah sastram (छन्दः शास्त्रम्) 8.34) gives a description of Pascal's triangle and Fibonacci sequence. However, this very cryptic code is not understood without the commentary of Halayudha Bhatt's Mritasanjeevani (10th century). He explained that through Pingala's sutra he created a table of numbers called मेरु प्रस्तार or MERU PRASTAR, which means mountain. As seen the Meru Prastar is very similar to Pascal's triangle or the Fibonacci Series cadence.

For those of you who are interested, Pingala wrote some really beautiful poetry as well, along with establishing the foundation for modern computer science (no biggie, all in a day's work). Here's an example of some poetry he wrote.
भवाब्धावपारे महादुःखभीरु: पपात प्रकामी प्रलोभी प्रमत्तः। कुसंसारपाशप्रबद्धः सदाहं गतिस्त्वं गतिस्त्वं त्वमेका भवानि ॥२॥
In the endless ocean of worldly existence, I am full of sorrow and much afraid, I have fallen with excessive desires and greed, drunken and intoxicated, Always tied in the bondage of this miserable samsara (worldly existence), You alone are my refuge, you alone are my refuge, Oh Mother Bhavani.
References:
-
"How Fibonacci Number Series Originated In Ancient India - Guruprasad's Portal". Guruprasad's Portal, 2018, http://guruprasad.net/posts/fibonacci-number-series-originated-ancient-india/. Accessed 15 Nov 2020.
-
"Pingala". En.Wikipedia.Org, 2020, https://en.wikipedia.org/wiki/Pingala. Accessed 15 Nov 2020.
-
Chandrdrahas Halai, How Pingala Created The Binary Number System - Indic Today". Indic Today, 2020, https://www.indictoday.com/quick-reads/pingala-created-binary-number-system/. Accessed 5 Dec 2020.
-
Chandrdrahas Halai, “Pingala’S Algorithm Part VI: Meru Prastaar - Indic Today". Indic Today, 2020, https://www.indictoday.com/quick-reads/pingalas-algorithm-meru-prastaar/. Accessed 5 Dec 2020.