Saturday, December 01, 2012


I have mixed them all.
I have dropped ice cubes into boiling hot: they sizzled and sighed and they lived and died.
I have rushed cold into hot and calmed hot into cold so that I could reason it out with lukewarm.
Now it is getting cold, the eternity of ice is longing to turn me numb.
In the end it will be all about mist for me but they will see icy remains.

Thursday, November 08, 2012

One of the best basic Machine Learning MOOC

Watch out for this course on Coursera. This is one of the best introductory courses on Machine Learning I have ever come across.

Thursday, October 18, 2012

MOOC good vs bad

I have undergone a dozen of MOOC courses with cool groups like coursera, udacity, khanacademy, edx etc

As expected I completed a few and dropped off a few...

From a student's point of view, I am convinced now that the success of a MOOC depends on the following in the decreasing order of importance:

1. Teacher.
2. Course content.
3. Pedagogy.

The knowledge/educational qualification of a teacher plays an unimportant role in motivating/convincing a student over the internet. Remember, this teacher can't be reached beyond the video. In my understanding, a teacher's job is to install the basic building blocks and motivate the students so that the students rediscover the wheel by themselves. Spoon feeding doesn't help at all if you really want to "learn". I found that a number of teachers on the MOOC just failed to convince/motivate me. The were lecturing as if a student will approach them outside the class to clarify the doubts!
In at least four courses I found an interesting pattern. If you don't have access to the books, you will fall flat on your face. I could smell that the content was designed as a teaser, you know what I mean, like those movie teasers! No free education. hehehe

Monday, October 15, 2012

A very helpful website on Indian tax and related matters bu Gulab A. Singh

Gulab A. Singh has been doing wonders on his webpage here. He is very helpful with his advice related to Indian tax and related matters.

In his words he has introduced himself as:

 I wish to state that I am a practising Chartered Accountant from Mumbai, India and also qualified the Law Degree. Currently I am pursuing final year in Masters of Law (LL.M) and hope to pursue Ph.D in future. I always had the inclination to write and present my views – both on professional & other areas comprising of Political, Social, Legal and Cultural.

Wednesday, October 10, 2012

Human brain a wonderful approximating engine

Human brains are perfect approximating engines.

The Idealists are adjusted to become Practicals.
And lo and behold!
The Practicals are adjusted to become Corrupts.

Tuesday, October 09, 2012

All the languages are just domain specific languages.

In a software engineer's terminology, mathematics is just another domain specific language. It was developed to suit a very specific set of needs of humans. Try expressing Love in mathematics. Try expressing Kangaroo in a non-australian-native language. And then try expressing a matrix of 1000 dimensions in mathematics.

But does that mean that spoken languages are also domain specific languages? Yes, they are. All the spoken languages can't express everything. They evolved to serve the local and specific needs. Try expressing Kangaroo in a non-australian-native language. Ty expressing a matrix of 1000 dimensions in English. And then try expressing Love in your mother tongue.

All the languages strive to be short, precise and sufficient to satisfy local needs.

Counting by my 2 years old daughter

My 2 years old daughter can now express counting:

If present it is "one". One or more present, all are counted as "one".
If absent it is "aa". She supports "aa" with a complex hand gesture conveying "it is gone, it is no more".

It is no big deal. But what caught my attention is that she learnt her "aa" first and "one" next! In other words she understood the meaning of "absence" and could express it long before "one" came in.
Food for philosophical thoughts? ;)

Saturday, September 29, 2012

Andrew Ng vs Daphne Koller

I completed Machine Learning @ Coursera taught by Andrew Ng.

I am in the first week of Probabilistic Graphical Model taught by Daphne Koller. And I am feeling the heat! :)

Although the content and objective of the courses are different. But in my experience Andrew is a better teacher.

Andrew uses very simple sentences. He speaks at a consistent rate. After each class you will always feel like exploring the topic by yourself. Andrew gives you enough to build upon.

Daphne uses very very heavy sentences. Sometimes you will find her speaking at a good intelligent rate and the other times she speaks really fast. She rarely breaths between two sentences. Trust me if you haven't already studied the topic/chapter you won't understand the videos a bit. After going through her videos you won't have enough energy to explore the topic further. :P

