Birthday Problem
The birthday problem asks for the probability of a shared birthday in a group of people. In the standard model, the birthdays are independent
and each follows the discrete uniform
distribution over
possible days, where
and
are positive integers. Let
be the probability
that no two birthdays match. For
, start with an arbitrary person's birthday, then
note that the probability that the second person's
birthday is different is
, that the probability
of no match among the first three people is
, and so on, up through the
th person. The products are interpreted as 1 when
. Explicitly,
|
(1)
| |||
|
(2)
|
This can be written in terms of factorials as
|
(3)
|
For ,
. For
, the probability
that two or more people out of
a group of
do
have the same birthday is therefore
|
(4)
| |||
|
(5)
|
while
for
.
For ,
let
denote the probability that the largest group sharing
a birthday has exactly
people. Then, for a positive
integer
,
the probability that a birthday is shared by
or more people is given by
|
(6)
|
For ,
can be computed using the recurrence relation
|
(7)
|
(Finch 1997), where
is the floor function. For the recurrence, use
and
for
, including
. For
, set
as an auxiliary recurrence convention, and use
for the weight of an empty assignment.
If 365-day years have been assumed, i.e., the existence of leap days is ignored, and the birthdays are assumed to follow a discrete
uniform distribution throughout the year (in actuality, there is a more than
6% increase from the average in September in the United States; Peterson 1998), then
the number of people needed for there to be at least a 50% chance that at least two
share birthdays is the smallest such that
. This is given by
, since
|
(8)
| |||
|
(9)
|
The minimum numbers
of people needed to obtain
for
, 2, ..., are 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, ... (OEIS A033810). For
and
, 2, ..., the minimum numbers of people needed for at least
a 50% probability that at least
people share a birthday are 1, 23, 88, 187, 313, 460, 623,
798, 985, 1181, 1385, 1596, 1813, ... (OEIS A014088;
Diaconis and Mosteller 1989).
For ,
the probability
can be estimated as
|
(10)
| |||
|
(11)
|
where the absolute error of the latter approximation satisfies
|
(12)
|
(Sayrafiezadeh 1994).
An explicit expression for is
|
(13)
| |||
|
(14)
|
where
is a binomial coefficient and
is a hypergeometric
function. The finite sum holds for all positive
and
, while the ordinary hypergeometric
function expression holds for
. This gives the explicit formula for
as
|
(15)
| |||
|
(16)
|
where
is a regularized hypergeometric
function. This expression holds for all positive
and
, interpreting it as the terminating series
with reciprocal gamma function factors when
is nonpositive.
For fixed ,
large
,
and
,
an approximation to the number of people needed for
to reach
is obtained by solving the equation
|
(17)
|
for the positive solution and taking
, where
is the ceiling function
(Diaconis and Mosteller 1989). For
,
, and
, 3, ..., with the trivial
value prepended, this formula gives
, 23, 88, 187, 313, 459, 622, 797, 983, 1179, 1382, 1592,
1809, ... (OEIS A050255), whose displayed terms
differ from the true values by from 0 to 4. A much simpler but also poorer approximation
for
such that
for
and
is given by
|
(18)
|
(Diaconis and Mosteller 1989), whose floor function gives 86, 185, 307, 448, 606, 778, 965, 1164, 1376, 1599, 1832, ... for , 4, ... (OEIS A050256,
with its
term omitted).
On a cyclic calendar, the "almost" birthday problem, which asks the number of people needed such that two have a birthday within a day of each other, was considered
by Abramson and Moser (1970), who showed that 14 people suffice. An approximation
for the minimum number of people needed to get a 50-50 chance that two have a match
within
days out of
possible is given by
|
(19)
|
(Sevast'yanov 1972, Diaconis and Mosteller 1989).
See also
Birthday Attack, Coincidence, Small World Problem, Sultan's Dowry ProblemExplore with Wolfram|Alpha
References
Abramson, M. and Moser, W. O. J. "More Birthday Surprises." Amer. Math. Monthly 77, 856-858, 1970.Ball, W. W. R. and Coxeter, H. S. M. Mathematical Recreations and Essays, 13th ed. New York: Dover, pp. 45-46, 1987.Bloom, D. M. "A Birthday Problem." Amer. Math. Monthly 80, 1141-1142, 1973.Bogomolny, A. "Coincidence." https://www.cut-the-knot.org/do_you_know/coincidence.shtml.Clevenson, M. L. and Watkins, W. "Majorization and the Birthday Inequality." Math. Mag. 64, 183-188, 1991.Diaconis, P. and Mosteller, F. "Methods for Studying Coincidences." J. Amer. Statist. Assoc. 84, 853-861, 1989. https://doi.org/10.1080/01621459.1989.10478847.Durrett, R. "Triple Birthday Matches in the Senate: Lies, Damned Lies and ChatGPT." 19 Feb 2023. https://arxiv.org/abs/2302.09643.Feller, W. An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. New York: Wiley, pp. 31-32, 1968.Finch, S. "Puzzle #28 [June 1997]: Coincident Birthdays." https://web.archive.org/web/20020214210302/http://www.mathcad.com:80/library/LibraryContent/puzzles/puzzle.asp?num=28.Gehan, E. A. "Note on the 'Birthday Problem.' " Amer. Stat. 22, 28, Apr. 1968.Heuer, G. A. "Estimation in a Certain Probability Problem." Amer. Math. Monthly 66, 704-706, 1959.Hocking, R. L. and Schwertman, N. C. "An Extension of the Birthday Problem to ExactlyReferenced on Wolfram|Alpha
Birthday ProblemCite this as:
Weisstein, Eric W. "Birthday Problem." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/BirthdayProblem.html