Monday, July 1, 2013

Probability - Bday Problem

What is the probability of two persons, amongst N people in a room, of sharing same birthday.
There are 365 days in a year.

No of People: 1, 2, 3 .... N
bi = birthday of person i.
bj = birthday of person j.

Probability of a person to have birthday = 1/365
Birthday of two people is independent event.
So P(bi and bj) = 1/365 x 1/365
Probability of bday of i and j on same day = P(bi == bj) = SUM (1/365 x 1/365 over all days.
P (bi == bj) = 1/365.

This is not the solution, but rather than finding the event where two people have same bday is cumbersome.

=========================
Another Solution:
=========================
Sample space of this problem = Event (people sharing bdays) + Event (people not sharing bdays).
Lets take E = no one shares bday.
So, 1 - E = shares bday.

E(1) = 365
E(2) = 364 //bcoz person2 cannot have same bday as first.
E(3) = 363 //bcoz person3 cannot have same bday as first.and second
E(4) = 362
.
.
E(n) = 365 - (n-1)

No of ways = 365 x 364 x 363 x .. x (365 - (n-1))
This is a factorial.
No of ways = 365! / (365 - n)!
This is Permutation of 365 with n.
No of ways = 365-P-n

Total Events = 365 x 365 x 365 x .... n times
Total Events = 365^n

P(no one shares bday) = ( 365-P-n ) / ( 365^n )

No comments:

Post a Comment