## 2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 1,600 times in 2014. If it were a cable car, it would take about 27 trips to carry that many people.

## Why is 1/0 infinity but 0/0 undefined?

October 10, 2014 at 9:34 pm | Posted in interesting maths, Mathematics | 1 Comment
Tags: , , , , , , , , , , , , ,

When we were kids, we were taught that anything divided by 0 is infinity i.e. a very big number that cannot be calculated. As kids, we took the liberty of taking 0/0 as infinity as well and no one corrected us. As long as there was no finite definition of x/0, everyone was happy and so were we.

The time changed, we grew up, started using calculators & spreadsheets and suddenly came across this difference. When you divide any number other than 0 by 0, your calculator returns ‘E’ or error but when you divide 0 by 0, it returns undefined. Why is it so? Is x/0 actually infinity?

Let us dig a bit deeper into why is there a discrepancy.

Let us take a very simple equation: xy=1

i.e. y = 1/x

So when x = 1, y=1 when x = 1/2, y = 2, when x = 1/4, y=4 and so on.

So (x,y) ∈ (1,1), (0.1,10), (0.01,100), (0.00001,10000)……… (1/10^n, 10^n)

Thus we see when n increases to extremely large numbers, limit(x)->0 but limit(y)-> ∞.

Thus we can say if something is divided by 0, the output is infinity(∞). But wait.

What if in our case, x < 0?

(x,y) ∈ (-1,-1),(-0.1,-10),(-0.01,-100)…..(-1/10^n, -10^n)

The result is same but in the other direction i.e. limit(x)->0, limit(y)-> -∞.

That essentially means, y is ±∞ depending on which side of the number line we approach it. So it might be okay to assume x/0 = ∞ for basic mathematics purposes but in reality it might not be true.

If we draw a graph of y = 1/x, it looks like:

#### If x/0 is infinity, then why is 0/0 undefined?

We approach this problem with simple two dimensional coordinate geometry.

We take a simple straight line y = x. This line has an intercept of 0 and slope of 1.

y = x i.e. y/x = 1;

Some of the points that lie on this line: (2,2),(1,1),(0,0),(-1,-1),(-2,-2)

Do you see something? If (0,0) lies on this line, (0,0) must satisfy the equation y/x = 1; i.e. 0/0 = 1?

Take another line y=2x i.e. y/x = 2;

Some of the points that lie on this line: (2,4),(1,2),(0,0),(-1,-2),(-2,-4)

Great. (0,0) lies on this line too i.e. 0/0 =2?

We all know that we can draw infinite number of straight lines through 0, so 0/0 changes its values infinite times.

Moreover, we have innumerable other curves that pass through (0,0) y=4x^2 for example. An infinite number of curves fulfilling such equations pass through (0,0), so 0/0 has another infinite set of values.

#### Total number of values for 0/0 = ∞ x ∞

Which value of 0/0 to pick among the so many values of 0, when we are asked?

– Himanshu

## Converting Miles to Kilometers – Fibonacci Numbers to the Rescue

Tags: , , , , , , , , ,

A lot of times we encounter a situation where we want to convert miles into kilometers. If we go by the formula where 1 mile = 1.609 kms, we will probably reach the actual conversion, but multiplying a number with 1.609 is not which everyone wants to do.

This is where Fibonacci series comes to the rescue. A Fibonacci series is a mathematical number series in which every number is a sum of two preceding numbers. For example:

1,1,2,3,5,8,13,21,34,55,89…….

In the above series, every number is the sum of preceding 2 numbers. We can assume an invisible zero before the first 1.

If we calculate the ratio between two consecutive terms, we find out that the ratio actually converges to 1.61803 after the first 14 terms.

Surprisingly this number is very close to the conversion ratio for miles to km conversion. If we consider anything between 1.6 – 1.65 as a decent conversion ratio for a back of the envelope conversion, we can safely say that once the series reaches 8, we consistently get the ratio between two consecutive terms to be well within the range.

What does that signify?

We have a very simple way of calculating the number of kilometers from miles (for kms > 5). Simply take the next value in Fibonacci series and that will be a good approximation in kilometers.

For example if we need to convert 13 miles to kms, simply take the next number in the series i.e. 21. In actual, 13 miles = 20.917 kms. Not bad.

Let us take another example:

55 miles = ? kms

Simple, from Fibonacci series, it should be close to 89 kms. By actual formula, it is 88.495 kms. Less than 1% error again. Superb.

What if the number is not a part of the Fibonacci series. Simple again. We all know about distributive law in Mathematics:

a x (b + c) = a x b + a x c

This essentially means we can add different Fibonacci numbers to reach the number we want to convert. For example, if we want to convert 26 to Fibonacci series, 26 = 21 + 5 so we take the next numbers from the Fibonacci series for 5 & 21 and add them:

Kms (26 miles) = Number next to 5 + Number next to 21

Kms (26 miles) = 8 + 34 = 42

If we use the formula, we get 41.834. Again percentage error is less than 0.5%.

Lastly, we take a big number say 145 and see how can we apply our analysis there:

141 = 144 – 3

Kms(141 miles) = Number next to 144 – Number next to 3

Kms(141 miles) = 233 – 5 = 228

By formula; its 226.869

Isn’t it Cool.

Thanks for reading – Himanshu Joshi.

## Why do we break traffic lights? – A Quantitative Analysis

Tags: , , , , , ,

India is my country and all Indians are my brothers and sisters. So this analysis believes in right to equality and assumes each of us to be equally prone to break a traffic signal. I am sure most of us would have broken a traffic signal atleast once in your lifetime or have seen someone breaking it.

Pb = Probability of breaking a traffic signal by you

Pc = Probability of getting caught when you break a signal

Pp = Probability that a policeman is standing on the traffic light to catch you

This analysis uses some basic approaches of game theory and Bayesian probability models. Please drop a comment if you have doubts in the analysis.

The Decision Tree

To start any analysis that involves probability, we should start with creation of the decision tree for various outcomes that can happen. If we draw a decision tree for a normal scenario:

Here we assume some more things:

• The payoffs for breaking a traffic signal are definitely more than those for not breaking a signal.
• When a rider does not break a signal, he loses some time and we can define the losses in financial terms.
• When a rider breaks a signal, he saves time thus he does not lose any money (arbitrary)
• When he gets caught, he has to pay some fine and some more extra money to the policeman to get away.

Assigning Values to Variables:

We do not know how much the loss is, in terms of money, for the rider when he does not break a signal. We assume it to be Rs. 100 to start and then proceed with our calculations. Similarly the gains that he gets by breaking the signal is equal to Rs. 100/-

Number of vehicles at any signal: 10

Number of vehicles breaking signal: 2

Number of vehicles getting caught: 1

Probability of breaking a signal, Pb : 2/10 = 0.2

Probability of getting caught, Pc: 1/2 = 0.5

Probability that a policeman stands (we can safely assume that in India, we see a policeman 1 in 10 times), Pp : 1/10 = 0.1

Fine when the rider is caught: Rs. 500

Updating the Decision Tree:

Next we add the payoffs / losses at various options and try to calculate the average payoffs at the various option nodes.

All we are left to is to calculate the payoffs/losses at the nodes C, B & A and try to see if breaking a signal sounds more logical.

At node C:

Nett payoff = 0.5 * 100 + 0.5 * -500 = 50 – 250 = Rs. – 200/-

At node B:

Nett payoff = 0.1 * (-200) + 0.9*100 = -20 + 90 = Rs. 70/-

At node A:

Nett payoff = 0.2 * 70 + 0.8*(-100) = 14 – 80 = Rs. -66/-

This essentially means that if there is a policeman, it is more logical for the rider not to break the rule because average expected payoff (Rs. 100 * 0.5 = Rs. 50) is less than the average expected loss (Rs. 500 * 0.5 = Rs. 250). However, if there is no policeman, the payoffs for the user to break the red light are much higher (0.9 * 100 = 90). So when there is no policeman, it sounds better to him to break the rule because he is atleast getting Rs. 90/- out of his payoff of Rs. 100/- on an average.

Overall at node A, there is only one option through which he gets a positive payoff and that is by breaking the traffic signal. So it sounds more logical to the rider to break the rule.

Next Steps:

If someone is interested in further analysing the behaviour using Game Theory of economics, he can approach the problem as under:

1. Change the payoffs and probabilities with real ones.

2. Calculate the threshold value of fine below which the rider will be tempted to break the law.

3. Calculate the optimum probability of a policeman standing on a traffic signal.

## Online Coupon and Deals Market in India

Tags: , , , , , , , , , ,

Coupon and deals market has always been something that can not be ignored by people. People love shopping and people love deals. So how does the market scenario look in India?

The eCommerce market stands at a whooping 70000 Crore today (2013). This comes out to be slightly more than 11 billion USD. Couponing and deals market basically works over the eCommerce market and if we take 10% as a heuristic in calculating the market size for coupons, it is still a very big number.

We conducted a survey and tried to find out the penetration of coupons in India. Here are the results:

Total number of respondents: 117
Gender based distribution: Male: 87%, Female: 13%
Age Group: 30-39: 77%, 21-29: 23%
Marital Status:Married: 67%, Never Married: 32%, Separated: 2%

More than 61% of them said that they shop often online.
Convenience was the biggest factor in shopping online closely followed by discounts. Very few people shopped online for variety.

