The Math Behind Viral Trends: Why the Internet Loses Its Mind on Command
- Jai Pandey
- Apr 17
- 5 min read
Here's a question: 8 divided by 2(2+2). What do you get?
If you said 16, congratulations. If you said 1, also congratulations, you're both part of the problem. In July 2019, this math expression broke the internet. Not a political scandal. Not a celebrity meltdown. A math problem. Steven Strogatz of the New York Times captured it perfectly: "The normally reassuring world of math, where right and wrong exist, and logic must prevail, started to seem troublingly, perhaps tantalizingly, fluid."
One side said 16. The other side said 1. Someone posted a photo of two calculators that gave different answers. The trash talking was immediate. "Some of ya'll failed math and it shows," came the instant reply.
This is virality. It's messier than you think, and very mathematical.
So What Actually Makes Something Go Viral?
Your first instinct is probably that viral content is just good. Funny, shocking, relatable. Something that deserves to spread. That is true, but the math tells a more uncomfortable story.
A model published in Nature Human Behavior found that just about anything can go viral, regardless of its quality. Not the best content, not the most important content. Anything. The system doesn't care what it's spreading.
Once you understand how the system works though, it starts to make a strange kind of sense. Scientists who study how content spreads online borrow their models directly from epidemiology, the same math used to track disease outbreaks. Every person on social media is a node on a network, connected to friends and followers by invisible lines. If Alice gets infected by a meme, say a video of her neighbor's dancing cockatoo, she might pass it to Bob and Clive, who pass it to their connections, and so on down the chain. It's basically the flu. But for content.

The Sandpile Problem
Here is where it gets really interesting.
In 2014, mathematician James Gleeson of the University of Limerick showed a mathematical similarity between viral spread and something physicists call a sandpile. Picture pouring sand slowly onto a flat surface. It piles up. Nothing dramatic happens. Then one extra grain lands, and suddenly the whole thing shifts. An avalanche.
Virality works exactly like that. Most content just sits there. Then something tips the system, and a post that looked completely ordinary overnight reaches millions of people. But the most unsettling part is that Gleeson's analysis suggests it's the structure of the system driving the avalanche, not the quality of the content. The grain of sand that triggers the collapse is not special, it just landed at the right moment.
Why Followers Aren't Everything
So the obvious takeaway is that you just need a massive following, right? Get enough connections and you're guaranteed to go viral eventually.
Not quite.
Mathematician Mason Porter of UCLA points out that network structure matters enormously, and it matters in ways that are not intuitive at all. Real social networks follow a power law distribution, meaning most people have a handful of followers while a few outliers have tens of thousands. If one of those superconnected hubs picks up a meme, it theoretically spreads everywhere fast.
But USC's Kristina Lerman found a catch when she actually studied Twitter behavior in 2016. Superconnected users pass on very few of the memes they receive. The reason is simple: their feeds move so fast that anything more than five minutes old is already buried beyond reach. Information overload ends up protecting most of us from most content. The hubs suppress most of the memes, but occasionally allow and amplify the few that break through the system.
Timing matters as well. According to research from Harvard Business Review, the more shares a video gets in its first two days, the higher it peaks overall. And the optimal day to post? Wednesday. Not Monday or Friday.
TikTok Cracked the Code
If any platform has figured out the math of virality, it's TikTok, and the reason is not what most people think.
Older recommendation algorithms waited for you to tell them what you liked. TikTok does something different, it actively experiments. It pushes content just outside your known interests and watches how you respond. Like Formula One videos? Here are some supercar clips. Still watching? Great, noted. The algorithm updates its model of you in real time, constantly, with every second of watch time.
And here is the part that matters for anyone trying to build an audience, every single video posted gets shown to at least one batch of users. If that batch engages well, it goes to a bigger batch. This cycle continues to repeat. The system only scales up when the content earns it, but the key point is that every video gets a shot. That is mathematically very different from how older platforms worked, and it's the real reason unknown creators blow up on TikTok all the time.

The Echo Chamber Problem
There is one more piece of the puzzle and it's the uncomfortable one.
People's friends tend to cluster. If Alice knows Bob and Clive, there's a good chance Bob and Clive already know each other too. That clustering creates echo chambers, spaces where the same content bounces around a group until it starts feeling like universal truth. In 2006, sociologist Matthew Salganik ran an experiment with over 14,000 people and found that participants were far more likely to download a song if they knew their peers liked it, completely regardless of whether the song was actually good in their own opinions.
The repetition effect is so strange it almost tricks your brain. You might see a post making some outlandish claim and immediately think it's ridiculous. See it a second time and you're slightly less sure. See it enough times and it starts feeling almost plausible, not because any new evidence appeared, but because repetition itself changes how our brains process information. That's not a conspiracy theory about social media, that's just human cognition doing what it was built to do. The math of virality, layered on top of how our minds actually work, can make almost anything seem credible given enough time and enough shares.
When the Math Hits Its Limits
However, these models don't capture everything. Kristina Lerman is openly skeptical of agent based models, pointing out there are too many adjustable parameters to be confident in specific results. Moreover, no mathematical model can fully explain why one video of a cat sitting in a box gets 50 views while another almost identical video gets 50 million.
Research from marketing firm Unruly, which analyzed 430 billion video views, found the biggest driver of sharing is psychological response, how the content makes you feel. Right behind it is social motivation, the reason you specifically want someone else to see it. The stronger the emotional reaction, the more likely people are to pass it on.
So the math can model the system and explain the avalanche. But the spark that starts it? That still seems to be something human.
Enjoyed this post? At Numbers in the Wild, we find the math hiding in plain sight, from viral videos to the algorithms quietly running your life. More posts coming soon.
HBR. "Why Some Videos Go Viral." Harvard Business Review, Sept. 2015, hbr.org/2015/09/why-some-videos-go-viral.
Hern, Alex. "How TikTok's Algorithm Makes It a Success: 'It Pushes the Boundaries.'" The Guardian, 24 Oct. 2022, www.theguardian.com/technology/2022/oct/23/tiktok-rise-algorithm-popularity.
Mukerjee, Madhusree. "How Fake News Goes Viral -- Here's the Math." Scientific American, 14 July 2017, www.scientificamerican.com/article/how-fake-news-goes-viral.
Strogatz, Steven. "That Vexing Math Equation? Here's an Answer." The New York Times, 2 Aug. 2019, www.nytimes.com/2019/08/02/science/math-equation-pedmas-bemdas-bedmas.html.



Comments