Understanding it late – A joke, an algorithm, a few sutras

Read this famous joke:

A man went out for a business tour.

He asked his wife to receive (snail) mails and write down on each envelope when it was received.

When he returned, his wife dutifully gave him the bunch of mail.

Each enveloped was marked “arrived today”.

I read this joke when I was 8 year old. I ran into it every now and then. It annoyed me because I couldn’t understand it till I was 20 years old and actually did something similar to the man’s wife.

I had exactly one high level programming subject during my studies of Electronics and Communication in the year 1990. I was one of the few in my class who liked programming. Recursion meant “cursing again” for most students 🙂

Fibonacci solution is a famous exercise for teaching recursion.

fibonacci(1) = fibonacci(2) = 1;

fibonacci(n) = fibonacci(n-1) + fibonacci(n-2); for n>=3

I called it 2-fibonacci, where in there are two initializations

fibonacci(1) = fibonacci(2) = 1;

and two terms in the sum

fibonacci(n) = fibonacci(n-1) + fibonacci(n-2); for n>=3

Then, I thought of 3-fibonacci, 4-fibonacci and so on and wrote some successful programs (in Pascal!!)

The question then arose was, for a given depth p, can I write nth term of a p-fibonacci sequence?

I could not. I could not fit the variable number of initial conditions and variable length of sum into a program.

My friend Hiren Mehta gave an iterative solution back in 1990 itself. The trouble was, the solution had an assumed limit on p.

Last week, after asking a silly question here and on one of the usenet groups, I sat down and tried to code it again.

Guess what? It was simpler than I thought. The trouble was, I could not think of putting a for loop inside a recursive function. Here is the solution – very simple.

int fibonacci (int depth, int term) {
int returnValue = 0;
if (term <= depth) return 1;

else {


for (int i = 1; i <= depth; i++) returnValue += fibonacci(verbose, depth, term-i);


return(returnValue);

}
}

I read Narada Bhakti Sutras when I was 23 year old. One of them was,

स तरति, स तरति, लोकान् तारयति च. [He swims, he swims and makes the world swim.]

It bothered my mind why the second स तरति was used in the sutra. It wasn’t until I started helping my wife in solving some of her assignments in her B.S. (and I was 30 years old) that the sutra indicated the need of swimming “back” to the shore to take the world along. And yet, Narada doesn’t call it swimming back because probably at his level of consciousness, the second act of swimming may not be in the “back” direction.

Once I understood this, I could also understand the importance of systematic unlearning (and inviting subtle discomfort) that is needed to teach. I could also appreciate the difference in Buddhism between an Arhat and a Buddha. [I read Surangam Sutra when I was 25 – but the fault was with the seeker, not with the path shown.]

I could also understand a phrase of shiva mahimna stotram, नास्ति तत्त्वम् गुरो परम्  – there is no philosophy/knowledge other than a teacher.

Long after reading this phrase, I saw a program on Discovery (?) wherein they showed that the only intellectual difference between an ape and a man is the indication. Apes never indicate explicitly at some object or phenomenon to the other ape but humans regularly do. There no TEACHING in non-human apes.

Probably this was the reason why philosophy/knowledge in Sanskrit is called “That-ness” or तत्+त्व = तत्त्व. There could be no knowledge for humans other than the teacher-ness or तत्त्व!

It is interesting to see how my mind deceits. It refused to work in time with illogic (a joke), logic (the algorithm) and analysis (the sutras).

Did you face similar problems?

Advertisements

One comment on “Understanding it late – A joke, an algorithm, a few sutras

  1. Rakesh Bhat K says:

    Same thing had happened to me when i was in bca and the when i looked at programming languages for first time . 🙂 that was adding 2 numbers program which i had done before all other complex program 🙂 then started same exploring but i didnt know about the sutras . but when teaching c programming to my younger brother again i had to come to shore and make him swim 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s