Wednesday, February 23, 2005

The Monty Hall problem

This particular problem has caught the fancy of some (Microsoft) interviewers lately but sometime back it was the hot topic for debates among top Mathematicians worldover. Marilyn Vos Savant was a columnist in Parade magazine (Appearently she is listed in Guiness Book of World Records for highest IQ (228)!). Her column used to invite logical questions from the readers and she used to solve the problems and supply the reasoning too. The column stirred up a hornet's nest when it published the solution by Marilyn for following problem:

Suppose you're on a game show, and you're given the choice of three doors. Behind one door is a car, behind the others, goats. You pick a door, say number 1, and the host, who knows what's behind the doors, opens another door, say number 3, which has a goat. He says to you, "Do you want to pick door number 2?" Is it to your advantage to switch your choice of doors?

Craig. F. Whitaker
Columbia, MD

We'll come to Marilyn's solution but before that there's an intesting piece of trivia about how it got the name - The Monty Hall's Problem/Paradox. Monty Hall was the presenter of Let's Make A Deal, which was a famous game show on american television back in 70's. The aforementioned problem is taken from the show. There was one episode where Monty did the exact thing; made the contestant choose one of the three doors and opened one not having the car. Now the contestant was asked whether s/he wants to change the choice. This made certain Mr. Whitaker think about the mathematical side of it!

Coming back to Marilyn; she suggested that the contestant should switch the doors. This response caused an avalanche of responses, mainly from people disagreeing with her! Various professors, PhDs and teachers challanged her solution. They had decided that it doesn't matter if the contestent switch or not! Due to the fervor created by Ms. Savant’s two columns, the New York Times published a large front page article in a 1991 Sunday issue which declared: “Her answer... has been debated in the halls of the C.I.A. and the barracks of fighter pilots in the Persian Gulf. It has been analyzed by mathematicians at M.I.T. and computer programmers at Los Alamos National Laboratory in New Mexico. It has been tested in classes ranging from second grade to graduate level at more than 1,000 schools across the country.” After several rounds of communication, she finally asked people to organize experiments (by computer simulation) and send her the results. The results matched her claim to astonishing degrees. But not all were satisfied by this experimental proof. Later several people came forward with theoritical proofs. The following picture explains the solution by taking all the possible outcomes and hence proving that the chances increase to 2/3 if the switch is made!



The catch is in the phrase "..and the host, who knows what's behind the doors..". If it was to be the case where the host was also as clueless as the contestent, the switch wouldn't have made any difference. But since the host knows beforehand about the gate with the car behind it and knowing that opens a gate which doesn't have the car behind it, it would increase the probability of winning car by switching the gates! Hats off to Marilyn for getting this non-intutive solution!

P.S. : I got curious about the origin and explaination after I read about this problem in The Curious Incident.... The protagonist, Christopher, has solved the problem all by himself in the book!

Monday, February 21, 2005

Amo a doctores!

I love doctors and there are no two ways about it! Medicine is perhaps the most polished profession around. Doctors are essentially of a mature age and well read too, after spending a major portion of their lives among books (and stiffs!). Like us engineers, their PR skills are not limited to just interviews. More often than not you'll find doctors more eloquent and affable than software engineers.

