Monday, June 30, 2014

Time Complexity - Linear, Polynomial and Exponential

Whenever I discuss about the complexity of programs, most of the times, I drain all my energy in few minutes (because of talking in very loud voice). The following example is very famous.

Is it linear, polynomial or exponential?

calculate(int c, int n)
{
   BigInteger x = 1;
   for(int i=0; i<n; i++) {
       x = x*c;
   }
   return x;
}

If I am giving input, and you are calculating output, then

Linear - You spend roughly equal amount of time as me
Polynomial - You spend significantly more amount of time than me, but, you will do it.
Exponential - I spend couple of mins, and your whole life is not enough to calculate the output.

If anyone says the above program is linear or polynomial, I am ready to spend 10 seconds of my time in giving the input. Are you ready to calculate the output?

Sunday, June 15, 2014

Multi Level Marketing

Few days back, I have travelled by Ola Cabs for free.

If an existing customer refers another one, then both gets Rs.300 which can be used when they travel by Ola cabs. Now, they have reduced it to Rs.100 from Rs.300.

If you have not registered with Ola cabs, I am more than happy to refer you. You would get Rs.100 discount, when you travel with Ola cabs. My referral code is H9JH6Q.

--- Ad Ends ---

Giving incentives to the consumers to market, is one of the most efficient ways of marketing. As a consumer, I prefer that kind of marketing than any other marketing, since, instead of spending the money for TV Channels, actors and sports people, they would be spending it on me.

Let's suppose, if Ola cabs introduces an incentive system where for the referrals that I have done, the person who referred me also gets some benefit, then our Indian government may file cases against Ola cabs, and there would be many "so called" social workers, who would pursue cases against Ola cabs, saying, they are cheating people and charging exorbitant prices.

If anyone thinks that, they are charging more money, they do not need to buy services from them. Whoever is buying the services, knows basic mathematics, and can find out which one is cheaper for the quality that they are getting. Most of the people do not need somebody else to come and teach basic mathematics.

In free market economics, there is practically no meaning to fighting against a business in their marketing. If anybody is fighting against any business for their marketing in free market economics, it only means, they have some self motives to destroy the business to reduce the competition or has individual vengeance on the owner of the business. Unfortunately in India, people use the name, "Social work" to kill the competition or to take revenge in these cases.

I am talking about Amway. I got frustrated with the people who file cases against Amway, when they never lost anything or lost because of their incapability in doing the business. I am also frustrated with the people who support these "so called" social workers. If someone does not know how to run the business and start a business, then they are bound to lose the money. And, if they file cases against the producer of the goods for their loss, it is completely ridiculous.

Monday, June 02, 2014

New State

Today, a state expelled one part of it, and started celebrating that they got a new state.

[They have given their name to the expelled area, and they got a new name for themselves. That's why, legally, they are claiming that their state is the new state.]

I wish to see all the accounts to get settled as soon as possible in the best of interests of everyone including mute spectators.

Saturday, May 24, 2014

NOTA (None of the Above) Means

NOTA option practically means,

I am ignorant enough to select a suitable candidate. All the intelligent people out there, please select a suitable candidate on behalf of me.

Wednesday, May 14, 2014

Why people are voting for YSRCP?

One educated fan of YSRCP told me that, from 2000-2004, the rain fall in AP is very less. In his near by village, there was severe water problem. Even drinking water was difficult to get. Every day, one tanker comes to that village, and everyone in that village fights for that water. After YSR became CM, he constructed a pipe from a distant canal/river [Since, there is nothing near by], and constructed two tankers in that village. Since then, that village did not have water problem, and there are no fightings everyday for water. Now, almost entire village votes for YSRCP.

It is very easy to say that, the village people take money and vote for corrupted people. But, if I am fighting for something everyday for 4 years, and suddenly if somebody solves that problem, why will I not vote for the person who solved that?

Eventhough YSR is very corrupted, but, he has given a lot to the people in innumerable ways. Whether it is Arogyasri, Pensions, 1 kg rice for Rs.2, Fee reimbursement for Engineering students, Lunch for students in primary schools, Free electricity, Loan waivers for farmers and so many others.

If a person who is going to die because of some severe disease, and if he is saved due to Arogyasri, will anyone in their family or close relatives would vote for somebody else?

Poor people know the value of fee reimbursement for Engineering students or 1 kg rice for Rs.2.

I heard from someone who takes child labour in their business that, after YSR started providing free lunch at schools, the children are going to schools, and nobody is coming to work in their business.

If my life is at stake, do I worry about India's economy, somebody's corruption, or India-China relationships?

I am not supporting YSR. But, I am reminded once again that, before blaming somebody, we should walk in their shoes for sometime.