Sunday, October 3, 2010

Beware of Logic

I have recently realized that many of the morons I have encountered over the years are not to be blamed for their condition. Under normal circumstances, it seems that everyone has a preference to think logically (or at least try). So why is that, that an overwhelming majority still believe in God, Astrology, Birthstones and the like? The root cause of this seemingly contradictory behavior lies in a flawed sense of logic. Though most people would like to think logically, the very definition of logic seems to take on different colors for different people and as is obvious, most have no idea what logic really implies. I have tried to analyze some of the common fallacies that I have come across and I am pretty sure most of you would have encountered the same.

1) Burden of Proof – This tops the chart by a long shot and I have come across this in the context of practically every supernatural phenomenon you can think of ranging from God to gemstones. The premise is simple. The person holding the viewpoint is convinced that because I am not capable of proving that the thing being discussed does not exist, hence it must exist. To them this seems perfectly logical. Unfortunately, logic dictates that the “Burden of Proof” lies with the one holding the belief and thus unless someone can prove that God exists, logically it does not. There is no way to prove that something does not exist.

Invoking reductio ad absurdum, let’s say I say that I believe that there exists a three headed lion that can breathe under water and talk like a human. Can anyone prove to me that it does not exist and hence I conclude that it must exist? Seems silly now doesn’t it?

2) Appeal to tradition/popularity – This is the lazy mans definition of logic. The central premise of this is that if something has been going on for generations or is endorsed by a majority of the people then that is a necessary and sufficient cause to prove its validity. The fallacy here is that the age of a belief or the number of people following it has no correlation to its validity. Traditionally, we had believed in Earth being the center of the solar system, the earth being flat, speeds beyond 25 mph are lethal, diseases being caused by witches and demons and now we all know how these went. There is perhaps a link to this kind of logical fallacy and the natural tendency of people to shy away from anything new.

3) “Post hoc, ergo propter hoc” and Relativist Fallacy - Post hoc, ergo propter hoc literally means ”After this, therefore because of this” and this seems to be the root cause of many superstitions. This logical fallacy is ascribing cause and effect simply on the basis of when events occurred. Someone may have bought a lucky charm and after a month something happened and hence the conclusion is reached that the charm must have something to do with it. This is similar to someone jumping in India and an earthquake in California that happens a month later being described as cause and effect. Relativist fallacy is typical escapism. The idea here is that the truth is subjective. This typically comes up when a person has to admit that he/she is logically incorrect but then goes on to say that he/she has personally experienced something or “believes” that something is correct. This stems from an individual’s reluctance to give up long held beliefs and they find it easier to find escapism by making truth subjective and they conclude that they somehow fall outside the purview of what is logical.

I find this to be rather interesting, because it shows that most people would like to justify their beliefs and that is a good sign. The only problem being then is that what they deem as logic is unfortunately not so. A classic example is perhaps the belief in Astrology. Ancient civilizations found out that they could observe the motion of stars across the sky to predict seasons and that was invaluable to them for deciding when to plant crops and when to harvest etc. Thus to them it was also “logical” to assume that if the stars could influence the seasons then they were also bound to have some effect on human lives and destiny. Thus the belief in astrology started.

The fallacy here is obvious. The seasonal changes are actually caused by the rotation/revolution around the sun and the position of the stars have no role to play. Let me assure you that meteorologists can predict the monsoons accurately about a week in advance and they are not star gazing. So, we have stopped relying on the stars for predicting seasons but we still hold on to the secondary belief of them influencing us? Hilarious to say the least. Maybe logic should be made a compulsory subject in schools. The least we owe to the future generations is to give them the right to decide for themselves what is fact and what is fallacy.

Monday, August 2, 2010

Quantum Model of Software Development

Of late I have been trying to co-relate some of the principles of Quantum Mechanics with those of Software Development. Though many models exist for developing software (SDLC, Agile, Waterfall etc) we all know that none of them are "perfect". Here is what I think is causing this indeterminacy.

Quantum Nature of Software
1) Quantization :
The number of bugs in a given piece of code is quantized. That is the number of bugs will always be found to be integers. There is 0 probability for the occurrence of 1/2 a bug.

