Monday, January 18, 2010

kaalapramaaNa

Much is being made of 2012 as the end of the world. In the Hindu literature, the perception of time is completely different. There are various accounts of time with slightly differing measurements, but here is presented what is probably the most accepted. I also consulted the book Puranic Encyclopedia by Sri Vettam Mani.

Carl Sagan in his hugely successful and influential book/TV Serial Cosmos, mentions about how the early Hindu sages were thinking in terms of billions, when the rest of the world did not yet begin to count numbers. Clearly, the table goes from 1/3600 of a second to several billion years.

For the end of Kali yuga in the current cycle, we have about 427,000 years to go! And we are in the 28th cycle of the 7th manvantara. For this manvantara to end, we have 43 cycles to go. And for this kalpa to end, we have about 7 more manvantaras. The current manu is vivaSvata. We will see the future manu-s in the next post.

At it does not end here. When the lifetime of current Brahma expires, a new Brahma takes over.


count of this is 1 equal to this of
in modern units Comments
30 alpakala truti 1/3600 second ~ 0.3 milli seconds
30 truti kalaa 1/120 second ~ 8.3 milli seconds
30 kalaa nimisha 1/4 second ~ 250 milli seconds
4 nimisha ganita 1 second
60 ganita vinadi 1 minute
60 vinadi ghatika 24 minutes
60 ghatika ahoratra 24 hours Day + Night
15 ahoratra paksha 15 days 1 Moon cycle
2 paksha chandramasa 1 month 1 Lunar month
12 chandra masa varsha 12 months 1 Solar year
1 varsha deva aho ratram 1 Deva day 1 Human year
360 varsha devavarsha 360 human years
4800 devavarsha kruta yuga 1,728,000 human years
3600 devavarsha treta yuga 1,296,000 human years
2400 devavarsha dvapara yuga 864,000 human years
1200 devavarsha kali yuga 432,000 human years
12000 devavarsha catur yuga 4,320,000 human years
71 catur yuga manu 306,720,000 human years
14 manvantara kalpa 4,294,080,000 human years Deluge
1 kalpa Brahma's night 4,294,080,000 human years No action
1 kalpa Brahma's day 4,294,080,000 human years Creation
2 kalpa Brahma ahoratra 8,588,160,000 human years Brahma's day + night
360 Brahma ahoratra Brahma varsha 3,091,737,600,000 human years 1 Brahma year
100 Brahma varsha End of Brahma 309,173,760,000,000 human years 100 Brahma years

Monday, December 14, 2009

The intellectual devotee

No matter how much ever one tries to embrace and love it, grammar of any language always remains a dry subject. At some point of time, the mind wants to stop analyzing and start to take things as-is. Panini's grammar rules, no doubt is a great tribute to human intelligence. At the same time, another extra-ordinary intellect, Adi Shankaracharya asks "What is the point of studying grammar, when the real liberation is achieved only by chanting the name of Govinda".
Chanting the names of Vishnu is a sure way to moksha especially in Kali yuga - Vyasa emphasises this in several of his works. The more you call his name the more the chances of liberation. So, of what use is memorizing and repeating the undecipherable technical terms of Panini - most of which does not even sound like a proper word, when the mind can be repeating the thousand names of Paramatma? Do the words like ShtunoShtu:, k~giti ca, ikoyanachi get a person any closer to moksha?
Thus the bhakta is at cross-roads with jnana. Should one study the intricacies of grammar or just chant the names of mAdhava? And why can't he do both?
A variety of literature has followed AshtadhyayI. While the SutrapATha (AshtadhyAyI) remains the ultimate focus of these literature, the literature itself spans several dimensions - vritti (gloss), vArtika (notes), bhAshya (exposition), siddhAnta (theory). Sutra was extremely concise, so vritti was written to supply missing elements. vArtika expanded the sutra, while mahAbhAshya was an extensive treatment, leaving no gaps. Kasika vritti, siddhantakaumudi, laghu siddhanta kaumudi have treated AshtadhyAyI extensively. In between there are novel attempts like BhattikAvya which attempts to teach Paninian grammar via Ramayana.
In the juggernaut of the Bhakti movement started around early 8th century (?) with Azhwars/Nayanmars and gained prominence throughout India by 15th century, someone snaps, why do I have to read all these grammar rules while I can be chanting the name of Hari? Of what use is this grammar when nitya sukham is in repeating the names of Krishna! And thus Jiva Gosvamin creates a brilliant work - 'Harinamamruta vyAkaraNam' - literally "The Grammar of Nectar of Names of Hari". It is based on Panini's grammatical rules, but every technical term is replaced by a meaningful facet of Vishnu.
Let us look at some of the parallels of Panini's technical terms and Harinamamruta vyakarana
vowels/varna/svara (ac) - sarveSvara:
first 10 vowels (ak) - daSAvatAra
each pair of vowel (hRsva and dIrgha) - ekAtmaka
hrsva - vAmana
dIrgha - trivikrama
pluta - mahApurusha
anusvara - vishnuchakra
anunAsika - vishnuchApa
visarga - vishnusarga
ka ca Ta ta pa - hari-kamalam
kha Cha Tha tha pha - hari-khadga:
ga ja da Da ba - hari-gada
Gha Jha dha Dha bha - hari-ghosha:
Adesha - virinci
Agama - vishnu
pumlinga - purushottama
strIlinga - lakshmI
napumsalinga - brahmajna
avyaya - alinga
lopa: - hara:

and so on. All the technical terms are carefully replaced by equivalent meaningful facets of Vishnu! Thus Jiva Gosvamin creates about 3192 sutras - a devotional parallel to Panini's AshtadhyAyI.

The intellectual devotee fulfils two purposes immediately - learn grammar by chanting the names of Vishnu. Talk about direct ascendency to moksha by bhakti through jnana!

Wednesday, December 9, 2009

From raama to raamaha

In a previous post we saw how a programming language can be written effectively in a natural language using Paninian sutra style.

In this post, let us do the exact opposite: converting a set of Panini-sutras to programming language style syntax to understand the rules of Sanskritam. The aim of the post is to kindle interest in Sanskrita studies for a typical software engineer to see the parallels of concepts of programming in Paninis methods. Statements and researches on Panini's methodology and how it is close to programming can be found plenty googling around. But as the ancient saying goes the proof of code is in the compiling. Of course I wont be delivering a code here, but hopefully a pseudo-code should convince any software engineer. Much of the pseudo-code can be polished and implemented in languages like Groovy/Ruby that supports expando, reflection etc.

Beginner Sanskrita students are often confused between rAma and rAma: (pronounced raamaha). Why do we add a visarga? Does the addition of visarga change the meaning?

The short answer is: Yes, the addition of visarga does add meaning.

In non-inflexional language like English, the prepositions provide the purpose of the noun. For eg by Rama, to Rama, from Rama, in Rama: in these cases "Rama" stays constant, while the prepositions provide the notion. Hindi also exhibits non-inflexional properties (rAm ne, rAm ko, rAm se, rAm par). In inflexional languages, the noun itself is modified to denote the purpose.

So what does this have to do with rAma: ? The word rAma: can be split into rAma + visarga. Here rAma is called the "stem" or "nominal stem". In Sanskrita its called prAtipadikam (प्रातिपदिकम्). prAtipadikam is defined as "arthavat adhAtu apratyaya" (अर्थवत् अधातु अप्रत्यय प्रातिपदिकम्) -- that which has meaning, and not a root, and not a suffix is called prAtipadikam. This stem will undergo modifications (inflexions) to fulfill the purpose of the noun.

Panini provides the methodology of modifying stem "rAma" to "rAma:" in a few sutras.

  1. su aujasamauTChasTAbhyAmbhis~gebhyAmbhyas~gasibhyAmbhyas~gasosAm~gyossup
  2. upadeSe ajanunAsikA it
  3. sa sajuSho ru:
  4. kharAvasanayo: visarjanIya:
The same in devanAgarI:
  1. सु औजसमौट्छस्टाभ्याम्भिस्ङेभ्याम्भ्यस्ङसिभ्याम्भ्यस्ङसोसाम्ङ्योस्सुप्
  2. उपदेशे अजनुनासिका इत्
  3. स सजुषो रु:
  4. खरावसनयो: विसर्जनीय:

Forget the tongue-wrecking, memory-bending first sutra for now. We will see its utility in the future posts.

Lets do some pseudo-code now.

//purpose of the noun - what do we want? singular/plural, masculine/feminine etc.
def purpose
//the stem to use, based on the purpose, this stem will now change
def stem = "rAma"
//anunAsika vowels for #2 (using single quotes to denote nasalization)
def nasalVowels { a', A', i', I', u', U', R', R.', e', ai', o', au' }

//Requirement: create a nominative-singular-masculine form of rAma -- prathamA vibhakti, ekavachanam, pumlinga from prAtipadikam rAma

def create_nominative_singular_ masculine_noun_from_stem(stem) {

if (purpose.isMasculine()  && purpose.isSingular() && purpose.isNominative()) stem.append("su'") //sutra #1: rAma -> rAmasu'
if (stem.endsWith(nasalVowel)) stem.removeLast(nasalVowel) //sutra #2: rAmasu' -> rAmas
if (stem.endsWith("s")) stem.replace("s", "ru'") //sutra #3: rAmas -> rAmaru'
if (stem.endsWith(nasalVowel)) stem.removeLast(nasalVowel) //sutra #2: rAmaru' -> rAmar
if (stem.endsWithAnyOf(KHAR)) stem.replace(stem.findLast(KHAR), ":")) //sutra #4
return stem //rAma:
}
Following the algorithmic steps, when the intention of one rAma is to be in nominative case (or as a subject), the end result is that a visarga is appended. Just 'rAma' does not denote anybody. "rAma:" denotes one masculine person in nominative/subject form.

Naturally, a question arises - Why dont we just add a visarga at the end instead of going thru all these rules? Note that this visarga is only for a masculine form. For neuter and feminine nouns, a su' will be added, but other rules from prevent them into morphing into a visarga. So Panini adds a common suffix and specifies rules on how it is applied in various situations.

In the next post, let us look at making the above method efficient.

Thursday, November 19, 2009

Sutra based Programming

Haven't software engineers had enough of programming languages? C and C++ were there for a while unchallenged. Then Java took over C/C++ pretty quickly. Even though you could create complex applications using Java and run on any platform, there is no dearth of new languages. Scala, Groovy, Ruby and very recently Go from Google.

All high-level programming languages do 4 basic things:

  1. Assignment
  2. Condition
  3. Loop
  4. Function/Procedure.
Loop and Function/Procedure/Subroutine are essentially glorified Goto.

Everything else is syntactic sugar.

Galileo has influenced us heavily to think math in terms of symbols. A mathematical symbol expresses an idea very concisely and effectively. Much more than a language could do.

So

x = 1
is more concise than saying "let x equal to 1".

Let me rephrase the above bereft of assumptions --


The mathematical expression "x = 1" is more concise than saying it in English "let x equal to 1".

But what if we could express "x = 1" much more concise in a natural language?

For e.g., let me just say

x 1
I just dropped the symbol "=". One symbol less! Whohoo! I also established a convention that whatever on left side is receiver and on the right side is provider. In a language like Sanskrit, for e.g., the "is/happens" is implicit (asti/bhavati). So no other verb is required. (There are other languages that exhibit this property too).

People think that just because ancient Sanskrit mathematicians did not use symbols, the works are not scientific. Symbol is just a convenience; if language could be more powerful than symbols, who needs them? As a side note, Sanskrita almost does not use punctuations (except for end of sentence - the pipeline character |). In contrast, English just can't be "communicated" without appropriate punctuations' usage.

To demonstrate the power of the language, let us look at a simple program using a pseudo-language.

//Pseudo-code to produce a random number and determine if its odd or even
s = 100;
r = (int) rand(s);
if (r % 2 == 0)
return "even";
else
return "odd";
The question is, can this program be expressed using natural language? Of course, we can write the whole program in plain English, but it wont be concise. (COBOL anyone, hello?)

Now lets apply the Sanskrit grammarian Paninian rules. I am going to keep the function names as is (in bold), but conjugate the variable names per Sanskrit rules (taking them to be consonant ending variables).


