Thursday, December 27, 2012

In Mumbai for a few days

This blog has been languishing ever since I shifted to Bengaluru. I just could not get enough spare time to write a post. Now, for a few days, I am back in Mumbai. Hopefully, I get time to put down my thoughts and experiences. And, it is the time for me to allow myself just a little indulgence in Wada Paav, Paav Bhaji, and Misal which I miss sorely in Bengaluru.

Wednesday, August 22, 2012

Bye Mumbai, Namaskara Bengaluru

The time has come to bid goodbye to Mumbai, my home for the past 37 or so years. A change in jobs has made this move necessary. So I will be trading my wada paavs, farali misal, paav bhaji for "veg manchuri", special dosas, idlis, and filter coffee.


Will keep posted on the experience here.

Friday, February 03, 2012

Teaching the kid how to factorize

So, one day when I return home, I find my wife desperately trying to teach the kid how to find all factors of a number in vain. The kid was unable to comprehend how to do it. After watching for a while, I decided to step in.

With the background in programming coming handy, I first explain what are prime numbers. Then, using the divide-and-conquer method, I show how to factorize.

For example, if the number is 36, I first say that the number itself and 1 are two of the factors.

36 = 36 x 1

Then, we choose a single factor which will divide the given number. For example, 9.

36 = 9 x 4

Now, repeat the above method for each of the factors until you reach prime numbers - numbers that cannot be factorized any further.

9 = 3 x 3
4 = 2 x 2

Since 3 and 2 are prime numbers, we are now in a position to find ALL the factors.

36 = 3 x 3 x 2 x 2

Now, form all possible combinations to get all the factors.

36 = 3 x (3 x 2 x 2) = 3 x 12
   = (3 x 3 x 2) x 2 = 18 x 2
   = (3 x 2) x (3 x 2) = 6 x 6


Add the ones found earlier, and that would complete the list of all the factors.

36 = 36 x 1
   = 9 x 4
   = 3 x 12
   = 2 x 18
   = 6 x 6

So, the factors of 36 are:
1, 36, 9, 4, 3, 12, 2, 18, 6

The above method has the advantage of being very fast, but it has the disadvantage that it becomes difficult if it is not easy to find the first factor.

Sunday, January 01, 2012

Happy New Year 2012

A very happy new year. Another new year, another day. This  new year I purchased a new pair of computer speakers - the Bose Companion 20 (a new model, and as usual expensive). The old speakers were less than nearly one-tenth the price of the new ones, but the old ones had nearly conked off.