67% of the people did more than 20% of their shopping online.
90% of these respondents used a computer or laptop to make the purchase. They were not sure with the security in mobiles.

65% of the people used Google Chrome to shop online closely followed by 26% people who use Firefox.

Most of these guys search on Google and Facebook for coupons before shopping online. Only 28% of them go to any coupon website.

Only 31% of them like the way coupons are presented to them currently. They do not like the clutter through which they have to find deals.

92% of them do not want to go to any coupon site. They would love to see a service that delivers coupons right on your browser.

Thankfully Guppit.com is one such website that gives coupons to the users right on their browsers.

If you want to get more insights on this survey, you can contact me through posting a comment and I will share complete data with you.

## Casteism in India – Some facts from the government database

March 5, 2013 at 4:12 pm | Posted in constitution, government, Independence, india | Leave a comment
Tags: , , , , ,

Some time back I analyzed the government database for crime against women in India. The results were surprising and insulting to our nation. Another issue that still exists in India even after 65 years of Independence is Caste-ism. So I thought of doing a similar study on the number of murders committed in the name of caste in the last decade (2001 – 2010).

Summary:

Total number of deaths
444 (44.4 deaths per year).
If we consider the population of India then this number sounds too small. However, in a modern world like today’s even 4-5 deaths per year on the grounds of caste etc. are shameful.

Top States

• Bihar – 179
• Jharkhand – 59
• Chhatisgarh – 35

That essentially means that top 5 states constitute ~77% of the total crimes in the name of caste. It is to be noticed that the five states are adjoining and similar communities live in the states. The people are hindi speaking, traditional, high level of believers and god fearing.

Most of the movies that are made around caste system show the protagonist to be based out of these states.

Complete list of all the states is as under:

No data is available from the north-eastern states. This can indicate either a perfect collaborative environment in which people from all the castes live, or a lack of data in the states.

Surprisingly Haryana and Uttarakhand show a zero figure. This is something I am unable to understand because of the reports of other types of crimes from these states.

Of the four southern states, only Kerala reports a zero figure. Probably some regression has to be done with overall education levels in a state vs. such crimes. I will do that and will post soon.

I am also surprised to see J&K in the list. They have other problems to solve rather than such issues.

This is it for now. My next step is to draw parallels between education and different kinds of crimes. Am hopeful that I will be able to find some correlation between education and such crimes that requires a narrow mindset which can be broadened by better and improved education.

Thanks for reading this post till the time.

## Crime Against Women in India

December 19, 2012 at 1:52 pm | Posted in india | 3 Comments
Tags: , , , , , , , ,

यत्र नार्यस्तु पूज्यन्ते, रमन्ते तत्र देवता

यत्र नार्यस्तु ना पूज्यन्ते तत्र सर्व क्रिया विफ़ल: ।

This is an old saying in Sanskrit meaning “Places where woman is worshiped there the Gods delighted. Where Woman is not worshiped, there good deeds are without fruit!”

Ten times more worthy of worship than the Father is the Guru, but a thousand times more worthy than the Guru is the Mother!

I have drawn these adages, proverbs, sayings and whatever you want to call them from the Indian history. How do they apply to the present?

To understand more about crimes against Women in India, I did some thorough research on the internet – visited government databases, read news articles, read articles on various websites. Being an engineer, I cannot live without numbers and so calculated various numbers as well. Here is a summary of my analysis:

The growth rate of crime against women in India is more than the growth rate of Indian population itself. Such crimes were not reported to the police earlier because of social stigma but the number of cases reported has dramatically increased in the past few years. This can imply two things

1. Either the society has opened up towards taking help from the judiciary system and punishing the culprits or

2. The percentage of cases reported remain the same, however total number of cases have increased manifolds.

There is no answer to which of the assumption stated above is correct, but I personally wish that the second one is not true.

Crime against Women can be categorized under the following heads:

1. Domestic Violence

The incidents of domestive violence are higher among the lower Socio-Economic Classes (SECs). The Protection of Women from Domestic Violence Act, 2005 came into force on October 26, 2006.

2. Female infanticides and sex selective abortions

India has a high Male / Female ratio and the main reason contributing to it is the killing of female child long before they open their eyes to this world. A surprising but true fact is that tribes in India have better Male/Female ratio as compared to well developed urban societies. Dowry can be attributed to as the main reason for female infanticide. Dowry is still prevalent in most parts of India. To counter this problem, all medical tests that can be used to determine the sex of the child have been banned in India.

3. Child Marriage

According to UNICEF’s “State of the World’s Children-2009” report, 47% of India’s women aged 20–24 were married before the legal age of 18, with 56% in rural areas. The report also says that 40% of the total child marriages in the World happen in India.

4. Dowry

