Sunday, March 17, 2013

Chitragupta's Algorithm

Body Master Chitragupta

Startled by the clamor around, I woke up to find myself in what looked like a court from Medieval times.  Well built mustached men with cold steely eyes moved around with immaculate precision.  From unseen dungeons below, I heard voices screaming for mercy.

As I walked through the halls of this presumed royal palace, first in awe, then in total curiosity, I bumped into a giant of man with a peculiar head gear and what looked like a large accountant's ledger in his hand.   He whirled around and let out a weak smile.

"Chitragupta, I presume?", I inquired, in a moment of inspired guess work.

"Indeed", he responded in a deep voice bordering on growling.  "I am the Body Master, keeping track of Karma for all souls.  The one and only trusted lieutenant of Lord Yama, the God of Death".

"Nothing to worry.", he added.  "Your time has not come yet.  I just need your assistance on an important matter".


Chitragupta's strange request

"I am tired of keeping track of Karma for all humans", Chitragupta began.  "While I am perfectly capable of handling the job", Chitragupta continued, feeling the edges of the large ledger book in his hand fondly, "my skills are better employed in more pressing matters".

Such as watching Apsaras dance in Lord Indra's court, I thought.

Ignoring my thoughts, Chitragupta continued.  "I have seen how you humans automate repetitious tasks on Earth.  I was looking for a good Programmer to help me with these chores.  So I had you invited here."

More like kidnapped, I muttered to myself.  Eyeing greedily around the sumptuous hall, I thought the assignment may be worth my time after all.

"You will be compensated handsomely based on your performance", Chitragupta nodded agreeably.

Jesus, it is hard to negotiate with a client who can read my mind.

"We don't allow people to use Gods from other religions here", prompt came the warning.

"Is your boss, Lord Yama on board with this arrangement?  I do not want my contract cancelled in the middle of the project.", I cautiously inquired.

Chitragupta's rubicund face fell.  Staring blankly at a distant palace, "I am going to demand more budget at my annual review.  I deserve a break, don't I?"


Chitragupta explains Karma

As a good Programmer, I then started gathering the client requirements in a series of interviews with Mr. Gupta over the next few days.

"Can you walk me through your current Karma algorithm?", I requested Chitragupta, when he had some spare time from scribbling his book.

"Okey dokey.  I just assign points to each action a person performs.  Positive points for good deeds; negative for demerits."

"Some use cases?"

"Sure.  +2 for telling the truth; -2 for each lie; +5 for lending a helping hand; -10 for cheating; +150 for rendering hymns to Lord Yama."

"You must be a busy God monitoring every act", I mused.

"Don't get me started", Chitragupta growled.  "All day long I just jot down these damn points.  And I have only two hands at that.  Some of the other Gods around here have 4 arms or more, but do nothing more than pose for pictures.  This is where you come in.", he looked at me hopefully.

"How do you handle abnormal terminations in your Karma algorithm?"

"You mean suicides?  It is a total sin.  It is we Gods who decide termination criteria for each soul.  If humans decide to terminate their lives at own will, what happens to our job security?"

Then Chitragupta added as an after thought: "But if a lady commits suicide when her husband dies, she is granted bonus merit points. These days Government bans such actions however", he added wistfully.

"What happens to a person who spent a corrupt life on Earth, enjoying his time in spite of the Scriptures?"

"After a brief stay here", pointing out to an invisible dungeon below, "we send him packing back to Earth.  We give him another chance to pray to us Gods."

"And to one who led a pious life, eschewing the bountiful luxuries that Earth has to offer, taking no pleasure in life, always spending his time stoically thinking of The Almighty?"

"We liberate him.  No more pleasures for him. We just kill his soul, taking it out of the game."  He clapped his hands gleefully.

"Let me get this right.  If a person has any positive points, he needs to return to Earth to enjoy life again? Not bad, if you ask me.  Does the algorithm provide a way out of this though?"

"The person can sacrifice all his merits to Lord Vishnu.  He kindly accepts such give-away.  How do you think He and his wife Goddess Lakshmi are so rich?", Chitragupta rolled his eyes.

"Now, can the person assign his negative points to Lord Vishnu as well?"