One of my fave from Daphne is:
"So here the structure is actually a sparsity in the transition model as opposed to something that manifests at the level of the 2TBN structure which is fairly simple."

ha ha ha

Tuesday, September 25, 2012

Javascript virtual machine as a standard

Was watching this video by Zed Shaw few months ago.

Well, all but one thoughts are totally forgotten.

But the one lingering is as follows:
The web browsers should be language(read Javascript) independent. They should support a common standardized bytecode engine to run things in them.
Let people choose their favorite languages to code and should not be forced to use Javascript. Those languages should generate a standardized bytecode.
People are anyway moving towards this goal with things like Coffeescript, Fay, Roy, Elm etc. But things could definitely improve beyond this code translation activities.

Thats it!

Wednesday, September 19, 2012


i can see your clothes thrown on the floor with mine,
you must be somewhere close, very close.

i can see your bangles lying around,
your bare hands must be rubbing against mine.

i can smell your sweet breath riding the waves of your heart,
your face must be hovering over mine.

i can taste the moist and fading strawberry flavor on my lips,
you must have touched mine.

i can see your lost earring stuck in the troughs of morning bed sheet,
although you are pretending to be worried, that satisfied smile must be settling on your tired lips.

i feel totally lost and dazed,
you must have looked into my eyes for long.

i can see that red haze in the room,
you must have been here few moments ago.

my life is glowing,
you are rising somewhere in my soul...

I forgot something

I think it is a common experience when we know that we have forgotten something but can't recall what it was.

It implies that the consciousness engine is not fed with the complete content of a thought. The engine only gets access to a set of pointers/impression/reflection of thoughts. The thoughts themselves reside somewhere else. To process a thought the engine first accesses the pointer and then processes the complete thought via that pointer. When a pointer loses the contact with the original thought content it causes that feeling of have forgotten something.

Actually a lot of time I get another picture:
Thought/impulse pointers scrolling automatically and endlessly in front of my consciousness engine. The engine doesn't really respond to all of them and lets them go past. Based on some judgement it pauses the scroll every now and then and picks a few and processes/consumes them selectively.

Thursday, August 30, 2012

Creator, Objects and the Big Picture

There is something odd about creation. The creator creates an object with all sincerity and honesty but always leaves out one part: the object is never allowed to know all by itself.

The created object always needs the fellow objects or at least some sort of reflection to know things beyond. Interaction is the key to knowledge. Interaction could be destructive or constructive, it doesn't matter but it always leads to better understanding of the big picture.

Friday, August 10, 2012

Indian Democracy digest for dummies

I am not doing any PhD in Social Sciences or Political Sciences. It takes few minutes to observe and understand how democracy, especially parliamentary democracy works in India.

It is simple. Indulge in reproduction, reproduce more. Promote reproduction in your community. As a community, race, caste, religion - reproduce more. The one who reproduces more will eventually rule ones who are delivering less. Of course never build communities on the ideologies, they are infinite. Take a simpler path: build groups on caste, religion, languages. It is that simple.

Why? Democracy is all about majority and votes. A leader is elected if he gets more votes. Plain arithmetics. Of course it doesn't matter how you get those votes.

The leader has to be from your caste or religion? If it happens then you are insured better otherwise you are supposed to elect one who is the greediest of all. Why? The elected one will make laws to suit you and your needs. Who is you? You are the community which reproduces the most. Why greediest? Who makes laws for free, you fool! Thus you will decide what is written in the holy book called Constitution. Remember constitution is written and updated for the people* and by the people*.
PS: people* = the highest reproducers.

But what about the other pillars of democracy: Judiciary, Executives and Media?

It is not that complicated: if Judiciary starts preaching and raising its hood then you take steps quickly so that the democracy continues to run smoothly and effectively. You see, you are bound to follow the holy book. So let us change it at the root. Smart, isn't it? All the leaders want to keep you, the performing reproducers happy. Chill!

But what if the rest opposes? Let the rest oppose. Where will they oppose? Ramlila Maidan can't be hired for the demonstrations for ever. How long will they oppose? After all they have got to run their businesses too. And please recall, they can oppose, shout slogans but they can't make laws! So, chill!