My liking for them has developed over the years. The earliest recollection of an encounter with a doctor would have me as a toddler (pre-school kid, Oh those sunny days!). I was a small kid with a shaky tooth, he was a dentist with big clamps, still he didn't infuse fear in me. Au contraire, we were chatting happily until he plucked it out in a smooth swift motion. Ice-creams did finally make up for the pain (and for the uneasy gap in my dentition!). Next, in Anoopgarh, we had one doctor uncle in our social circle who always used to scare us with tonsillitis! We kids aptly named him Tonsil Uncle! Barring rare shots, he was again a gentleman, very nice to us kids. In Bikaner, we had Dr.Chahar (Chahar Uncle). (Un)Fortunately I didn't have much business with him. In Bharathpur, I was prescribed some blue pills by Dr. Digamber Singh (the present Health Minister of Rajasthan) to fix the problem of irregular metabolism timings (used to wet my bed once a month or so :( )! He was again good uncle, their family is still very close to ours.

So all in all, doctors are humble people. There can be various reasons, but one I find very reasonable is because they are allowed to practice ONLY after entering their 30's and by then age has taken a toll on the mischievous kid in them. Just imagine, how it would feel to study and study and study, first to enter college for MBBS, then for MD + specialization! We engineers are blessed people, just clear JEE once, then even if you don't study much for the next four years, you are bound to end up with a decent paying job.

Friday, February 18, 2005

The Curious Incident of the Dog in the Night-Time - Mark Haddon

Confession time: When I bought the book from the roadside vendor along with The Broker, I had no clue what is this book about. But I remembered reading about how good it was or someone having recommended it highly. The cover read "Winner : Whitbread book of the year" and the graphics were kinda abstract and funny! I thought, rather assumed, it will be another light/comedy book.

The first thing I noticed when I started to read was the unusual chapter numbers (It has chapters listed by prime numbers!). At first I thought I got a damaged copy with the first chapter missing (Note: 1 is neither prime, nor composite :) ). Many misconceptions about the book (and my copy) were lifted as I dug deeper into the book.

As a matter of fact, although the book is not a comedy, its very interesting nonetheless! Its about Christopher, who is a special kid (I always thought calling someone special is just euphemism for retarded, but he is certainly not retarded! He is indeed special kid!). He has a photographic memory (My memory is like a film….And when people ask me to remember something I can simply press Rewind and Fast Forward and Pause like on a video recorder….If someone says to me, 'Christopher, tell me what your mother was like,' I can rewind to lots of different scenes and say what she was like in those scenes.). He never lies (A lie is when you say something happened which didn't happen. But there is only one thing which happened at a particular time and a particular place. And there are infinite number of things which didn't happen at that time and that place. And if I think about something which didn't happen I start thinking about all the other things which didn't happen.). He has nutured his own simple philosophical thinking (I think people believe in heaven because they don't like the idea of dying, because they want to carry on living and they don't like the idea that other people will move into their house and their things into rubbish.). He is intelligent enough to score an 'A' on 'A' level math. He is also a walking encyclopedia, he can talk about various topics under the sun, varying from types of heart attacks to black holes to molecules to species of monkeys. He keenly observes his surroundings, contrary to the grazing "normal" people do. Sometimes, just because of this, he can't handle too much information at once. He normally avoids crowded places as he can't take all the information coming into his brain. In such situations, he kneels down and starts groaning (to cut off the noise!). He thinks of it just like pressing CTRL-ALT-DEL on his computer (this is a metaphor, he can differentiate between a metaphor and a simile, but can't understand similes :) ).

The adventure starts when his teacher at his (special) school encourages him to write a book. As he can't lie, he thinks of writing a book from what he observes. He wants to write a murder mystery (his favorite book is The hound of Baskervilles by Sir Arthur Conan Doyle). He starts to write a book on the murder of a dog in the neighbourhood. When his teacher tells him that no one cares much if the dog is dead, he argues that two hounds were murdered in The hound of Baskervilles :)! He starts to investigate this murder, much against his father's wishes and in the process he unveils some very important realities about his own life!

The charcter I hold in very high regard is Christopher's father, Ed. He is really patient with Christopher. Ed's wife has left him because it was too painful for her to take care of Christopher. Ed gets really heart-broken when Christopher also runs away from home. It's really heart-rending to see how hard he tries to win his son's trust back. His situation is kind of hopeless and somewhat depressing.

It's the first novel for Hadden and indeed an extra-ordinary effort on his behalf. I recommend this book highly to all readers! Welcome to the curious world of Christopher.

Favorite quote from book: Prime numbers are what is left when you have taken all the patterns away. I think prime numbers are like life. They are very logical but you could never work out the rules, even if you spend all your time thinking about them.

Wednesday, February 16, 2005

Cyborgs are here!

They don't get hungry.
They're not afraid.
They never forget their order.
They don't care if the guy next to them is shot.
Will they perform better than humans -- we'll see that :).

Sci-fi writers have fancied AI enabled, swiftly moving, mean killer machine robots for decades now. Movies like The Terminator, RoboCop potray immense possibilities in the field of robotics. Matrix and Terminator series even saw the possibility of a take over of Earth by machines!

All this is not longer figments of imagination but very much here (we still have to see the take over deal :) ). The article here informs us about the RnD work being carried out by the US Army in this direction. They are looking for possibilities in this area for last 30 years and it is supposed to take around 30 more years to manage an entirely independent army of robots. But they are supposed to be a major fighting force in next 10 years. Initially they will be manually controlled remotely. Robots in battle, as envisioned by their builders, may look and move like humans or hummingbirds, tractors or tanks, cockroaches or crickets. With the development of nanotechnology - the science of very small structures - they may become swarms of "smart dust." The Pentagon intends for robots to haul munitions, gather intelligence, search buildings or blow them up.

