Live as if you were to die tomorrow. Learn as if you were to live forever.

A few years ago, a lonely American in London began to ponder his chances of finding a girlfriend. Surely in a city of 8 million people, plenty of women would find a dark-haired doctoral candidate in economics attractive.

But how many women might be into him? What were his actual odds of finding love?

These are questions more than a few lonely hearts are pondering this Valentine’s Day. To try and answer as precisely as possible, Peter Backus, who was 31 at the time, used a mathematical equation to identify the number of women who fit his criteria for romance.

The result, he calculated, was a depressing 26.

Mr. Backus based his calculation on the Drake Equation, a probability formula devised in 1961 by astronomer and physicist Frank Drake to try to solve another great universal mystery: the number of planets in our galaxy that could sustain intelligent life.

In Mr. Backus’s romantic version of the Drake Equation, “intelligent alien” equaled “girlfriend.”

Here’s how the equation works: In a given population—say, London or New York or wherever you happen to live—you apply a series of increasingly restrictive criteria until you end up with a subpopulation that satisfies all the conditions.

The seeker can include any number of criteria—say, the percentage of the population that is college-educated, the number who love “The Hobbit,” the fraction who spent their summers at science camp, or the portion who are blond, Republican, Catholic, taller than average or passionate about KenKen math puzzles.

Of course, statistics aren’t available for every characteristic, and increasing the number of conditions—being choosier, if you will—quickly shrinks the pool of prospective mates.

In Mr. Backus’s case, he wanted to find a single woman around his age in London who was college-educated, attractive and—potential deal-breaker—one with whom he could get along.

The product of the variables produced his result: U.K. population (60,975,000 at the time) x living in London (13%) x women (51%) x single (50%) x between the ages of 24 and 34 (20%) x university educated (26%) x he found attractive (5%) x found him attractive (5%) x compatible (10%).

He obtained most of the figures from the U.K. Office for National Statistics. The three dealing with attractiveness and compatibility were estimates based on his personal experience.

“My friends thought that’s a very Peter thing to do,” Mr. Backus, who is now married and still living in the U.K., said of his calculation, which he wrote up as a joke and posted online.

But he wasn’t alone in his analytical quest for love. Around the same time he deduced his odds for finding a mate, a doctoral student in astrobiology in Seattle wondered how many suitable partners were out there for him. Among his criteria: Must love the Denver Broncos.

Yet another doctoral candidate, studying electrical and computer engineering in Ontario,had the same idea, writing up his assessment in an essay called “Single LGM Seeks Same.”

LGM stands for “little green man.” Clearly, a tolerance for Martian jokes was a plus.

Those three were preceded a decade earlier by a computer-science graduate from Saskatchewan who weighed his chances and, arriving at his mathematical answer, opined that he would never have a girlfriend.

Among his criteria: one standard deviation above the norm for intelligence, and two standard deviations above the norm for beauty.

These lonely young men aren’t the only ones to have jotted down the Drake Equation to estimate their chances of finding love.

National Public Radio correspondent David Kestenbaum confided to Ira Glass in a segment of This American Life that he and his Harvard classmates, who were doctoral students in physics at the time, had worked out the equation, too.

And sitcom writer Dave Goetsch introduced the concept in an episode of “The Big Bang Theory” in which a cast of fictional nerds—also a group of physicists and engineers—applied the equation to determine their odds of hooking up with someone on “anything can happen Thursday.”

“I thought this is exactly how our characters think,” Mr. Goetsch said.

It might be tempting to joke that it is obvious why none of these young men had a romantic partner. In each case—real-life and fictional—each turned not to courtship to solve his problem but to analytics, perhaps with the goal of demonstrating that not having a mate wasn’t his fault.

After all, according to their calculations, the odds were against them.

But not so fast! Mr. Backus found and married someone who matched his parameters, and most of the others have also found mates. It seems they have defied the odds—perhaps because at some point they set aside their calculations and concluded love cannot be reduced to a number.

As Raymond Francis, the Ontario student who now, as a postdoctoral scholar, helps support NASA’s Mars Science Laboratory, said: “You could spend lot of time trying to nail down those factors. But maybe you should just start looking for someone.”