I have always lived my life by logic. As a teenager, I fought with my sister over the optimal route home from school. So it was inevitable I’d think about applying the same rationale to finding the perfect route to love, too.

Throughout my 20s I joked with my friends about using maths to optimise my dating strategy and find the perfect partner. Surely, I argued, there had to be a more scientifically robust way of meeting ‘the one’ than striking up a conversation with a random stranger at a party?

Having thoroughly analysed the mathematics online dating when I was looking for love, paradoxically I didn’t end up using them but instead met my husband on an old-fashioned blind date when I was 28 (as the result of another mathematical theory I was testing). But we did use mathematical modelling to create the table plan for our wedding.

Since then, I’ve always used little mathematical tricks to help my life and my relationship run smoothly, from divvying up household chores to brokering peace between our two girls, aged five and three, when they bicker. My husband and I even used a mathematical equation to work out where we should live.

Hannah Fry (pictured) met her husband when she was testing out a mathematical theory. The UK-based mathematician says that maths is the study of patterns and love

My friends and family occasionally think me crazy, but I love using numbers, statistics and data as a way of storytelling and shedding light on the world. After studying maths and theoretical physics at university, followed by a PhD in fluid dynamics, I became a lecturer and ultimately a maths professor at University College London.

My big breakthrough happened when I was catapulted from academic to TV presenter. I had decided to spice up my 29th year with a challenge, and work according to a ‘regret minimisation model’.

Essentially, I would spend 12 months saying ‘yes’ to every offer just to see what direction that would take me in. Every time I was offered a choice or an opportunity, I’d think ahead to the future version of me and picture the path I’d least regret taking, then say ‘yes’ to anything which didn’t seem disastrous.

I love this model because, whatever happens, in the end you can be confident you made the right decision in the moment. So, I said ‘yes’ to a blind date with the man I went on to marry; I said ‘yes’ to trying stand-up comedy; and ‘yes’ to the whole raft of TV work that followed. The maths certainly worked for me!

Hannah says her friends and family occasionally think her crazy, but she loves using numbers, statistics and data as a way of storytelling and shedding light on the world

In the past eight years I’ve fronted numerous TV and radio shows and this month saw the start of an exciting new TV series, The Secret Genius Of Modern Life, which aims to demystify the amazingly intricate science behind everyday household objects.

Although it was never a serious focus of my research, I remain endlessly fascinated by the mathematics of love. Maths is the study of patterns, and love, like so many aspects of life, is full of patterns: from the number of sexual partners we have in our lifetime to the people we choose to message on an internet dating website.

These patterns twist and turn, warp and evolve just as relationships do. If you can recognise them, you can use them to boost your love life. Here’s my guide to cracking the love code…

FIRST, FIND LOVE

When posting an online dating profile picture, the maths suggests you should never try to hide your quirks or flaws. Statistics show it’s not the exceptionally good-looking people who get bombarded with messages. It’s the people who divide opinions regarding their looks who end up being considerably more popular. Perhaps because people who stumble on their profiles imagine they’re getting less attention than they are.

Want to get him to empty the dishwasher? Use a maths game called The Prisoner’s Dilemma

TIP: When choosing your profile picture, play up whatever features make you different (don’t cover tattoos, hide a protruding nose or dress conservatively if you’re usually flamboyant). You’ll be more successful if some people find you unattractive than if everyone thinks you look great.

Make the first move

When you’re looking for love, don’t wait to be approached by someone you fancy. It makes mathematical sense to do quite a bit of the running yourself, even though you risk a series of rejections. If you wait for potential suitors to talk to you, there’s a greater chance you’ll be approached by the least preferable person.

TIP: If you set your sights on the second most attractive person in the room (ignoring the stunning one, obviously) and work your way through the others in descending order of perceived attractiveness, you should end up with the best viable option who accepts your advances.

First, work out your ‘dating window’. You can apply this at any age but if you’re starting to date at 40, say, and you’d like to settle down again by 50, then your window is ten years