But how to deal with these Executives and Media? Hmm looks like you didn't really evolve optimally through this article. Solution: If the leaders don't work for free then so don't these other so called pillars of democracy.

Well there are more tentacles in this system than illustrated above, but the fundamentals never change:

Reproduce more


Respect the economics of commissions, cuts and rewards.

Sunday, August 05, 2012

The smart content of Coursera and Udacity

I have been studying few subjects on Coursera and Udacity. The content of these courses are designed very smartly. Most of the times you would feel confident after going through them. But let me warn you, you might be suffering from overconfidence. They are not complete, they are just meant to introduce you to the topics. So better take some time to explore the chapters elsewhere to really appreciate the subject in depth. Their objective to keep the lectures short to avoid distractions has this subtle side-effect.

Happy learning!

Wednesday, August 01, 2012

Feedback system for muscle movement

The other night I dozed off on my study table. In that process I pushed by pen off the table. To my surprise even in that state of mind I had already realized the fall and stretched my hand to intercept the trajectory so that the pen could be caught before reaching the floor.

Well let me clarify first that I am not the person under the cloak of Spiderman.

What was revealing to me that our brain deals with movement control using a feedback system. Each movement effort expects a feedback. While wide awake this loop is so fast that we never realize its presence. But in that half sleepy state of mind, it revealed how that feedback cycle works by anticipating the trajectory of the fall in future.

Phrase overloading by a 2 years old

My 2 years old daughter can now overload phrases.

An interesting example is "bye". When she is going out she waves "bye". That is a normal usage of "bye" that we all know of. But interestingly when she wants you to leave her alone she uses the same word "bye".  So actually she has understood "bye" as a symbol of separation.

Tuesday, July 24, 2012

So you have started hating Khan Academy

he he he

So people have started calling Salman Khan a bad teacher. In contrast it is his this gifted ability to explain things which made him popular. Without any doubt he is a very good teacher. If he was not we wouldn't have been discussing him.

But he has also publicly criticized the teachers who teach for the sake of working. You know people get in that comfort zone, regular salary streaming in. Who cares about teaching after that! The initial enthusiasm drowns and laziness and muscle memory sets in. Khan has hit them on the right spot. They have woken up. But instead of correcting themselves they are lobbying around the media houses and howling.

And there is another group of people who want to sell themselves riding the hype around all this. They are great trained teachers who have worked for years to create those error-free contents. They appear in front of their students with that additional halo around them and start their lectures. But students don't connect with soul-less and robotic teachers! It is true and all of us have experienced it sitting through those factories called schools. Confess it!

he he he

Saturday, July 21, 2012

minimum deviations

Median leads to minimum sum of absolute deviations.
Mean leads to minimum sum of deviation squares.

Thursday, July 19, 2012


Zero is a wonderful concept we humans created to simplify our understanding of everything, it helps to build a world starting from anywhere(or nowhere ;)). Place that zero on your dining table and start imagining that bowl whose center of base coincides with the zero. That 3 dimensional world starts appearing spontaneously around that zero. In contrast imagine searching for that absolute zero in this never ending world before starting to build that bowl around it! Due to zero it has become so damn flexible to express ideas portably and modularly! Zero is everywhere and without it we wouldn't have come this far in expressing our ideas. So long with this relativistic and referential understanding of zero.

Does zero exist only in referential domain? Is there an absolute zero somewhere where it all started in absolute form? If it really exists then everything is connected and related to each other with respect to that absolute zero! Time to return to the surface and breath normally. :)

Tuesday, July 03, 2012

Mean calculation based on previous mean value

mean_n(a) = ( 1/n ) * ( (n-1) * mean_n_1 + a )

where mean_n is mean of all numbers till a.
           mean_n_1 is mean of all numbers except a.

Now if the n is big then it can be approximated to: mean_n_1 + a/n.

The interesting part is (a/n). If a wants to participate in the mean calculation then it just needs to be divided into n portions and added to the previous mean(for n-1).

Online learning vs Batch learning

Any machine learning application should eventually be really open to online learning strategy. Once they have learnt enough with offline batch learning strategies and ready to be used, then they should be reconfigured to switch to online approach.

Money in and out