Already we've several robots digging Iraq for land-mines, small unmanned planes doing the spy work. AI is coming up as an area of great potential. It was supposed to get stagnent some time back, but the advent of robotics and putting intelligent decision trees in their heads has revived the entire research community for AI.

So next time you hear, Is it a bird? Is it a plane?, it may not necessarily be Superman there :).

Tuesday, February 15, 2005

Cellphones and your privacy.

Recently Supreme Court ordered Indian Govt. to curb the nuisance created by the tele-marketing people. How often you've received these annoying phone calls about credit cards, house loans, and what not. RG will vouch for it, how annoyingly dumb these tele-marketers are (He was once asked to go for Silver card since he already had Gold card :) ). And they just don't let go of it so easily! Certainly its a good decision and a definite relief for the customers.

But its just a teeny-weeny side-effect of the flourishing mobile market in India. If you thought tele-marketing was an invasion to your privacy, think about a scenerio where your location can be tracked as accurately as some meters, or even less! Read this and you'll come to know that your new mobile phone is already acting as a homing device, sending signals to satelites constantly revealing your whereabouts! There is another simple way to detect your current location via your mobile phone. Mobile phone service companies divide the entire area in hexagonal cells, defined with the help of three towers. You are serviced by the nearest towers. Currently this information is utilized by the service providers for LBS (location based services). But its quite elementry to use the location of three nearest towers and work out the exact location of the mobile phone.

Right now the service providers are using this information to provide inane LBS, but no law prevents them to sell this information. This now, is a scary scenario! The constitution provides everyone of us the right of privacy (Privacy : The state of being free from unsanctioned intrusion) and this is certainly a unsanctioned intrusion! Some might argue that, big deal people know where are you roaming, but I don't rate it any higher than stalking and that is a perversive act! So, while you enjoy all the cool features of your mobile phones, don't forget big bro is watching!

Thursday, February 03, 2005

Last day at Oracle...

Today was my last day at Oracle, resigned on 12th Jan. My manager, Guido, was generous enough to let me go and waived 10 days of my notice period. So, today I bade farewell to all the colleagues at Oracle. Though it wasn't as dramatic as last dance with Mary Jane, it evoked some memories and thoughts.

I got the offer from Oracle when I was really pressed against the wall. The last semester at IIT was over and I was working on my (extended) B.Tech. project (Oh! those gloomy days and Oh! Dr. Chandran!). With no progress in project and no jobs in hands (to make it worse, I was besotted in love too!), life was full of gloom. Then Oracle HR punter (Vishnu?) contacted me, I had 3-4 rounds of telephonic interviews. Interviews were really easy, they never got into those gross technical details, which are useful only to mean interviewers and which must be known to all "good" candidates. And one fine morning, I came to NSL, checked my mail only to find the offer from Oracle! I remember, I went directly to Canara Bank to draw money for night's treat (that was the night when Jha got totally smashed!). I was also being interviewed by MicroSoft those days, but after receiving the offer from Oracle (that too from Oracle Bangalore!), I closed all other windows of opportunities rather abruptly. I was told very clearly during interviews that it will be a "testing" job, but at that time other than some general negative comments, I didn't get to learn much about this "testing" stuff. So shrugged it off and went on to join Oracle.

