Saturday, September 20, 2008

CRASH-ed

Someone recommended me to watch the 2004 Paul Haggis movie Crash. Desparation got the better of me and Youtube pointed to the easy exit. So I just finished watching the movie. Thanks Sujata, it was indeed a fine movie, at least thats what a part of me keeping telling me. I say so because the other part kept thinking I am watching a well made documentary, an extremely well made one.

A good documentary is almost like a movie; in fact I am not even sure if there is a sharp line separating them. Possibly I was less moved than expected while the movie because I am so used to seeing around me all those that was shown in the movie. A sensitive person should crash while watching the vignettes of discrimination, mostly racial in nature. I have seen those in so many forms and feathers that they didn't affect me as much.

A poet once said "Where the mind is without fear, where the head is held high...". It needs a lot of courage to be able to do that in today's world.

Tuesday, September 16, 2008

Sesh Proshno

No excuse is enough for not blogging for a year and then resuming with some copied content. I will not even try to give one.

While returning from India, I brought 3 volumes of a collection of novels by the famous Bengali novelist Kathasahityik Sarat Chandra Chattopadhyay with me for (Dr.) Saikat (Guha). I recommended him the novel "Shes Proshno" (the ultimate question). Here is how he summarised it later.

The story revolves around a set of prabasi Bengalis in Agra, when a wealthy elderly widower Ashubabu moves into the city with his only daughter Manorama. In spite of being very rich, Ashubabu gains instant popularity amidst the Bengali community because of his extremely
down-to-earth/sociable/helpful demeanor. Ashubabu frequently visits other families, and invites people to his home (a huge house) for meals, music gatherings, and adda. Shibnath is an excellent musician, but a very lose character person, who Ashubabu meets with and starts inviting to his home regularly because of his excellent musical talent. One evening, at a dinner with several others and Shibnath at his home, it gets revealed that Shibnath had left his first wife because of her persistent ill health and had married a daughter of a Dasi in his house. Shibnath gets unpopular and loses respect in the community but still maintains his demand due to his music and his charming and open personality. The appearance in the story of this stunningly beautiful second wife of Shibnath, called Kamal, arouses a tremendous surge of a mixture of rage, respect, and curiosity in the Bengali community. Kamal was brought up in a tea bagan in north bengal and was born to a European man and a Hindu dasi. Kamal is a very strong character and is not influenced a bit by insult and societal negligence due to her caste and her beliefs. In spite of being an outcast, (and later in the story been dumped by Shibnath), she continues to influence the community by her fearless philosophy that revolves around the betterment of humanity as a whole, and not clinging to the age-old Hindu traditions to be the saviors of our souls. The remainder of the story revolves around Kamal, Ashubabu (who immensely likes Kamal and almost sees her as his daughter, but doesn't agree on a single thing with her ever), Ashubabu's foreign-return (supposedly) hobu Jamai Ajit, Manorama, and a few other very interesting, albeit different characters.


Sounds interesting? The plot itself speaks of a silence revolution in a society far far away in space and time. Yet I am sure you will find small bubbles of revolting characters, some even similar to Kamal from the novel, in any society anywhere. To get the full flavour of the novel,
you should definitely read the novel in Saratchandra's words... the dialogue deliveries and the character sketches are remarkable, and in spite of the story being set in pre-independence days, has an incredible amount of relevance to today's society.


I personally read the novel during my mid-teens. One of the advantages of studying away from home is to get access to all kinds of literature, good bad or ugly (ahem! no raised eyebrows please). Anyway, I read it later once more but do not remember much about the story. What I remember is that when I read it, it was unlike any other Sarat Chattopadhyay's novels. Most of his novels center around women and somewhat feminist. This was the same yet different. In short, highly recommended if you can stand complex arguments and long winding discussions about social issues.

Well, this is an opportunity to learn Bangla (one of the top 10 most spoken languages in the world). However, if you are impatient, you may be able to use the English translation (review).

Monday, August 13, 2007

Mystery of Indian Bay Leaves

Indian cooking, especially north and eastern region, uses Tej Pata/Tej Patta to a huge extent. It is also part of the magic aromatic mixture known as Garam Masala. So I too use them here in Boston, and till now bought the Bay leaves found in the local grocery stores. And almost anytime I used it, I had a feeling that they are not quite the same as the traditional Tej Pata I am used to.

I used to have a feeling that they may not be the same thing. Until someone told me that he was surprised to know that Bay leaves are used in Indian cooking. That got me thinking and I googled my brain as well as the internet to hunt for the difference, if any. The first prominent difference I always noticed that the bay leaves did not have that strong an aroma as back home. I generally pushed that argument aside, citing quality difference. After all I do grocery at cheap neighbour stores. But now I remembered from my school bio classes - tej pata back home had several (3 ?) parallel veins unlike the single pinnate-style bay leaves I see here. A bit of internet search revealed that they are indeed different. Tej Pata ...are often erroneously labeled as "Indian bay leaves" though the bay leaf is from the Bay Laurel, a tree of Mediterranean origin in a different genus, and the appearance and aroma of the two are quite different... Indeed they are different. Next time I go to a grocery, I will know what to look for.

Friday, August 10, 2007

Kudos to Anil Kumble

A post just for the century by Anil Kumble in the 3rd Test match between
India-England (July-Aug, 2007).

He has been called as the unsung hero by many before, now he is again a hero
but for an altogether different reason. Congratulations, Anil Kumble.

Wednesday, July 25, 2007

Good bye Mr President

Dr Avul Pakir Jainulabdeen Abdul Kalam, India's 11th president (2002-2007) is on his way out. I wish him good luck on his future endevours. I also welcome our 12th president, Mrs Pratibha Patil, earlier governor of Rajesthan.

Abdul Kalam was an exemplary statesman. Constitutionally, the post of Indian president is a ceremonial head but without any effective power. Most of the times, the ruling party had its say on the presidential election. So all they did was to visit countries as head of the nation, give speeches and help the ruling party in passing the bills of their choice. APJ was chosen during NDA's regime of 1998-2004 not because of his political inclination, which he did not have, but because of his iconic image and charisma. Elected, rather nominated, out of protocol, this scientist chose to defy the norms and protocols left and right when it came to presidential grandeur.

What more, he used to utilize his time judiciously. Even the people en masse could feel his activity. Today he was visiting some school in some village, tomorrow he was in some submarine of India navy and maybe the next day, he is addressing some doctors via teleconferencing. It has been reported that his days usually had 10 meetings. Not surprisingly, several visions of this visionary scientist met reality. Indian all over the world and more importantly, even in the remotest villages came to know of him. Know that the post of president is not meant to only enjoy the power but to actually meet the responsibility that accompanies the power. APJ has an excellent skill in writing. His books and articles are quite popular in India especially among the younger generation. Of all the 5 presidents that I actively remember, I don't think I remember any of the rest 4 for anything. I was not even clear how much a president can do ? APJ proves, when there is a will, there is a way.

I hope our current president can live up to the reputation of the president's post. India is aware of the president's office, the youth in this country are well trained to dream and chase the dream. I hope Mrs President will similarly uplift the morale of Indian women. I do not want all Indian women to join politics or airforce or become executives. I just want them to be aware of their position in the society and live with their head held high.

Welcome Mrs President and good luck!

Wednesday, July 4, 2007

Kolkata kebal bhule bhara

Those who teach frequently use examples to explain concepts. Those who write software programs love reproducible test cases which they can debug, analyze and correct. With utmost humbleness, I believe the civic engineers have neither experienced good teaching nor have decent engineering skills. Year after year, with sure shot prediction, Kolkata floods during monsoon. Its pretty easy to guess, any heavy rainfall will cause water logging. It becomes an even better test case because the water does not go down quickly once the rain stops. So here is a situation that is realized 3-4 times a monsoon season and provides ample time to check design and implementation flaws. Given that the situation is not improving, in fact, degrading year after year only has one conclusion: like the Indian cricket team, the engineering team needs fresh blood and talented minds.

Final note: please do your part by not throwing plastic bags around. Whether its the drains, empty land or waterbody, the fundamental problem they cause is to block the flow of water. Store them at home and when enough is deposited, dump it in a garbage dump. Though there is no adequate plastic recycling program, at least this will prevent plastics from blocking water flow around your house.

Wednesday, April 18, 2007

Another Take on the 7-Hats problem

Consider the problem described here.

Let 0 denote Red and 1 denote Blue. Fix an order among the n players. So the different ways to put hats is all possible n-bit strings, each occurring with equal
probability. Any assignment is an n-bit string.

The players could decide the following strategy. They split all n-bit strings into two disjoint sets S and S' (S'=complement of S). They try to split it in a certain way so that they are able to correctly guess (which means at least one guesses correctly and others pass) when the assignment is in S'. Then their probability of success will be |S'|/|S|+|S'|.