If you earn money easily(you know what I mean), then there is a high chance that you will spend it freely. Hard earned money won't be spent that easily.  This feedback mechanism looks so sensitive that things could go out of hand very easily at a macro level. Market is such a delicate work of balance!

Saturday, June 23, 2012


For last few weeks I have been studying online with Andrew Ng on  and Salman Khan on Both them are superb teachers and I observed these similarities:
  • They have a very warm and straight forward approach while discussing matters.
  • A good sense of humor.
  • They know what to hide and what to share on a topic. When you have teachers like that even an average learner like me won't get intimidated with the vastness and complexities of subjects.
  • They strongly encourage learning attitude against the attitude of outshining others. 
  • They are very modest and always discuss their shares of failures very constructively.
This is going great! May they continue to succeed in their endeavors!

Thursday, June 21, 2012

Lost in Scala's support for partial function and currying

scala> def x(s:Int, t:Int) =  s+t
x: (s: Int, t: Int)Int

scala> def x2(s:Int)(t:Int) = s+t
x2: (s: Int)(t: Int)Int

scala> def x3(s:Int) = (t:Int) => s+t
x3: (s: Int)Int => Int

scala> (x(_,_)).curried
res0: Int => Int => Int = <function1>

scala> (x2(_:Int)(_:Int)).curried
res4: Int => Int => Int = <function1>

scala> x2(_)
res13: Int => Int => Int = <function1>

scala> x3(_)
res19: Int => Int => Int = <function1>

scala> x2(1)(2)
res11: Int = 3

scala> x3(1)(2)
res10: Int = 3

scala> res0(1)(2)
res8: Int = 3

scala> res4(1)(2)
res9: Int = 3

scala> res13(1)(2)
res16: Int = 3

scala> res19(1)(2)
res20: Int = 3

Although by the classical functional programming concepts of currying and partial functions x2, x3, res0, res4, res13 and res19 all of them are same, but they are still so different in Scala.
What could be the reason behind this approach which could be very intimidating to the newbies?
Could it be the burden of supporting object-oriented concepts like method overriding via inheritance where method signature plays an important role?
One thing is sure that Scala's syntax design is very poor and full of gotchas.

Wednesday, June 20, 2012

Common Problem solving with fp and oop ways

The fundamental basis of common problem solving is to split a problem into smaller problems, smaller problems with one angle/factor/context at a time.

Then try to solve each one of them in seclusion, avoid mixing contexts as much as possible while solving them.

Now once they are solved individually compose them back to get the grand final solution. It will work if the contexts and the solutions both are composable.

Even with my limited knowledge of functional programming concepts I can see the above scheme fitting it nearly well. While solving it FP way I am focussing exactly on the behavior and the solution. Composition of smaller solution units as functions are deeply engrained in the paradigm. I have just one entity to worry about while composing: function/behavior. Things tend to be precise. Although the learning curve is sharp it tends to fall in place sooner or later.

Now that I have been exposed to little of FP, I have started to realise where object-oriented is not working. With that of mainstream object-oriented concepts, I start with the classes. The splitting of the problem and appearance of classes look cool and encouraging. Things look great and beautiful during the splitting phase. But when the time comes to compose the solutions back to the big picture, it tends to start getting ugly. I think the main reason behind this hurdle is that now we are trying to compose the solution at two levels: class and behavior. If I focus on class composition then the behavior tends to either underfit or overfit the desired solution. If I focus on the behavior composition then the classes start to look mixed and weird. Statefulness of the classes add another level of complexity. So now we have to deal with three types of complexities at a time.

Scala is trying to bridge the gap with its hybrid approach, but have you looked at the trio of class/trait/object? They are so hairy, full of details, so much detail! As expected the functional part is hard anyway.

The contemporary programmers like me are going through so much of flux, confusion, trial and errors and brain bending phases. But it is fun of course. Let the wheels keep rolling. :)

Tuesday, June 19, 2012

Scala implicit: confusing

scala> implicit val x=23
x: Int = 23
scala> def dos(implicit d:Int)(s:Int) = println(d+s)
:1: error: '=' expected but '(' found.
       def dos(implicit d:Int)(s:Int) = println(d+s)
scala> def dos(s:Int)(implicit d:Int) = println(d+s)
dos: (s: Int)(implicit d: Int)Unit