1: aSeSha: SUnyam  // No remainder 0 (No remainder equals 0)
2: s Satam         // s Satam asti (s is 100)
3: sa: rand r      // of s random is r (r is random of s)
4: int ca          // int also (r is also int of random of s)
5: even ra: aSeshe dvibhAjane  // "even" is of r during division of 2 when no reminder happens (on division by 2 of r has no reminder, it is even)
6: odd SeShe       // "odd" when there is a reminder

Here are the sutras in proper Sanskrit:

अशेष: शून्यम् |
स् शतम् |
स: वृथा र् |
अभिन्न: च |
समं र: अशेषे द्विभाजने |
विषमं शेषे ||

As you can see there are absolutely no mathematical symbols! A program is written purely by the expressive power of language. So what happened? How are they equal?

Using nominative case and the implicit "is", Panini eliminated the need for equals sign. Functions are defined via genetive case. Using the locative case, Panini provides the if-else condition. In effect, mathematical expressions are substituted by simply conjugating the variables.

That is the genius contribution of Panini to Sanskrita! Now a skilled poet could come and rearrange the above 6 sutras into a sloka format, and lo! there is sloka that tells us how to determine an even/odd number!

Let me attempt a half-baked sloka (May Sanskrita enthusiasts forgive me for such a blasphemy).

अशेषो शून्यं भूयात् सेकशतं वृथा रेफ: स: ।
अभिन्नश्च द्विभाजने विषमं समं शेषोऽशेषे ॥

Due to the occurrence of words like SeSha, SUnyam, aSeSha, dvibhAjane, abhinna the above can be mis-interpreted to refer Adisesha, SUnyavAda, Vishnu, Dvaita, Advaita etc. Now we have an example of a sloka referring to the gods and a mathematical algorithm encoded in it!

Tuesday, November 10, 2009

The Panini Certificate

Ever since Panini has written his monumental ashtadhyAyI, there have been plenty of commentaries on it and still continues to follow. Katyayana's Vartika, Patanjali's Mahabhashya, Kasika Vritti, Siddhanta kaumudi, Laghu kaumudi, Laghu siddhanta kaumudi are a few Sanskrit commentaries. When the West discovered Sanskrit, more commentaries sprang up.

For some reason, whosoever has tasted a little bit of Panini (not the Italian sandwich) feels so compelled to write a commentary on it. In modern days blogs have replaced commentaries. Whosoever even just heard about Panini, is compelled to write a blog about him. Just like me.


Kalidasa describes this feeling in a beautiful poem:


मन्द: अपि अमन्दताम् एति संसर्गेन विपश्चित: । (मालविकाग्निमित्रम् 2.7)

The company of the intelligent brings respect even to the dumbwitted. (Malavikagnimitram - Ch 2, verse 7)


The human mind tends to super-impose the characteristics of an associative object with the associating subject. So whoever reads Homer is a literat. Whoever likes Homer Simpson is dumb. Whoever loves Bambi is cute, whoever appreciates legumes are nuts. During a Panini study, a student undergoes one or more, usually all, emotions of bewilderment, amazement, overwhelmingness, stunning and finally dumbfounded, in any order. By this time he/she figured out that he/she got smarter just knowing Panini.


Ignorance shadows smartness.
Ankle deep into ashtadhyAyI, the student now questions Panini's sutras and methodology. 'This sutra does not make sense', 'This sutra could have been avoided and put elsewhere', 'This is an unfortunate sequence of sutras' etc - so the student passes judgement like my wife's hand distributes neighbor's ghee to everybody.


When does this feeling stop? When does the student hear the inner-voice 'Oh, shut up'? The post-Panini period was a cauldron of grammatical activities. It has been told that several grammarians attempted modifications, additions of sutras to ashtadhyAyI. In midst of all this, one great intellectual, one that the human mind has since not surpassed, stood up and proclaims "ashtadhyAyI is perfect beyond your pea-brained comprehension faculties".


And that brings this quote from that Great Rishi Patanjali himself, who drank ashtadhyAyI as easily as soda from a can and gives an 'Outstanding' certificate to Panini.