Property of S,S': Let the actual assignment be s. They want, if s is in S, someone to be able to guess correctly and no one wrongly. One way to ensure this is if for all s in S', there is some i in 1...n (at least one bit position), such that flipping the i-th bit of s gives a string in S. The players will decide in advance a suitable S and S' satisfying this property.

Then then need to decide a strategy based on S and S'. Here is a simple one. Each person i can see (n-1) bits. He considers the two possible n-bit assignments, s0 using 0 in the i-th bit and s1 with 1 in the i-th bit. These are the cases,

  • s0 is in S and s1 is in S': Guess 1 as his bit. If s is in S', guess is correct.
  • s0 is in S' and s1 is in S: Guess 0 as his bit. If s is in S', guess is correct.
  • Both s0,s1 are in S: So, the actual string s must also be in S. He can just say pass.
  • Both s0,s1 are in S': So, the actual string s is in S'. He can say pass. By the property above, there is some j such that s is obtained from S by flipping bit j. Then person-j will guess correctly.

By the strategy above, they win if the string s is in S'. The tricky part is to find the correct S and S' satisfying the property above. They can be found using various algorithms e.g. using brute force or greedy approach. For example when n=3, one possiblity is S={000,001,010,011} and S'={100,101,110,111} (so the success probability is 1/2).

