Friday, January 31, 2014

Everyday math


I was checking out at the local grocery store, and the young girl asked for my ID for the beer I had purchased. She looked at it and giggled. "We have the same birthday".
I thought to myself, really you look much younger than me. 

My second thought of course was the birthday paradox. If you have a bunch of people in the room what is the likelihood at least 2 people share the same birthday? Well of course it depends on how many people is a bunch. But lets say you have a classroom of 23 people. Do you think at least 2 have the same birthday. Well, if you are a betting person you would say yes, because most likely there will be 2 people that have the same birthday in a classroom of 23.

Stay with me here. This won't hurt a bit.

If I flip a fair coin what is the likelihood it lands on heads? Half the time it lands on heads, and the other half it lands on tails. Therefore the likelihood of landing on heads is 50%. Often the word Probability is substituted for likelihood, and often instead of using 50% the term .5 is used. So the probability of a coin landing on heads is .5. There you know as much math as most high school students and more than most college grads.

Now what is the probability of throwing a coin twice and getting heads both times? Phew that's hard. Well the first time we have already established its .5. The second time, hmmm, well the first flip in no way influences the outcome of the second toss. The fancy word for that is the two events are independent. So just trust me on this next statement, the probability of sequence of events is the product (thats a fancy word for multiply) of each event. Well thats true if the events are independent. So the first flip is .5 and the second flip is .5 therefore the probability of 2 heads in a row is .5 * .5 = .25.

So if you toss a coin 100 times and it lands on heads each time what is the probability that the coin on the 101st toss will be heads, well its still .5, but you better go find a new coin.

So what does all this have to do with birthdays. Its all the same actually. What is the probability that 2 people have the same birthday? Well each person say has equal probability of having one of 365 birthdays (forget leap year and more people are born on tuesdays..) Another way to figure this out (and actually easier) is to ask what is the probability that two people don't have the same birthday? Well the first person is born on a random day. The other person just can't be born on that same day. So the second person has a total of 364 days out of a potential  365 days they can be born on not to have the same birthday as the first person. Phew thats hard. Imagine the first person was born on July 20th. The second person can be born on any day except July 20th in order not to be born on the same day. Soooo the probability of two people NOT having the same birthday is

364/365 = .9972

Therefore the probability that two people have the same birthday is the opposite of this or

1 - .9972  = .0027

Now lets consider 3 people.
The second person's probability of not having the same birthday again is 364/365 and the third person is 363/365

Grinding through the math ..

1 - (364/365 * 363/365) = .00824

… and for 4 people

1 - (364/365 * 363/365 * 362/365) = .01

I think you can see the pattern, so if you keep doing this at about the 23rd person the probability reaches .5.

So next time you are at a cocktail party and there are more than 23 people there, most likely 2 or more were born on the same day. Isn't that weird, I mean would you guessed it took only 23 people for this to happen? Welcome to the first in a series of Everyday Math where we explore counter intuitive stuff.






3 comments:

Anonymous said...

Whew! This blog has gotten rather difficult all of a sudden. What happened to pictures of food, drink, cats, maps . . .

I guess I shouldn't really complain since my blog has gotten rather stalled, and not all of a sudden.

CMD said...

Oh dear...

CMD said...

Oh dear...