Quick answer: Pingala's Chandahshastra, a treatise on Sanskrit metre usually dated somewhere between the 5th and 2nd century BCE, treats every syllable as either laghu (light) or guru (heavy). Its recursive procedure, prastara, lists all 2^n patterns of an n-syllable metre, and companion procedures turn a pattern into its serial number and back. That ordering matches binary counting with the bits reversed and the count starting at 1. Pingala did not invent binary arithmetic as computers use it, and Leibniz did not borrow from him. The triangle now called Pascal's triangle appears as the Meru Prastara in Halayudha's 10th-century commentary on Pingala. The true story is remarkable enough without exaggeration.

A surprising true fact to start

Mathematician David Mumford, reviewing Kim Plofker's Mathematics in India for the Notices of the American Mathematical Society, describes Pingala as introducing "what is essentially binary notation for numbers, along with Pascal's triangle". The book in question was about poetry. Pingala was trying to describe every rhythm a Sanskrit verse line could take, and the tools he built for that task turned out to be counting and listing methods that mathematicians still recognise (Source: Mumford, Notices of the AMS, March 2010).

This guide works through those tools with real examples, so you can see for yourself what is binary-like about them and what is not. It is part of our series on India's genuine scientific history, alongside Panini's grammar and computer science and Madhava and the Kerala school.

Who was Pingala, and when?

Nobody knows Pingala's dates for certain. Jayant Shah dates the Chandahshastra to the 2nd century BCE, Amba Kulkarni to c. 200 BC, and Plofker to roughly the 3rd to 2nd century BCE; Mumford suggests "perhaps" the third century BCE. An old Indian tradition makes Pingala the younger brother of the grammarian Panini; if that is right, Subhash Kak argues, Pingala belongs to the 5th century BCE. The honest range is therefore about the 5th to the 2nd century BCE (Source: Jayant Shah, 'A History of Pingala's Combinatorics').

Two building blocks: laghu and guru

Sanskrit verse is measured, not stressed. A short syllable counts one matra (a unit of duration) and a long syllable counts two. Pingala's formal algorithms deal with syllable-counted (vṛtta) metres, where every position holds one of two values. A metre pattern is therefore effectively a string written with two symbols. In this article we use L for laghu and G for guru (Source: Jayant Shah).

Worked example 1: listing all 3-syllable patterns (prastara)

Prastara ("spreading out") is a recursive recipe. Start with the two one-syllable patterns, G and L. To get the list for n syllables, make two copies of the list for n - 1 syllables, add G to every pattern in the first copy and L to every pattern in the second.

Advertisement
  1. 1 syllable: G, L
  2. 2 syllables: copy 1 gets G added (GG, LG); copy 2 gets L added (GL, LL). List: GG, LG, GL, LL
  3. 3 syllables: copy 1 gets G added (GGG, LGG, GLG, LLG); copy 2 gets L added (GGL, LGL, GLL, LLL)

That gives exactly the list Shah reports for n = 3: GGG, LGG, GLG, LLG, GGL, LGL, GLL, LLL, which is all 2^3 = 8 patterns. Notice that the first syllable flips every row, the second every two rows, the third every four rows. That rhythm is the clue to the binary comparison (Source: Jayant Shah).

Worked example 2: the binary-like ordering

Subhash Kak, summarising the Indologist B. van Nooten, explains the mapping: write laghu = 1 and guru = 0, read the pattern with the leftmost position as the least significant bit (the reverse of modern notation), and add 1, because Pingala's rows run from 1 to 2^n rather than from 0 to 2^n - 1 (Source: Subhash Kak, Annals of the BORI 81 (2000)).

RowPatternL = 1, G = 0 (left to right)Value with leftmost bit = 1s placeValue + 1
1GGG0 0 001
2LGG1 0 012
3GLG0 1 023
4LLG1 1 01 + 2 = 34
5GGL0 0 145
6LGL1 0 11 + 4 = 56
7GLL0 1 12 + 4 = 67
8LLL1 1 11 + 2 + 4 = 78

Every row's serial number falls out of the pattern. That is why scholars describe the scheme as binary-like. The standard scholarly treatment is van Nooten's article "Binary numbers in Indian antiquity" in the Journal of Indian Philosophy 21 (1993), which Kak cites.

The six problems later prosodists drew from Pingala

Later writers on metre organised Pingala's material into six formal problems (pratyayas). Shah notes that Pingala himself does not give them these names (Source: Jayant Shah).

PratyayaQuestion it answersFor 3 syllables
PrastaraList every pattern in orderThe 8 rows above
NashtaGiven a serial number, what is the pattern?Row 6 is LGL
UddishtaGiven a pattern, what is its serial number?GLL is row 7
LagakriyaHow many patterns have k short (or long) syllables?1, 3, 3, 1 (binomial coefficients)
SankhyaHow many patterns in total?2^3 = 8
AdhvayogaHow much space is needed to write out the list?Depends on the writing layout

You can check the lagakriya line against our table: one pattern with no laghu (GGG), three with one laghu (LGG, GLG, GGL), three with two (LLG, LGL, GLL) and one with three (LLL).

Advertisement

Pingala's methods are recursive. Shah calls them "the first example of recursion in Indian mathematics", and Kulkarni describes them as recursive algorithms holding intermediate results in what amount to stack variables; Kedar Bhatt (c. 800 AD) later gave iterative versions (Source: Amba Kulkarni, arXiv:math/0703658). Donald Knuth traces the binary method of exponentiation (square-and-multiply) back to the Chandahshastra; a 2026 history of that algorithm calls Pingala's prosody work the earliest known antecedent while crediting al-Kashi (1427) with the first explicit general statement (Source: Aydin et al., arXiv:2606.00958).

