Did you know that math can help you find your soulmate? This math expert did just that.

Chris McKinlay, a 35-year-old with a PhD in Math, like a lot of people today was looking for his perfect match through an online dating site. OkCupid works by asking people a series of questions about their personality then matching similar people with similar answers using an algorithm.

McKinlay set up 12 fake OkCupid accounts and a built a computer program to harvest data from female members who fitted his target profile.

The fake profiles “bots” automatically visited the profiles of women aged between 25 and 45 in the LA area and gathered their personal data and answers to OkCupid’s survey questions.

McKinlay trained his bots to act human, mirroring the typing speed and click rate of a human user, after OkCupid started to shut down his fake accounts.

He had gone from having a 90% “match” with a few hundred women, according to OkCupid, to having a 90% or higher match with 30,000 women.

The breakthrough came via the use of an algorithm, K-Modes, originally developed to analyse soybean crops.

McKinlay used this to sort the 20,000 women into seven clusters of different personality types – and found there was two, one full of mid-twenties arty types and one full of slightly older professional creative women, that were just right.

Now he could

a) Create TWO OkCupid profiles targeted at each group, using text-mining

b) Answer the 500 most popular survey questions among his two favorite groups.

Of course, he had to go on dates and managed 55 of them in one summer.But on his 88th date he went out with Christine Tien Wang. They hit it off and they are now engaged.

McKinlay tells Wired: “I think that what I did is just a slightly more algorithmic, large-scale, and machine-learning-based version of what everyone does on the site.”

Chris also wrote a book on his love equation.