September 30, 2011

Some thoughts on the culture of arbitrariness

Today during lunch, one of advisors asked me "How is it that India still remains to be poor?" I was full of answers, however to keep it short I said "it's complicated." However, one answer which is becoming more and more important is favoritism, nepotism, or as we call it in India "Do you know who my father is?" Well if you have a very powerful father the laws in India can be completely bent to ensure that you and your father still remain the king! P. Sainath calls it the culture of arbitrariness. Arbitrariness which includes waivers being given citing emotions and sentiments of the mass public, waivers that make absolutely no sense at all.

Lets have a look at one such waiver and let me begin by some simple questions. Now, do want the person who breaks the law to be punished or not? What if the person is really influential? Do you want him to pay the penalty for breaking the law? Now if I say that the person who is to pay the penalty is a politician then I guess all the members of "I am Anna Hazare" fan club would proudly say Yes!

Before looking at who the guilty is, lets evaluate the impact of the misdeed. For starters, lets account for the impact of a small loss say Rs 500,000. Say Rs 500,000 should have been collected by the government as taxes or a penalty or a fine. According to the pain staking research done by the intellectuals of the Government of India, Rs 32 is enough for a family for one day for all its daily expenses. On Rs 500,000 this family could have merrily lived for a little over 15,000 days which in years would be close to 40 years. Considering the life expectancy of poor people, this would be enough for one lifetime of one family. So, according to our wonderful Indian Government, one family could have survived for one lifetime if the government would have taken the Rs 500,000 which it should have. Another way of looking at Rs 500,000 is that with this amount the death of 15,000 Indian families (or 60,000 Indians considering a family size of 4) could have been delayed by one more day!

Now lets change the situation a little bit. Say if a really rich person is exempted from paying a tax which he/she should have paid? Wouldn't there have been a hue and cry? Now consider the amount of Rs 1.13 crores in taxes, i.e., Rs 11300000 (yes there are 5 zeros here!). This amount at Rs 32 a day, would have delayed the death of 353,125 Indian families or 1,412,500 million Indians by one more day. Another way to look at it is it would have been sufficient for 21 families for close to 45 years! Now if I say a politician, say for example Sharad Pawar got a tax waiver of this amount of Rs 1.13 crores for one of his agri-business then the whole country would have made a huge hue and cry. There would have been a trial by media and possibly some of his effigies might have been burnt by some patriotic soul.

I completely agree that there should be a huge hue and cry for this. But that is where the culture of arbitrariness kicks in. Wouldn't a politician suffered a trial by media if he seeked a waiver of taxes or penalty. My question is, now just because Sachin Tendulkar is in the guilty box, why isn't there a huge hue and cry? Why is it that Sachin Tendulkar is finding it difficult to pay a fine which he rightly should according to the law? I find it really amusing and disturbing that the very state government which could do nothing for their farmers who committed suicide, the very state government that has turned a blind eye to the hunger related deaths in Thane district (less than 200 km from their offices in Mantralaya), has gone out of the way to seek a waiver of Rs 475,000 for Sachin. Also I find it difficult to think that the central government waiving the Rs 1.13 crore in duty for the Ferrari of Sachin. Now this amount is a drop in the ocean considering that the IPL is exempted from most of the taxes and so is the BCCI. What worries me is the that the RTO officer who was responsible for this waiver of Rs 1.13 crore on Sachins Ferrari went on to create the now defunct Kochi IPL team.

It is this sad culture of arbitrariness which is becoming the root cause of some the worst problems plaguing India. Tax waivers being given to corporations, mining contracts being given to relatives of politicians, houses to be allocated for war heroes being diverted to political families. This issue of Rs 500,000 might seem small but on a larger scale just think about it. Imagine a tribal family living in a village with no electricity. How can you tell that family that the government is sorry that it cannot provide any medical aid to a sick child because it has no funds. How has the infant that is loosing its life while you are reading this article benefited from one of the beautiful batting innings of India's batting maestro -- isn't the infant paying the price of the sick waivers being given by the government!

Sources:
1. http://www.rediff.com/cricket/2003/aug/09sach.htm
2. http://www.rediff.com/cricket/report/maharashtra-govt-asks-bmc-to-waive-penalty-on-tendulkar-house/20110929.htm
3. http://articles.economictimes.indiatimes.com/2010-04-16/news/28419652_1_tax-waiver-shailendra-gaikwad-bike-scam

September 20, 2011

Saving your passwords file using gpg

gpg provides a nice tool for encrypting and signing files. I am currently using gpg version 1.4.11 to save my passwords.It is available for most linux distros and is very easy to use.

For example if I have a plain text file with the names and passwords I used in various banks

--
bank: velma inc
login: scoobydoo
account: 112358
password: scoobysnacks

bank: haddock gmbh
login: snowy
account: 31415
password: tintin
--

I have this filed saved as finance-passwords. Then with gpg I encrypt it using the following command:
 > gpg  -c --force-mdc finance-password

This creates a file finance-password.gpg in the same folder. Note the --force-mdc which needs to be provided. --force-mdc is to use encryption with a modification detection code while -c is to encrypt with a symmetric cipher using a passphrase. Do a man gpg for further security stuff but for guys like me this is enough.

The encrypted file can be decrypted using the following command
 > gpg finance-password.gpg 

This creates the file finance-password. During decryption I get the warning
gpg: WARNING: message was not integrity protected

if the --force-mdc option is not used during encryption.

August 17, 2011

First conquer the evil in you

In the last few days, thanks to the zillions of news channels and news papers in India which have their content online, I have seen Indians getting emotionally charged like never before in the last couple of decades. Here is a list of questions I would like to ask each emotionally charged Indian. I pray that after reading these questions you are still charged up to address the issue of corruption that is raping my country and this beautiful earth.

1. Have you voted in the last general, assembly, and municipal election?
You can protest if you have taken part in the democratic process. If you have not performed your duties the question of your rights does not arise. Only those who have performed their duties should talk about rights.

2. Have you updated your ration card? Are you buying food from the allotted Ration shop? If no have you converted your card to a card that indicates you will not buy food from (public distribution system) PDS shops? (In Pune my family has a white ration card which is for people who want the card only for address proof and not for rations).
The questions ask you if are indirectly contributing to malpractices due to your ignorance (which is unpardonable given that you can at least read english) and lethargy. The above questions are related to hunger in the country which is by far the biggest proof of inequality, and the dirtiest consequence of any malpractice -- killing a person with hunger makes the killer a parasite which feeds on another living creature. The government uses PDS to ensure that the population gets the bare minimum supply of food. Sadly malpractices in PDS result in hunger related deaths. These malpractices coupled with inflation is making rotational hunger common in many areas. Rotational hunger is when a person eats one day so that he/she can work in the fields or the MNREGA; the next day another family member eats and goes to work -- the money that finally reaches the household after a days worth of manual labor (close to 12-15 hours) is enough to feed one person and if possible his/her children thanks to inflation. Your laziness and ignorance gives officials working in the PDS a chance to be manipulate the food supplies; this indirectly also affects inflation.

3. Have you filed your tax returns? Have you submitted false information to reduce your income taxe and/or other taxes? For example given false rent receipts to reduce your income tax.
People reading this blog post have access to the Internet; hence most probably have sufficient earnings to be taxed. Black money is the money that should have been taxed. This question asks if you have created some black money.

4. Have you bought a house? How much cash did you pay your builder to reduce the property tax?
Corruption and black money is not limited to the government sector. The private sector is a big source of black money. Once black money is created it begins to flow as bribes.

5. Have you paid a bribe because you thought paying money is preferable? For example paying Rs 100 is better than Rs 500 for a traffic rule violation or it is better to bribe rather than waste time waiting in a queue.
Giving a bribe is morally (if not legally) a crime of the same magnitude as that of taking a bribe. एक हाथ से ताली नहीं बजती -- it takes two to tango.

Anna Hazare is fasting against corruption. One of the objectives of a fast, according to Mahatma Gandhi, is self purification. Going on a fast does not mean that your sins are pardoned after the fast; a fast is supposed to awaken the very conscience that you have inherited thanks to the billions of years of the evolutionary process. This awakening shall guide you and help you guide the ones around you from committing the mistakes previously committed. Anna's fast and protest is against the evil of corruption. He can fight this battle because he has not let the evil conquer him. To become part of his battle you must first conquer the evil in you before you start your attack on the evil present around you.

Before you begin any battle please keep in mind this quote by Friedrich Nietzsche "Be careful when you fight the monsters, lest you become one."

June 22, 2011

Notes for the Evolution 101 course

A few notes from the Evolution 101 course from UC Berkeley [1]. I am guilty of rampant plagiarism however, I had to do so because the words used in the Evolution 101 course are precise and unambiguous.
  1. Evolution means that we're all distant cousins: humans and oak trees, hummingbirds and whales.
  2. Scientists constantly reevaluate hypotheses and compare them to new evidence. As scientists gather even more data, they may revise these particular hypotheses, rearranging some of the branches on the tree. For example, evidence discovered in the last 50 years suggests that birds are dinosaurs, which required adjustment to several "vertebrate twigs."
  3. We can reconstruct evolutionary relationships and represent them on a "family tree," called a phylogeny.
  4. Because a phylogenetic tree is a hypothesis about evolutionary relationships, we want to use characters that are reliable indicators of common ancestry to build that tree. For example, birds and bats both have wings, while mice and crocodiles do not. Does that mean that birds and bats are more closely related to one another than to mice and crocodiles? No. When we examine bird wings and bat wings closely, we see that there are some major differences.
  5. If you wanted to squeeze the 3.5 billion years of the history of life on Earth into a single minute, you would have to wait about 50 seconds for multi-cellular life to evolve, another four seconds for vertebrates to invade the land, and another four seconds for flowers to evolve — and only in the last 0.002 seconds would "modern" humans arise. Life began 3.8 billion years ago, and insects diversified 290 million years ago, but the human and chimpanzee lineages diverged only five million years ago.
  6. Evolution is the process by which modern organisms have descended from ancient ancestors. Evolution only occurs when there is a change in gene frequency within a population over time
  7. Humans did not evolve from chimpanzees. Humans and chimpanzees are evolutionary cousins and share a recent common ancestor that was neither chimpanzee nor human. Humans are not "higher" or "more evolved" than other living lineages. Since our lineages split, humans and chimpanzees have each evolved traits unique to their own lineages.
  8. Mutation, Migration, Genetic drift, and Natural selection are the four processes that are the basic mechanism of evolutionary change
  9. Biologists use the word fitness to describe how good a particular genotype is at leaving offspring in the next generation relative to how good other genotypes are at it. So if brown beetles consistently leave more offspring than green beetles because of their color, you'd say that the brown beetles had a higher fitness.
  10. Natural selection is the simple result of variation, differential reproduction, and heredity — it is mindless and mechanistic. It has no goals; it's not striving to produce "progress" or a balanced ecosystem.
  11. A species is often defined as a group of individuals that actually or potentially interbreed in nature. In this sense, a species is the biggest gene pool possible under natural conditions.
  12. All available evidence supports the central conclusions of evolutionary theory, that life on Earth has evolved and that species share common ancestors. Biologists are not arguing about these conclusions. But they are trying to figure out how evolution happens, and that's not an easy job. It involves collecting data, proposing hypotheses, creating models, and evaluating other scientists' work.
Now for a list of misconceptions [2]:
  1. Evolution is just a theory.
  2. Evolution is like a climb up a ladder of progress; organisms are always getting better.
  3. Evolution means that life changed by chance.
  4. Natural selection gives organisms what they need.
  5. Gaps in the fossil record disprove evolution.
  6. Teachers should teach both sides (read evolution and creationism) and let students decide for themselves.
The reason for this blog posts are as follows
  1. I am hearing "Evolution is just a theory" a lot these days.
  2. To end some debates I used to say "Teachers should teach both sides". I should stop saying this [2].
  3. I say used to say Humans evolved from Chimpanzees. This is also wrong [1].
  4. I used to wonder if random mutation and natural selection has a long term goal that ensures resources are sustained. Apparently there is no long term goal, as the course says that natural selection is mindless and mechanistic. This is important as evolution neither guarantees nor does it work towards sustaining the available resources.
[1] http://evolution.berkeley.edu/evolibrary/article/evo_01
[2] http://evolution.berkeley.edu/evolibrary/misconceptions_faq.php

April 9, 2011

Learning to Sort

Here is a collection of videos I found in the Internet for sorting algorithms. (Thanks to Antonio and Prem Piyush for their facebook posts).

1. Bubble Sort:


2. Insert Sort:


3. Select Sort:


4. Shell Sort:


And my favorite is to see how the various sorting algorithms sound like. This one is really nice as you get a feel of why time complexity matters a lot!



My favorite however is Heap Sort.

March 2, 2011

PhD and The Hair Cut



Occasion: This week I shall be finishing 1 1/2 years of PhD. My rate of going for a hair cut has reduced so much that I fear that by the end of my PhD I might not need a hair-cut.

Matlab Code (sans Annotation):
x=0:0.01:3;
y=0:15*pi/300:15*pi;
plot(x, exp(-x)+0.05*sin(y), 'linewidth', 3);
set(gca, 'xlim', [0,3]);
set(gca, 'FontSize', 20);
ylabel('Need for Haircut', 'FontSize', 30);
xlabel('Time spent as PhD student (years)', 'FontSize', 30);

January 24, 2011

Honest and Stable Government: Is existence of India as a country a random miracle?

