This is not a class assignment.

It so happened that 4 team members in my group of 18 happened to share same birth month. Lets say June. . What are the chances that this could happen. I'm trying to present this as a probability problem in our team meeting.

Here is my attempt:

  • All possible outcome $12^{18}$
  • 4 people chosen among 18: 18$C_4$
  • Common month can be chosen in 1 way: 12$C_1$

So the probability of 4 people out of 18 sharing the same birth month is $\frac{18C_4 * 12C_1}{12^{18}}$ = very very small number.


  1. Is this right way to solve this problem?
  2. What the probability that there is exactly 4 people sharing a birth month?
  3. What the probability that there is at least 4 people (4 or more people) sharing a birth month?

Please note: I know that all months are not equal, but for simplicity lets assume all months have equal chance.

  • 4
    $\begingroup$ Exactly 4 or at least 4 out of 18? $\endgroup$ – NotThatGuy Jun 15 '20 at 9:53
  • $\begingroup$ Do you include or exclude that there are two (, three, or four) subgroups of four people, each member of a given subgroup shares the same birth month, and no two subgroups have have the same birth month. $\endgroup$ – Eric Towers Jun 15 '20 at 18:32

You can see your argument is not correct by applying it to the standard birthday problem, where we know the probability is 50% at 23 people. Your argument would give $\frac{{23\choose 2}{365\choose 1}}{365^{23}}$, which is very small. The usual argument is to say that if we are going to avoid a coincidence we have $365-(k-1)$ choices for the $k$th person's birthday, so the probability of no coincidence in $K$ people is $\prod_{k=1}^K \frac{365-k+1}{365}$

Unfortunately, there is no such simple argument for more than two coincident birthdays. There is only one way (up to symmetry) for $k$ people to have no two-way coincidence, but there are many, many ways to have no four-way coincidence, so the computation as you add people is not straightforward. That's why R provides pbirthday() and why it is still only an approximation. I'd certainly hope this wasn't a class assignment.

The reason your argument is not correct is that it undercounts the number of ways you can get 4 matching months. For example, it's not just that you can choose any month of the 12 as the matching one. You can also relabel the other 11 months arbitrarily (giving you a factor of 11! ). And your denominator of $12^{18}$ implies that the ordering of the people matters, so there are more than $18\choose 4$ orderings that have 4 matches.


The correct way to solve the 2 coincident problem is to calculate the probability of 2 people not sharing the same birthday month.

For this example the second person has a 11/12 chance of not sharing the same month as the first.
The third person has 10/12 chance of not sharing the same month as 1 &2.
The fourth person has 9/12 chance of not sharing the same month as 1, 2 & 3.
Thus chance of no one sharing the same month is $(11*10*9)/12^3$ which is about 57%. Or 43% chance of at least 2 sharing the same month.

I can't provide advice on how to extend this manual calculation to the 3 or 4 coincident problem. If you know R, there is the pbirthday() function to calculate this:

pbirthday(18, classes=12, coincident = 4)
[1] 0.5537405

So for 18 people there is a 55% chance that at least 4 people will share the same month.

Here is a good source for understanding the problem: https://www.math.ucdavis.edu/~tracy/courses/math135A/UsefullCourseMaterial/birthday.pdf

Edit For completeness here is a quick and dirty simulation in R:

four <- 0  #count for exactly 4
fourmore <- 0 #count for 4 or more

