Thursday, 12 February 2015

Mathematics of Love

Valentine's Day is this Saturday. Apropos of this, I recently ran across an article by the science writer Hannah Fry; she discusses the mathematician Peter Backus, who estimated his chances of finding a girlfriend at 1 in 285,000.

There's a lot of maths needed to get these arrows on target.
Source: ClipArtLord
The method was quite simple. Backus wanted to compute the number of potential girlfriends in his home city of London. His criteria, and their associated probabilities, are as follows:

  • Female: 0.51
  • Within five years of his own age: 0.2
  • Single: 0.5
  • Has a university degree: 0.26
  • Is attractive: 0.05
  • Finds Backus attractive: 0.05
  • Get along well together: 0.1

Multiplying these probabilities together, we have (0.51 x 0.2 x 0.5 x 0.26 x 0.05 x 0.05 x 0.1) = 0.000003315 = 1/302,000. This is slightly worse than the 1/285,000 Backus claims. (He may have fallen victim to rounding error; always check your working.) Anyway, the exact figure doesn't matter; under these assumptions, the chances are very poor, with only about 30 women in the whole of London who would go out with Backus.

If you read Backus' original paper from 2010, it is clear he meant this as a light-hearted exercise, not to be taken seriously. As ever, the media failed to get the joke. His article triggered breathless reporting along the lines of, "Maths boffin finds formula for love." (Backus himself has since got married.)

This story has something for everyone. The happily partnered can feel smug at heroically overcoming the odds. The single and unhappily partnered can console themselves, thinking science says it's not their fault. The cruel can laugh at the inability of this nerdy mathematician to get a date. All of them can enjoy the narrative that those wacky scientists are always coming up with an equation for something or other. (The "equations for the worst Monday" and the like are not science and I find them profoundly annoying, but that's a topic for another blog post.)

In the 2011 census, 35% of the UK population aged 16 and over were "never married". The other 65% were married, divorced, or widowed. Two thirds of us have, at one time or another, felt sufficiently in love to walk down the aisle. This doesn't square with a 1 in 285,000 chance of finding a satisfactory partner. I feel stupendously lucky that I met my wife, and maybe I did beat the odds, but statistically that can't be true for every married person in the world. What's going on here?

Fry suggests Backus was merely being too pessimistic. She has a point; if we chose 100 women of the right age group at random, it seems unreasonably picky for Backus to rule out 95 of them on appearance alone. Similarly, Backus is a fairly ordinary-looking fellow, so it seems unlikely 95% of women would reject him on sight. Fry adjusts the probabilities upward, and obtains a better chance of 1 in 9615.

However, I think both Fry and Backus are asking the wrong question.

You can't personally evaluate millions of potential romantic partners. Suppose you go to a concert -- rock, jazz, light opera, death metal, whatever your genre of choice may be. There are 100 individuals of your preferred gender and age group, any of whom you could meet in the bar after the show.

Let's say you have three hours to interact with potential partners. Are you going to systematically spend 1 minute and 48 seconds on each one, without a moment's diversion to buy a drink, visit the toilet or talk to your friends? Obviously not.

You can narrow it down by approaching those you find attractive who aren't obviously partnered; if the chances of that are 20% and 50% respectively, you still have 10 individuals. Are you going to identify them and spend 18 minutes conversing with each one? Again, no; you'd be doing well to talk to two or three. The other seven wander off into the night, never to encounter you again. Maybe one of them was your ideal partner, who knows?

If you're going to go out with someone, at some point you need to talk to them, so you can both work out if you want a relationship together. That takes time and effort. Let's refer to this as a "first date".

How many first dates can you realistically have? If you're actively looking for a partner, let's say it's between 5 and 50 a year. Suppose you spend 10 years of your life in this search, after subtracting time when you are in a relationship, too busy, or otherwise not available. Then you have somewhere between 50 and 500 "first dates". If you are to find a long-term partner, he or she must be one of them.

If you live on the Isle of Arran (population 5000) and refuse to leave, in principle you could date the entire resident population of your preferred gender and age group. In the old days, this is how it worked for most people. Your village had at most a few hundred people, and you would have known the possible romantic partners for your entire life. To get married, you would have to choose and be chosen by one of them -- with a greater or lesser amount of input from your respective families.

In a modern city such as London, there are many more candidates than you could ever interact with. The good thing about that is, you can try to maximize your likely compatibility with your pool of first dates. This could be done formally (dating services), or informally (joining clubs, introductions from friends). At the same time, each dating partner has criteria of his or her own, and knows he or she can only evaluate a limited number of people.

There are no guarantees, but in the end it seems to work out for most people. I have gone hitchhiking a few times, and meeting someone to go out with is not so different. All you can do is get out there, make yourself visible, and try not to look like a psychopath; the rest is luck.

Now, let's consider a science fiction scenario which is close to being technologically feasible. More and more of our social interaction is moving online. Imagine a company such as Facebook decided to mine its available data, and create a Romantic Compatibility Engine. It has, literally, billions of couples to examine. It can chart their relationships from start to finish, until death or breakup do them part, then apply that knowledge to work out which potential couples are most compatible.

With sufficiently sophisticated artificial intelligence, it could become eerily accurate. The machines really could evaluate four million women in London, and choose the optimal girlfriend for Peter Backus. One day, it might come to pass; I would be very surprised if Facebook was not trying to develop something like it. It might even increase the sum of human happiness, which is more than can be said for some of Facebook's other algorithms.

Personally, I am happy to leave some room for serendipity. I spent Valentine's Day 2002 on my own, grumpily watching a video (as I recall, I rented Chasing Amy). A week later I went on a trip to the Isle of Skye with some friends, and the rest is history.

Enjoy Valentine's Day, whatever you do with it. Enriching florists and chocolatiers is not obligatory, watching videos is good too.

I'll conclude with a link to Tim Minchin's excellent (and statistically accurate) love song, "If I Didn't Have You":

Thanks to Katherine and Patrick for the online discussion which sparked this off.


  1. Good post - at the risk of taking the formula rather more seriously than its author intended, an obvious problem, now I think about it, is that if you follow its logic, the number of people who meet the first five criteria are so few and far between that he cannot possibly have met enough such people to have any way of accurately estimating the probability of people meeting those criteria also meeting the last two.

    As to the AI, many moons ago I signed up to a dating site that asked a series of questions and purported to find my 'best match' in the local area. As it turned out, she was rather familiar... What was more disturbing was that if I widened the search to the nearest 200 miles, the result did not change.

    1. Thanks, and good point. Although it depends to some extent on the efficiency of his search. At (say) an event for postgraduate students, the age and education criteria are already met. OTOH if he has reasonably conventional standards for attractiveness, and only ever talks to the top 5%, such people can afford to be choosy so that might have skewed his results.

      I think AI has come on a bit since the old days. Size of training data set and candidate pool matters as well, I think on both counts Facebook is orders of magnitude bigger than that dating site. FB also has the advantage of being able to follow couples' interactions during and after their relationships, which a site purely devoted to dating would find much harder.