"No.  He does not accept it.  The person simply needs to suffer to burn off the negative points."


Decision Algorithm

Me: How do you decide whether a person's act is good or bad?
C. Gupta: It is obvious, no?  For example, harming your teacher is bad.  Very bad, indeed.
Me: Arjuna attacked his Guru Drona with weapons, per Mahabharatam.  But Lord Krishna applauded this was totally cool.
C. Gupta:  Don't worry about the edge cases.  Just ensure your solution works for at least 80% of the applicable scenarios.


Karma for animals

Me: Do animals incur Karma due to their act?
C. Gupta: Animals? Ha, no!  As it is, I have my hands full, keeping track of Karma for humans.
Me: So when a soul gets transformed to an animal, it can do whatever it damn well pleases?
C. Gupta: Yeah.  It gets a freebie life.
Me: Looks like being an animal is not bad, after all.


Idiosyncrasies of Big Gods

Me: When a person dies, his accumulated Karma gets carried over to the next cycle, right?
C. Gupta: Pretty much.
Me: Well, there are exceptions?
C. Gupta: Usually I do not cut a slack.  But Lords Vishnu and Shiva have demanded that if a person utters their names at the last breath, I cancel his Karma and liberate his soul.  And mind you, Lord Vishnu alone has over 1000 official names.
Me: So you hang around and pay close attention to what a person mutters at the end of product cycle?
C. Gupta:  Yes. All these journeys to be around each person passing away pretty much exceeds the travel miles the rest of Gods put around here. And I don't even have an official vehicle!  Our department has one  vehicle, the black buffalo.  My boss, Lord Yama, monopolizes its use, strutting around for cameo appearances in movies.
C. Gupta:  There are occasions where I don't even know if the guy said Rama or Llama.  I just give him the benefit of doubt.
Me: Any other exceptions that my algorithm should respect?
C. Gupta: Oh, yes.  If the person dies in the city of Varanasi, at least within the city's official boundary recorded in the State Government's survey books, he gets liberated.  Thus Lord Shiva has decreed.
Me: I am sure Lord Vishnu has competing requirements.
C. Gupta: You bet.  Lord Vishnu has decreed that any one passing away on His favorite day,Vaikunta Ekadasi, gets a free pass as well.
Me: Any other Gods with such special requirements?
C. Gupta: (sighs)  Only last month, Lord Ganesha was demanding liberation to people trampled to death by elephants.  When I protested in the Councils of Big Gods that at this rate, we can simply abolish Karma for all, Lord Ganesha backed off.


Thus spoke Chitragupta

Thus I spent several more sessions of requirements gathering with Chitragupta.  The more he explained Karma, the less I seemed to understand it.

Sensing my troubled face, Chitragupta helpfully offered, "Other than that, the algorithm is pretty intuitive.  It is not as complicated as your IRS tax laws."

"Why was Stalin, who murdered so many people, still led a wonderful life till the end?"

"Our jurisdiction does not extend beyond the Bharatavarsha continent."

"Well.  What about Gandhi then?  He was the apostle of non-violence, harming no one within 100 feet.  Yet, he met a brutal end."

"That is because of his past lives."

Pointing to a politician in newspaper I exclaimed, "No one is admittedly more terrible than him.  Why is his life getting better and better?"

"He will pay for his sins in his future lives."

"Why not settle the account fair and square within one's life? At least we humans can understand the logic better."

"If we keep things so simple, why would you need us Gods, then?  We need job security too.", Chitragupta looked at me contemptuously.


Escape from Chitragupta

By now, I was pretty convinced this was a doomed project.

"Body Master, Chitragupta!", I addressed.  "If there is some logic to Karma, I can automate it.  But this is a bunch of ever-changing rules and exceptions.  No one can help you, I am afraid."

"That is unacceptable.  Breach of contract is a culpable offense here."

I could see a bunch of thugs approaching me from behind.  I grabbed a pot of boiling oil, swung around, poured it on their heads, and started running.

Behind me, Chitragupta screamed, "Get him back. Ring the bell.  Ring the bell."

As I groped around, I found the alarm clock buzzing me for another day of hard programming, this time for a more reasonable client.