tatra aSakyam varNena api anarthakena bhavitum, kim punariyatA sUtreNa |


तत्र अशक्यम् वर्णेन अपि अनर्थकेन भवितुम्, किम् पुनरियता सूत्रेण ।

Even by a single letter (varNena api) is not possible (tatra aSakyam) to exist (bhavitum) meaningless (anarthakena), what to say about a whole sutra!

Saturday, November 7, 2009

Myths and Facts about Sanskrit

Myth 1: Sanskrit is a dead language.Myth-buster: Define dead
Myth-annhilator:

Both the 'elite' historians of India and pseudo-Sanskritists of the West have delighted themselves in the propaganda of calling it a dead language. So much so that its a fashion to call it so, even by the educated. Is Latin dead because nobody speaks it? Sumerian and Egyptian languages are dead. Is Sanskrit dead the same way?

A 'dead' language has a few advantages:

  1. It remains in exclusivity of a few (of those believing the dead language theory).
  2. It creates a certain aura around it, of being something special, thereby making the people who know it also 'special'
  3. Ordinary folks will not attempt to learn it.
Lets travel back in time any period between 500 BC - 1600 AD and see the facts.
  1. Sanskrit remained in exclusivity of a few (Brahmins)
  2. Sanskrit was treated special, so were the Brahmins special
  3. Nobody else except Brahmins attempted to learn

So all the above were true even before this dead-language theory (except now Brahmins are replaced by historians and pseudo-Sanskritists). So was Sanskrit dead all the time? If it was dead, why there are several thousand Sanskrit works available?

Myth 2: Sanskrit is a difficult language to learn.

Myth-buster:
Define difficult
Myth-annhilator:

Which language is not? German has several conjugations. Mandarin and Japanese have too many lines. French has the 'r'. Fact is every language is difficult until your perspective is adjusted.

In fact, the toughest of all these languages is English. The alphabet is not phonetical; each letter is represented by different shapes (capital and small); each word should be learnt phonetically independently; the grammar does not have a analytical approach that can be universally applied and not the last -
if you do not punctuate the sentence, you practically puncture the meaning.

None of these anomalies apply to Sanskrit. There is a deep science (SikshA) behind phonetics. There are no capitals and small letters. The science of Sandhi is perfected just to facilitate natural flow of speech. It adheres to philosophy of WYLIWIR - What you listen is what you read. Once the alphabets are learnt, the words can be read without any additional references, ie there is absolutely no guess work when reading or listening. Imagine how the complexity of text-to-speech systems will be reduced. You feed the meta-data of letters + pronounciation of each letter/compound to the system. And the system can read any word without additional effort. Any word! And all those spelling-bee contests, where students cram and rote completely arbitrary spellings can be replaced by something more analytical. The grammar is very analytical and algorithmic. Every technical term in grammar is very meaningful. In fact the word grammar itself is vyAkaraNa - which is split into vi + aa + karaNa = (vi) separate + aa (analyze) + doing (karaNa), ie "separation and analysis".

We learnt English as kids, when we never questioned logic, so it seems easy. I know some of my friends who came from non-English medium (ie learnt all subjects through regional language and exposed to English only around 5th grade), who have dreaded the English exams.

Myth 3: There is no benefit from Sanskrit.

Myth-buster:
Define benefit.
Myth-annhilator: There is no action without an effect.

Monetary Benefits:

  • Pseudo-Sanskrit academicians benefit by researching ancient Sanskrit books, habitually or purportedly misunderstanding the text, write books on it and do a Sanskrit-love-hate tango after the books are published.
  • "South-asian" pundits benefit from it with their half-baked Sanskrit knowledge (just because they were born in India) and feed the above group.
  • Vedic priests benefit from it as most rituals can be done only by them and not by anybody else
Ego-boosting benefits:

  • Elitist historians benefit by not letting any academicians challenge their pet theories, also called as history.
  • Students benefit it from learning it and showing-off to their lesser intelligent mortals
  • Bloggers benefit from it by belonging to an exclusive club and making sure no one understands what they write or turned off by lengthy blogs in these days of tweeting.
