Are you looking for love? Then in today's world you're almost certainly looking for love online. Dating websites and apps are now a common way to look for a hook-up as well as for a life partner, rather than just relying on our social circles in the physical world.

A frog

Who is your prince(ss)?

Dating apps rely on mathematics to link you up with potential dates — whether it's by shared interests based on surveys, compatibility based on personality tests, proximity or even automatic profiling produced from your use of social media. But some of these services wear their maths more proudly on their sleeves than others: OkCupid was started by four maths students from Harvard in 2004 and has the sales pitch "we use maths to find you dates".

OKCupid's matching algorithm relies on users answering multiple-choice questions that vary from "Did you delete Facebook?" to "Do you want to have children?" Users can answer as many questions as they want, and for each they also record how they'd like their potential match to answer. The user also indicates how important each question is to them personally: from irrelevant to mandatory.

If you're one of those users then each of your potential dates is given a percentage score based on how they answered the questions you have in common. The importance you give each question changes the weight of that question in the calculations: your rating of a question's importance decides how many points that question will contribute to your potential match's score. Similarly, you are also given a score that rates you from a potential match's point of view.

What's your score?

To make it easy to see how the scores are allocated, we'll follow the example Christian Rudder, one of the founders of OkCupid, used in his explanation of the algorithm. Suppose you and your potential love, call them X, have just two questions in common: "How messy are you?" and "Do you like to be the centre of attention?". Here is how you both answered:

Messy?Answer you will accept from the otherImportance of question
YouNot at allNot at allVery important
XNot at allAverageA little important
Centre of attention?Answer you will accept from the otherImportance of question
YouNoNoA little
XYesNoSomewhat important

The following table shows how many points a questions scores depending on how important you rated it:

Irrelevant0
A little important 1
Somewhat important 10
Very important 50
Mandatory250

From this we see that for the first question X scores 50/50 in your eyes (they gave the answer you wanted to a question you rated as very important) and you scored 0/1 points in their eyes (you didn't give the answer they wanted to a question they rated a little important). Similarly, for the second question X scores 0/1 in your eyes and you scored 10/10 points in their eyes. Combining these scores, X scores 50/51 or 98% in your eyes, and you scored 10/11 or 91% in their eyes. You can see how this procedure works if you and X have more than two questions in common.

Do you match?

The final step of the algorithm, calculating the match percentage, is to combine the score your potential match has in your eyes and the score you have in your potential match’s eyes in a type of average. But rather than the most familiar average — where we add $n$ things up and then divide the answer by $n$, called the arithmetic mean — the algorithm uses something like the geometric mean — taking the $nth$ root of a product of $n$ numbers. Geometric means are particularly useful when the quantities you are averaging might be quite different, perhaps even measuring different properties.

The match percentage is based on the scores you each gave each other based on the $n$ questions you both answered. These scores are multiplied and the $nth$ root is taken of the product. If you have two questions in common, with scores of 98% for your potential match and 91% for you, the match percentage is given by

  \[ \sqrt{0.98 \times 0.91} \approx 0.94, \]    

which translates to 94%.

If your satisfaction scores were based on three questions, we would instead have taken the cube root and your match percentage would have been:

  \[ \sqrt[3]{0.98 \times 0.91} \approx 0.96, \]    

which translates to 96%.

We’d have taken the fourth root if you’d had four questions in common:

  \[ \sqrt[4]{0.98 \times 0.91} \approx 0.97, \]    

which translates to 97%.

The nature of this mathematical operation ensures that the more questions you answer — the higher the value of $n$ in the $nth$ root — the higher your match percentage will be.

The site then uses the match percentage to suggest potential dates: the higher your match percentage with a person, the higher up your profile will appear in their results and their profile in yours.

The match percentage in OKCupid is calculated only for the questions that you and your potential date both answered. So it's worth answering a bunch of questions — the more you answer the wider your pool of questions, increasing the chance that you will have questions in common with other users.

In 2012 a maths PhD student, Chris McKinlay, famously "hacked" the OkCupid algorithm. He didn't hack into their machines, instead he applied his maths skills to the process of choosing which questions to answer (and he answered these honestly), and what importance to give them, to increase his match percentages dramatically. He went from just 100 matches over 90%, to being the top match for more than 30,000 women. This didn't automatically make these matches successful relationships, it just meant he got a chance to be higher in other people's results and get that, up until that point, elusive first date. It took 88 of these first dates to meet his true love, and they were engaged by the time the story hit the press in 2014. Reader, he married them.


About this article

Book cover

This article is based on a chapter from the new book Understanding numbers by the Plus Editors Rachel Thomas and Marianne Freiberger. The book will be published on April 11, 2019!

Read more about...