1
$\begingroup$

Assumptions:

  • $365$ days in the year.
  • All birthdays are equally likely.
  • The three consecutive days must fall within the same calendar year.

This was a fun problem that came up at my office of $100$ people when we had $3$ consecutive Birthdays. It's been a while since I've done a probability problem like this and I'm not feeling confident in the soundness of my approach.

My thoughts:

  • A. There are $363$ consecutive triples in a year since all days must fall within the same calendar year.
  • B. There are $100C3$ ways to select $3$ people to have consecutive Birthdays.
  • C. There are $3!$ ways to order those $3$ people.
  • D. There are $365^{97}$ ways the other $97$ people can have Birthdays.
  • E. There are $365^{100}$ ways $100$ people can have Birthdays.

Attempt: $P = (A * B * C * E) / D$

I seem to get muddled regarding what to do though. I'm getting confused about ordering in addition to combinations that have multiple sets of consecutive triples. From my research, I seem to think maybe I should be calculating the likelihood of not having any consecutive Birthdays, but that seems really difficult to count itself.

$\endgroup$
4
  • 1
    $\begingroup$ This is a reasonable mathematical problem, but you should share what research and thinking about it happened before posting. In its present form it lacks context and needs to be edited to make it suitable content for Math.SE. $\endgroup$
    – hardmath
    May 18, 2021 at 16:08
  • $\begingroup$ Do birthdays across the New Year count? For instance: Does December 31, January 1, January 2 count as three consecutive birthdays? $\endgroup$
    – paw88789
    May 18, 2021 at 18:48
  • $\begingroup$ Great question. Allowing them would mean that there are more than 365 days we'd need to consider. For simplicity, let's assume the 3 consecutive days must fall within a calendar year. $\endgroup$
    – TimJ
    May 18, 2021 at 18:58
  • $\begingroup$ In my answer below, I assumed that the three birthdays don't necessarily fall in the same year. I don't think changing that will make a noticeable difference, but I'll test it. $\endgroup$
    – saulspatz
    May 18, 2021 at 19:03

1 Answer 1

0
$\begingroup$

This is difficult to compute exactly, for the reason you state. When we try to count the triples, we end up count the distribution more that once. If we count the ways the we can have people born on days $1$, $2$ and $3$, and add to the ways where people are born on days $7$, $8$, and $9$, we count the distribution where both events occur twice. Also, if a total of four people are born on days $1$, $2$, and $3$, we count that distribution twice.

One can try to use the principle of inclusion and exclusion to calculate this, but it's not practical, because of the large number of ways multiple events occur. Alternatively, we could try to compute the complementary probability: the probability that there are no three consecutive birthdays, but this suffers from the same kind of difficultly. We might end up selecting $100$ different days, no three of which are consecutive. If can compute that, there are $100!$ ways to distribute the people. But we might have only $95$ different days. Then we have to consider what the duplicate are like. Were $6$ people born on the same day? Or two on five different days? Or two people on three days and three on another? All these possibility require different calculations.

Unless I'm overlooking something, the most practical way to do this is by simulation. In a test with $100,000$ trials, I found $3$ consecutive birthdays $98.824\%$ of the time, so it's not at all unusual.

from random import choices

trials = 100000
count = 0
for _ in range(trials):
    birthdays = set(choices(range(365), k=100))
   
    for day in birthdays:
        if {(day+1)%365, (day+2)%365} <= birthdays:
            count += 1
            break

print(f'{count} successes in {trials} trials') 

produced the output

98824 successes in 100000 trials

I ran it again, without assuming that the birthdays must fall in the same day of the year. (Just remove the %365's in the test.) As expected it didn't make much difference. This time the output was

98876 successes in 100000 trials

so it appears that the probability is around $98\%$ either way.

EDIT

I should have said "just under $99\%$." I ran it again for the less restrictive case, and computed a $99.7\%$ confidence interval of $(.98789562,.98998438)$.

$\endgroup$
3
  • $\begingroup$ Good call simulating. My assumption that the consecutive days needed to be in the same calendar year doesn't really make a ton of sense, since people have a birthday every year! Regardless you inspired me so I did the same simulation in Python since I didn't 100% understand your syntax and get ~99% as well. $\endgroup$
    – TimJ
    May 18, 2021 at 19:31
  • $\begingroup$ Keep in mind that I am totally ignorant in the area that I am asking about. Excluding both simulation and exact calculation, is there an alternative analytical computation-estimation method that involves poisson distribution, or something like that. I vaguely read that poisson distribution has been used for such problems as random-walks, or the chances of getting exactly $(50)$ Heads in $(100)$ coin flips. Therefore, I wonder if such an approach is viable here. $\endgroup$ May 18, 2021 at 21:21
  • $\begingroup$ I don't see how the Poisson distribution could be applied here. As far as an alternative analytical method goes, I can't think of an approach, but that doesn't mean there isn't one. $\endgroup$
    – saulspatz
    May 19, 2021 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.