कथा कौतुकम् - 11 - छन्दः पादौ तु वेदस्य
Piṅgala’s analysis of Sanskrit metre treats every syllable as either laghu or guru, allowing metres to be systematically enumerated as sequences of two symbols. The article connects his prastāra, naṣṭa, uddiṣṭa, and Meru-prastāra procedures with binary representation, combinatorics, and related mathematical ideas.
Article compiled by Harsha M Krishna
Find Harsha on Instagram, X, LinkedIn, About
संस्कृतच्छन्दसि द्वे एव अक्षरे स्तः। 🔢 saṃskṛta-chandasi dve eva akṣare staḥ. (In Sanskrit metre there are only two kinds of syllable.)
लघु — ह्रस्वम्। गुरु — दीर्घम्। अन्यत् किमपि नास्ति। laghu — hrasvam. guru — dīrgham. anyat kimapi nāsti. (Laghu — short. Guru — long. Nothing else exists.)
अतः प्रत्येकं छन्दः लघु-गुरु-मालिका एव। ataḥ pratyekaṃ chandaḥ laghu-guru-mālikā eva. (So every metre is just a string of shorts and longs.)
द्वितीये शतके पिङ्गलः नाम आचार्यः अचिन्तयत् — dvitīye śatake piṅgalaḥ nāma ācāryaḥ acintayat — (In the 2nd century BCE an ācārya named Piṅgala thought:)
"अष्टाक्षरे छन्दसि कति भेदाः सम्भवन्ति?" 🤔 "aṣṭākṣare chandasi kati bhedāḥ sambhavanti?" ("In an eight-syllable metre, how many patterns are possible?")
एतत् पृष्ट्वा सः यत् अविन्दत् — तत् अद्य सङ्गणकस्य हृदयम् अस्ति। 💻 etat pṛṣṭvā saḥ yat avindat — tat adya saṅgaṇakasya hṛdayam asti. (What he found by asking this — is today the very heart of the computer.)
In English 👇
Piṅgala was not a mathematician. He was a prosodist — a man cataloguing poetic metres.
But he had noticed something. A Sanskrit syllable is only ever one of two things: laghu (ल) short, or guru (ग) long. There is no third option.
So a line of poetry is a string of two symbols.
Piṅgala wanted to list every possible metre. And to do that, he built a system to generate them in order:
1 syllable → 2 metres: G L
2 syllables → 4 metres: GG LG GL LL
3 syllables → 8 metres:
GGG LGG GLG LLG
GGL LGL GLL LLL
Look carefully at that third row.
Now replace G with 0 and L with 1: 000, 100, 010, 110, 001, 101, 011, 111
That is binary counting — 0 through 7. Written down in India in roughly the 2nd or 3rd century BCE. 🤯
Piṅgala's version runs left-to-right where ours runs right-to-left. Otherwise it is the same thing.
Leibniz, usually credited with binary, published in 1703 — around 1,900 years later.
And he built the algorithms too ⚙️
Piṅgala didn't stop at the list. His Chandaḥśāstra contains named procedures:
🔹 प्रस्तार (prastāra) — generate every possible pattern in order 🔹 नष्ट (naṣṭa) — "given the number 5, tell me which metre that is" → binary decoding 🔹 उद्दिष्ट (uddiṣṭa) — "given this metre, tell me its number" → binary encoding 🔹 सङ्ख्या (saṅkhyā) — total metres of length n = 2ⁿ
Naṣṭa and uddiṣṭa are a matched encoder–decoder pair. Index ↔️ pattern, both directions. That is not a poetic observation. That is a specification.
He also used the word शून्य (śūnya) — zero — as a marker in his procedure. One of the earliest such uses anywhere.
Then it gets better: Mount Meru 🔺
Piṅgala's final sūtra sets out an arrangement he called मेरुप्रस्तार (Meru-prastāra) — "the steps of Mount Meru" — for counting how many metres have exactly k long syllables.
Nobody was doing mathematics here. Piṅgala was trying to make a complete catalogue of poetry — and discovered that to catalogue anything exhaustively, you need combinatorics.
Binary numbers, binomial coefficients, encoding and decoding algorithms, and the Fibonacci sequence all fell out of one question:
"How many ways can a poem sound?" 🎵
⚠️ Honest note: some scholars caution that popular sources overstate Piṅgala — particularly claims that he had full binary arithmetic or the square-and-multiply algorithm. What is solidly established is the binary representation and enumeration, the encode/decode procedures, and Meru-prastāra. That is astonishing enough without embellishment. 🌸
छन्दः पादौ तु वेदस्य — "Metre is the feet of the Veda." And on those two feet — short and long — the modern world learned to walk. 🙏