A 1997 report claimed that at least 5,000 women die each year because of dowry deaths, and at least a dozen die each day in ‘kitchen fires’ thought to be intentional. In 1985, the Dowry Prohibition (maintenance of lists of presents to the bride and bridegroom) rules were framed. According to these rules, a signed list of presents given at the time of the marriage to the bride and the bridegroom should be maintained. The list should contain a brief description of each present, its approximate value, the name of whoever has given the present and his/her relationship to the person.

5. Sexual Harassment & Rape

Eve teasing is a euphemism used for sexual harassment or molestation of women by men. Many activists blame the rising incidents of sexual harassment against women on the influence of “Western culture”. In 1987, The Indecent Representation of Women (Prohibition) Act was passed to prohibit indecent representation of women through advertisements or in publications, writings, paintings, figures or in any other manner.

In order to analyze rapes in India, I downloaded data from the government’s National Crime Record Bureau and did some analysis on my own. Here is the summary.

Rape Map of India (Darker = More number of Rape Cases)

In terms of Total Number of Rapes Reported (click on the image for better viewing):

The number of cases alone in Madhya Pradesh are more than double of those in Uttar Pradesh. Surprisingly West Bengal has the second most number of reported rape cases. Compare the size of Karnataka and Delhi and the number of rape cases in the two states.

Some major high-sensitivity cities in India were studies and the report was surprising:

Mumbai reported 201 cases of rape, Bangalore 65, Kolkata 32, Pune 91, Chennai 47 and Delhi 414.

However the most surprising of them all was the following result:

Tier 2 cities in Madhya Pradesh (Bhopal, Indore and Jabalpur) show large number of reported cases.

Jabalpur reports 1:13016 (Rape Cases:Population), which is the highest in any city in India. Similarly Kolkata reports 1:140209 which is the lowest in any city in India. So what can be inferred from this data is that even though Kolkata reports less number of reported cases, the cases in other areas of West Bengal are high and that can be attributed to low education levels.

Total number of reported cases in Delhi is more than double in Mumbai. Delhi comes third in the list of cities prone to rape. The sequence goes like this:

1. Jabalpur (1:13016)

2. Bhopal (1:24598)

3. Delhi (1:26589)

Ahmedabad (1:113685), Bangalore (1:129630) & Kolkata (1:140209) remains the safest cities in India.

I am not deducing anything out of the data at the moment but I would love to find out a detailed correlation between education levels and such incidences.

Feel free to comment on this post and use this data wherever you want to use it.

## मज़ा लिया जाए – Ghazal

Tags: , , , , , , , , ,

दिन है इतवार का मज़ा लिया जाए
थोडा इंतज़ार का मज़ा लिया जाए

जवानी का पतझड़ कब का गुज़र गया गया
बुढापे  की बहार बहार का मज़ा लिया जाए

कलम दवात मेरी पूरी ज़िन्दगी को खा गए
खंजरों की धार का मज़ा लिया जाए

बेईमान हो गए तो उनकी हैसियत बदल गई
फिर से इमानदार का मज़ा लिया जाए

पहली नज़र में ही उसे दिल दिया मैंने
मोहब्बत की इस हार का मज़ा लिया जाए

कभी कभी बच्चे भी बनके देख लो यारों
माँ के उस दुलार का मज़ा लिया जाए

घटनाएं रोज़ ही होती रहेंगी नया कुछ नहीं है
चलो पुराने अखबार का मज़ा लिया जाए

## Hindi ki Kahaani

Tags: , , , , , , ,

युग बदल गया अब वो हिंदी न रही
सलवार की जगह जींस आ गयी, और माथे पे बिंदी न रही |

कल तक जो दुपट्टा था आज वो stole हो गया
अरे हिंदी का आसन बुरी तरह से डांवाडोल हो गया |

हिंदी बोलने में आजकल के संस्कारी युवा झिझकते हैं, शर्माते हैं
अधकचरा अंग्रेजी बोल कर अपने जैसे ही लोगों में upclass कहलाते हैं |

हिंदी की इज्ज़त सिर्फ सितम्बर के राजभाषा मास में होती है
बाकी के महीने ये किसी कोने में दुबक कर सोती है |

अगर आगे बढ़ना है तो हमें इसे ऊपर उठाना होगा
हिंदी की आग को हम सबके अन्दर भड़काना होगा
वरना मेरे दोस्त, अधकचरी भाषाओँ में हम कहीं खो जायेंगे
जिन संस्कारों को दुनिया मानती है उनमे भी  हम अधकचरे हो जायेंगे |

## What my English teachers taught me :)

June 18, 2012 at 10:13 pm | Posted in fun, humour, india, knowledge | Leave a comment
Tags: , , , , , , ,

Ha Ha ha..

Next Page »