2) Sams Uncertainty Principle (If Heisenberg can get his name in so can I :-) ):
It is not possible to predict the time line and the quality of a product simultaneously.
Hence any estimation that assures on time delivery will have quality issues and better quality software will induce a time penalty.
The equation relating these can be expressed as follows:
Definitions:
Quality(Q): Bugs per 1000 Lines of code (LOC)
Time (T): In any units (preferably in person days)
FP(CP): Function points (Coding language): This is the number that represents the average
amount of time needed to code 1000 lines in a given programming language.
Thus,
Q*T = 4.FP(CL) where 4 represents standard DIR (Defect injection ratio)

In other words, 0 defect implies infinite time!

3) Bug Tunelling effect:
There exists a finite non zero probability of a code issue in one module causing an inexplicable bug in another even if the interfaces are seamless.


Begin Random Rant

Sorry to digress but whats the deal with all these quality models CMM, Six Sigma etc ?
These models are like teenagers and sex
1) Everyone is talking about it.
2) Everyone thinks everyone else is doing it
3) Almost no one is really doing it.

End Random Rant

Enjoy. Comments welcome! :-)

Monday, July 26, 2010

Newton - A "Relative" of Einstein

While answering the query of a school kid recently pertaining to the Law of gravitation, I started thinking a bit more about Newtons laws of motion. One thing led to another and a thought experiment now seems to suggest to me that Newton may have unknowingly laid down the foundation for the Special Theory of Relativy in some sense. This is a very crude comparison in some senses but nevertheless it seems interesting (well to me atleast :-))
Here is what I have come up with.
We all know that Newtons law says that F=ma i.e The force is equal to the product of the mass and the acceleration of a body. Viewed in terms of an objects relation to the force of gravity, this also leads to the definition of "Weight" which is w = mg and here g being the acceleration due to gravity.
In essense thus, the acceleration of a body can be thought of as contributing to its weight. Acceleration on the other hand implies an addition of energy to the system. Thus, adding energy to a body by accelerating it in some sense increases the weight of the body and hence necessitates addition of higher amounts of energy to maintain the acceleration. This is also refelected by the Inertia of Motion exhibited by a body.
Looking at this from a different viewpoint, it appears that the addition of energy to a system and trying to increase its acceleration will in some respect manifest as an increased weight of the system. (E=mc2.. wink :-) )
So the next logical qusestion would be what the limiting condition is i.e how much energy can be added to the system so that its weight (mass) becomes so large that no amount of energy can accelerate it further. What Einstein found is this limit and gave us the exact relation between mass and energy.

Saturday, July 10, 2010

Chaos Theory - One dimension Logistic map (Excel)

Chaos Theory - Pretty interesting stuff and somehow very profound. It is yet another of those mathematical models which goes against the very grain of mathematics itself (well the 19th century view of mathematics to be precise).
Mathematics has always been regarded as the holiest of the scientific subjects owing to its inherent properties of being testable, predictable and deterministic. It was natural to assume that if something could be described mathematically then there would remain no surprises and it made perfect sense. Then maths got complicated!
1) Probability Theory - Here, after rigorous mathematical somersaults all you would end up with is the probability of the occurrence of an event not a certainty. Though it can be argued that it does limit the range of possible outcomes and hence is deterministic in some sense.
2) Quantum Theory - My favorite ! The uncertainty principle virtually guarantees that no matter what instrument is used it is impossible to determine the position and momentum simultaneously. Then of course there is the "Measurement problem" the mention of which will send shivers down any Physicists spine. To put it bluntly, if you set up an experiment to measure something like a Photon as a particle then you will detect it as a particle. An experiment set up to detect it as a wave will detect it as a wave. Funny isnt it? :-)
Well thats how the collapsible wave function of gauge boson behaves..deal with it. So essentially here mathematics has determined that you cannot determine.
3) Chaos Theory - Perhaps the most counter intuitive of all theories. Seemingly innocuous linear equations display behavior that is very surprising. I was trying to model the one dimension logistic map equation which is incidentally one of the good example of deterministic chaos. This equation is also very intriguing because this has wide uses in fields as diverse as ecology! ( Population Growth model) . In essence this equation has a very high dependency on the initial conditions and the behavior changes drastically with changes in initial conditions.
The linked spreadsheet has the equation embedded and plots a graph of 200 points based on the input value of the scaling parameter k ( Sheet: Input, Cell: A8). I have put down the ranges of k that induces different behavior from the same equation. Have fun trying it out for yourselves.
Also, Wolframs Mathematica has done a better job of modeling this equation so if you want to try out a widget which allows a greater control of parameters as well as a mean square minimized error then please refer the Wolfram Demonstration Project

