Sunday, December 1, 2013

Life and the Central Limit Theorem - An asscociation made in mathematical heaven

Too often in life we tend to generalize and associate individual behavior with the behavior of a group. Many of our social biases stem from such a tendency and what we fail to appreciate is the wonderfully complex world we live in.
The Central Limit theorem is one of those beautifully constructed mathematical models that seek to bring about a semblance of order in a chaotic world. In its simplest formulation, it provides a way of visualizing the behavior of seemingly random events. It essentially is a mathematical model of life, a life that involves a myriad of possibilities, a plethora of possible outcomes - some good some bad.
The simplest demonstration of this theorem can be obtained by the roll of an unbiased dice. If we roll one dice then at every roll we can land up with any of the six numbers from 1 - 6 and the probability of occurrence of any of these digits is the same and equal to 16.66%
However, if we now roll two dice and evaluate the sum of the digits that show up then the total number of possible outcomes goes up to 11 with the probability of a 7 showing up now being the highest. The probability is not longer uniformly distributed. This is because 7 can show up as a result of the following combinations
1 - 6
2 - 5
3 - 4
4 - 3
5 - 2
6 - 1

If we start rolling more dice simultaneously and repeat the analysis, the distributions creeps closer and closer to a normal distribution yielding the simplest demonstration of the theorem. I have coded the algorithm for evaluating this in a spreadsheet and it is available here and you can try it out. The only input required is the number of dice that you want to roll together and hit "Calculate". The code evaluates the total number of outcomes possible and then then probability distribution is plotted.
Caution: Owing to the mathematical complexity of evaluating the total number of combinations which rises exponentially with larger number of dice, do not input more than 6 as it is likely to crash your PC ( if its a 32 bit CPU). If you have a 64 bit processor then you can try a bigger number

PS: Code could have probably been written to use recursion but got lazy and hence relied on mathematical jugglery.
Case 1: When one die is used. Number of possible combinations and outcomes is 6



Case 2 : With two dice the number of combinations is 36 and outcomes is 11


Case 3: With 6 dice the number of combinations is 46656 and outcomes is 31


The moral is that a lot of unrelated events can still lead to something that is so wonderfully symmetric and this applies to more aspects of our lives then we care to think about. From the noise that affects electronic circuits (Additive White Gaussian Noise) to how the marks/ratings will be distributed among a random selection of individuals to why individuals in a group behave differently than when alone ( Mob psychology), patters of behavior and data are often more relevant than individual behavior.
As individuals we make choices but given the random nature of individual choice, the outcomes follow a Gaussian distribution which we unwittingly contribute to. Extreme cases of success and failure are the outliers on this curve while humanity's choice as a whole is the mean. Making choices closer to the mean would imply a higher probability of favorable outcome but if everyone does it then it takes away the importance of individual choice.
Neo : "Choice, the problem is choice." - Matrix

Friday, July 26, 2013

Fast and Furious - 1st Gear (Bangalore Edition)

Bangalore - The second most affluent city in India, a city that millions call home and a subset of those millions also call it an obstacle course.
The Government of India has stipulated that a Drivers License obtained anywhere in India has national validity. I beg to differ. A DL just says that you "may" legally be allowed to drive. The roads in Bangalore begs the question.... CAN you drive..PUNK? (Read this out aloud imagining yourself to be possessed by Nana Patekar to get the drift)
In order survive the daily ordeal, here are a few tips that can help you keep a check on your sanity.

The Mental Preparation:
As any good Bangalorean will tell you, the brain is the most important organ in the human body...on weekdays. On weekends, the kidneys/liver and lungs call the shots. However, I digress, a day of office commute should begin with a deep breath and empty bowels. Watching inspirational and motivational videos is a good start but if you are pressed for time then try convincing yourself that you love driving.Over a period of time you may be able to actually convince yourself that you like driving, this is a variation of self hypnotic therapy and is useful in some cases.

The Physical Preparation:
Eat a healthy breakfast, go light on fluids (unless you are carrying adult diapers). Light stretching focusing on the calf muscles, triceps and wrists is essential. As always, try doing the exercises in sets and with a predefined rhythm. I have personally found that repeating the phrase "Clutch, Gear, Brake" repeatedly while working out is a healthy outlet and helps in both
               a) Mental Preparation
               b) Physical Preparation
and is a mantra that you can repeat as often as you like during the drive

The Car: 
Whether you have  Reva or a BMW, you need to forget that your car has anything beyond 1st and 2nd gear. I have heard rumors of  roads where the courageous have shifted to 3rd but there are no confirmed reports. Always ensure that you are not low on fuel and stock you car with supplies like you would if you knew that a zombie attack was imminent. Know how to work the controls, with one hand/foot, simultaneously..and yes, I mean the brakes too. Your other appendages can then productively be engaged in fiddling with your smart phone. Get a seat with Lumbar Support. I have heard that the Cab drivers here have a seat that has a protruding spike placed below the posterior which juts out at random times. It is supposed to improve your driving skill but has the undesirable side effect of causing rapid accelerations, sudden brakes and wild turns.

The Road:
Ha ha..got you!! What road?

The Potholes:
At first glance you may mistakenly assume that you drove out of your apartment and landed on the surface of the moon and start postulating on whether it was a wormhole or a manhole that got you there but not so fast. These potholes are a major tourist attraction and there are actually major roads that have been named after the potholes. 80ft road and 100ft road are such roads where the depth of the pot holes are 80ft and 100ft respectively. Some "outsiders" think that the names allude to the width of the roads...such ignorance!! These potholes have numerous advantages
1) The water accumulated in these potholes percolates and replenishes the ground water level
2) They act as well designed speed breakers.They are guaranteed to break more than your speed and are regarded as engineering marvels.
3) They keep drivers constantly on alert and many have actually reported that so keen is their focus on the potholes that they do not look at road signs or landmarks.The potholes are like playing a game of connect the dots. It takes out the monotony of driving.

