On this page
You may have heard that ancient India invented binary numbers through Sanskrit poetry. The real story is more interesting than the slogan. The prosodist Pingala treated metres as strings of two symbols, long and short, and gave exact rules for listing and indexing them. Later writers sharpened his rules into something very close to binary place value. This post works through Pingala's methods with examples you can check, and shows what is solid history and what is overstatement.
Who was Pingala?
Pingala wrote the Chandahshastra, a treatise on Sanskrit metres. Jayant Shah of Northeastern University, in his paper A History of Pingala's Combinatorics, dates it to the 2nd century BCE. Subhash Kak, in a paper on the golden mean and Pingala's Mount Meru, gives about 200 BCE, and perhaps earlier if traditions that make him the younger brother of the grammarian Panini are right. Pingala's sutras are very short and were explained by later commentators, notably Halayudha in the 10th century.
How do long and short syllables become a counting problem?
A Sanskrit syllable is either guru (heavy, G) or laghu (light, L). A metre with n syllables is a string of n Gs and Ls. Each position has two choices, so there are 2 × 2 × ... × 2 = 2ⁿ possible patterns. For four syllables that is 16. Shah notes that Pingala's own closing sutras state the doubling rule: the number of forms of the next metre is twice that of the previous one.
This is the multiplication principle you meet in permutations and combinations.
What is Pingala's prastara?
Prastara means "spreading out": a full list of the patterns in a fixed order. Shah describes Pingala's recursive method. Start with the 1-syllable list G, L. To get the n-syllable list, write the (n−1)-syllable list twice, add G to the end of each pattern in the first copy, and L to the end of each in the second. For three syllables:
GGG
LGG
GLG
LLG
GGL
LGL
GLL
LLL
Look down the first column: G, L, G, L... The second alternates in pairs and the third in fours. Read each row from left to right with L = 1 and G = 0, the first position worth 1, the second 2 and the third 4, and each row's value is one less than its position. Row 6, LGL, is 1 + 0 + 4 = 5, and 5 + 1 = 6.
Worked example: find a pattern from its position (nashta)
Which 3-syllable pattern is at position 6? Shah gives Pingala's rule: if the number is even, write L and halve it; if it is odd, write G, add 1 and halve. Repeat until you have n letters.
6 is even: write L. 6/2 = 3.
3 is odd: write G. (3 + 1)/2 = 2.
2 is even: write L. 2/2 = 1.
Answer: LGL, which matches row 6. For a 4-syllable metre, carry on: 1 is odd, write G, (1 + 1)/2 = 1. The sixth 4-syllable pattern is LGLG.
Worked example: find a position from a pattern (uddishta)
What is the position of LGLG? Pingala reverses the process. Start with 1 and read the pattern from right to left. Shah's version: at the first L, double; after that, double at every L, and double then subtract 1 at every G.
Reading right to left, the first L is in position 3: 1 × 2 = 2.
Next comes G, in position 2: 2 × 2 − 1 = 3.
Next comes L, in position 1: 3 × 2 = 6.
Position 6, as expected. Now Mahavira's shortcut: write 1, 2, 4, 8 above the four syllables L, G, L, G. Add the numbers above the Ls, 1 + 4 = 5, then add 1. Again 6. That is reading the pattern as a binary number, lowest place first.
What mistakes do students make here?
Reading in the wrong direction. In this scheme the first syllable is the lowest place value, the reverse of how we write binary today. Fix the direction before you start.
Forgetting the +1. Positions start at 1, while the binary value of GGG is 0.
Mixing up the odd-number step. In nashta, an odd number needs +1 before halving. Skip it and you get fractions.
Did Pingala invent Pascal's triangle?
This is where care matters. Halayudha, in the 10th century, read Pingala's last sutra as instructions for the meru prastara, the triangle of numbers we now call Pascal's triangle, which counts how many n-syllable patterns have exactly k short syllables. For n = 3 its row is 1, 3, 3, 1: one pattern with no L, three with one, three with two, one with three. Check that against the list above.
Shah agrees with the 19th-century scholar Albrecht Weber that the sutra Halayudha quoted does not describe the triangle. He still traces the counting of these numbers back to Pingala through another sutra and through later writers such as Bharata. Kak, meanwhile, connects the Meru to the Fibonacci numbers that later prosodists found by counting patterns by length. Connect this to the binomial theorem: row n of the triangle gives the coefficients of (1 + x)ⁿ.
What can a student learn from Pingala?
Pingala took a practical question, which metres are possible, and answered it with exact, repeatable rules, including rules that run in both directions. That is a habit worth copying: whenever you learn a procedure, also learn how to undo it.
If a counting problem stops making sense halfway, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Try it now: list all sixteen 4-syllable patterns with Pingala's method, then find the position of GLLG using both uddishta and Mahavira's shortcut.