In the last few weeks I read two interesting status messages on facebook.
  1. You can bring the horse to the well, but you cannot force it to drink. But if you bring it 2, 3 times to the well and he still doesn't want to drink, then it is probably a donkey.
  2. Une phrase qui tourne en ce moment..."un président qui s'enfuit, un premier ministre qui pleure à la télé, un blogueur qui sort de prison pour devenir secrétaire d'État, un juge exclu d'un plateau de télé, une manif de flic, un avocat qui fait la circulation, des patron qui se font licenciés par les employeurs...est ce qu'il y a un gros nuage de fumée de cannabis qui passe au dessus du pays???? (Last sentence asks if there is a dense cloud of cannabis passing over my country).
The first is in the context of Belgium and the second in the context of Tunisia. Both countries are currently in desperate need for a stable and honest government. In contrast, the Indian government is toiling hard to show that these two words, stable and honest, are logical complements of each other and do not complement each other. In India there exists a government, at least on paper; but it is doing everything apart from governing and is busy enacting the meaning of the word "sucks". It is using stability as an excuse for being completely dishonest and showing the world what it is to be absolutely corrupt and suck the nation dry. One thing that I like about this government is that it has shown that independence is an on going process and it is wrong to say India gained Independence in 1947. It always amazed me how a handful of Britishers (less than 100,000) colonize a country. In fact they could because there were agents like the ones we now have outside every government office; agents who are willing to sell everything. And when I mean everything, I mean each and everything that is on this Earth -- from humans as slaves (human trafficking of girls from the north-east for forceful polyandry to counter skewed sex ratios -- modern day draupadis in Punjab), to the land (we even have our military having dirtying their hands in Adarsh and the Sukhna land scam), and natural resources (how can we forget the iron-fisted Reddy brothers and coal mafia operating with the blessing of Soren). To be frank, I thank this government for showing everyone in the world that from a Birth certificate to the Death Certificate one might have to pay a bribe in India.
Satish Acharyas Cartoon
Satish Acharya's Cartoons
Further, this corruption is not limited to the public sector. With the Radia tapes Indians have shown the world that US style lobbying fortified with the powers and thinking of an Indian dalaal (agent) can be used by the private sector to sell to the country. With Manmohan Singh at the helm, there was a glimmer of hope. However with time it has become clear that this glimmer is basically the light being used by the UPA to misguide the Indians on the road to hell.

Well this road to hell was evident with the appointment of Bureaucrats. To begin, take MS Gill, the current sports minister who was in the past the Chief Election Commisioner. Now the very MS Gill is the member of the Congress. How can one believe that all his decisions taken as the CEC was not to please a a particular party. The same is true for Navin Chawla. Speaking of bureaucrats, this government has taken the country to new lows by the appointment of the Chief Vigilance Commissioner; the one responsible for blowing the lid of the scams. Can Manmohan Singh explain the motives behind his insistence on having a scam tainted bureaucrat to head the Central Vigilance Commission. To make matters worse, how can one expect a bureaucrat to investigate the $38 billion telecom scam that took place when he was the top ranked bureaucrat in the telecom ministry. Also given this mentality how can one expect this government to bring the $1.4 trillion dollars of unaccounted money back to India; money whose source includes hawala, drugs, arms trading, human trafficking, and I guess the deeds which even God doesn't know and might be ashamed to see.

At times it is hard to comprehend what India gained from Independence. Yes we have freedom of speech -- however this is abused big time by the Geelani family, Arundhati Roy, and recently Digvijay Singh to speak complete nonsense. We were supposed to have equality but we have a potential prime-minister, Rahul Gandhi, who visits a house because it is a Dalit's house and not because it is a house of a fellow human being let alone an Indian. To be frank the ruling class and the babus have shown that there exists no discipline in India and at the same time indiscipline is being used as a metric to show the power. Basically in the last 60 years we have overthrown the true leaders who fought for Independence and replaced them with the very bullies who sold the country to the Britishers; this time however they are selling it to themselves.

The only positive side is that India continues to give birth to the ones like Homi Bhabha, Abdul Kalam, and millions of selfless and true Karma-Yogis, whose names will never appear in any history book; these nameless individuals are responsible for the existence of this country as they are miraculously unaffected by the cloud of the cannabis smoked by the ruling class. I only hope that the existence of my country is not some random miracle.

January 9, 2011

Friends on Facebook

Friends on Facebook

The R code used to generate the above plot. [This is my first plot using R.]
---
x=seq(0,5,0.01)
y=exp(-x)
#pdf("~/tmp/foo-R.pdf")
jpeg("~/tmp/foo-R.jpeg")
plot(x, y, xlab='Time spent on facebook (hours/day)', ylab='Fraction of "friends" you actually socialize with', type='line', lwd=3, cex.lab=1.5, cex.axis=1.5, xaxs='i', yaxs='i')
grid(10,10)
dev.off()
---