It turns out the above property is satisfied by error detecting codes detecting 1-bit error. All the non-codewords in a 1-bit error detecting code are obtained by flipping 1-bit of some codeword; so S is the set of codewords. Any such error detecting code with k codewords will give a strategy with error probability k/2^n. The probability can be maximized by finding a error detecting code with the smallest set of codewords. The (7,4)-Hamming code is one such example with 16 codewords; so using its codewords as S gives a strategy with error probability 16/128=1/8.

Note that, the game does not allow the players to collaborate once the game starts, which means they are not allowed to pass hints to others by choosing which order to make their guess or listening to others before making guess. If colloboration is allowed, the error can be made very small 2/2^n.

Monday, April 9, 2007

7-hats problem

7-hat problem: 7 persons are assigned red or blue hats, uniformly at random, with their eyes closed. When they open their eyes, they look around and try to predict the colour of their own hat by saying blue, red or staying silent. They lose if any of them is wrong or if all stay silent. What is the maximum probability of winning ?

Consider the various possibilities,

A) (prob: 1/128) 0 red, 7 blue: All players see 6 blue. To win, they should say blue.
B) (prob: 7/128) 1 red, 6 blue: 1 player sees 6 blue (should say red), other 6 see 5 blue (should say blue).
C) (prob: 21/128) 2 red, 5 blue: 2 players see 5 blue (should say red), other 5 see 4 blue (should say blue).
D) (prob: 35/128) 3 red, 4 blue: 3 players see 4 blue (should say red), other 4 see 3 blue/3 red (should say blue).
and complement cases (interchange red and blue in the four cases).

If the players decide based on the number of blue/red hats, they can decide a strategy to win alternate cases. So the best they can do is to satisfy (B), (D) and their complementary cases i.e. anyone seeing 6 or 4 blue will say red and vice versa, others stay silent. They will win with probability 84/128 = 21/32 = 0.656.

They can take into account ordering information beside just looking at the numbers. This will give them higher chance of winning. Lets look at the 3-hat problem once again.

Consider how the players might decide a strategy. They can decide an order among themselves so that the values, 0 (for red) or 1 (for blue), form a bit-string of length 3. When they open their eyes, they will consider both the possibilities for themselves and decide accordingly. They could decide beforehand a set S, and its complement S' and a strategy such that for every player if bit b (b in {0,1}) puts the string in S, he says b for himself; otherwise stays silent. What are the properties needed for such a set S ?

1) For all s' in S', changing one bit of S' should put it in S. Otherwise, the player will not be able to decide. (The same could also hold for S, but that is not a strict requirement since the players are allowed to stay silent. So, if both 0 and 1 puts the value in S, the player stays silent).

2) For all s in S, there must be some s' in S' such that, s is obtained by flipping some bit of S'. Otherwise, all players will remain silent and they will lose. If such s' exists, then one of the players will be correct.

If they find such an S (and S'), they will win if the value is in S.
Consider any s in S. By (2), there exists some s' such that s=flip(s'). Say the flip occurs in position i. Then, player i will say the correct value. Others will either stay silent (both 0 and 1 put it in S) or say the correct thing (only one of the values put it in S) (it cannot be that neither puts it in S by (1)).
Consider any s in S'. Everybody will be either wrong or stay silent (in which case they also lose).
So, they win with probability size(S)/size(S)+size(S').

(1) => all strings in S' are at least 2 bit-flips apart. So, the trick is to come up with S and S' such that S' has strings separated by at least 2 bit-flips and all strings in S are obtained by flipping one bit of some string in S'. You can greedily construct some sets. Put any string s in S'. Flip one bit of s at a time and put them in S. When done, look at the strings left and pick one not used. Put that in S'. Continue.

E.g. for 3-hat, S' could be {000, 011, 101, 110} (prob of winning 4/8 = 0.5) or S' could be {000, 111} (prob of winning 6/8=0.75).

The above strategy has nothing to do 3. This could as well be used for 7-hat.

For 7-hat, the strategy at the top would work. S' is the string in cases (A) and (C) (and complement sets). Verify easily that all 7-bit strings are either in S' or S, all strings in S are one-bit away from some string in S' and all strings in S' are 2-bit flips apart.

Finding the best S and S' manually is a bit difficult. If you are familiar with coding theory, you can observe that any code that detects one bit error will work (S' would be the set of codewords; since they differ by 2, one bit error can be detected). E.g. the Hamming code for 7-bit codewords, gives S' of size 16 (out of total 128). So, using S' as the set of codewords of (7,4) hamming code, the players can win with probability 7/8. Note that, hamming code not only detects but corrects one-bit of error. Any other 1-bit error detecting code will also work but will give a lower probability of winning.

Wednesday, March 28, 2007

Probability puzzle: Uniform Everytime

Assume I have a bag with several distinct objects. Particularly, I do not tell you how many objects I have. At each step, I take out one item and give it to you. I may do this in any order, with any probability distribution or even adversarially. You can only hold one item in your hand at a time. So, at each step, you get to choose whether to retain the object already in hand or replace it with the new one. When I run out of objects (or I am simply tired and quit), I stop.

Your goal is adopt a strategy so that the object in your hand at the end is uniformly at random among all items. In other words, irrespective of how many objects I give you or however I choose them, this item in your hand should be equally probable to any other item.

Go figure!
(courtsey Nenad)

Saturday, March 24, 2007

Worshipping False Gods

Yet again, the Indian cricket team failed. Being hyped by the media as
the team with the best batting line-up, this is no the first time the
batting order has seen a complete collapse and I fear this would not
be the list time either. Indian cricketers enjoy a god-like (not
God-like, yet) status back home. The facilities, the perks, the
attention and the support they get from the fans, officials and media
is phenomenal and unparalleled. So it sounds right when the fans treat
them harshly after poor defeats. Sometimes their show of
disappointment gets a bit overboard which is definitely not desired.
But again, when the worship the cricketers, nobody complains either!

I don't know about the other subcontinent teams but the gods in the
team are definitely past their days of glory. They are only fit for
consultations now; they should be retired and fresh blood should be
brought into the team. It has happened time and again. It took the
board 2 full years to sack and drop Sourav Ganguly. He returned in the
team after regaining his batting form. Look ma! Sourav is now scoring
runs. When and if he loses his rhythm again, he should be dropped.
Same for Sachin, Sehwag and other non-performers.

I feel the cricketers should also be restricted from doing too much
non-cricket stuff. They spend time after endorsements, other business
(whats this recent craze about opening restaurants ?) and doing public
speeches for political parties. Appearing in one or two advertisements
for public service is good, since quite a few of the cricketers are
seen as role models by the youngsters but not as brand ambassadors.
Similarly, being citizen of India they are entitled to the freedom of
voicing their opinion but not with any regularity.

BCCI should cap non-cricket involvement, spend more resource and
effort after domestic cricket and make the seniors also play domestic
cricket. That keeps them in practice and on the other hand provides
the young guns with better exposure. I personally don't think a
foreign coach is necessarily a bad or a good thing. Give the job to
the best person. The richest cricket board can afford to pick the
best.

In other news, Sachin is only one duck away from equalling Srinath's
Indian record of most (19) ODI ducks.