for (i in 1:count) {
   #sample 12 objects, eighteen times
   m<- sample(1:12, 18, replace=TRUE)
   if (any(table(m)>=4)){fourmore <-fourmore +1}
   if (any(table(m)==4)){four <-four +1}

#[1] 0.57768
#[1] 0.45192
  • 2
    $\begingroup$ According to the documented reference (Diaconis & Mosteller 1989), pbirthday uses an "approximation that is valid for fixed $k$ [=4 here] and large $c$ [=12 here]." It's unclear whether 12 is "large" enough. Moreover, this function estimates the chance of "$k$ or more in the same category" rather than exactly $k$ in the same category. For both these reasons your answer is suspect. It could be nearly right by accident, but that ought to be checked, if only with a quick simulation. Better would be to use pmultinom in the pmultinom package. $\endgroup$ – whuber Jun 15 '20 at 13:10
  • $\begingroup$ @Henry, good suggestion, but after seeing Phil's answer and reviewing whuber's comment, the pbirthday function seems to lose its accuracy at a higher coincident. I performed a simulation similar to Phil's and obtaining a result of approximately 45% for exactly 4 coincident, (and 57% for at least 4). $\endgroup$ – Dave2e Jun 15 '20 at 16:51
  • 2
    $\begingroup$ @Dave2e - very wise - though for exactly $4$ my simulation is closer to $0.42$ and whuber's suggestion of pmultinom seems to suggest $0.4165314$ for exactly $4$ and $0.5771871$ for at least $4$ in the most common month $\endgroup$ – Henry Jun 15 '20 at 17:02
  • $\begingroup$ Inspecting the code of pbirthday also shows it's based on an approximation. The Diaconis and Mosteller paper doesn't give an exact formula. I'm sure one can find an exact formula in the literature but it's probably quite ugly. $\endgroup$ – Michael Lugo Jun 15 '20 at 18:54
  • $\begingroup$ @Michael Read the Diaconis & Mosteller paper: they refer to an exact formula by Bruce Levin. Levin's formula is the basis for pmultinom. It's not ugly at all! $\endgroup$ – whuber Jun 15 '20 at 19:14

There are $43$ partitions of $18$ into $12$ non-negative parts where the largest part is $4$, while there are another $298$ partitions where the largest part is greater than $4$, and $25$ partitions where the largest part is less than $4$.

For example one partition is $$18=4+3+3+2+2+1+1+1+1+0+0+0\\= 1\times 4+2\times 3+2 \times2 + 4\times 1 + 3 \times 0$$

The probability of that particular partition pattern occurring among the birthmonths of your team is $\dfrac{\dfrac{18!}{4!^1 3!^2 2!^2 1!^4 0!^3} \times \dfrac{12!}{1! 2! 2! 4! 3!}}{12^{18}} \approx 0.05786545$

Add the probabilities up where the largest part of the partition is $4$ and you get about $0.4165314$; add them up where the largest part of the partition is $4$ or more and you get about $0.5771871$. These are the answers to your question.

More specifically, the probabilities for the different frequencies of the most frequent month are as follows. $4$ turns out to be most likely and the median (the mean is about $3.76$)

Freq of most freq month    Probability
            1               0
            2               0.0138050
            3               0.4090079
            4               0.4165314
            5               0.1297855
            6               0.0262102
            7               0.0040923
            8               0.0005116
            9               0.0000517
           10               0.00000423
           11               0.000000280
           12               0.0000000148
           13               0.000000000622
           14               0.0000000000202
           15               0.000000000000490
           16               0.00000000000000834
           17               0.0000000000000000892
           18               0.000000000000000000451
  • $\begingroup$ Neat! Could you say where the information on number of partitions comes from? $\endgroup$ – Thomas Lumley Jun 16 '20 at 5:09
  • 1
    $\begingroup$ @ThomasLumley I used the parts function from the R package partitions and then counted the ones I was interested in $\endgroup$ – Henry Jun 16 '20 at 7:39
  • $\begingroup$ - "Dear School Director, last year we split our 216 students in twelve classes alphabetically and some teachers weren't happy. What's the new plan?" - "Oh, this year we split them by date of birth; it's time to win a 1 in a trillion bet." $\endgroup$ – Cœur Jun 16 '20 at 12:36

While Henry already has given a way to compute the number exactly by counting all the partitions, it might be interesting to know about two approximate methods.

In addition, there is an alternative exact computation based on conditional Poisson distributed variables.

Computational simulation

You won't be easily able to compute all $12^{18}$ possibilities (and it won't be easy to scale up the problem), but you can have a computer simulate randomly a subset of the possible ways and obtain a distribution from those simulations.

