I made a statistical game out of dating: could I crack the formula for love?

Alpha job + beta husband = my future sorted. What could possibly go wrong?

I am a math nerd. A maths nerd, my partner corrects me, because we live in London now. Fine. I love puzzles and formulae and bullet-pointed plans. Ive spent many a winter morning with a steaming cup of tea and an Excel file. I dont often make major forecasting errors, but Im in the middle of my lifes biggest miscalculation.

Until I was eight, in 1987, I lived in Isfahan, Iran, in a big, warm family of science and maths types. I had a bike and a best friend and my own calculator. I loved a boy named Ali Mansouri. But then my mother was jailed for converting to Christianity and, when she was temporarily released, we had to escape Iran. Before you could calculate the probability of losing every toy and friend and photo, it was gone, favourite calculator and all. We were in a refugee hostel in Dubai and then in Rome. And then two years had passed and I was the foreign kid in early 1990s Oklahoma. Every subject was foreign to me: English, Oklahoma history, the topography of who knows what. But one subject hadnt changed; in fact, in this one area, I was ahead of everyone else. In maths, I shone. I could do a sheet of 100 multiplications in less than a minute.

At 12, when I started to feel our poverty, I asked my mother how much money an average person needed not to stay awake all night, punching my calculator. She said, flatly, \$5,000 a month. Sixty thousand a year, I thought. I went to a library and looked at average income levels. I learned that to make that much right out of college, I had to get into an east coast university (I had yet to learn about the regional cost of living). Screw this life, I thought. Im going to live comfortably. I had the grades, but back then it wasnt so marketable to be an Iranian refugee: even trying felt like a risk.

The university guides said I needed sports. I needed a national championship. I calculated the probability of winning trophies in the sports I loved: tennis and swimming. Other girls loved those, too. Wealthy Oklahoma suburbs were teeming with country-club girls who had way more practice and nicer rackets than me. I needed a sport that bent to my juvenile analytics: a sport with trophies handed out by weight levels, age levels, belt levels. A sport that didnt attract rich girls with trainers. So I signed up for taekwondo.

I dropped 20lb, put in five hours of practice a day alongside the boys. I counted calories, fat grams, the hours on the Stairmaster. At 13% body fat, I stopped menstruating and won a national championship.

At Princeton, I decided to find a boyfriend. I had never had one, never been kissed, never had sex. I made a secret chart of the boys I knew. I quickly threw it away, ashamed of myself. I hated the entitled rich boys. I didnt want another financial aid kid the probability of poverty was too high. I was planning to go into finance or consulting, so I joined a business organisation and met an awkward boy with a kind heart who loved my OCD and the way I counted on my fingers. He wasnt hungry like me; he was enjoying his life. So I gave him some of my hunger, that missing ingredient, and he thrived. We married and bought a canal house in Amsterdam. He grew handsome and ambitious. He had rows of wooden shoe racks and the most beautiful suits.

I followed the numbers to New York, to McKinsey & Co, and he came, too. My life was perfect on paper, an immigrant girls fantasy: the midtown consulting job, the apartment, the husband. We made way more than \$5,000 a month. In one of our earliest photos, were both in Brooks Brothers trench coats, leaning on a Princeton umbrella and sporting his-and-hers corporate haircuts. A friend said, Thats the yuppiest thing Ive ever seen. Then I went to Harvard Business School; we made a plan for our lives. He would have the low-beta career and I the high-beta (beta being the finance term for risk and potential reward). We actually did the maths for this.

Through the years, Ive had periods when something snaps. When I turn deaf to the data and do something crazy, because I crave joy, creativity, a jolt. It happens every decade or so. In 2011, it happened. I became a writer. We divorced.

I moved back to New York and made a statistical game out of dating. I downloaded a few dating apps and quickly figured out which had the best men: the best apps centred on photos. After all, I had undergone enough institutional brainwashing to be able to weed out, from a few snaps, the cultured, educated ones from the ones who were faking. I learned that a hat means hes bald, no smile means bad teeth, grainy pictures means lying about age. From photos, I could figure out their travel smarts, their creativity, insularity, intelligence level, and even education and political bent. Believe it or not, something as simple as a baseball cap, choice of sunglasses or favourite sport is enough accurately to differentiate (on an aggregate level, at least) a midwestern Republican bible-thumper on a two-year work stint in New York from a pro-choice, dual citizen who makes his own bechamel sauce and reads Sebald.

In two years, I had many high-quality boyfriends, ones who scored well by every known metric. And, as predicted by my personal algorithm, I went on roughly 12 dates per eventual boyfriend. Once, I segmented the population of Iranian-American men into four categories and devised a plan to date one from each kind. The experiment effortlessly settled the question: Should you be with an Iranian? The answer was no.

As a rule, I wasted no time. I had a tight schedule. I had many pretty dresses. I kept my body fat next to nothing. Sometimes, I accompanied friends to freeze their eggs. I considered it, but in the end I believed in my eggs. Throughout all this, I found my way into a decent writing career. At 35, I had it together again.

Then, out of nowhere, chaos.

***

I met Sam, not on a Tinder date, but at a writers colony. He was English, divorced, 39, jobless. His shirts were full of holes. He hadnt cut his hair in six months and washed it maybe every two weeks; it was a crazy curly mess that reminded me of Sideshow Bob from the Simpsons. Back in New York, I was dating a handsome Mexican businessman who fit all the criteria. A low-beta career, love of travel, a sense of humour. But, suddenly, I found myself falling for the unwashed writer, and I was confused. I actually remember thinking, If I date him, theres an 80% chance Ill get a weird infection.

Over many meals, I learned that Sam had spent the last year wandering from residency to residency, writing a novel about a Vichy demographer so devoted to his work that he didnt stop to think maybe he shouldnt be calculating census numbers for the Nazis. Now, he was on trial for crimes against humanity.

So youre claiming that he did it mostly for the love of the census? I said.

Right, Sam said. Culpability is a complex thing.

I think hes guilty, I said, surprising myself. Maths is just a tool. You have to care about the thing youre calculating.

Silently, I did the forecasts on Sam: he wouldnt make a dime for years. But I loved his novel. He lent me The Reader. He lent me Stoner. We walked in the woods. I stopped crunching the numbers. Slowly, I fell for his distractedness, his wandering, the life he had scattered in three storage spaces. He loved my OCD and the way I counted on my fingers. He called me Rain Man.

How much do you love me? I asked.

Theres beggary in the love that can be reckoned, he said.

Screw that, I thought. Everything can be measured, even love. If it was a job, Id be amazing at it. I should be a yenta.

Sometimes, Sam watched me do puzzles. He read me short stories as I slept.

Then, at some point between a history in French demography and a night with the works of Annie Dillard, my once-a-decade insanity came early and I got pregnant.

Soon, every sphere of my life, once neatly rolled skeins arranged in a basket, unravelled into one big tangled mess. Early in the summer, early in our relationship and also in our pregnancy, Sam and I decided to leave New York and start over. Lets wander! we said, delirious with our news, with our brand new romance, each of us seeing in the other a strange twist on the qualities we had always chased in others.