First shock of my professional life jolted me when I saw the first salary. The difference between the "CTC" and "inhand" salary was staggering! Later I learnt about the components in the offer, which are meant to only increase the weight of offer :-). What I thought of as Rs.1000 per day, was about Rs.1000 per working day! Who needs two days' weekend now, haaa?

At the very begining, I couldn't make head or tail of what I was supposed to do. But slowly and steadily I developed an understanding and a strong dislike for the work! There was really not much scope for applying the mind. There were some bright streaks, but for most part of it, I was disappointed with the work. But the people and culture were really nice! I made some very good friends at Oracle. Their HR policies and general benefits were also good. I really learnt a lot, if not about technologies, about the way things work in the industry. About shaping career, about interviews and selection procedures, about managing people from good/bad managers, about conf-calls and skipping them :).

I feel kind of melancholic thinking about last 1.5 years and future. I will surely miss Oracle and its people. I will miss the extended coffee breaks, evening snacks at OTP terrace watching sun set, literally fleecing visiting managers from HQ with lunches, arguments in pantry with Sumanth Prasad about anything and everything, team meeting, cracking PJs with Amar, Pizzas with Stuti during conf-calls, discussing managers with Poxy,... list just goes on!

Anyway, I'm joining Everypath on monday. So have 4 full days to do NOTHING! And thats what I plan to do :). Recently bought an easy chair, will lie on that all day and read! I'll read the history books I bought, or probably the Manorama yearbook. Duh, I know I'm not gonna do that!

Monday, January 24, 2005

Stairway to heaven!

Yeah, I'm hooked upon this LedZepp number thesedays! The song can be found here. Lets see the lyrics first.

There's a lady who's sure all that glitters is gold
And she's buying a stairway to heaven.
When she gets there she knows, if the stores are all closed
With a word she can get what she came for.
Ooh, ooh, and she's buying a stairway to heaven.

There's a sign on the wall but she wants to be sure
'Cause you know sometimes words have two meanings.
In a tree by the brook, there's a songbird who sings,
Sometimes all of our thoughts are misgiven.
Ooh, it makes me wonder,
Ooh, it makes me wonder.

There's a feeling I get when I look to the west,
And my spirit is crying for leaving.
In my thoughts I have seen rings of smoke through the trees,
And the voices of those who stand looking.
Ooh, it makes me wonder,
Ooh, it really makes me wonder.

And it's whispered that soon if we all call the tune
Then the piper will lead us to reason.
And a new day will dawn for those who stand long
And the forests will echo with laughter.

If there's a bustle in your hedgerow, don't be alarmed now,
It's just a spring clean for the May queen.
Yes, there are two paths you can go by, but in the long run
There's still time to change the road you're on.
And it makes me wonder.

Your head is humming and it won't go, in case you don't know,
The piper's calling you to join him,
Dear lady, can you hear the wind blow, and did you know
Your stairway lies on the whispering wind.

And as we wind on down the road
Our shadows taller than our soul.
There walks a lady we all know
Who shines white light and wants to show
How everything still turns to gold.
And if you listen very hard
The tune will come to you at last.
When all are one and one is all
To be a rock and not to roll.

And she's buying a stairway to heaven.


The lyrics ofcourse contain a message, about money and buying stairway to heaven with it. There are many interesting facts associated with the song. Robert and Jimmy wrote this in an old mansion called Headley Grange in Worcestershire, England, where they recorded most of their 4th album. It was a huge, old, dusty mansion with no electricity but great acoustics. Bands would go there to get some privacy and focus on songwriting. One night, in front of a roaring fire, Page strummed the chords to this for Robert. Plant wrote 90% of the lyrics right there in front of the fire.
But it made biggest news when it was claimed that when played backwards, its a song for satanic worship. Supporting this theory is the fact that Jimmy Page bought Aleister Crowley's house in Scotland, which had become a well known Satanic church and was known as "The Toolhouse." In his books, Crowley advocated that his followers learn to read and speak backwards. The backward clip can be found at this page.
Robert Plant addressed the issue in an interview with Musician magazine: "'Stairway To Heaven' was written with every best intention, and as far as reversing tapes and putting messages on the end, that's not my idea of making music. It's really sad. the first time I heard it was early in the morning when I was living at home, and I heard it on a news program. I was absolutely drained all day. I walked around, and I couldn't actually believe, I couldn't take people seriously who could come up with sketches like that. There are a lot of people who are making money there, and if that's the way they need to do it, then do it without my lyrics. I cherish them far too much."
All said and done, the song is really a great one, certainly among the best of rock!


