Solving the Birthday Problem: Probability & Average Guesses

  • Thread starter curiouschris
  • Start date
In summary, this person is trying to figure out the expected number of guesses they would need to correctly guess all five birthdays. The answer is 61.
  • #1
curiouschris
147
0
Hi

I have a question about probabilities.

Given 5 people each having a birthday on a different date in the year.

I have the task of working out which day in the year each ones birthday is. There are no clues as to the dates except that if I manage to get one right the persons who's day I got right will admit to it.

In other words there is no way of me knowing before hand which days the birthdays fall on.
The only clue I have is that the birthdays are normally spread out evenly across the year. It is highly unlikely that they are all in January (but possible) and the same goes for December.

I could start off at day 1 and progress to day 365 guaranteeing to get it right in a maximum of 365 guesses.

But what if I was to randomly guess dates?

Is their a way of determining the average number of guesses I would need to have before getting it right?

At the low end it would be at least 5 at the high end it would be 365, but is there a way to work out the average?

I know this sounds like a home work question but its actually not its for a software program. a way to reduce the *average* time it takes to reach the solution.

Much Appreciated
CC
 
Physics news on Phys.org
  • #2
Okay, so basically this is a discrete, uniform distribution with 365 possible values, from which we have randomly selected five distinct data points. (It looks like you want to assume that the birthdays are definitely on five distinct days, which probably makes things easier.)

Regarding your question, the method/order of your "guessing" shouldn't matter. Whether you go in order, Jan. 1-Dec. 31, backwards, or using some sort of random guessing technique, should make no difference whatsoever. We should probably assume, however, that you won't re-guess the same day twice.

Let's first work on what may be a slightly easier problem: the expected number of guesses you would make to correctly guess anyone of the five birthdays:

The chance of selecting any correct birthday on your first guess is (5/365). The chance that your second guess is your first correct guess is (360/365)*(5/364). The chance that your third guess is your first correct guess is (360/365)*(359/364)*(5/363)...etc.

Based on this pattern, the probability that your first correct guess is on your nth guess is:
[tex]\frac{5}{366-n}[/tex] [tex]\frac{360!}{365!}[/tex] [tex]\frac{(366-n)!}{(361-n)!}[/tex]

So then the expected number of required guesses N would be:
E(N) = [tex]\sum^{n=1}_{n=361}[/tex] [tex]\frac{5}{366-n}[/tex] [tex]\frac{360!}{365!}[/tex] [tex]\frac{(366-n)!}{(361-n)!}[/tex] n

Wolfram alpha says that this = 61 (apparently exactly). I might have guessed lower, but I suppose it makes some sense that you'd have to work your way through about two months if, on average, there is a birthday every 12/5 = 2.4 months.

However, I think your original question is still unanswered. You want the expected number of guesses required to correctly identify all five birthdays, right? I'll work on this in my next post.
 
Last edited:
  • #3
So in the above post, I found that the expected number of guesses to identify one of the five birthdays was 61. Now I will find the expected number of guesses to correctly identify all five birthdays.

To do this, I think we would need to determine the probability that a string (of guesses) with length n contains all five birthdays and terminates in a birthday (since when you guess the last birthday, you are done guessing).

Okay...so let's look at this as the probability that a string of length (n-1) contains four of the five birthdays, times the probability of then selecting the fifth birthday.

A. First the latter part. The probability pa of selecting the fifth birthday on the nth guess after already selecting the other four in the previous n-1 guesses is simply 1/(365-(n-1)), so pa = 1/(366-n).

B. Now let's find the probability pb that a string of length n-1 contains four birthdays.

pb can be found using the hypergeometric density function, given that there are 5 birthdays in total and 365 days to choose from.
pb = (5 choose 4) * ( 365-5 choose n-1-4) / (365 choose n-1)
pb = 5 (366-n) [tex]\frac{360!}{365!}[/tex] [tex]\frac{(n-1)!}{(n-5)!}[/tex]

C. Thus, probability that a string of n guesses contains all five birthdays and terminates in a birthday equals:

pa * pb = 5 [tex]\frac{360!}{365!}[/tex] [tex]\frac{(n-1)!}{(n-5)!}[/tex]

D. Finally, to find the expected value E (N), we must calculate the sum:

E(N) = [tex]\sum^{n=5}_{n=365}[/tex] 5 [tex]\frac{360!}{365!}[/tex] [tex]\frac{(n-1)!}{(n-5)!}[/tex] n

According to Wolfram alpha, E(N) = 305, apparently exactly. Like the last problem, this is surprisingly high, but since the math all seems to make sense, I'm forced to accept it. Remember that this setup gives the expected number of guesses you would make to have guessed all five uniformly random yet distinct birthdays (given that you you do not repeat guesses). If I have time, I will E(N) for a number of birthdays "m" other than 5. Should be simple.
 
Last edited:

Related to Solving the Birthday Problem: Probability & Average Guesses

1. What is the Birthday Problem?

The Birthday Problem is a mathematical problem that asks how many people need to be in a room for there to be a 50% chance that two people share the same birthday. It is also known as the Birthday Paradox.

2. How do you calculate the probability of the Birthday Problem?

The probability of the Birthday Problem can be calculated using the formula: P(n) = 1 - (365!/((365-n)!*365^n)), where n is the number of people in the room. This formula takes into account the fact that each person has a 1/365 chance of sharing a birthday with another person in the room.

3. What is the average number of people needed for the Birthday Problem?

The average number of people needed for the Birthday Problem is approximately 23. This means that in a room of 23 people, there is a 50% chance that two people share the same birthday.

4. Why is the Birthday Problem considered a paradox?

The Birthday Problem is considered a paradox because the number of people needed for a 50% chance of shared birthdays is much lower than what most people would intuitively guess. This is due to the fact that we tend to think about probabilities in a linear way, while the Birthday Problem is a non-linear problem.

5. How is the Birthday Problem relevant in real life?

The Birthday Problem has applications in fields such as cryptography, statistics, and probability. It also highlights the concept of randomness and how it can lead to unexpected outcomes. In social settings, it can be used as an icebreaker or party game to demonstrate the power of probability and how it can defy our intuition.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
9
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
979
  • Precalculus Mathematics Homework Help
Replies
2
Views
2K
  • General Math
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
7
Views
2K
  • Precalculus Mathematics Homework Help
Replies
29
Views
2K
  • Precalculus Mathematics Homework Help
Replies
32
Views
773
  • Precalculus Mathematics Homework Help
Replies
5
Views
2K
  • Precalculus Mathematics Homework Help
Replies
12
Views
4K
Back
Top