Please wait...

I Made a Computer Program To Predict the Apocalypse; It’s Not What You Think.

I Made a Computer Program To Predict the Apocalypse It's Not What You Think.

Estimated reading time — 13 minutes

It began as a lark, really. I woke up one morning from a dream about the apocalypse. No, not a wild west apocalypse. Exactly how the world was ending wasn’t clear, I just knew that it was, and so I enrolled in the autoshop class at my local tech education center. I figured it would let me pilfer supplies, stockpile things like spark plugs, brake pads, an alternator. By the light of day the idea seems silly. When half the world is dying, and nobody has gas, auto parts are going to be lying around everywhere, yours for the taking, good luck trying to use them. But when I told my partner Max, he said there should be somewhere for people to call in such dreams. A database that would compile people’s dreams about the apocalypse, and see what the collective unconscious could tell us.

It sounded like a fun idea, and easy to do. I threw together a database and some simple code to extract themes, put it up on the web, and figured nobody would find it. A week later, based on twenty-four replies, the hive mind was recommending we stockpile assault rifles and high-capacity magazines. It seemed too obvious to have come out of people’s dreams, even if my sample size was pathetically small. So I looked at a few of the entries. Here is a representative sample:

I am a ninja sordsman with a cybernautic arm with a AK. I am comandr of aleet teem of asasins. We shoot zombies in the hed.

I was struck by two things, the first being that I’m a damn good coder, to be able to extract themes from the writings of the illiterate. The second was that the writer’s “dream” looked an awful lot like a daytime fantasy. Some others were obviously not dreams:

We shud get lots of ammo and guns but mostly ammo cuz u yuse lots and its hard getting mor. Put lots of sandbags arownd you’re hous and lots of food and water in you’re basemint.

There was only one that showed any creative thinking—not to mention English grammar—but it was disturbing:

You will need a defensive perimeter around your base of operations. If you don’t have a place in the country I don’t recommend trying to get one. Everyone will want one, so the ones that weren’t well-defended will be taken over by somebody who will defend them. Instead, you should burn down all neighboring houses to give yourself at least a full block of unbroken line of sight in all directions.

Whether that is good advice or scary, it was clear my data was corrupted, and people’s actual dreams were lost in a mishmash of fantasies and advice. I explained my problem to Max one evening over dinner.

“Wait, you actually did this?” he asked.


I shrugged. “I thought it would be fun. But I need to figure out how to stop people from entering stuff that isn’t their dreams. Maybe if, instead of a ‘Submit’ button, it had a query: ‘This comes from a dream I had: Yes-No.’ “

“Maybe,” Max said thoughtfully. “But if clicking ‘No’ means they don’t get to submit, some people will just click ‘Yes.’ ” Max was a therapist who worked in the local high school. He had few illusions about people’s abilities to follow directions. “Maybe instead of Yes-No, you give people a menu to source their contribution. ‘This comes from a dream I had,’ ‘This is my recommendation of best practice.’ ‘This is based on the Bible or another religious source.’ And ‘Other.’ You always need an ‘Other’ category for the person who says, ‘This isn’t my “recommendation,” this is the right way to do it!’ “

I considered this. It made sense. Instead of stopping people from entering non-dream material, I could get them to flag it, and thank them for their contribution. Then it would be a simple matter to filter the non-dream material from the results. It only took a moment to add the query and the filter. Then my problem would be how to get enough people to participate that I had a reasonable sample size. I’m good at coding. Not so good at marketing.

I checked back a week later, and traffic had dwindled to a dozen hits, of which 75% had been flagged as “recommendations.” Given that I’d had to toss the original 24, this left me with nearly nothing. A week later, six more hits, none of them dreams. I gave the project up as a failure.

What inspired me to check back, nearly three months later, I can’t say. It may just have been that it popped into my mind, for whatever reason, and I thought, “Hey, I wonder.” But I checked. Over 36,000.

The filter explained what had probably happened. Eighty-four percent were “based on the Bible.” Someone must have posted the link to an evangelical group, and they had had great fun quoting Revelations and Daniel. But with all that reposting, 12% had been inspired to post non-Bible-based recommendations, and 4% had actually used the site as intended. Four percent of 36,000 is 1,400 entries.

“So what did you find?” Max asked when I told him of my success. “What does the hive mind tell us about the coming Apocalypse?”

“Well…” This was the awkward part. “It’s not clear. I didn’t get many hits on the likely candidates. Epidemics were at eight percent, even though we aren’t far out of Covid. If I lump drought, flood, and cataclysmic storms as ‘Environmental Issues’ I get maybe nineteen percent. Nuclear war was only three percent, went up to nine percent if it was ‘War, All Sorts.’ Famine was eleven percent.”

