Combinatorics and Brainrot
December 4, 2025
Beginning earlier this year, the internet was introduced to the 6-7 Meme, and it's gotten massive. So big that my friends and I are beginning to notice these numbers everywhere. On receipts, in movies and shows, in podcasts, barcodes, basically any string of digits you can find out in the wild. Of course, this could just be some classic frequency illusion at work. Still, out of curiosity, I wanted to see if I could figure out the probability that any -sized string of digits would have the numbers and appear within it, in that order.
Before I dive in, I'd like to mention a similarly interesting problem I saw in a textbook before. It goes a bit like this: we want to know how many games are played every year during the NCAA Division 1 Men's Basketball Tournament. The author reasons that every game has a loser, and no two games have the same loser. What this allows us to do is say that there are the same number of games as there are losing teams. We know that teams play in the tournament, and only wins, so the other lose, therefore there are games.
This is similar to the kind of problem we want to solve right now, where we reason to find the right formula, and sometimes we get to use neat tricks like the losers-to-games equivalence we used. Note that for , to appear in a string we'd need at least two digits in it, so . Throughout this process, we rely on something called the Multiplication Principle. It goes something like this:
To start, we'd like to know how many strings of digits there are. We can determine this in a step-by-step process. Say our string has no digit, we're choosing the first digit. Since we have digits to choose from, we have possible ways to do this. Let's move on to the next digit. Again, we have digits to choose from, so another possible ways to do this. By the Multiplication Principle, we have ways of choosing both digits, meaning there are different possible strings of two digits.
From here, it shouldn't be too hard to convince yourself that there are different ways to choose digits for an -size string, so there are such strings. We're gonna use this in our probability formula.
Next, we want to find how many strings of digits have and appearing within them. Let's go back to the idea of building a string of digits. We want to know what positions we can put and . We have positions, from to , so there are positions for to be in. Since can't be in the same position as , we have choices for . By the Multiplication Principle, there are different ways to position and .
What about the rest of the string? We don't really want to see or appear again, so for every other digit we only have options really. Since we have positions left to fill and options of digits for each, we have ways for the rest of the string to look. With another application of the Multiplication Principle, we have strings of digits where and appear once.
Here's the issue, though: if we assume for a second, you'll notice that our possibility includes as well as . As per the meme, it's , not . This means we want strings like to be ignored. Thankfully, we have a neat way to do this. Observe that if you take any of these strings of digits where is before (the way we don't want), and you swap around and , you get a string of digits where is before (which we do want). This tells us that there is the same amount of each (think about it). Meaning, within our strings, exactly half will be the way we want, and half will be the way we don't want. Then, naturally, our new number is
The last and final step is pretty straightforward. What we wanted at the end of the day was to know how many out of a bunch of strings will have this quality we want. Since our bunch of strings comes out to and the number of special strings is , we divide them and get a probability of
Now for some application. Let's compute the probability for different sizes of to see how the raw probabilities are using some Python.
formula = lambda n: ( n*(n-1) * (8 ** (n-2)) ) / (2 * (10 ** n))
for i in range(2, 16):
print(f"{formula(i) * 100:.2f}%")
1.00%
2.40%
3.84%
5.12%
6.14%
6.88%
7.34%
7.55%
7.55%
7.38%
7.09%
6.70%
6.25%
5.77%
Now we can say, for example, that the average barcode has a % chance of having and appear in it in that order.
Earlier I mentioned some examples in the wild, and I wasn’t kidding. Here are four instances from the show Stranger Things:
These examples show that the – pattern appears in the real world. While probability helps us understand the likelihood of such occurrences, seeing them firsthand makes the pattern more tangible and concrete.