Armageddon comes in many guises: climate breakdown, asteroid strike, zombie apocalypse. But just as interesting a question as what might cause the world to end is the question of when it might cease to exist. According to some scientists, we can make confident predictions about the latter by using a simple probability theorem, with some estimates anticipating our demise in as little as 12 years. Just how worried should we be? Or is it all just a geeks’ parlor game?

Certainly some partisans of mathematical “doomsday arguments” are no puny intellects. One is the astrophysicist J. Richard Gott III, author of the excellent “Time Travel in Einstein’s Universe”; another is the philosopher John Leslie, considered the world’s greatest expert on why there is something rather than nothing. In “The Doomsday Calculation: How an Equation That Predicts the Future Is Transforming Everything We Know About Life and the Universe,” the journalist William Poundstone marshals arguments for and against the plausibility of doomsday predictions with vivid and subtle ease, enjoyably wrong-footing the reader by being persuasive first for one point of view and then for its opposite. He goes on to vividly demonstrate applications of doomsday-style arguments in finance, quantum physics, the potential threat of artificial intelligence and the question of whether we might all be living in a computer simulation.

A fundamental assumption of all doomsday calculations is what, in cosmology, is called the Copernican Principle. Just as Copernicus discovered that the Earth does not occupy a privileged place at the center of the solar system, the principle that bears his name tells us to assume that we do not occupy any special place in the universe—or, for that matter, in time. If, for example, we assume that we are seeing a Broadway show at a randomly chosen moment in its history, we should, according to the Copernican principle, be more surprised to find ourselves at the very beginning, or the very end, of the show’s run than somewhere in the middle. Add some math first formulated by the 18th-century English clergyman Thomas Bayes, and this assumption of our nonprivileged moment enables us to calculate a precise range of future outcomes.

So what happens when we apply the Copernican Principle to the history and future of humanity? There are various ways to do this. If we simply assume that we find ourselves at a random point in human history, then the math tells us with 95% confidence that humans will survive no more than 7.8 million years, but at least another 5,100 years. If we add data about the historic world population and birth rate, and then assume the randomness of our “birth order” (that is, our place in the continuum among all the humans who have ever lived and ever will live), then doomsday is coming—again, with 95% confidence—at most 18,000 years from now, and at minimum in the year 2031.

Copernican considerations can help guide investing. “The highest-valued companies are often new ones that are burning cash,” Mr. Poundstone notes, but the 10 largest holdings of Warren Buffett’s Berkshire Hathaway are very old companies—the youngest being Apple, at 43—that a Copernican would expect to remain in business. Some physicists, meanwhile, appeal to doomsday-style probabilistic reasoning when rejecting the “many worlds” interpretation of quantum mechanics—according to which everything that can happen does happen in an infinitely branching series of universes.