# function to sample 18 birthmonths 
# and get the maximum number of similar months
monthsample <- function() {
  x <- sample(1:12,18,replace = TRUE)   # sample
  n <- max(table(x))                    # get the maximum

# sample a million times
y <- replicate(10^6,monthsample())

# obtain the frequency using a histogram
h<-hist(y, breaks=seq(-0.5,18.5,1))

Approximation with Poissonation

The frequency of the number of birthdays in a particular months is approximately Poisson/binomial distributed. Based on that we can compute the probability that the number of birthdays in a particular month won't exceed some value, and by taking the power of twelve we compute the probability that this happens for all twelve months.

Note: here we neglect the fact that the number of birthdays are correlated so this is obviously not exact.

# approximation with Poisson distribution
t <- 0:18
z <- ppois(t,1.5)^12          # P(max <= t)
dz <- diff(z)                 # P(max = t+1)

Computation with Bruce Levin's representation

In the comments Whuber has pointed to the pmultinom package. This package is based on Bruce Levin 1981 'A Representation for Multinomial Cumulative Distribution Functions' in Ann. Statist. Volume 9. The outcome of birth-months (which is more precisely distributed according to a multinomial distribution) is represented as independent Poisson distributed variables. But unlike the before mentioned naive computation, the distribution of those Poisson distributed variables is regarded to be conditional on the total sum being equal to $n=18$.

So above we computed $$P(X_1, X_2, \ldots , X_{12} \leq 4) = P(X_1 \leq 4) \cdot P(X_1 \leq 4) \cdot \ldots \cdot P(X_{12} \leq 4)$$ but we should have computed the conditional probability for the Poisson distributed variables being all equal or lower than $$P(X_1, X_2, \ldots, X_{12} \leq 4 \vert X_1+ X_2+ \ldots + X_{12} = 18)$$ which introduces an extra term based on Bayes' rule.

$$P(\forall i:X_i \leq 4 \vert \sum X_i = 18) = P(\forall i:X_i \leq 4) \frac{P(\sum X_i = 18 \vert \forall i:X_i \leq 4 )}{P( \sum X_i = 18)} $$

This correction factor is the ratio of the probability that a sum of truncated Poisson distributed variables equals 18 $P(\sum X_i = 18 \vert \forall i:X_i \leq 4 )$, and the probability that a sum of regular Poisson distributed variables equals 18, $P( \sum X_i = 18)$. For a small amount of birth months and people in the group this truncated distribution can be computed manually

# correction factor by Bruce Levin
correction <- function(y) {

Nptrunc <- function(lim) {

  # truncacted Poisson distribution
  ptrunc <- dpois(0:lim,1.5)/sum(dpois(0:lim,1.5))
  ## vector with probabilities
  outvec <- rep(0,lim*12+1)
  outvec[1] <- 1
  #convolve 12 times for each months
  for (i in 1:12) {
    newvec <- rep(0,lim*12+1)
    for (k in 1:(lim+1)) {
      newvec <- newvec + ptrunc[k]*c(rep(0,k-1),outvec[1:(lim*12+1-(k-1))])
    outvec <- newvec

z2 <- ppois(t,1.5)^12*Vectorize(correction)(t)          # P(max<=t)
z2[1:2] <- c(0,0)
dz2 <- diff(z2)                                         # P(max = t+1)


These approximations give the following results

distribution graph

> ### simulation
> sum(y>=4)/10^6
[1] 0.577536
> ### computation
> 1-z[4]
[1] 0.5572514
> ### computation exact
> 1-z2[4]
[1] 0.5771871

It so happened that 4 team members in my group of 18 happened to share same birth month. Let's say June. What are the chances that this could happen? I'm trying to present this as a probability problem in our team meeting.

There are several other good answers here on the mathematics of computing probabilities in these "birthday problems". One point to note is that birthdays are not uniformly distributed over calendar days, so the uniformity assumption that is used in most analyses slightly underestimates the true probability of clusters like this. However, setting that issue aside, I would like to get a bit "meta" on you here and encourage you to think about this problem a little differently, as one that involves a great deal of "confirmation bias".

Confirmation bias occurs in this context because you are more likely to take note of an outcome and seek a probabilistic analysis of that outcome if it is unusual (i.e., low probability). To put it another way, think of all the previous times in your life where you were in a room with people and learned their birthday month and the results were not unusual. In those cases, I imagine that you did not bother to come on CV.SE and ask a question about it. So the fact that you are here asking this question is an important conditioning event, that would only happen if you observe something that is sufficiently unusual to warrant the question. In view of this, the conditional probabiltity of the result you observed, conditional on your presence asking this question, is quite high --- much higher than the analysis in the other answers would suggest.

To examine this situation more formally, consider these the following events:

$$\begin{matrix} \mathcal{A}(x,y) & & & \text{Seeing } x \text{ people with same birthday month out of } y \text{ random people}, \\[6pt] \mathcal{B} & & & \text{Deciding the observed outcome warrants probabilistic investigation}. \ \end{matrix}$$

Most of the answers here are telling you how to estimate $\mathbb{P}(\mathcal{A}(4,18))$ but the actual probabilty at play here is the conditional probability $\mathbb{P}(\mathcal{A}(4,18) | \mathcal{B})$, which is much, much higher (and cannot really be computed here).


The maths is way beyond me. However, this sort of thing fascinates me, so I built a spreadsheet to replicate this for 10,000 groups of 18 people each with a birth month generated at random. I then counted how many of these groups had exactly four people with a shared birth month. For the purists, as the question didn't specify, I did also include any incidences of four people sharing a birth month and a separate four people sharing a different birth month. I also didn't rule out three or four groups of four sharing three or four different birth months respectively.

I ran this spreadsheet 50 times, and the lowest result I got was 43.95%. The highest was 46.16%. The mean was 45.05%.

I'll leave it to someone more experienced to do the maths to validate this approximate outcome!

  • $\begingroup$ Thank you, I got ~57%, I directly simulated the # of time one would encounter >=4 people having same birth month. $\endgroup$ – forecaster Jun 15 '20 at 16:45
  • 1
    $\begingroup$ Forecaster, you have now framed your question in two distinct ways: do you want the chance of exactly four people sharing a birth month or of four or more people sharing a birth month? $\endgroup$ – whuber Jun 15 '20 at 17:15
  • $\begingroup$ Thank you @whuber , I have clarified this in the question. $\endgroup$ – forecaster Jun 15 '20 at 19:04

This is a balls-into-bins problem.

The probability that the maximum occupancy of any bin is $m$, given $n$ bins and $r$ randomly allocated balls is the coefficient of $x^r$ in

$\begingroup \Large \begin{equation} \left(\sum _{i=0}^m \frac{x^i}{i!}\right)^n\end{equation} \endgroup$

multiplied by $\begingroup \Large \begin{equation} r! n^{-r}\end{equation} \endgroup$

Evaluating this for the "4 or more" and "exactly 4" cases yields $$\frac{555795868793273}{962938848411648} \approx 0.577187$$ and $$\frac{19807122209875}{47552535724032} \approx 0.416531$$ respectively for your query.

  • $\begingroup$ I've tweaked your LaTeX to make it more readable. If you don't like it, then please roll it back with my apologies. $\endgroup$ – Sycorax Jun 16 '20 at 21:57
  • $\begingroup$ @SycoraxsaysReinstateMonica no worries, I blow at LaTeX, so I appreciate it! $\endgroup$ – rasher Jun 16 '20 at 22:04

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.