The birthday problem asks for the probability that at least two members of a group share a birthday. Use the explicit model of independent random variables taking labels with a uniform distribution on a finite set. Let and be integers. For calendar examples below, stipulate equally likely labels and omit leap days. For , the probability of at least one matching pair is
At , the empty product is one and . At , a repeat is certain by the pigeonhole principle. Count the complement to obtain the formula: the first label has choices, then a distinct second label has , and so forth, out of equally likely label sequences.[ref]
For the stipulated calendar, and . Only 23 people suffice to put the probability above one half. There are possible pairs, each with matching probability . The many comparison opportunities explain why a small group can contain a repeat.
Figure 1.
Any matching pair becomes likely much sooner than a match with one specified person
. Original exact computations under the independent uniform 365-label model. The solid curve allows every pair in a group of total size ; the lower curve requires a match with one designated member. The dashed curve is the exponential lower bound for any-pair collision probability. This is a model calculation, not observed birthday data. Details.
The distinction also matters for hash collisions. If independently generated outputs of a hash function are uniformly distributed over possible labels, the same counting formula governs repeats. The birthday square-root scale explains why looking for any repeated output requires far fewer labels than trying to match one predetermined output. The uniform-independent model is an assumption about those outputs; the birthday problem does not itself establish that a particular implementation meets it.
In a group of total size , designate one member and ask whether any of the other labels equals that member's label. Conditional on the designated label, all the other draws avoid it with probability . Independence gives
For , this is approximately , while the probability of some matching pair is approximately . The designated-member question examines pairs; the any-pair question examines all . A repeated label elsewhere in the group does not require a match with its designated member.
Figure 1.
Fifteen possible pairs versus five comparisons with one designated member
. Original illustrative labels for six members: . The complete graph includes every possible pair and marks the two equal-label pairs in red. The right panel uses only pairs containing member F, whose label 5 is unique. This chosen configuration illustrates the two different events; it is not a random sample of measured birthdays. Details.
The birthday collision count counts equal-label unordered pairs. Write it as a sum of indicator random variables:
This uses linearity of expectation; mutual independence of the pair indicators is unnecessary. For 23 uniform calendar labels, , whereas . A configuration with three equal labels contributes three pairs, so counting pairs and recording whether any pair exists are different random variables.
Treating every pair event as mutually independent would give the wrong exact formula. For three draws, and force . The probability that all three equalities hold is , while the product of their individual probabilities is for . This distinguishes independence of the original label draws from mutual independence of events built from overlapping draws.
The union bound gives . Using on the distinct-label product gives
The lower bound reaches at least one half when . The simple approximation predicts a group size near 23 for . It is the quadratic number of pairs that makes the square root appear.
For a precise limiting statement, let and . Expanding the logarithm of the complement yields
On this scale the remainder tends to zero. Thus a fixed substantial collision probability appears after order draws. For uniform output labels, the corresponding scale is order ; matching one specified birthday instead involves a number of draws of order .
Suppose two independent random variables have the same categorical distribution, with label probabilities . The disjoint equal-label events give
For the original chosen probabilities , this is , rather than the uniform four-label value . The Cauchy-Schwarz inequality gives , so uniform probabilities minimize this two-draw collision probability. This pair formula alone does not supply the entire group collision probability for a nonuniform model.

Articles by others on the same topic (1)

The Birthday Problem, also known as the Birthday Paradox, refers to a counterintuitive probability puzzle that deals with the likelihood of two or more people sharing the same birthday in a group. The problem is commonly stated as follows: In a group of \( n \) people, what is the probability that at least two of them share the same birthday?