Friday, September 29, 2006
Wednesday, September 27, 2006
Good Morrrninnnggggg Mumbai
जब यही जीना है दोस्तो तो फिर मरना क्या है?
पहली बरिश मे ट्रैन लेट होने की फ़िक्र है
भूल गये भीग्ते हुए टहलना क्या है?
सीरिअल्स् के किरदारो का सारा हाल है मालूम
पर मा का हाल पुछ्ने की फ़ुर्सत कहा है?
अब रेत पे नन्गे पाव टहल्ते क्यू नही?
108 है चैनल फिर दिल बहल्ते क्यू नही?
इन्टरनेट से दुनिया के तो टच् मे है,
लेकिन पङोस मे कौन रहता है जान्ते तक नही.
मोबाइल, ळैन्डलाईन सब की भरमार है,
ळेकिन जिगरी दोस्त तक पहुचे ऐसी तार कहा है?
कब डुबते हुए सुरज को देखा था, याद् है?
कब जाना था शाम का गुज़रना क्या है?
तो दोस्तो शहर की इस दौड् मे दौड् के करना क्या है
जब यही जीना है तो फिर् मरना क्या
- Jahnvi in Lage Raho Munnabhai
Sunday, September 24, 2006
Sunday, September 10, 2006
Thursday, September 07, 2006
Knuth's first encounter ...
"The manuals we got from IBM would show examples of programs and I knew I could do a heck of a lot better than that. So I thought I might have some talent."
- From the book "Out of their Minds: TheLives and Discoveries of 15 Great Computer Scientists" by Dennis Shasha and Cathy Lazere.
Tuesday, September 05, 2006
Types of geniuses
- Mark Kac
Saturday, September 02, 2006
A 404 to remember
The page sought could not be found
but, is the fault yours?
A 404 error message at the Department of Computer Science website of the University of California, Santa Barbara.
http://www.cs.ucsb.edu/sample
Tuesday, August 29, 2006
Richard Feynman
Friday, August 18, 2006
Knuth on sorting ...
Some people have suggested that "sequencing" would be the best name for the process of sorting into order; but this word often seems to lack the right connotation, especially when equal elements are present, and it occasionally conflicts with other terminology . It is quite true that "sorting" is itself an overused word ("I was sort of out of sorts after sorting that sort of data"), but it has become firmly established in computing parlance . Therefore we shall use the word "sorting" chiefly in the strict sense of sorting into order, without further apologies .
- From the book (epic) "Art of Computer Programming - Vol 3"
Tuesday, August 08, 2006
It tolls for thee ...
Entire of itself.
Each is a piece of the continent,
A part of the main.
If a clod be washed away by the sea,
Europe is the less.
As well as if a promontory were.
As well as if a manner of thine own
Or of thine friend's were.
Each man's death diminishes me,
For I am involved in mankind.
Therefore, send not to know
For whom the bell tolls,
It tolls for thee."
These famous words were taken from the "Devotions upon Emergent Occasions", by John Donne, circa 1623.
I am not much into classical literature (atleast currently), but this piece stands out. It shows us even in our 'nuclear' world, we are all interconnected. Another man's (or woman's for that matter) loss is my loss. Here a bell tolling signifies a death. So next time do not inquire who died, the bell tolled for you.
What could be a more powerfull expression of brotherhood than this!
Friday, August 04, 2006
Diplomacy ...
1. Sir Humphrey – Permanent Cabinet Secretary
2. Sir Frederick – Permanent secretary of the Foreign and Commonwealth office
3. Bernard Woolley – Private secretary to the Prime Minister
-------------------------------
Sir Frederick: There are 157 independent countries in the world, we have dealt with them for years. There is hardly any MP who knows anything about any one of them.
Sir Humphrey: Show them a map of the world, most of them will have a job finding the Isle of Wight.
Bernard: Well, politicians can’t be that ignorant.
Both secretaries laugh.
Sir Frederick: Very well, sit down Bernard.
Sir Frederick: Where is Upper Volta?
Bernard: um …
Sir Humphrey: What’s the capital of Chad?
Bernard: um …
Sir Frederick: What language do they speak in Bali?
Bernard: um …
Sir Humphrey: Who is the president of Peru?
Bernard: um …
Sir Frederick: What is the national religion of Cameroon?
Bernard: um …
Sir Humphrey: Bernard, you should stand for parliament.
Friday, July 28, 2006
Saturday, July 22, 2006
Management :))
So the manager said: "All right, in that case you may set your own working hours, as long as you finish your projects on schedule." The programmers, now satisfied, began to come in at noon and work to the wee hours of the morning.
- From the book "The Tao of Programming" translated by Geoffery James, one of my personal favorites. Must read for any programmer. You can get the complete text from here.
Monday, July 17, 2006
Princeton ...
Fine Hall housed the world’s most competitive, up-to-the-minute mathematics department. Next door -connected, in fact - was the nation’s leading physics department, whose members, including Eugene Wigner, had driven off to Illinois, California, and New Mexico during the war, lugging bits of laboratory equipment, to help build the atomic bomb. A mile or so away, on what had been Olden Farm, was the 118 Institute for Advanced Study, the modern equivalent of Plato’s Academy, where Einstein, Gödel, Oppenheimer, and von Neumann scribbled on their blackboards and held their learned discourses.
Visitors and students from the four corners of the world streamed to this polyglot mathematical oasis, fifty miles south of New York. What was proposed in a Princeton seminar one week was sure to be debated in Paris and Berkeley the week after, and in Moscow and Tokyo the week after that. ”It is difficult to learn anything about America in Princeton”, wrote Einstein’s assistant Leopold Infeld in his memoirs, “much more so than to learn about England in Cambridge”.
In Fine Hall English is spoken with so many different accent s that the resultant mixture is termed Fine Hall English.... The air is full of mathematical ideas and formulae. You have only to stretch out your hand, close it quickly and you feel that you have caught mathematical air and that a few 51 formulae are stuck to your palm.
If one wants to see a famous mathematician one does not need to go to him; it is enough to sit quietly in Princeton, and sooner or later he must come to Fine Hall.
- From “A Beautiful Mind”, the (e)book.
Friday, July 07, 2006
The Milky Way
One particular topic which singularly set the discussion on fire was about our galaxy, the Milky Way. From childhood, we have been taught and found in textbooks that our galaxy looks something like this when seen from the top. I asked him like how did they arrive at this. I assume that nobody would have peeped out and seen how it looked like. Intuitively, exploring the structure of other galaxies seems to be much easier than doing that for our own galaxy.
However, my friend did have a reply which I found quite interesting. He said that we realized that planet earth was spherical long before we ventured out in outer space. I said that there is a rather simple explanation for that. When you stand on a coastline and see a ship approaching you, you first see the top of the mast followed by the sails followed by the complete ship. Also, this is true for all directions at any point on Earth. If that distance is measured, using some trigonometry the curvature of Earth can be found out.
He said that somebody must have done an analogous experiment for the Milky Way. However, we couldn’t think further. Can you help us?
Note: Neither of us is an astronomer, nor has had any formal study of it. We are just lowly Computer Science grads ;). But knowing about the cosmos is not the primary motive here. It is all about challenging the assumptions/half-truths rather than accepting them blindly, and to prove or disprove them for yourself. I feel that true understanding can come only through this way. My friend put it more beautifully. He said that this path is something even bigger than that. It is a path to enlightenment.
Thursday, July 06, 2006
The Ancient Masters
The programmers of old were mysterious and profound. We cannot fathom their thoughts, so all we do is describe their appearance. Aware, like a fox crossing the water. Alert, like a general on the battlefield. Kind, like a hostess greeting her guests. Simple, like uncarved blocks of wood. Opaque, like black pools in darkened caves. Who can tell the secrets of their hearts and minds? The answer exists only in Tao.
Grand Master Turing once dreamed that he was a machine. When he awoke he exclaimed: "I don't know whether I am Turing dreaming that I am a machine, or a machine dreaming that I am Turing!"
- From the book "The Tao of Programming" translated by Geoffery James, one of my personal favorites. Must read for any programmer. You can get the complete text from here.
Monday, July 03, 2006
Goodbye Lenin
I also did read quite a lot about German history, particularly post-war (primarily from Wikipedia). Was really fascinated by the fact that a city (Berlin) standing at the cross points of two civilizations. I always wondered how life would have been on both sides of the wall, with perennial atmosphere of hostility but still being united by a common language and culture.
I saw a wonderful movie last Sunday - "Goodbye Lenin". It’s a movie about an East German family coming to terms with life post re-unification. I was greatly impressed by the movie and also as I had a German version (with English subtitles); it helped me brush up my language as well. Also I really enjoyed the experience of seeing the things which I read happen live before my eyes.
The story goes something like this. An average German family is living happily in East Berlin. Fearing persecution for not towing the party line, the father absconds into the west. But still the mother appears to be a headstrong socialist. Now in the late 80's the boy Alex grows up and is clearly dissatisfied by the scheme of things. In 1989 at the 40th anniversary of East Germany (Deutsche Demokratische Republik - DDR), an evening-walk protest is organized. As expected, the troops called "greens" brutally crush the protest. While all this is happening, mother is a mute spectator. As our hero Alex is being 'softened', mother faints. It is later declared that she went into coma after having a major heart attack.
When she is asleep, the wall collapses and Germany reunifies. Capitalism storms into the East and along with a deluge of westernization. In end (after a few months) the East ceases to exist.
In 1990, mother wakes up but is still in a fragile state. Now the doctor strongly advises Alex that she should be kept far away from any excitement, otherwise results could be fatal. Now Alex moves her into their house and comically tries to create an atmosphere like the old times, with bogus TV broadcasts, hiring kids to sing patriotic songs etc.
The movie goes on with many twists and turns and incidences that will make you laugh and cry and at least I didn't anticipate the ending.
Tuesday, June 27, 2006
The Parable of the Black Belt
"Before granting the belt, you must pass one more test," says the sensei.
"I am ready," responds the student, expecting perhaps one final round of sparring.
"You must answer the essential question: What is the true meaning of the black belt?"
"The end of my journey," says the student. "A well-deserved reward for all my hard work."
The sensei waits for more. Clearly, he is not satisfied. Finally, the sensei speaks. "You are not yet ready for the black belt. Return in one year."
A year later, the student kneels again in front of the sensei.
"What is the true meaning of the black belt?" asks the sensei.
"A symbol of distinction and the highest achievement in our art," says the student.
The sensei says nothing for many minutes, waiting. Clearly, he is not satisfied. Finally, he speaks. "You are still not ready for the black belt. Return in one year."
A year later, the student kneels once again in front of the sensei. And again the sensei asks:
"What is the true meaning of the black belt?"
"The black belt represents the beginning -- the start of a never-ending journey of discipline, work, and the pursuit of an ever-higher standard," says the student.
"Yes. You are now ready to receive the black belt and begin your work."
- From the book "Built to Last: Successful Habits of Visionary Companies" by James Collins and Jerry Porras
Sunday, June 25, 2006
Martin discovers infinite recursion
The dragon peered suspiciously as Martin unrolled the scroll, placing a candlestick at each end to hold it flat. ‘‘This scroll makes no sense,’’ the dragon said. ‘‘For one thing, it’s got far too many parentheses.’’
‘‘The writing is a little strange,’’ Martin agreed, ‘‘but I think I’ve figured out the message. It’s an algorithm for computing Fibonacci numbers.’’
‘‘I already know how to compute Fibonacci numbers,’’ said the dragon.
‘‘Oh? How?’’
‘‘Why, I wouldn’t dream of spoiling the fun by telling you,’’ the dragon replied.
‘‘I didn’t think you would,’’ Martin shot back. ‘‘But the scroll says that Fib of n equals Fib of n-1 plus Fib of n-2. That’s a recursive definition, and I already know how to work with recursion.’’
‘‘What else does the scroll say?’’ the dragon asked.
‘‘Nothing else. Should it say more?’’
Suddenly the dragon assumed a most ingratiating tone. Martin found the change startling. ‘‘Dearest boy! Would you do a poor old dragon one tiny little favor? Compute a Fibonacci number for me. I promise to only ask you for a small one.’’
‘‘Well, I’m supposed to be upstairs now, cleaning the cauldrons,’’ Martin began, but seeing the hurt look on the dragon’s face he added, ‘‘but I guess I have time for a small one.’’
‘‘You won’t regret it,’’ promised the dragon. ‘‘Tell me: What is Fib of four?’’
Martin traced his translation of the Fibonacci algorithm in the dust:
Fib(n) = Fib(n-1) + Fib(n-2)
Then he began to compute Fib of four:
Fib(4) = Fib(3) + Fib(2)
Fib(3) = Fib(2) + Fib(1)
Fib(2) = Fib(1) + Fib(0)
Fib(1) = Fib(0) + Fib(-1)
Fib(0) = Fib(-1) + Fib(-2)
Fib(-1) = Fib(-2) + Fib(-3)
Fib(-2) = Fib(-3) + Fib(-4)
Fib(-3) = Fib(-4) + Fib(-5)
‘‘Finished?’’ the dragon asked innocently.
‘‘No,’’ Martin replied. ‘‘Something is wrong. The numbers are becoming increasingly negative.’’
‘‘Well, will you be finished soon?’’
‘‘It looks like I won’t ever be finished,’’ Martin said. ‘‘This recursion keeps going on forever.’’
‘‘Aha! You see? You’re stuck in an infinite recursion!’’ the dragon gloated. ‘‘I noticed it at once.’’
‘‘Then why didn’t you say something?’’ Martin demanded.
The dragon grimaced and gave a little snort; blue flame appeared briefly in its nostrils. ‘‘How will you ever come to master recursion if you rely on a dragon to do your thinking for you?’’
Martin wasn’t afraid, but he stepped back a bit anyway to let the smoke clear. ‘‘Well, how did you spot the problem so quickly, dragon?’’
‘‘Elementary, boy. The scroll told how to take a single step, and how to break the journey down to a smaller one. It said nothing at all about when you get to stop. Ergo,’’ the dragon grinned, ‘‘you don’t.’’
The End
_________________________
Here ends the story of Martin. Kudos to its original author David Touretzky, a prof at CMU.
Saturday, June 24, 2006
The Dragon's Dream
‘‘I had a most curious dream,’’ the dragon said. ‘‘It was a recursive dream, in fact. Would you like to hear about it?’’
Martin was stunned to find the dragon in something resembling a friendly mood. He forgot all about the alchemist’s latest problem. ‘‘Yes, please do tell me about your dream,’’ he said.
‘‘Very well,’’ began the dragon. ‘‘Last night I was looking at a long loaf of bread, and I wondered how many slices it would make. To answer my question I actually went and cut one slice from the loaf. I had one slice, and one slightly shorter loaf of bread, but no answer. I puzzled over the problem until I fell asleep.’’
‘‘And that’s when you had the dream?’’ Martin asked.
‘‘Yes, a very curious one. I dreamt about another dragon who had a loaf of bread just like mine, except his was a slice shorter. And he too wanted to know how many slices his loaf would make, but he had the same problem I did. He cut off a slice, like me, and stared at the remaining loaf, like me, and then he fell asleep like me as well.’’
‘‘So neither one of you found the answer,’’ Martin said disappointedly.
‘‘You don’t know how long your loaf is, and you don’t know how long his is either, except that it’s one slice shorter than yours.’’
‘‘But I’m not done yet,’’ the dragon said. ‘‘When the dragon in my dream fell asleep, he had a dream as well. He dreamt about—if you can imagine this—a dragon whose loaf of bread was one slice shorter than his own loaf. And this dragon also wanted to find out how many slices his loaf would make, and he tried to find out by cutting a slice, but that didn’t tell him the answer,
so he fell asleep thinking about it.’’
‘‘Dreams within dreams!!’’ Martin exclaimed. ‘‘You’re making my head swim. Did that last dragon have a dream as well?’’
‘‘Yes, and he wasn’t the last either. Each dragon dreamt of a dragon with a loaf one slice shorter than his own. I was piling up a pretty deep stack of dreams there.’’
‘‘How did you manage to wake up then?’’ Martin asked.
‘‘Well,’’ the dragon said, ‘‘eventually one of the dragons dreamt of a dragon whose loaf was so small it wasn’t there at all. You might call it ‘the empty loaf.’ That dragon could see his loaf contained no slices, so he knew the answer to his question was zero; he didn’t fall asleep.
‘‘When the dragon who dreamt of that dragon woke up, he knew that since his own loaf was one slice longer, it must be exactly one slice long. So he awoke knowing the answer to his question.
‘‘And, when the dragon who dreamt of that dragon woke up, he knew that his loaf had to be two slices long, since it was one slice longer than that of the dragon he dreamt about. And when the dragon who dreamt of him woke up...."
‘‘I get it!’’ Martin said. ‘‘He added one to the length of the loaf of the dragon he dreamed about, and that answered his own question. And when you finally woke up, you had the answer to yours. How many slices did your loaf make?’’
‘‘Twenty-seven,’’ said the dragon. ‘‘It was a very long dream.’’