Above all,  be positive, your car has a Power steering and Disc Brakes for a reason, use them. To be a successful car driver in Namma Bengaluru you need to lose the fear, lose the fear of death,disability and car repairs and you shall prevail.
So repeat after me  Clutch, Gear , Brake.. Clutch , Gear, Brake............Accel..BRAKE!!!!

Friday, May 17, 2013

Home Loans Vs Renting - Cost of Ownership




Should I buy a house and spend the next 20 -25 years of my life worrying about an EMI or should I just live as a Tenant?

This question seems to have as many answers as people you choose to ask. The fact is that there are aspects of this deal which are hard to pin down in numbers and most people tend to justify the decision that they have themselves made. I have seen many articles written on this but I think that rather than presenting a conclusion, what is really needed is to have all the aspects listed out so that people are provided with something that they can try and figure out for themselves.

This link has a spreadsheet(Loan_Feasibility.xlsx) that I have shared and can be downloaded. I will, in the following paragraphs describe how this works along with the assumptions that have been made. I hope this is useful for all those who are in the midst of taking this decision.

Listed below is a screen shot of how the spreadsheet looks like and the section by section explanation of the various fields follows

Input  Paramters:

Property Value: This is where you need to enter the current value of the property you are after
Own payment: This is the amount that you can pay up front for the property
Loan: This is auto calculated based on the above listed inputs
Loan Interest Rate: This is an Input parameter and you can plug in the expected ROI for your loan
Loan tenure(months): Self descriptive input parameter. Should be < 300 months (25 years)
Annual Inflation: This is another input parameter that is a critical factor to be considered
Rent: This is the monthly rent that you would expect to pay if you stay in a SIMILAR property.
EMI: This is auto calculated based on the loan amount, interest rate and tenure provided.

All the rest of the fields are auto calculated based on the inputs and the following sections describes how these are being calculated. You can play around with the excel to factor in additional details if needed. There are no macros in the spreadsheet, just cell formulas, which are easy to manipulate.

Owned Apt Cost:

Loan Repaid: This is the total amount of loan repaid (EMI*tenure)
FD loss (own Payment): This is the amount that you would have had if you had invested in a FD instead of paying the down payment for the property. Assumed annual cumulative return@Inflation for duration of the Tenure
Tax Savings (30%): The current 1.5L rebate on income tax is factored in here. Assuming a tax bracket of 30%

Rented Apt Cost:

Rent paid: This is the total amount that will be paid out as rent over the duration of the tenure. The assumption here is that the rent increases@Inflation every year.
EMI Savings: This is the savings that would accrue for you if you go in for rent rather than paying an EMI. The calculation also accounts for the fact that the savings is invested and earns interest@Inflation for the relevant duration i.e for a 20 year tenure, the savings of the first year earn interest for 20 years,the savings for year 2 accrue interest for 19 years and so on. Also note that with the rent increasing @Inflation every year it will get to a point where rent becomes higher than the EMI (which is fixed) and hence at that point, the savings become negative. This has also been accounted for.

Conclusions:

 Difference b/w Ownership Cost and Rent: This is the difference between the two costs i.e cost of ownership - cost of renting.
Current value of Asset: This is the current value of the asset.Assumption is that the appreciation was @Inflation
Net Worth(Ownership): This is the price of the asset minus the cost incurred

Net Worth (Rent): This is the amount expended when living as a tenant

Difference: This is your perceived net worth after the end of the tenure

*Points to Ponder

1) The difference between the EMI and the rent that you would have to pay for a SIMILAR property has a significant bearing on the outcome so validate this assumption. Saying that the property price is 90L for a 3 BHK and then comparing it against paying a rent of 10,000 is illogical simply because if you are actually planning to buy a property worth 90L then it has to have the amenities/environment etc that should command a higher rent.
2) The rate of Inflation is being used to calculate the returns on FD, increase in Rent as well as appreciation in property price. This is realistic but honestly speaking  it is a convenience to make such an assumption but for the calculation intended here, it should suffice.
3) The final asset value also has a huge bearing on the outcome. Be realistic about it. The calculation assumes appreciation @Inflation for the tenure of the loan. This will never happen in the long run so adjust this accordingly. Over the last 5 years however, this logic seems to have held good.
4) Try and keep your EMI to be around 40-50% of your take home salary. Its a safer bet.
5) One obvious thing that is not factored in here is the part prepayment possibility as that is difficult to estimate. However, this too can have a very significant bearing on the total amount you dish out for the loan.

Please play around with the spreadsheet and try out different combinations of the Input paramters to see the effect on the outcome. My favorite calculation was to first decide on a property price/loan details and then play around with the rent parameter to bring the Difference b/w Ownership Cost and Rent as close to Zero as possible. This would give you the "equivalent" rent.

Example:  

In the snapshot given above, the Property price is 90L,down payment was 30L for a Loan Tenure of 20 years@11%. Inflation is at 8% and Rent is 25K.
Overall it shows that the net worth of the person owning the property would be 87L higher then a Tenant.

If you play around with the Rent parameter then the equivalent rent in this scenario will turn out to be 
Rs 41155

Happy decision making!!! Ending with a few lines by a great man

"Ownership has a cost but also brings joy
Leverage your credit, don't be coy
Or chill for a while, pay the rent
Maybe the Earth will expand and you wont repent"- Samrat (A tormented EMI payer) :-)