There are always benefits learning a new language. Its up to the person to figure out the weight of the benefit.
Myth 4: Sanskrit is the perfect language, mother of all languages and best suited for computers.
Myth-buster: Define perfect
Myth-annhilator:

This is a favorite of the overzealous right-wing enthusiasts. See this picture, where Sanskrit is one corner of the Indo-european languages. Academic opinions are pretty muddled regarding the theory of PIE, most of them peddaled by funding rather than facts. Several people have claimed that Forbes has claimed that computers have claimed that Sanskrit is best for themselves. I am not sure how much of this is misquoted. What is suitable for computers is the approach that Panini took to define a natural language such as Sanskrit, as derivable from formal rules. No other natural language is buffered by such formal rules. That method is very algorithmic, not the language itself.
Myth 5: Is it Sanskrit, Samskrit, Samskrita, Sanskrita, Samskritam?
Myth-buster:
Define is it.
Myth-annhilator:

The British anglicized it to cool-sounding Sanskrit, just because they never learnt anything to pronounce properly, including English. The North-Indians pronounce it as Samskrit (chopping-off the final vowel, per Hindi rules). Tamilians pronounce it as Samasgridam (adding the Dravidian grammatical touch to it). Somewhere in between these are the pronounciations Sanskrita, Samskrita etc, pretty much because of being unsure how to say it.

The correct pronounciation is sanskRitam, where n is nasalized, just like 'song'. The Ri is the most problematic and misunderstood. It should be pronounced thus: Say i (ee, as in tweet) first and then slightly roll the tongue upwards to touch little bit before the teeth.

Tuesday, November 3, 2009

The subhAshita-ratna-bhandAgara

When you think of Samskrita, one of the several things that come to mind immediately is subhAshitA. Literally it means "something well said", the english equivalent of which is 'proverb' or 'saying'. Proverbs are generally pithy sentences that reflect a truth of what happens, what should happen or sometimes a simple generalization. Many proverbs are advises, intended to correct the course of human behaviour, moral, ethical etc.

But subhAshitA-s are not just proverbs. subhAshitA-s come in very different flavors and cover a wide range of topics. There are subhAshitA-s for pretty much every occasion, every behaviour and on every natural thing that we see around. There are subhAshita-s that praise, denounce, praise and denounce at the same time (so called ninda-stuti), make fun, sarcastic, plead, humorous and exhibhit a range of other emotions. Some are philosophical, some are just down-to-earth. In fact there is a subhAshitA that makes a mockery of subhAshitA-s. Several poets have saved their heads by appeasing their kings with an appropriate subhAshita.

Throughout Samskrita literature (vAngmaya), there have been attempts at compilations of subhAshita-s too. Prime among them is the subhAshita-ratna-bhandAgara (SRB) which is a collection of almost ten thousand subhAshitAs on various topics. It consists of 7 chapters (prakarANa-s) - namely: mangalacharana, sAmAnya, rAja, chitra, anyokti, navarasa and sankIrNa. While there are so many wonderful verses there are some really stunning ones. One of them I quoted in my last post alluding to the Ocean's son-in-law selection process.

Here is another one from the navarasa (art) category. It again shows the poet's out-of-the-box thinking.

एकवस्तुम् द्विधा कर्तुम् बहव: सन्ति धन्विन: ।
धन्वी स मार एवैको द्वयो: ऐक्य: करोति य: ॥
eka vastu dvidhaa kartum bahava: santi dhanvina: |
dhanvI sa mAra evaiko dvayo: aikya: karoti ya: ||

Lets look at word by word:

eka vastum - one thing
dvidhaa - into two
kartum - to do
bahava: - many
santi - are
dhanvina: - archers
dhanvI - archer
sa mAra - (is) that manmatha (Lord of Love)
eva eka: - alone (only one)
dvayo: - of two
aikya: - into one
karoti ya: - he who does

There are many archers who can split one thing into two. But there is only one archer, Manmatha, who unites two into one.

This alludes to the fact that the Lord of Love sends an arrow to unit two people's heart. So the poet takes something that is meant for a singular purpose and uses it in the context of getting an entirely opposite result.