How to know when you’ve met ‘the one’

This is complex but it will give you the best chance, mathematically, of finding the right partner for you. Here’s how it works. According to something called ‘optimal stopping theory’, if over your dating lifetime you go out with ten people, you are most likely to find ‘the one’ after you reject the first four, or the first 37 per cent of those you encounter.

Or, if you’re likely to go out with more partners — let’s say 20 — it’s a good idea to keep moving on through the first eight people, which also equates to 37 per cent, and settle down with the next person who is better than any of them.

The problem here, of course, is that you can’t predict the number you’ll go out with. If you could see all ten or 20 lined up, it would be easy to work out which was the best! So instead you have to gamble, but with the odds tilted in your favour by maths.

First, work out your ‘dating window’. You can apply this at any age but if you’re starting to date at 40, say, and you’d like to settle down again by 50, then your window is ten years. Now apply the magic 37 per cent — you’re going to date and have fun with the people you meet in the first 37 per cent of your window, but ultimately you’re going to reject them all. That takes you to the age of 43.7, or 44, which is when you emerge from your ‘rejection phase’.

Having engaged in your brutal culling of that 37 per cent, you’ve got a very good one in three chance of finding your perfect match in the people you date next. Here comes the crucial bit: the next person who comes along who is better than all those you’ve rejected is ‘the one’ to settle for — or at least the one most mathematically likely to be your match.

Maths can only get you so far. Finding true love is 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

The reason this works is all to do with a magic mathematical constant called ‘e’. Mathematicians apply it to all sorts of problems requiring you to select the best candidate from a random pool. Yes, there are flaws in it. If you meet the perfect partner early in your dating window, ‘optimal stopping theory’ would demand you dump them… and if no subsequent relationship matches up, you could potentially end up alone.

TIP: Maths can only get you so far. Finding true love is 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.

… AND THEN KEEP IT ALIVE!

Relationship experts have shown that by observing the way couples interact, they can predict — with a staggering 90 per cent accuracy — their risk of divorce.

The key lies in your propensity to descend into what they call ‘spirals of negativity’.

### Why men always exaggerate the number of sexual partners they’ve had

A famous Swedish model established an accepted ‘average’ for sexual partners for heterosexual women of seven, and 13 for heterosexual men. But, clearly, those numbers don’t add up. If there are roughly the same number of heterosexual men and women in the world, you would expect the average number of partners for both to be roughly similar.

Deliciously, there is maths to explain this discrepancy. Women tend to count by listing their partners by name (they ‘enumerate’). Although this is usually accurate, it’s easy to forget one (or two), which explains why women are prone to underestimating. Men, on the other hand, are much more likely to tot up partners in random groupings (they ‘estimate’ — for example: ‘five a year for the past four years’), which makes them more likely to overestimate.

TIP: It’s a bad idea to get hung up about the number of notches on a partner’s bedpost because, even if you’re both trying to be honest, neither of your figures is likely to be true.

These are all about how you act when you’re speaking to your partner and, fascinatingly (for me and other nerds like me), there is a set of mathematical equations which measure how each partner does it.

Here’s the formula for how positive or negative a wife might be in the next thing she says in the course of a conversation with her husband:

Wt+1 = a + r1Wt + IHW (Ht)

So, the wife’s reaction (Wt+1) depends on her general mood ‘a’, how she feels about her husband (r1Wt) and her husband’s influence on her (IHW) including his most recent comment or action (Ht). And there’s a comparable equation for the husband.

The critical figure is represented by Wt+1 — the higher it is, the greater the likelihood of divorce. If the maths seems complicated (it is!), don’t worry. What it essentially shows is how negative moods and negative actions, like checking your phone while they’re speaking or interrupting your partner, can slowly kill relationships.