Worked example 3: the Meru Prastara (Pascal's triangle)

Halayudha's commentary Mṛtasañjīvanī (c. 950 CE) reads Pingala's final sutra, pare pūrṇam iti, as describing a construction called the meru prastara ("Mount Meru arrangement"): the triangle now called Pascal's triangle, used to compute how many patterns have a given number of short syllables. Each number is the sum of the two above it:

Syllables (n)Meru rowTotal (sankhya)
011
11 12
21 2 14
31 3 3 18
41 4 6 4 116
51 5 10 10 5 132

The row for n = 3 is exactly the lagakriya count we found by hand. Shah writes that it is "almost universally accepted on the authority of Halayudha" that the sutra implies this construction, and that before Halayudha only Virahanka describes such a construction or uses the name meru prastara (Source: Jayant Shah). The triangle in Halayudha's commentary comes centuries before Blaise Pascal.

Worked example 4: counting by duration gives the 'Fibonacci' numbers

Change the question: instead of counting syllables, count total duration, with laghu = 1 matra and guru = 2. How many rhythms last exactly n matras?

MatrasPatternsCount
1L1
2LL, G2
3LLL, GL, LG3
4LLLL, GLL, LGL, LLG, GG5
58 patterns (add L to every 4-matra rhythm, or G to every 3-matra one)8

Each count is the sum of the previous two. Parmanand Singh's study in Historia Mathematica shows that Virahanka (AD 600-800), Gopala (before 1135) and Hemacandra (c. 1150) gave these numbers and the rule for forming them, all before Fibonacci (c. 1202); Narayana Pandita (1356) later related them to multinomial coefficients (Source: Parmanand Singh, Historia Mathematica 12 (1985)).

Advertisement

Leibniz and Pingala: a comparison, not a borrowing

Gottfried Leibniz's binary arithmetic dates from a 1679 manuscript and his 1703 paper "Explication de l'Arithmetique Binaire", whose title refers to the ancient Chinese figures of Fu Xi. He learned of the I Ching hexagrams through the Jesuit Joachim Bouvet around 1701. No source consulted documents any contact between Leibniz and Pingala's work, so historians treat the two as parallel ideas, not a chain of influence (Source: Wikipedia, 'Binary number'). If you hear that Leibniz "rediscovered" Pingala, read it as an analogy.

Myth vs fact

MythWhat the evidence says
Pingala invented the binary arithmetic used in today's computers.Pingala enumerated two-valued patterns and converted between patterns and serial numbers. The scheme was never used for arithmetic, its bit order is reversed and its count starts at 1. Shah gives Mahavira (c. 850 CE) as 'the closest Indian mathematicians came to inventing binary numbers'. Source: Jayant Shah
Leibniz took his binary system from Pingala.Leibniz linked his work to the Chinese Fu Xi / I Ching figures. No transmission from Pingala is documented. Source: Wikipedia, 'Binary number'
Pingala's sutras explicitly set out Pascal's triangle.The reading comes from Halayudha's 10th-century commentary. Albrecht Weber said it 'does not follow from his words in any way'; Alsdorf (1933) disputed Weber; Shah finds no evidence for Halayudha's reading but traces binomial-coefficient computation to Pingala. Source: Jayant Shah
Pingala himself wrote down the Fibonacci sequence.The explicit sequence is credited to Virahanka, Gopala and Hemacandra, building on Pingala's theory of metre. Source: Parmanand Singh

Why this still matters

None of this needs inflating. A poet-scholar more than two thousand years ago saw that the rhythms of verse could be counted, listed, numbered and recovered by rule, and he expressed those rules recursively. Later Indian prosodists carried the work forward for more than a thousand years, producing the Meru Prastara and the so-called Fibonacci numbers long before European mathematicians. Mumford sees in Pingala's work the start of a long line of research on counting patterns. For families, these worked examples make a lovely kitchen-table exercise: clap out LGL and GLL, then let children find each one's row number.

Frequently asked questions

Did Pingala invent binary numbers?

Not in the modern sense. Pingala enumerated two-valued syllable patterns and gave algorithms to convert between a pattern and its position in a list. Historians note that the mapping is binary-like, but the bit order is reversed, counting starts at 1, and the scheme was never used for arithmetic. Jayant Shah calls a later method by Mahavira (c. 850 CE) 'the closest Indian mathematicians came to inventing binary numbers'.

Advertisement

When did Pingala live?

The date is uncertain. Scholars place the Chandahshastra roughly between the 5th and 2nd century BCE: Shah says the 2nd century BCE, Kulkarni c. 200 BC, Plofker c. 3rd to 2nd century BCE, and Mumford 'perhaps' the third century BCE. A tradition that Pingala was Panini's younger brother would push him to the 5th century BCE.

What are laghu and guru?

Laghu is a light (short) syllable worth one matra, a unit of duration; guru is a heavy (long) syllable worth two. Because every position in a syllable-counted metre is one or the other, each metre pattern is effectively a string of two symbols.

Is the Meru Prastara the same as Pascal's triangle?

The Meru Prastara, as Halayudha described it in his 10th-century commentary, is the triangle now called Pascal's triangle, centuries before Pascal. Whether Pingala's own sutra describes it is debated: Jayant Shah finds no evidence for Halayudha's reading of the sutra, though he traces the computation of binomial coefficients back to Pingala.

Did Leibniz learn binary from Pingala?

There is no evidence of that. Leibniz's binary work dates from a 1679 manuscript and a 1703 paper that link it to the Chinese I Ching figures, which he learned about through the Jesuit Joachim Bouvet. Pingala and Leibniz are a comparison of parallel ideas, not a line of influence.

Did Pingala discover the Fibonacci numbers?

The explicit sequence and its rule were given by Virahanka (AD 600-800), Gopala (before 1135) and Hemacandra (c. 1150), all before Fibonacci (c. 1202), building on the theory of metre Pingala founded. Crediting the explicit sequence to Pingala himself goes beyond the evidence.

Editor's note (9 October 2026)

Every historical claim, date and quotation on this page comes from the scholarly sources linked in the text, chiefly Jayant Shah's history of Pingala's combinatorics, Subhash Kak (2000) summarising van Nooten (1993), Amba Kulkarni (2007), Parmanand Singh (1985) and David Mumford's 2010 review, checked on 9 October 2026. The worked tables are our own calculations using the methods those sources describe. Pingala's dates are uncertain and we give the range scholars propose. We do not claim that ancient texts anticipated modern computers; the binary comparison is a mathematical parallel.

Image credit: Unknown, Public domain, via Wikimedia Commons (https://commons.wikimedia.org/wiki/File:A_palm_leaf_Sanskrit_manuscript_in_Brahmi_script_from_Miran_China.jpg).