Extracting the digits of pi from the SlOka

Some sa~skRth trivia. Is the following a SlOka on kRShNa, a SlOka on Seva or an incredible (and mostly accurate) mnemonic for pi.

gOpE BAgya maDhu vratha SRnggESO dhaDhesanDhega | KalajEvetha Katava galahata rasanDhara ||

A note on notation

Some of what you read in this page will look strange. Yes, strange in the preceding sentence refers to the orthography, not the meaning. I shall assume that you are already familiar with the dhAEvanAgarE script (if your browser has graphical capabilities, the above sa~skRth SlOka will appear in dhAEvanAgarE.

In order to explain the mnemonic device that is used in the above SlOka, I will have to make use of phrases in sa~skRth. I could do that by inlining images with the phrases written in dhAEvanAgarE, or I could save myself a lot of trouble by using a transliteration for dhAEvanAgarE into ASCII characters---and the latter is what I chose to do. In the absence of a logical scheme for transliterating sa~skRth (as written in the dhAEvanAgarE script), I have developed my own scheme called rOman-nAgarE. Since I did not plan on using rOman-nAgarE for transliterating languages other than those native to India, I did not use a more comprehensive scheme such as the IPA. You will need to be familiar with rOman-nAgarE to make sense of what follows.

rOman-nAgarE associates distinct phonetic (and phonemic) values with upper- and lower-case Roman alphabets---hence the standard rules of English punctuation (capitalization in particular) do not apply.

The katapayAdhe sangKya

The katapayAdhe sangKya is a system of converting a string of characters written in dhAEvanAgarE into a string of digits. The name ka-ta-pa-yA-dhe itself comes from the first syllables of the canonical ordering of the consonants of the dhAEvanAgarE alphabet. The scheme works as follows:


       digit -->     1   2   3   4   5    6    7    8    9    0
       group
       |     kAdhe   k   K   g   G   ng   c    C    j    J    nj
       |     tAdhe   t   T   d   D   N    th   Th   dh   Dh   n
       v     pAdhe   p   P   b   B   m
             yAdhe   y   r   l   v   S    Sh   s    h

Obviously, there is no requirement that the original string in dhAEvanAgarE mean anything, or that it be a meaningful phrase in sa~skRth---one could very well take a phrase in English and phonetically transliterate it into dhAEvanAgarE (or rOman-nAgarE) and apply the katapayAdhe function to it. The important thing to remember is that the katapayAdhe sangKya is a mapping from a string of symbols (in dhAEvanAgarE or rOman-nAgarE or equivalent) to a string of symbols (decimal digits).

The katapayAdhe sangKya by itself is not at all interesting. However, when the original string in dhAEvanAgarE represents a meaningful phrase in some language (such as sa~skRth) and the mapped digit string represents a meaningful number, the katapayAdhe sangKya becomes interesting and useful (especially as a mnemonic device for the number).

katapayAdhe conversion program

For those who do not wish to remember the above table (although I must say that this is trivial for those who are familiar with the dhAEvanAgarE script and any of the languages related to sa~skRth), here is a small Perl program that will do the katapayAdhe conversion for you. The program does not care about punctuation or characters that are not in the dhAEvanAgarE alphabet. The output is a stream of decimal digits.


%sangKya = (
    "k",  1, "K",  2, "g",  3, "G",  4, "ng", 5,
    "c",  6, "C",  7, "j",  8, "J",  9, "nj", 0,

    "t",  1, "T",  2, "d",  3, "D",  4, "N",  5,
    "th", 6, "Th", 7, "dh", 8, "Dh", 9, "n",  0,

    "p",  1, "P",  2, "b",  3, "B",  4, "m",  5,

    "y",  1, "r",  2, "l",  3, "v",  4, "S",  5,
    "Sh", 6, "s",  7, "h",  8,
);

$svara     = "RR|lR|lRR|ae|aE|Ae|AE|au|aU|Au|AU|[aAeEuURiIoO]";
$vyanjjana = "ng|nj|th|Th|dh|Dh|Sh|[kKgGcCjJtTdDNnpPbBmyrlvSsh]";

while (<>) {
    chop;
    s/(${vyanjjana})(${svara})/$sangKya{$1}/ego;
    s/\D+//go;
    s/${vyanjjana}//go;
    s/${svara}//go;
    print $_, "\n";
}

Transforming the SlOka

The conversion of the above SlOka to a string of digits via the katapayAdhe sangKya works as follows:

The SlOka in rOman-nAgarE:
gOpE BAgya maDhu vratha SRnggESO dhaDhesanDhega KalajEvetha Katava galahata rasanDhara.
The rOman-nAgarE string with only the syllabic consonants:
g p B y m Dh r th S g S dh Dh s Dh g K l j v th K t v g l h t r s Dh r.
The katapayAdhe mapping of the consonants:
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 1 4 3 3 8 1 2 7 9 2.
The mapped decimal string is:
3.14159 26535 89793 23846 21433 81279 2.
The decimal expansion of pi given by the GNU calculator bc:
3.14159 26535 89793 23846 26433 83279 5.

Thus the above mnemonic is incorrect in 3 digits, but still good upto the 21 decimal places. It is quite likely that I do not have the correct SlOka and that the original one may not have even these 3 errors.

I should also point out that the original SlOka is meaningful in sa~skRth---in fact, depending on how one chooses to split compound words and interpret words with multiple meanings, the phrase could be a SlOka in praise of kRShNa or in praise of Seva. It is this consistent twin meanings, and the mapping to the digits of pi that make the SlOka interesting.

Origin of the mnemonic

I do not know the source of the above SlOka. I have often seen it reported as being very ancient (and hence proof that mathematicians of the Vedic times knew about the true nature of pi or that they were divinely inspired). I do not believe such nonsense without proof. If any one reading this knows the exact source of the SlOka (text, author, recension, approximate date, etc.) I would appreciate knowing about it so that I can verify my own version (and possibly ponder on the origin of the mnemonic). My own feeling is that the SlOka is a very recent composition by someone skilled in sa~skRth poetry and with access to a detailed decimal expansion of pi.


Appendix

Many sites have information about pi, its expansion in different bases, and properties of these expansions. Below are a few "meta"-collections of links to many of these sites.


[ Miscellaneous | Krishna Kunchithapadam ]


Last updated: Sun Jun 27 17:00:19 PDT 2004
URL: http://geocities.datacellar.net/krishna_kunchith/misc/pi.html

1