He’d met me for lunch down on Boston Common. I was scrolling through the results on my laptop while he shared his sandwich with the ducks. This probably explains why he’s so skinny.

“So none of the Four Horsemen topped eleven percent, huh?” Max asked. “What about wild animals?”
I stared at him. “Why did you ask that?”

“Oh, it’s from Revelations. If you read it, the horsemen actually aren’t named Famine, War, and Pestilence. The fourth horseman, who is named Death, is given the power to kill with famine, war, pestilence, and wild beasts. Somehow, the first three charges got made into the names of the first three horses, and the fourth charge got left off, but it’s in there, officially. One of the ways to die at the End Times.”

“Well, that explains it,” I said.

“What?” Max asked. “How high did wild beasts score?”

“Eighteen percent. More than war and epidemics put together. But I think my sample was skewed to evangelical Christians.” I explained how my responses were overwhelmingly dominated by people quoting the Bible, and reasoned that many of those reporting their dreams might come from the same communities.

“Nah, I don’t think so.” He tossed another bite of sandwich to an impressive male mallard, who cocked his eye critically at Max, as if to say, “Don’t you know that bread isn’t good for ducks? Are you trying to poison us?”

“Why not?” I asked. Max, not the duck.

“Well, you know I’ve got a couple cousins who were Born Again, right?”

I did.

“Yeah, well one thing they don’t appreciate is for an unbeliever to tell them what the Bible really says. Did anyone dream of dragons? There’s a dragon in Revelations.”

“Some,” I said. “I wasn’t sure how to classify some of them. If they said ‘beast’ I grouped it with wild animals, but if they said the beast breathed fire I grouped it with dragons. Then there was one that was, ‘the heir of dinosaurs.’ Was that a dragon or a wild beast?”

“Or a duck,” Max said. “Ducks are descended from T-rex.”

“That’s very helpful, Max.”

“I think this one is channeling his ancestor, he looks like he wants my fingers more than my sandwich.”
Actually the duck was glaring at me. He waddled a couple steps closer.

“I don’t have anything,” I said. I showed him my empty hands. The duck stared at my laptop, suspecting me of hiding treats behind it. “Here, see?”

I turned the laptop around so it could see there was nothing behind it. The duck lunged out his head and tried to peck the keyboard. I snatched it out of reach.

“Hey! That’s not edible!”

“I’ll tell you what,” Max said. “I have a couple students who are well-connected online. I’ll see if they can promote your project. Maybe it will correct the Bible-bias in your sample.”

The smart thing would have been to give up on it. It was a silly idea, after all. But I was curious if the results would change.

I avoided thinking about it for another month, and then checked back to see what had happened. Apparently, Max had known the right people. I was now over 80,000 responses, and nearly 45% were actual dreams. When you consider that my original Bible-thumpers probably still made up 40% of my sample, that meant the great majority of Max’s people had filled it out correctly.

But the weird thing was that when I ran my sorting routine, the percentages didn’t change much. Dragons were down, climate change was up. Wild beasts also rose to 20%. It’s hard to say why, but this irritated me. I suppose it was the illogic of it. War, or climate change, or war and climate change, these were the big threats to Earth. The eruption of the Yellowstone supervolcano could do it. The giant impactor is always a possibility. There’s only ever been one planetary collision that threatened all life on Earth—the one that killed the dinosaurs–but it wouldn’t have to be that massive just to bring down civilization. There are similar thoughts to a super plague. Historically, even the worst plagues haven’t killed more than a third of people. But the modern world is built on such a complex structure of global communication and transportation. A significant disruption could cause a cascade of disasters. During the Black Death, the survivors lived much closer to their farms, they didn’t have to contend with cities built on the assumption that food could be delivered from thousands of miles away by burning fuel from wells on the far side of the world Their farms weren’t dependent on labs to make genetically-engineered seed and broad-spectrum fungicides.

Shop Now

But wild animals? Seriously? Even if every dog in the world instantly went Cujo, some locked doors and automatic weapons would quickly end the crisis. A zombie plague seemed more likely. All that required was some unknown mechanism, alien microbes or whatever. There was plenty of unknown in the world. But a wild animal apocalypse just didn’t make sense. There wasn’t enough wilderness left in the world to threaten humanity. All the people in the world total 60 megatons of carbon. All the wild mammals, every blue whale, elephant, mouse, and pygmy shrew, and every wild bird, totals just 9 megatons. We outweigh them seven to one.

The other thing that bothered me in my data was the unclassifiable dreams. Fully 42% fell into this category. That was enough, potentially, to make any response a majority. No statistician would take my results remotely seriously with such a large unknown. I had to find some way to sort these responses.

Manually sorting them was hopeless. There were over 16,000 of them. That would take weeks, after which I’d probably have another 16,000. But maybe I could come up with some tweaks to my code.

Part of the problem was short entries. Like this: “They came from the water, in a line, one following the other. Terrible. Terrible.” It could mean anything. Aliens. Lobsters. Killer frogs. Russian frog men. Sub-launched nuclear missiles. Or this one: “Toothless, they swallowed us whole. None survived.” Maybe those killer frogs again. Frogs don’t have teeth, and they swallow you whole. Of course, the same could be said for owls, or mudslides, or tidal waves, or flying saucers. “We fed them in the park, and they killed us.” Pigeons? Homeless people?

The only thing I got out of this effort was a new category: “They—undefined,” which actually became the highest scoring category of all at 31%. But, considering that it was doubtless a polyphyletic category, that didn’t mean anything. All I’d accomplished was splitting my “Other group” into those that mentioned a “they” and those that didn’t.

The solution, of course, was AI. I could contract with an AI vendor to process my results. My simple filtering routines were built around specific words, and depended on my ingenuity to think of all the variants and permutations. I might search for “killer frogs” using “frogs” and “toads,” but if someone accidentally typed “fog” instead of “frog” I’d classify it under “weather.” An AI might be able to tell the difference between: “We could see nothing in the terrible, icy fog,” and “The fog flicked out its tongue, snagged four people, and swallowed them whole.”

Contracting an AI meant spending money, but I could afford it, and I was hooked. I wanted to make sense of this. Maybe the wild animals were metaphorical. That would make sense in dreams. You don’t often dream exactly about what you’re thinking about. Like sometimes I dream about speeding down a crazy highway. It’s like eight lanes wide, and going much too fast, and it’s constantly splitting into different directions and combining with other highways. Sometimes it’s dark. Or the windows are fogged. Or I’m too short to see over the dash. These are not dreams about driving. These are dreams about my life running out of control. Maybe the wild animals were about something else. Maybe an AI could translate some metaphors.

It turned out to be more difficult than I imagined. I found a company that would take it on, but they needed me to give it samples of dream interpretation to extrapolate from. I tried doing some myself. Then I dug around online, trying to find some professional samples. The challenge here was to avoid anything with a Freudian orientation. I didn’t want to discover that the end of the world was a giant penetrating phallus. There were plenty of modern samples I could find, even after I excluded the hundreds of fruit-loopian schools of thought. I also dug up some from Jung, Erikson, Vygotsky and their devotees. Fed it all into the program, and then I just had to wait.

While I waited someone broke into our apartment. It wasn’t the first time. Our apartment door is unfortunately at the end of the hall, around a little bend, so it’s a private little nook for people to hide while forcing the door. But this one was weird. To begin, they hadn’t come through the door. They’d come through the second-story window. Also, they didn’t take anything. Granted, Max and I don’t have a TV—after the third time we just didn’t buy another, we make do with my laptop. For similar reasons, we don’t have many other high resale items. My laptop was with me at work. But usually they find something to make it worth their while.

It wasn’t for lack of trying, either. They’d opened every cabinet and cupboard, every closet and drawer. Pulled everything out and made a mess of things. The policeman who took the report had a couple ideas.


“This reminds me of people who knock over small-time drug dealers. Somebody thinks there’s a stash of Oxycontin in the house, they’ll go crazy looking for it.”

He gave us a critical eye.

“You think we’re drug dealers?” Max looked at me. We both started laughing.

The policeman laughed, too. “No. No, I don’t.” Although I wasn’t entirely persuaded he hadn’t been fishing to see what we’d say.

“Do you have any documents or heirloom items that any family member or acquaintance would want to get a hold of?” he asked.

“Not that I can think of,” I said.

Max was still laughing. “Well, I’ve got the family jewels, but I always take them to school with me.”

The policeman stopped smiling. He went to the window and stuck his head out. “The thing I don’t get is how they got in.”

“We’re guessing it was the window,” Max said.

“Knock if off,” I whispered to him. The cop had already hinted he suspected us of hiding drugs in the house, the last thing we wanted to do was piss him off and make him look for an excuse to charge us with something.

“This is the street side of the building, they weren’t going to put a ladder up,” the cop said.

“There’s a tree branch someone could have jumped from,” I said.

The cop scowled. “In a comic book, maybe. Does anyone else have a key to your apartment?”

“My mother,” Max said. “But even if she did want to search through all my stuff, she would definitely have cleaned up after herself.”

“Ask her if she’s lost the key,” he said. “I don’t think anybody came in that window. I think someone came in through the door, and then broke the window to make it look like a robbery. I think you should think through who you know might have wanted something of yours. Give me a call if you think of anything.”

It was a disturbing thought. But neither Max nor I could come up with any relatives who would be up for burglary. I asked about his Born Again cousins.

“Well, they pray at us,” Max said. “And write nasty letters. They’re good at nasty letters. But, you know, ‘Thou shalt not steal.’ ”

A week later I received a disturbing email from the AI vendor. They were going to be delayed in fulfilling a number of contracts, due to the unexpected death of their lead engineer in a plane crash.

I’m not ordinarily paranoid. Really I’m not. But a week after the curious break-in, I was still looking for some explanation. I hadn’t really formed any logical thought like, “Someone killed him to prevent me discovering the nature of the apocalypse.” I just wanted to know if it was possible the burglar could have learned who my vendor was during the break-in. I wanted to rule out the possibility, really, prove to myself there couldn’t be a connection. So I opened up the photos we’d taken of the mess, while we were trying to figure out if there was anything worth claiming from the insurance (there wasn’t).

I saw it in the very first picture: the receipt I had printed out, lying square in the middle of the study floor, detailing exactly what I wanted them to do. So then I called up the news reports, and yes, the name on the receipt was the lead engineer who had died. But the news reports were reassuring: the plane had not crashed due to terrorism, bombs, or mysterious mechanical failure, but to a freak accident. Bird strike.

During take-off, the plane had sucked two Canada geese into the jet engines, one on each side. Both engines had failed catastrophically, and the plane had gone straight down.

It was a pretty freakish accident, though. The article said that while bird strikes are a known aviation hazard, there were no recorded instances of a simultaneous hit on both engines. Still, it ruled out the possibility that one of Max’s Born Again cousins, intent on stopping us from disproving Revelations, had taken out a contract on the software engineer.

“Or not,” Max countered when I told him. “Maybe they prayed really hard, and got God to stuff those birds into those plane engines.”


“Right.” I rolled my eyes at him. “If they could do that, they could cure you of your sinful lifestyle, too.”

More reasonably, there actually was an unusual crowd of migrating birds in Boston. The birds were so thick they were intimidating the smaller dogs that people usually walked in the park, and the City was having trouble cleaning up the mess. It was so bad Max and I had moved our usual lunch date to a cafe away from the park.

Three days later we lost our internet connection. It was a freak accident, they said. Simultaneously, black ducks got caught in seven different relay stations around Boston, electrocuting themselves and shorting out systems, and bringing down the whole network.

There’s coincidence, and then there’s two ridiculous but similar coincidences in a row.

“Max?” I asked him when he got home that evening. “Are geese a kind of duck?”

“How should I know, I can’t get online.”

“How far would we have to drive to get somewhere we can connect to the internet?”

He shrugged. “I don’t know. Framingham?”

“Let’s go.”

Ordinarily, Max doesn’t like going out on school nights. But I think he heard something in my voice. He said, “Okay,” and we drove out to Framingham, found an internet cafe, and got online. Sure enough, my results were waiting for me.

Most common theme of apocalyptic dreams: ducks. Duck imagery was the most probable referent in 48% of reported dreams. Looking at the breakdown it became even more disturbing

Wild animals—ducks 48%
Wild animals—avian, undifferentiated 6%
Wild animals—air-breathing aquatic animal, undifferentiated 5%
Wild animals—all other categories <1%

Which is to say, 59% of dreams either referenced ducks, or an animal that could be a duck. Most any dream that featured wild animals either was or could be a duck. Fully 82% of dreams were judged “not inconsistent with ducks.”

War was a close second, at 42%, but on closer examination that was no reassurance.

War—human vs. human 7%
War—human vs. extraterrestrial <1%
War—human vs. wild animal 30%
War—human vs. undifferentiated 5%

In other words, all but 7% of that 42% could still be about ducks. There was a similar breakdown for divine wrath, at 36%:

Divine wrath—demonic beings 5%
Divine wrath—fire 3%
Divine wrath—earthquake, tidal wave, flood, other environmental 1%
Divine wrath—wild animals 15%
Divine wrath—undifferentiated 7%

Environmental devastation was relatively duck-free, but was only a theme of 22% of dreams, and even 7% of this included “interspecies competition.”

There was one glaring blind spot in my dream survey, of course. When will it happen? I don’t know. Dreams are no help with questions of timing. Everything in dreams is present tense. But now that the plan is revealed, I just think it will be soon.

So, yeah. Max and I are now living in an undisclosed location, somewhere far away from any pond or migration route. I’d have dismissed the whole thing as a lark, a ridiculous project that meant nothing. I mean, just because people everywhere are dreaming about it doesn’t mean it’s true. No one’s ever proven that dreams predict the future. I’d have laughed the whole thing off.

But the ducks believe.

Credit: Eugene Fairfield

Official Site


Please wait...

Copyright Statement: Unless explicitly stated, all stories published on are the property of (and under copyright to) their respective authors, and may not be narrated or performed under any circumstance.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top