Ancient Indian obsession with Binary Systems

On Binary Coding, Combinatorics, Pascal’s triangle, and Fibonacci Series

Sujatha R
6 min readApr 12, 2021

More than a thousand years back, what had motivated the great minds to ideate Binary numbers, Combinatorics, Pascal Triangle, and Fibonacci Number like parallels?

When the creative mindset of “poetry and combinations” blends with the logical mindset of “deduction and problem solving”. Meet the genius and audacity of the Indian rishi Pingala.

The domain of “audio sounds” and “rhythm” as a platform for expressing “profound thoughts” in the tradition of “oral transmission”.

A simplistic intuition into the topic.

About a decade back when I first heard the field medalist Manjul Bhargav explaining “Fibonacci series had its roots in the ancient Indian form of poetic expression”, I felt a pang of awe and curiosity to explore at a pace favorable to my understanding.

What had compelled the ancient seers to explore these topics? What was their problem statement? I find these stories very exciting as they bring newer dimensions in viewing Mathematics and the marvel of creation.

Recently stumbled upon a few posts from chandrahasblogs. Hearing these stories from the ancient civilizations brings a deep sense of awe and inspiration.

What was the Problem Statement?

It is amazing to see that the domain of sounds, poetry, and specifically syllable combinations was the premise for this vast foundation.

There are 2 kinds of syllables. The short and long syllables coded as 1 and 0.

A few illustrations to understand the concept of syllables. Note: It is an inbuilt feature of the Indian languages and scripts and may not make much sense in the English representation.

Short Vowels
cuba cu-ba 1 1 (short short)
Long Vowels
novi noo-vi 0 1 (long short)
puri puu-ri 0 1 (long short)
china ch(ai)-na 0 1 (long short)
owl (au)l 0 (long)
Multi Consonant
bengalooru ben-ga-loo-ru 0 1 0 1 (L S L S)
california caa-li-forn-ya 0 1 0 1 (L S L S)
sweden swe-den 0 0 (L L)
norway nor-ve 0 0 (L L)

And from here stems the exciting problems of the binary world represented in 1s and 0s.

Binary & Octal notation

There were poems of 6 syllables blocks and some went up to 24 and more. Hence came the idea of representing the long binary signatures in octal forms. It was easier to represent the octal codes after all.

Alright, where did they use it?

A unique signature of short and long syllables was called a meter. For instance, Gayatri represented a 6 syllable meter.

In ancient days, profound compositions were transmitted in oral tradition. Be it a treatise on philosophy, science, math, or work of Drama or Poetry. Like a railway track, every verse in the block followed the syllable pattern and the verses just chugged in. Like the carrier wave in AM modulation, verses were weaved around the template.

Mahabharata is said to have 1.8 million words and follows the 8 syllable chanting pattern along with Bhagawad Gita and the epic Ramayana. The ancient Vedas like Gayatri mantra had the 6 syllable chanting pattern.

Syllable Combinations, Power of 2s & Pascal’s triangle

The next question was about combinations. For instance, in a 4 syllable meter, how many kinds of combinations were possible?

Let us start with 0 short syllables in the entire phrase.

0 Short Syllables (1)
0 0 0 0

Then let us proceed to 1 short syllable in the verse.

1 Short Syllable (4)
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

Similarly, if we were to list how many ways we can have2, 3 and 4 short syllables.

2 Short Syllables (6)
1 1 0 0
1 0 1 0
1 0 0 1
0 1 1 0
0 1 0 1
0 0 1 10 0 0 13 Short Syllablse (4)
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0
4 Short syllablles (1)
1 1 1 1

Hence we get this Pascal triangle like breakout. 2⁴ = 1 + 4 + 6 + 4 + 1 = 16

Did they have Algorithms?

Well, their binary notation was flipped or mirrored when compared to modern times. It was ‘left to right’ instead of our modern notation of ‘right to left’.

During ancient times, the codes used to be written on the sand. There was a chance that the wind would blow away these tables. Hence Pingala assigned numeric index values starting from 1.

Index Number - Signature - Pingala's Binary - Modern Binary
1 GGGGG 00000 00000
2 LGGGG 10000 00001
3 GLGGG 01000 00010
4 LLGGG 11000 00011

And Pingala had an algorithm how to recover binary codes from decimal indeces. The number was recursively divided by 2 and checked for divisibility with 2. This is akin to our long division of polynomials. Something like our left bit shift and extracting the first bit.

And another algorithm how to compute powers of 2 in an efficient manner. Think about 2¹⁷ how we would compute. This algorithm has been acknowledged by Knuth apparently.

What about Fibonacci Series?

The Jain poet Hemachandra had this theoretical question. How many combinations of Long and Short sounds were possible in any time unit t? Fibonacci’s number is closely related to the Creator’s paradise Golden Ratio and it quite seems all of this has stemmed from Nature itself.

Let us say short syllable took 1 time unit and a long syllable 2 time units. It is fun working it this problem with 2 kinds of lego blocks. Let us represent it by . and ~

When t=1, we have one solution. When t=2, we have 2 solutions.


As we keep constructing, we can see that the 3rd set can be generated by appending the long unit to the first set and the short unit to the second set. Similarly, 4th set can be generated by appending the long unit to the second set and the short unit to the third set.

combinations for time (t) = combinations for (t-1) + combinations for (t-2)
1 2 3 5 8 13 …


And Why did they use these elaborate Meters?

Well, we live in an age where it is even hard to digest the concept of syllable meters. Unlike modern times, they did not have notepad app, or even pen and paper to write and rewrite. For the great masters, it seems linguistic expressions poured out like a work of art.

Meters had a deep psychological aspect of harmony weaved into it. For instance, the catchy Shiva stotram had a simple binary 0 1 0 1 0 1 kind of cadence. Longer meters had unique “wave like” and other distinct patterns and brought about elements of beauty and melancholy like in Saundarya Lahari and Meghadhootha.

Chandas or “syllable meters” is a vast field by itself and my attempt in simplifying this topic by bringing illustrations of the modern age. My attempt in enumerating different meters used by the great master Shankaracharya. If interested, do check out this post.

And this domain of poetry and meters seemed to bring about tools of mathematical beauty about 2000 years back by the great master Pingala.. Binary & Octal systems, algorithms, combinatorics, Pascal’s triange & Fibonacci series.

Bhaskaracharya had composed Lilavati in 1150 CE to teach Mathematics to his daughter Lilavati. This book has very interesting and realistic problems covering arithmetic, algebra, geometry, mensuration, combinatorics, number theory, and other basic topics.

This book was used as a standard textbook for almost 700 years. A few interesting problems of Lilavati are explained well in the Blog.




  1. Hemachandra-Fibonacci Number
  2. Pingala:


Illustrated Lilavati:



Sujatha R

I write.. I weave.. I walk.. कवयामि.. वयामि.. यामि.. Musings on Music, Linguistics & Patterns