Nov 7 2011

Birthday Paradox

The Birthday Paradox is not real paradox, you will not find any logical contradiction in the next few paragraphs. It is called a paradox because it is very counter-intuitive, and you will soon find out why.

The paradox is demonstrated in the following way: Choose n people randomly. What is the probability that two of them were born on the same date? (only day and month, discarding the year. and assuming there are 365 days every year)

Lets say that n=40, what do you think that chances are?
Most people will think the probability is very low, but is it?

First lets define our sample space:

\Omega=\left\{ \left(d_{1},\ldots,d_{n}\right)\, d_{i}\in\left\{ 1,\ldots,365\right\} \right\}

The vector \left(d_{1},\ldots,d_{n}\right) defines a series of dates for every person. Meaning d_1 is the birthday of the first person, d_2 of the second and so on…

The event we are interested in is the following:

A=\left\{ d_{i}=d_{j},\text{ for any } i\neq j \right\}

Apparently, Doing the direct calculation to solve this problem is hard, too hard. So we’ll attack the problem from a different angle.

Lets take a look at the complement of A (meaning, that every person in the group was born on a unique date):

A^{c}=\left\{ \left(d_{1},\ldots,d_{n}\right)\in\Omega:\, d_{i}\neq d_{j},\,\forall i\neq j\right\}

It is easily calculated that the number of elements in A^{c} is:

\left|A^{c}\right|=365\cdot364\cdot\ldots\cdot\left(365-n+1\right)

And of course the number of elements in our sample space (meaning the number of options for birthdays for n people) is:

\left|\Omega\right|=365^{n}

Assuming uniform probability, the probability that every person was born on a unique date is:

P\left(A^{c}\right)=\frac{\left|A^{c}\right|}{\left|\Omega\right|}=\frac{365}{365}\cdot\frac{364}{365}\cdot\ldots\cdot\frac{365-n+1}{365}=\prod_{k=0}^{n-1}\left(1-\frac{k}{365}\right)

Therefore, the probability that at least two people were born on the same day is:

P\left(A\right)=1-P\left(A^{c}\right)=1-\prod_{k=0}^{n-1}\left(1-\frac{k}{365}\right)

So, said n=40 right? lets calculate! (Don’t worry, you can let WolframAlpha do the calculations for you)

P\left(A_{40}\right)=1-\prod_{k=0}^{39}\left(1-\frac{k}{365}\right)\approx 0.891232

So it seems the probability is more than 89%! Amazing, isn’t it?

If you want, you can checkout and find that after 23 people, the probability pass the 50% barrier, and that after only 57 people the probability is more than 99%!


Oct 5 2011

Transformers

My understanding of theĀ Laplace Transform:

Laplace transforming Optimus Prime

The only problem is that I’m not sure if it is safe to assume that Optimus Prime has finite energy…

This site is hosted by: