In his sublime definition of love, playwright Tom Stoppard painted the grand achievement of our emotional lives as “knowledge of each other, not of the flesh but through the flesh, knowledge of self, the real him, the real her, in extremis, the mask slipped from the face.” But only in fairy tales and Hollywood movies does the mask slip off to reveal a perfect other. So how do we learn to discern between a love that is imperfect, as all meaningful real relationships are, and one that is insufficient, the price of which is repeated disappointment and inevitable heartbreak? Making this distinction is one of the greatest and most difficult arts of the human experience — and, it turns out, it can be greatly enhanced with a little bit of science.

That’s what mathematician Hannah Fry suggests in The Mathematics of Love: Patterns, Proofs, and the Search for the Ultimate Equation (public library) — a slim but potent volume from TED Books, featuring gorgeous illustrations by German artist Christine Rösch. From the odds of finding your soul mate to how game theory reveals the best strategy for picking up a stranger in a bar to the equation that explains the conversation patterns of lasting relationships, Fry combines a humanist’s sensitivity to this universal longing with a scientist’s rigor to shed light, with neither sap nor cynicism, on the complex dynamics of romance and the besotting beauty of math itself.

She writes in the introduction:

Mathematics is ultimately the study of patterns — predicting phenomena from the weather to the growth of cities, revealing everything from the laws of the universe to the behavior of subatomic particles… Love — [like] most of life — is full of patterns: from the number of sexual partners we have in our lifetime to how we choose who to message on an internet dating website. These patterns twist and turn and warp and evolve just as love does, and are all patterns which mathematics is uniquely placed to describe. […] Mathematics is the language of nature. It is the foundation stone upon which every major scientific and technological achievement of the modern era has been built. It is alive, and it is thriving.

In the first chapter, Fry explores the mathematical odds of finding your ideal mate — with far more heartening results than more jaundiced estimations have yielded. She points to a famous 2010 paper by mathematician and longtime singleton Peter Backus, who calculated that there are more intelligent extraterrestrial civilizations than eligible women for him on earth. Backus enlisted a formula known as the Drake equation — named after its creator, Frank Drake — which breaks down the question of how many possible alien civilizations there are into sub-estimates based on components like the average rate of star formation in our galaxy, the number of those stars with orbiting planets, the fraction of those planets capable of supporting life, and so forth. Fry explains:

Drake exploited a trick well known to scientists of breaking down the estimation by making lots of little educated guesses rather than one big one. The result of this trick is an estimate likely to be surprisingly close to the true answer, because the errors in each calculation tend to balance each other out along the way.

Scientists’ current estimate is that our galaxy contains around 10,000 intelligent alien civilizations — something we owe in large part to astronomer Jill Tarter’s decades-long dedication. Returning to Backus’s calculation, which yielded 26 eligible women on all of Earth, Fry notes that “being able to estimate quantities that you have no hope of verifying is an important skill for any scientist” — a technique known as a Fermi estimation, which is used in everything from job interviews to quantum mechanics — but suggests that his criteria might have been unreasonably stringent. (Backus based his formula, for instance, on the assumption that he’d find only 10% of the women he meets agreeable and only 5% attractive.)

In fact, this “price of admission” problem is also at the heart of a chapter probing the question of how you know your partner is “The One.” Fry writes:

As any mathematically minded person will tell you, it’s a fine balance between having the patience to wait for the right person and the foresight to cash in before all the good ones are taken.

Indeed, some such mathematically minded people have applied an area of mathematics known as “optimal stopping theory” to derive an actual equation that tells you precisely how many potential mates to reject before finding the perfect partner and helps you discern when it’s time to actually stop your looking and settle down with that person (P):

Fry explains:

It tells you that if you are destined to date ten people in your lifetime, you have the highest probability of finding The One when you reject your first four lovers (where you’d find them 39.87 percent of the time). If you are destined to date twenty people, you should reject the first eight (where Mister or Miz Right would be waiting for you 38.42 percent of the time). And, if you are destined to date an infinite number of partners, you should reject the first 37 percent, giving you just over a one in three chance of success. […] Say you start dating when you are fifteen years old and would ideally like to settle down by the time you’re forty. In the first 37 percent of your dating window (until just after your twenty-fourth birthday), you should reject everyone; use this time to get a feel for the market and a realistic expectation of what you can expect in a life partner. Once this rejection phase has passed, pick the next person who comes along who is better than everyone who you have met before. Following this strategy will definitely give you the best possible chance of finding the number one partner on your imaginary list.

This formula, it turns out, is a cross-purpose antidote to FOMO, applicable to various situations when you need to know when to stop looking for a better option:

Have three months to find somewhere to live? Reject everything in the first month and then pick the next house that comes along that is your favorite so far. Hiring an assistant? Reject the first 37 percent of candidates and then give the job to the next one who you prefer above all others. In fact, the search for an assistant is the most famous formulation of this theory, and the method is often known as the “secretary problem.”

But the most interesting and pause-giving chapter is the final one, which brings modern lucidity to the fairy-tale myth that “happily ever after” ensues unabated after you’ve identified “The One,” stopped your search, and settled down him or her. Most of us don’t need a scientist to tell us that “happily ever after” is not a destination or a final outcome but a journey and an active process in any healthy relationship. Fry, however, offers some enormously heartening and assuring empirical findings, based on a fascinating collaboration between mathematicians and psychologists, confirming this life-tested and often hard-earned intuitive understanding.

Fry examines what psychologists studying longtime couples have found about the key to successful relationships:

Every relationship will have conflict, but most psychologists now agree that the way couples argue can differ substantially, and can work as a useful predictor of longer-term happiness within a couple. In relationships where both partners consider themselves as happy, bad behavior is dismissed as unusual: “He’s under a lot of stress at the moment,” or “No wonder she’s grumpy, she hasn’t had a lot of sleep lately.” Couples in this enviable state will have a deep-seated positive view of their partner, which is only reinforced by any positive behavior: “These flowers are lovely. He’s always so nice to me,” or “She’s just such a nice person, no wonder she did that.” In negative relationships, however, the situation is reversed. Bad behavior is considered the norm: “He’s always like that,” or “Yet again. She’s just showing how selfish she is.” Instead, it’s the positive behavior that is considered unusual: “He’s only showing off because he got a pay raise at work. It won’t last,” or “Typical. She’s doing this because she wants something.

She cites the work of psychologist John Gottman, who studies why marriages succeed or fail. He spent decades observing how couples interact, coding and measuring everything from their skin conductivity to their facial expressions, and eventually developed the Specific Affect Coding System — a method of scoring how positive or negative the exchanges are. But it wasn’t until Gottman met mathematician James Murray and integrated his mathematical models into the system that he began to crack the code of why these toxic negativity spirals develop. (Curiously, these equations have also been used to understand what happens between two countries during war — a fact on which Fry remarks that “an arguing couple spiraling into negativity and teetering on the brink of divorce is actually mathematically equivalent to the beginning of a nuclear war.”)

Fry presents the elegant formulae the researchers developed for explaining these patterns of human behavior. (Although the symbols stand for “wife” and “husband,” Fry notes that Murray’s models don’t factor in any stereotypes and are thus equally applicable to relationships across all orientations and gender identities.)

She breaks down the equations:

The left-hand side of the equation is simply how positive or negative the wife will be in the next thing that she says. Her reaction will depend on her mood in general (w), her mood when she’s with her husband (r w W t ), and, crucially, the influence that her husband’s actions will have on her (I HM ). The Ht in parentheses at the end of the equation is mathematical shorthand for saying that this influence depends on what the husband has just done. The equations for the husband follow the same pattern: h, r H H t , and I HM are his mood when he’s on his own, his mood when he’s with his wife, and the influence his wife has on his next reaction, respectively.

The researchers then plotted the effects the two partners have on each other — empirical evidence for Leo Buscaglia’s timelessly beautiful notion that love is a “dynamic interaction”:

In this version of the graph, the dotted line indicates that the husband is having a positive impact on his wife. If it dips below zero, the wife is more likely to be negative in her next turn in the conversation.

What all of this translates into is actually strikingly similar to Lewis Carroll’s advice on resolving conflict in correspondence. “If your friend makes a severe remark, either leave it unnoticed, or make your reply distinctly less severe,” Carroll counseled, adding “and if he makes a friendly remark, tending towards ‘making up’ the little difference that has arisen between you, let your reply be distinctly more friendly.” Carroll was a man of great psychological prescience in many ways, and this particular insight is paralleled by Gottman and Murray’s findings, which Fry summarizes elegantly:

Imagine that the husband does something that is a little bit positive: He could agree with her last point, or inject a little humor into their conversation. This action will have a small positive impact on the wife and make her more likely to respond with something positive, too… [But] if the husband is a little bit negative — like interrupting her while she is speaking — he will have a fixed and negative impact on his partner. It’s worth noting that the magnitude of this negative influence is bigger than the equivalent positive jump if he’s just a tiny bit positive. Gottman and his team deliberately built in this asymmetry after observing it in couples in their study.

And here is the crucial finding — T- is the point known as a negativity threshold, at which the husband’s negative effect becomes so great that it renders the wife unwilling to diffuse the situation with positivity and she instead responds with more negativity. This is how the negativity spirals are set off. But the most revelatory part is what this suggests about the myth of compromise.

As Fry points out, it makes sense to suppose that the best strategy is to aim for a high negativity threshold — “a relationship where you give your partner room to be themselves and only bring up an issue if it becomes a really big deal.” And yet the researchers found the opposite was true:

The most successful relationships are the ones with a really low negativity threshold. In those relationships, couples allow each other to complain, and work together to constantly repair the tiny issues between them. In such a case, couples don’t bottle up their feelings, and little things don’t end up being blown completely out of proportion.

She adds the important caveat that a healthy relationship isn’t merely one in which both partners are comfortable complaining but also one in which the language of those complaints doesn’t cast the complainer as a victim of the other person’s behavior.

In the remainder of The Mathematics of Love, Fry goes on to explore everything from the falsehoods behind the standard ideals of beauty to the science of why continually risking rejection is a sounder strategy for success in love (as in life) than waiting for a guaranteed outcome before trying, illustrating how math’s power to abstract reality invites greater understanding of our most concrete human complexities and our deepest yearnings.

Complement it with a fascinating look at what troves of online dating data reveal about being extraordinary, Dan Savage on the myth of “The One,” and Adrienne Rich on how relationships define our truths.