Tuesday, January 18, 2005

Zafar : Victory, Triumph

Na kisi ki aankh ka noor hoon, na kisi ke dil ka qaraar hoon
Jo kisi ke kaam na aa sake main wo ek musht-e-Gubaar hoon

Na to main kisi ka habib hoon, no to main kisi ka raqeeb hoon
Jo bigad gaya wo naseeb hoon, jo ujaad gaya wo dayaar hoon

Mera rang-roop bigad gaya, mera yaar mujh se bichhad gaya
Jo chaman fizaan mein ujad gaya main usi ki fasl-e-bahaar hoon

Paye faatehaa koi aaye kyun, koi chaar phool chadhaaye kyun
Koi aake shammaa jalaye kyun, main wo bekasi ka mazaar hoon

- Bahadur Shah 'Zafar'


Bahadur Shah 'Zafar' was last among the mighty mughals. During the 200 years of
Mughal rule, India saw it all, the pyramid of Rajput skulls made by Babar, lucky
Humayun to get back the thorne from Sher Shah Sur, the golden era of Akbar,
Din-e-elahi, the passion of Jahangir for Anarkali, the devotion of Shahjahan for
Noorjahan, the iron hand rule of Aurangzeb. When it came to Zafar mughals were
reduced to mere pensioners of Maratha. The great empire was reduced to only Delhi. It was said:

Jahanpanah shah alam
Az Delhi tu Palam

Palam is about 7 miles from Delhi.

Zafar's took the thorne at the ripen age of 60. His golden time came when he was declared the Baadshaah-e-hind by mutineers in 1857 mutiny. Soon after Brits took the control back, he was sacked and sent to Rungoon (Yangoon in Myanmaar).

During his time the urdu poetry florished a lot. He himself was a prolific poet. His shayari is often laden with sadness and disappointment. One very nice example is given above. For more go here.

Monday, January 17, 2005

Do I know you?

The other day I bought History of India - Phalaksha from Blossoms. Blossoms is a old book store. So people basically sell their old books there and people interested in old (read cheap) books, like me, hog the place searching for books of their likings. I must say, the collection is excellent there. Many might suggest that prices are bit on the higher side for such old books, others will say you'll get cheaper books from road side vendors, but I go there mainly for the collection! Much to my roommate's, Jha, irritation I go there quite often just to browse through.

The book, History of India, was not quite helpful (it has many contradictory statements like: Harappa had big public baths located near temples....No temples were found in the ruins!). But it looked like it was used as textbook by some college for BA 1st year. I saw the names written on the book, presumably of its earlier(or first) owner. It read Rajini B. S. It reminded me of Faraaz's famous sher:
Ab ke bicchade to fir shayad hum khwabon mein milein,
Jaise sukhe huye phool kitaabon mein milein.

It also reminded me of Amelie. French entry for 2001 Oscar for best foreign film. The "adventures" of Amelie start when she finds out that behind her apartment's bathroom tiles, some one (some kid perhaps) has stored his toys! With the help of newspaper cutting with the toys she finds the date and ultimately with the apartment register she finds out who it could be. Very ingeniously, she returned the toys to the original owner, now a wrinkled old man. This incident inspires her to bring happiness to others' lives. The story is in fact very feel-good!

Talking of movies, I have to watch Six degrees of separation. The title refers to the fact that we all know everyone by six people or degrees (on average). This is quite astonishing phenomenon known as Small World Effect. A 1967 small world experiment by psychologist Stanley Milgram which found that two random US citizens were connected by an average of six acquaintances. However, after more than thirty years its status as a description of heterogeneous social networks (such as the aforementioned "everyone in the world") still remains an open question. More on this here.

Tuesday, January 11, 2005

Agriculture in India: Road to future?