And to think, our universe Probably started from Chaotic conditions on a scale that necessitates the existence of Quantum effects.

If God exists he must be ROFLing now.. couldnt have made it more puzzling. :-)

Saturday, June 26, 2010

FIFA 2010 - Mathematical modeling

After having sleep deprived myself for more than two weeks, I decided to try and take out some suspense from this World Cup :-)
The following is my analysis of the next round and predicted winners, the metric used was the normalized linear combination of the goals scored for and against a team. Lets see how things turn out.

Friday, June 4, 2010

Are we getting smarter?

I guess everyone would have noticed that kids nowadays on an average seem much more intelligent. This might not appear very surprising but I got thinking about this phenomena a bit more and it seems that there might be more then what meets the eye.
It is a well known fact that the rate of evolution in humans is 10 to 100 times the average long term rate. You might be surprised to know that 10,000 years ago no human had blue eyes but now the gene OCA2 has emerged and so we do. The mundane (and perhaps logical) explanation for this phenomenon is that the population explosion that mankind has experienced provided for a lot opportunities for mutations to creep in. That plus the added challenges of post industrial life may have contributed to this accelerated rate of evolution.

From this viewpoint it seems natural to assume that generation next will be better equipped to deal with the challenges that we now face and indeed we do see this happening in the animal kingdom as well. However, can this phenomena alone explain this growth in intellect? Rats, ants, rabbits, mosquitoes even, all propagate at rates much higher than humans but I am yet to see a rat that can understand calculus (not that I have tried teaching it to one :-)). Cockroaches have a few million years of lead on us but they havent done much beyond survival yet. There seems to something else driving our evolution that cannot be explained away by physical processes.

Here is my hypothesis:

Before I present it I think I need to point out a surprising form of memory called "Flatworm memory". In an experiment conducted in in 1953, Dr James McConell made a few worms get through a maze and then he killed them and fed them to a second batch of worms. These made it through the maze faster than all the control groups. The same experiment has been repeated with goldfish, rats and canaries with similar results. An injection of RNA seems to induce the same result. So, this cannibalistic experiment seems to point out that somehow memory is being absorbed and hence knowledge is being passed on by the act of digestion.

Maybe humans also transmit information in some way to their surroundings. If we assume that mankind as a whole is connected to a hypothetical meta physical universe that holds the consciousness of the species itself then things start getting interesting. Knowledge acquired by prior generations get accumulated in this "cloud" and any new sentient being that can tap into it instantly inherits this vast expanse of knowledge. This can explain why people are getting smarter. Yes, we have the internet and news travels fast but that is information. Knowledge is a different ball game. It is the ability to interpret information and God knows that the internet does anything but help that cause. Looking at major religions we can draw similarities between many stories and all seem to have a similar theme. Is this coincidence because during ancient times it was not possible for stories to circle the globe rapidly or is it something else? Here for example is a list of the similarities between Jesus and Krishna.
This is not mere speculation, the Global Consciousness Project has been running for over 10 years gathering data and analyzing correlations between random numbers and for many major events they have noticed a significant deviation. This is being speculated to be the result of a global consciousness that can actually have physical and measurable effects. Surprised?

Maybe there is more than just our appearance and genetics that makes us HUMAN. Certainly a tantalizing prospect.

Tuesday, May 18, 2010

Unprovoked Thoughts

Unprovoked Thoughts


The rising sun, desperate heat
The thought of sweet rain.
Randomness of pure thought
A smile, a laugh and pain.

Memories, dreams, hopes
Fleeting glimpses of a time past;
Fear, regret, plans and tears
How long will it all last?

Some things frozen in time:
Small joys, bigger smiles
Friends standing forever
Roads walked alone for miles.

Dreams that turned to life
Unrealized reality that taints.
Ah! Randomness of thought
What a canvas it paints!