So the implicit argument can't be the first one on a curried function.

scala> def dos(d: Int, implicit s: Int) = println(d+s)
:1: error: identifier expected but 'implicit' found.
       def dos(d: Int, implicit s: Int) = println(d+s)
Can't declare an argument as implicit if it is not the first one on a non-curried function.

scala> def dos(implicit d:Int, s: Int) = println(d+s)
dos: (implicit d: Int, implicit s: Int)Unit

First argument of a non-curried function can be implicit but the rest of the arguments automatically become implicit!

Friday, June 15, 2012

Those parentheses in inline anonymous function application in Scala

scala> (x:Int,y:Int)=>x+y
res26: (Int, Int) => Int =

scala> res26(_:Int,10)
res27: Int => Int =

scala> res27(1)
res28: Int = 11

scala> res26(_:Int,10)(1)
:9: error: Int does not take parameters

scala> (res26(_:Int,10))(1)
res30: Int = 11

Programming language not based on boolean algebra

Programming languages are designed to be executed by a machine which understands Boolean Algebra. Naturally to express an idea in these programming languages one will have to totally unambiguous. Encapsulation and Abstraction concepts of prgramming languages try hard to hide or abstract the context in which the programmer tries to express something. But sooner or later it gets very complex.
Although I have very limited understanding of Fuzzy logic and similar mathematical/statistical concepts, but can we develop some programming language which is based on these foundations rather on Boolean Algebra? Or is it already there?
What I am vaguely imagining is a platform:
1. Is a composition of context bound expressions.
2. Would start with very contextual expressions and assume that they are correct and totally discrete and unambiguous.
3. Working towards the common goal of the program, when these expressions interact with others then there respective contexts should be corrected so that they make sense to each other.
4. The expressions remain the same and aren't corrected. The contexts are corrected.
5. It has to be iterative and evolving.
6. Not sure if the contexts should be aware of the bigger goal of the program. How will the contexts and their corrections align towards the main objective of the program?

Tuesday, June 12, 2012

Nursery Rhymes!

A number of nursery rhymes are really well thought and designed. I watched a few with my daughter and was delighted to appreciate their intentions. Trying to elaborate a couple of them:

  • Hickory Dickory Dock:  Obviously it introduces clocks to the audience. But then it also teaches the counting. And at a subtle level it introduces progression as the animals grow in size. And then this progression can be associated with the numbers on the clock.
  • Old MacDonald: This one is a memory jogger. You start with moo-moo and move to baa-baa and then next. But each time you move to the next level you have got to recall the previous one all the way back to the first one. moo-moo. baa-baa, moo-moo. cluck-cluck, baa-baa, moo-moo. The audience can be introduced to the trick of association to recall the order of animals. Kool!
Now the tough part is to encourage them to appreciate these points. Just memorizing them up would be useless and should be sung by deriving the next step with these tricks.

Let me see how I can explain these to my daughter when the time comes. Right now she is too young for them I feel.

Tuesday, May 22, 2012

The way my brain thinks

There is a way my brain thinks. I could sense/observe these:
  • It always thinks in small tiny units. It holds the thinking within that unit and then something happens and it jumps to the other unit. Not sure whether this unit has a sense of time or not.
  • Each unit has its own context. It obeys the rules of that context. The context is based on the previous experiences and biases. These contexts are not like those "free thinking" phrases coined by some. These contexts are very narrow. It is as if you are running blindfolded in a narrow tunnel. You will be guided and steered by the walls of the tunnel. It is not like a wild horse running in a vast green, beautiful field spread between infinite horizons. I can reflect right away that my expression and imagination of this wild horse itself is bound within the boundaries of a previous experience. My brain never violates the rules of a context.
  • But it really jumps from one context to another. These contexts are chained to each other. They are again bound to each other due to previous experiences. They are not chained to each other just randomly. One of the most interesting association links is the concept of Analogy. A context could chain to other due to some common factor called analogy.
  • Because we are bound within contexts most of the time we communicate effortlessly. Imagine one fine morning I greet somebody and I receive a hurl of abuses in return! Out of context?
  • Even the poets express themselves within contexts. If there is a mismatch in contexts I won't appreciate the work of art.
  I am such a narrow minded person! Depressed, sigh.