Thursday, March 4, 2010

Divide and Conquer....




It was high time for Lord Vishnu to incarnate on this material world, for the respect that children paid to parents had declined, the devils brain had increased all over, and the sufferings of the people in the world had also increased.

" Parithranaaya sadhunam vinasaya ca dushkrutham
dharma sampsthapanarthaya sambavami yuge yuge "
(- Bagavath Gita)

(For the protection of the devotees and the annihilation of the miscreants and to fully establish righteousness, he appears millennium after millennium). He descends, so that we all ascend. Thus after Parasurama avataram, he decided to incarnate as Rama.

Knowing this, there was a great competition among the different 'nakshatrams' (constellations) and 'thithis' as to who should take position in the galaxy during His advent on earth. The star 'Punarvasu' was lucky enough as it got its path cleared. Lord chose this to say that he would be the son of "vasudevar" in the next avtar. The thithis 'Ashtami','Navami' are not considered good. To fulfill their wishes, Lord agreed to advent on Navami Day, promising Ashtami in the next avataram. Thus we get chance to celebrate 'RamaNavami' and 'GokulaAshtami'.

Thus, the next issue to be addressed was the clan in which he had to take birth. Rightly, he chose the 'Ikshvahu' clan based at Ayodhya, the king being Dasaratha. He did so because the statue of Lord Ranganatha was with that kingdom and he wanted to serve him.

Then, he had to choose his mother, among the 3 wives of King Dasaratha. He chose "Kousalya" the senior among all. Generally, parents pray for having good children with them, but with Lord, it is the opposite.

While all this was taking place at Vaikuntam, there were other developments at Ayodhya. King Dasaratha was performing the "puthra kameti" yagam. The outcome of the yagam would be "pal payasam" that he had to give to his 3 wives - Koushalya, Kaikei and Sumithra.

The following incident was a very interesting one. King Dasaratha applied the concept of DIVIDE AND CONQUER to give "pal payasam" to his wives.

We Computer Science engineers use the DIVIDE AND CONQUER technique as an algorithm to solve a few standard problems such as sorting, searching etc. Wonder how Dasaratha used Divide and Conquer...He had to give the contents of the bowl (pal payasam) to his 3 wives.

He first divided the contents of the bowl into two. He gave the first half to Kousalya, the mother of Rama, and thus conquered it.

The remaining half was again divided into two. The first half was given to Kaikei, the mother of Baratha, and thus conquered it also.

The remaining half was again divided to two. The first half was given to Sumathra, the mother of Lakshmana. After thinking for a while, the other half was also given to Sumathra, the mother of Shaturguna this time. (Laksmana and Shaturguna were twins, Lakshmana being the elder)

Now look at this algorithm -

Algorithm DAndC(P)
{
if Small(P) then return S(P);
else
{
divide P into P1 and P2;
Apply DAndC to each of them;
return Combine(DAndC(P1),DAndC(P2));
}
}

Is there any difference between Dasaratha's algorithm and this one? I dont think so...

And after 12 full months, were born the 4 sons for King Dasaratha - Rama, Lakshmana, Bharatha and Shaturguna.

Proud to be a CS Engineering student ;)...

Cheers !!

- ∫.∫rikrishnan

4 comments:

  1. Lol!! Ultimate da.. Thank God the epic author is not alive..

    ReplyDelete
  2. i'm proud u r my junior. :D
    ulti post. loved it

    sindhuja

    ReplyDelete
  3. machi last thavira its al cool
    but.....ok kalakita

    ReplyDelete