0
$\begingroup$

If $n$ people are present in a room, what is the probability that no two of them celebrate their birthday on the same day of the year? How large need $n$ be so that this probability is less than 12?

Because each person can celebrate his or her birthday on any one of 365 days, there are a total of $(365)^n$ possible outcomes. (We are ignoring the possibility of someone having been born on February 29.) Furthermore, there are $(365)(364)(363) · (365 − n + 1)$ possible outcomes that result in no two of the people having the same birthday.

But why is there a (365-n+1)?

$\endgroup$
3
  • $\begingroup$ There are $n$ factors in the product $365\times364\times363\times\dots$ so the last factor is...? $\endgroup$
    – Karl
    Commented Sep 30, 2023 at 6:23
  • $\begingroup$ You should read what is called the "fencepost error". It might help you in many other questions, since you are having a doubt here. $\endgroup$ Commented Sep 30, 2023 at 6:48
  • $\begingroup$ Also known as the "off by one" error. Do a few small examples and try to see a pattern. A question based on this error is my first when interviewing programmers. $\endgroup$
    – badjohn
    Commented Sep 30, 2023 at 9:23

1 Answer 1

1
$\begingroup$

Look at it as an arithmetic sequence.

$365, 364, 363, ...$
The first term $a = 365$
The common difference $d = -1$ The $n^{th} \ term = a + (n - 1)d = 365 + (n - 1)(-1) = 365 - n + 1$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .