Is humanity doomed? We certainly don’t lack apocalyptic scenarios: nuclear war, a robot uprising, out-of-control climate change. Unlikely, far-fetched? Not according to scientists and mathematicians who, in recent decades, have found a surprising new source for anxiety about the long-term survival of the human race: probability theory. The so-called “doomsday argument” holds that there is a 50% chance that the end of human life will come within 760 years.

You may well wonder how such a calculation is possible, much less an...