Overview:
The wide ranged reforms launched in 1991 has changed the Indian economy substantially. More sectors are opened to private activity. The license raaj introduced after second five year planning (1956-61) was abolished, thus freeing the economy from the clutches of bureaucracy. Services recorded a boom during 90's mainly due to IT sector. A little more than a decade after, its time to assess and decide our main focus for coming years.
With a 24.2 per cent contribution (triennium ending 2001-02) to the gross domestic product (GDP), agriculture still provides livelihood support to about two-thirds of country's population. The sector provides employment to 56.7 per cent of country's work force and is the single largest private sector occupation. Agriculture accounts for about 14.7 per cent of the total export earnings and provides raw material to a large number of Industries (textiles, silk, sugar, rice, flour mills, milk products). India has 169,700 thousand hectares of arable land (3rd in world), which is 54.35% of total area.
But are we producing to our capabilities? When we talk of yield of principal crops and compare it with various countries, we stand no where close (refer 4). The uncertainity about the contribution of agriculture sector to our GDP is making it mark on the growth rate of nation's GDP. Growth rate of agriculture sector was meagre and constantly on decline during second half of 90's, while Services and Industries were recording increase in growth rates. This was mainly attributed to the draught. So a sector, which employs more than half of the labour force of country, which can boost GDP growth rate from 4.0 to 8.1 in one good season, which holds tremendous potential, should be left at the indeterminate rains?

Problems for Agriculture:
- Uncertainity:
The crop yield is heavily dependent on the rains that year.This was the main reason of decline in growth rate of agriculture sector in second half of 1990's. This uncertainity hits worst the small farmers and labourers, which are usually leading a hand to mouth lifestyle. In a country like our's, where people die of draughts AND floods, every year, something must be done to support farmers and supply them enough water. Ditto with electricity.
- Economically Inactive Population: People often are heard saying that population is the root of every single problem India is facing! Errr... I would like to differ. Its not the population, its the economically inactive people, who are adding to India's problems. Try to see the population we have as a resource (reminds me of an old joke: Q. What does India produce most? A. Indians!). We have huge number of idle people, we must find/invent ways to employ them and make the numbers contribute towards the growth! Especially in agriculture, we can notice passive unemployment. That is, say, 10 persons working where only 2 are required. Hence you'll find, output generated by agriculture, per person, would be way below world average.
- Under-utilization: We already talked about under utilization of human resources. But we can also increase the output by providing water to places where its not currently available. For example, before Indira Gandhi canal came to Sri Ganganagar (in Rajasthan) that area was just plain desert. Now, its among most rich districts in India.
- Poor farmers: Since a huge part of (poor) population is engaged in agriculture, unless we increase their living standards, overall growth of India is not possible. If we keep ignoring the poor, this disparity will keep on increasing between classes. Debt traps in Andhra are forcing farmers to suicide. People are migrating towards city hopeing for better livinghood, but only to increase the slum population in cities. Rural population must be given employment in their areas and they should be given chances to prosper and earn living for them and their families. They just aren't getting enough returns for their efforts

Solutions for India:
India is carrying on the label of "developing" country for quite long now, for making the move towards being a "developed" country we must shed this dependency on agriculture sector. This means focussing more on the Industry and Services sectors. More employment opportunities must be created so that we can better utilize the huge human resources we have. This doesn't mean discouraging the agriculture sector. People don't do it for sentimental reasons, they do it for their living. If you will provide them better life, why won't they move from agriculture to other sectors? Aren't labourers in Punjab are from UP and Bihar? Isn't my cook in Bangalore an Oriya? The bottom line is people will move if they find better life! We need to create opportunity in Industry and Services sectors. Focus must be kept on generating employment in Industry and Services sectors. India has been an economy based on agriculture for centuries, but I believe its time to get over it.

Sources:
1. http://indiabudget.nic.in/es2003-04/esmain.htm
2. http://lnweb18.worldbank.org/SAR/sa.nsf/Attachments/dpr/$File/chapter1.pdf
3. http://www.censusindia.net
4. http://planningcommission.nic.in/plans/planrel/fiveyr/10th/volume2/v2_ch5_1.pdf
5. http://www.nationmaster.com/country/in