close logo

Pingala’s Algorithm Part III: Prastaar of Kedar Bhatt

This is in continuation of my two previous articles – How Pingala created the Binary Number System and Pingala’s Algorithm for Binary Conversion.

In the 11th century CE, Kedar Bhatt had composed his work on the non-Vedic meters named Vruttaratnakar (वृत्तरत्नाकरः). This book contains six chapters, of which the last chapter is devoted to algorithms related to combinatorial mathematics. Though these algorithms accomplish essentially the same things as the algorithms (pratyay) developed by Pingala, but their approach is different.

Pingala’s algorithms are recursive, meaning to write down the prastaar of a meter containing 6 syllables one needs to have a prastaar for 5 syllables. And to write a prastaar for 5 syllables you need to have a prastaar for 4 syllables and so on. Whereas in the algorithm developed by Kedar Bhatt to write down the prastaar for a meter having 6 syllables I don’t need to have a prastaar for 5 syllables. So, let us have a look at Kedar Bhatt’s prastaar.

The sutras for prastaar as given by Kedar Bhatt are:

पादे सर्वगुरावाद्याल्लघुं न्यस्य गुरोरधः |

यथोपरि तथा शेषं भूयः कुर्यादमुं विधिम् || (वृत्तरत्नाकरः 6.2)

ऊने दध्याद् गुरूनेव यावत्सर्वलघुर्भवेत् |

प्रस्तारोऽयं समाख्यातश्छन्दोविचितिवेदिभिः || (वृत्तरत्नाकरः 6.3)

Meaning:

Begin with a row containing all gurus (G). (For a prastaar for 4 syllables, begin with a row containing all 4 gurus). Start scanning the row from the left. When you encounter the first guru, place a laghu (L) below that. The syllables to the right are copied below as they are. All the places to the left of L are filled up with Gs. Repeat the process for the subsequent rows till you reach the row having all Ls.

I will illustrate Kedar Bhatt’s algorithm by writing down a prastaar for a meter containing 4 syllables.

Table 1

1 G G G G Start with a row containing all Gs.
2 L G G G Place L below the first G of above row. The syllables to the right are copied as they are.
3 G L G G All the places to the left of L are filled up with Gs.
4 L L G G Place L below the first G of above row. The syllables to the right are copied as they are.
5 G G L G
6 L G L G
7 G L L G
8 L L L G
9 G G G L
10 L G G L
11 G L G L
12 L L G L
13 G G L L
14 L G L L
15 G L L L
16 L L L L The process stops here.

Compare this table with Table 5 in the article “How Pingala created the Binary Number System”.

You must be wondering how Kedar Bhatt come up with such an algorithm?

The answer is Binary Addition.

So, let’s understand the basics of binary addition.

Let me add a 1 to 0. We have,

0

+1

1

Now, let us add a 1 to 1.

1

+1

10

The binary number system like the decimal number system is a place-value system. In the decimal number system you have ten digits (0 and 1 through 9). Likewise in the binary number system you have only two digits, 0 and 1, which are called bits. Bit is short for Binary digit. The binary number system is a base two number system. In decimal number system the value of the digit depends on its position, i.e. digit times the power of ten. In the binary number system too, the value of the digit depends on its position, but here it is digit times the power of 2.

When you add a 1 to 1, the result is 2, which in binary is 10. Hence, write a 0 in the current column and carry over a 1 to the next column.

Now, let us add a 1 to 10. We have,

10

+1

_____

11

11 is 3 in decimal.

Now, let us add a 1 to 11. We have,

11

+1

_____

100

100 is 4 in decimal. Here, when we add a 1 to the 1 in the rightmost column we get a 10. Hence, a 1 is carried forward to the next higher column. The next column already contains a 1. So, the same process is repeated.

Now, let us add a 1 to 0111. We have,

0 1 1 1
+ 1
1 0 0 0

If we pay attention to this last addition, we can see similarities between Kedar Bhatt’s algorithm and binary addition. In this addition, we scan the number 0111 from the right and set the first zero we encounter to 1. And fill up all the bits to its right to 0s.

To make it clear let me give one more example. Let us add 1 to 10100111 (which is 167 in value / decimal).

1 0 1 0 0 1 1 1
+ 1
1 0 1 0 1 0 0 0

In this addition, we scan the number 10100111 from the right and set the first zero we encounter to 1. We fill up all the bits to its right to 0s. The bits to the left are copied below as it is.

If we replace Gs and Ls in Table 1 with 0s and 1s, we get the binary sequence for numbers from 0 to 15 in reverse order. Hence, it must have become clear to all that Kedar Bhatt must have developed his Prastaar algorithm from the principles of binary addition.

During ancient times, the prastaar used to be written on the sand. There was a possibility that the wind might blow away the sands and erase some rows of the prastaar. So, how do you restore an erased / damaged row?

In my previous article “Pingala’s Algorithm for Binary Conversion”, I had discussed Pingala’s technique (pratyay, प्रत्याय) or algorithm called Nashtam (नष्टम्) to regenerate the sequence of Guru and Laghu syllables of a row with a given row / index number.

To restore an erased row, take a previous intact row and apply Kedar Bhatt’s procedure to it. Let me illustrate this by applying it to find the 29th row of a prastaar for a quarter of length 5. The guru and laghu sequence for the 28th row is LLGLL.

L L G L L Guru and Laghu sequence for the 28th row
G G L L L Scan the previous row from the left. When you encounter the first G, put a L below it. The syllables to the right are copied as they are. All the places to the left of L are filled up with Gs.

Hence, the guru and laghu sequence for the 29th row is GGLLL.

From the above discussion it is obvious that Kedar Bhatt had good understanding of Binary Addition.

The author thanks Prof. Subhash Kak for his valuable comments on the article.

Explore Pingala’s Binary Number System Part I and Part II

Disclaimer: The opinions expressed in this article belong to the author. Indic Today is neither responsible nor liable for the accuracy, completeness, suitability, or validity of any information in the article.

Leave a Reply