When relationship experts follow the formula closely, they can clearly see the point at which one partner’s negativity changes the other partner’s mood, triggering a negative response and potentially creating the negative spirals which are so often the portents of relationship doom.

TIP: If you want to stop those negative spirals, which you do, the equation shows that one of you has to act promptly to lift the tone.

That might be agreeing with the last point he has made (or at least trying to) or injecting a little humour, for example.

Small actions such as these often have a sufficiently positive impact on your partner to make them respond in a positive way too, thus averting the disaster of a hideous argument.

Why warring couples are in an ‘arms race’

What happens if one partner causes the other to lose their cool completely in a row? This is known as the ‘negativity threshold’ and it turns out it’s important in understanding how relationships break down. Interestingly, similar equations have been shown to explain successfully what occurs between two countries during an arms race.

It might be logical to assume that the good relationships are those where one, or both, partners are extremely tolerant, blindly in love, or rarely triggered by each other’s less than lovable habits. In other words, they have a high negativity threshold.

Surely, you would think, good relationships are all about compromise and understanding, giving each other plenty of room and only getting stroppy if something becomes a big deal? But no. The maths says otherwise.

It turns out the most successful relationships are actually the ones with a low ‘negativity threshold’. That means both of you are honest about the things that annoy you and try to resolve them in a mature way when they happen.

TIP: The key to long-term happiness lies not in biting your tongue when your partner winds you up, but in explaining how you feel when annoyed.

Simply ‘forget’ to empty the dishwasher too (just once), make after-work plans without telling them, or suggest making charitable donations instead of buying each other Christmas presents this year

This allows you to repair all those tiny problems that occur in a relationship and stops little daily grievances from becoming big, fatal flaws. I love the fact there’s mathematical evidence to show you should never let the sun go down on an argument.

Stop being a doormat with equations

If your partner starts behaving badly — perhaps they ‘forget’ to empty the dishwasher or omit to say they won’t be back for dinner or buy you a rubbish present — you find yourself at a crossroads. On the one hand, you don’t want to be walked over but neither do you want to cause a huge row over a small issue.

One option is to apply the principles of a mathematical game called The Prisoner’s Dilemma. In this cut-throat model, both parties treat the other as an adversary.

There are a series of complex mathematical equations to explain this strategy but, most simply, it involves adjusting your behaviour to match your partner’s (in other words, you do to them what they just did to you). If they ‘co-­operate’ with you (empty the dishwasher), you co-operate too. If they ‘defect’ (don’t empty the dishwasher), you respond in kind.

TIP: Simply ‘forget’ to empty the dishwasher too (just once), make after-work plans without telling them, or suggest making charitable donations instead of buying each other Christmas presents this year. One small act, then every­thing else continues as normal.

It’s a ‘tit for tat’ trade which resets the relationship balance without starting a huge quarrel. The key is to be able to move on quickly and return to being co-operative and working as a team.

These are the rules:

1. Be clear. Don’t play games within the game. Being manipulative or tricky won’t work out in the long run.

2. Be nice. Continue to be co-operative unless given reason to act otherwise.

3. Be provokable. Don’t allow yourself to be exploited by bad behaviour. If someone treats you badly, you should retaliate with a measured response. But don’t go overboard. As soon as a bad deed has been dealt with, you should then…

4. Be forgiving. Move on from bad behaviour quickly and return to being co-operative. You have nothing to gain from continually punishing someone for a single mistake.

Use game theory to divide chores

If you, or your children, are arguing over who is going to have the last slice of cake or pizza, try agreeing that one person cuts it in half and the other person gets to choose which half they want. This is what you’re supposed to do according to ‘game theory’ and it heightens the incentive of the person doing the cutting to make the cut as fair as possible.

TIP: You can apply ‘game theory’ to the challenge of dividing up household chores: one of you puts the list into two separate columns in such a way that they don’t mind which column they’re allocated, and the other gets first choice of column.

• Hannah Fry’s The Secret Genius Of Modern Life is on BBC2.