# Probability of five children in the same class having the same given name

On baby-naming forums, prospective parents repeat some version of their Fear of Jennifer all the time: "I don't want my child to be one of 5 in his class with his name." Thing is, no name comes even close to that sort of popularity any more, and even at the height of the Jennifer craze, you didn't get five of them in a class. I would like some sort of answer for these parents of just how unlikely such a coincidence of name repetition would be.

Using the Social Security Administration's extensive baby-name data (https://www.ssa.gov/oact/babynames/limits.html), can someone tell me how to figure out the chances of an elementary school class in the U.S. having five children with the same name? (For simplicity, by "same name" I mean same spelling, and by "school class" I mean all the kids were born in the same year.) I'm not specifying a class size, but it should definitely be greater than 4. :-)

• Posts about baby names is a recurring theme on Andrew Gelman's blog. In none of the posts I found on his site does he discuss your specific question. He does link to a "baby name blog" where you might have more luck getting an answer. andrewgelman.com/2005/09/07/baby_name_blog Aug 3, 2016 at 19:46
• I think you may string something together using the multinomial distribution with probabilities of success of say, the first top twenty names extracted from census data such as this. Aug 3, 2016 at 19:50
• Does the SSA provide data about the number of children born with a name? I'm only finding information about ranks which obviously discards some useful information.
– Sycorax
Aug 3, 2016 at 19:50
• @AntoniParellada I think the reality of the situation is even more subtle: since the US school system is highly segregated by income and race, I think the national statistics will have a poor correspondence to actual classrooms.
– Sycorax
Aug 3, 2016 at 20:06
• When I was a student at a (small) primary school, we had three Johns in a very small class (I think boys and girls combined was only about 14). One year we combined with the year above to make one full-size class... and got a fourth John. Now John was pretty common then but not all that common. (In terms of the original issue, three would be nearly as annoying as five). The chance of a particular name being duplicated many times would be very low, but the chance some name appears multiple times will be far higher. Aug 4, 2016 at 4:13

All data can be found here. Each value in the table represents the probability that given a 25-person sample from that location and birth year, 5 of them will share a name.

Method: I used the Binomial PDF on on each name to find the probability that any given 25-person class would have 5 people who shared a name:

n = class size
k = 5,6,...,n
p_i = (# of name[i]'s) / (total # of kids)


$$P_n(5+\ kids\ share\ name) = \sum_{\forall\ names}\sum_{k=5}^n{n \choose k}p_i^k(1-p_i)^{n-k}$$

For example, if there are 4,000,000 total kids, and 21,393 Emily's, then the probability that there are 5 Emily's in any given class with 25 students is Binomial(25, 5, 0.0053) = 0.0000002. Summing over all names does not give an exact answer, because by the Inclusion/Exclusion Principle, we must also account for the possibility of having multiple groups of 5 people who share names. However, since these probabilities are for all practical purposes nearly zero, I've assumed them to be negligible, and thus $P(\bigcup A_i) \approx \sum P(A_i)$.

Update: As many people pointed out, there is considerable variance over time, and between states. So I ran the same program, on a STATE BY STATE basis, and over time. Here are the results (nation-wide probability is red, individual states are black): Interestingly, Vermont (my home state) has been consistently one of the most likely places for this to happen for the past several decades.

• Any chance you could explain how you got these numbers? You don't need to dumb it down much -- I do have a bachelor's degree in math, and I know where to look stuff up -- but I'd really like to know the sort of reasoning that actually leads to probabilities (instead of daunted sighs). Aug 4, 2016 at 2:19
• This assumes that names are given at random with the same probabilities, what is simply not true. Also real-life experience shows that there is much more classes with kids having the same names then 1 in 200!
– Tim
Aug 4, 2016 at 7:32
• I get slightly different results, but they're close. This isn't worth discussing, though, because the geographic and temporal variation in the results is huge. The answer has changed by two orders of magnitude since 1910 and varies by an order of magnitude among states. Since almost no elementary school class is drawn from the entire US, the model of random selection from the national names list is inappropriate.
– whuber
Aug 4, 2016 at 15:12
• (1) Look at the other years in the national file you downloaded. (2) Look at the state files available on the same site.
– whuber
Aug 4, 2016 at 15:27
• Yes, the graph of probabilities over time is dramatic: it began a steep decline by 1980. But the state variation is very large indeed, as one would expect: names vary geographically and they cluster strongly by ethnicity, income, and other demographic factors. (+1 for your extended investigation into the state and time variation, BTW.)
– whuber
Aug 4, 2016 at 20:23

please see the following Python-script for Python2.

My final answer would be, the probability of finding at least five Jacobs in one class, with Jacob being the most probable name according to the data from https://www.ssa.gov/oact/babynames/limits.html "National Data" from 2006.

The probability is calculated according to a binomial distribution with Jacob-Probability being the probability of success.

import pandas as pd
from scipy.stats import binom

# count of children in the dataset:
sumCount = data.Count.sum()

# do calculation for every name:
for i, row in data.iterrows():
# relative counts of each name being interpreted as probabily of occurrence
data.loc[i, "probability"] = data.loc[i, "Count"]/float(sumCount)

# Probabilites being five or more children with that name in a class of size n=25,50 or 100
data.loc[i, "atleast5_class25"] = 1 - binom.cdf(4,25,data.loc[i, "probability"])
data.loc[i, "atleast5_class50"] = 1 - binom.cdf(4,50,data.loc[i, "probability"])
data.loc[i, "atleast5_class100"] = 1 - binom.cdf(4,100,data.loc[i, "probability"])

maxP25 = data["atleast5_class25"].max()
maxP50 = data["atleast5_class50"].max()
maxP100 = data["atleast5_class100"].max()

print ("""Max. probability for at least five kids with same name out of 25: {:.2} for name {}"""
.format(maxP25, data.loc[data.atleast5_class25==maxP25,"Name"].values))
print
print ("""Max. probability for at least five kids with same name out of 50: {:.2} for name {}, of course."""
.format(maxP50, data.loc[data.atleast5_class50==maxP50,"Name"].values))
print
print ("""Max. probability for at least five kids with same name out of 100: {:.2} for name {}, of course."""
.format(maxP100, data.loc[data.atleast5_class100==maxP100,"Name"].values))


Max. probability for at least five kids with same name out of 25: 4.7e-07 for name Jacob

Max. probability for at least five kids with same name out of 50: 1.6e-05 for name Jacob, of course.

Max. probability for at least five kids with same name out of 100: 0.00045 for name Jacob, of course.

By a factor of 10 same result as David C's. Thanks. (My answer does not sum all the names, should may be discussed)

• This answer does not appear to address the question of the chance that some name appears five or more times in a classroom.
– whuber
Aug 4, 2016 at 15:46
• @feinmann I believe that taking the sum over all names is appropriate because the probability of having two or more sets of 5 people with the same name in one class is nearly zero, and is negligible for all practical purposes. That is, according to the Inclusion/Exclusion Principle, if we disregard this possibility, then $P(\bigcup A_i) \approx \sum P(A_i)$ Aug 4, 2016 at 15:59
• No, you haven't answered the question as you just formulated it. The chance that some name will appear five or more times is much greater than the maximum chance that a given name will appear five or more times.
– whuber
Aug 4, 2016 at 16:21
• As @whuber points out, "5 Jacobs" is a weaker argument than "5 of some name", but it may be useful in baby name discussions anyway: "Here's the probability of five kids with the most popular name. You're not using the most popular name, so your probability is even less." Aug 5, 2016 at 1:18
• It's not exactly, because the possibilities aren't mutually exclusive: you could have 5 or more Thomases and 5 or more Richards (and perhaps even 5 or more Henrys) in a single class. So it's an upper bound. @DavidC argues in a comment here that such events have negligible probability. Aug 5, 2016 at 9:47