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.