Member-only story

The Mathematics of Love

randerson112358
9 min readOct 1, 2017

--

A mathematical approach to finding a companion, what math and data can teach us about relationships.

Finding a companion for love, can be difficult, but luckily there are methods and algorithms that you can use to optimize your chances of success. In this article I will mention a few of the algorithms you can use and questions you can ask to improve your chances of a long term successful relationship. These algorithms and questions come from mathematics, statistics and data sets that have been collected from successful relationships. Let us get started to optimizing your chances of finding that special someone.

Gale-Shapley Stable Marriage /Matching Algorithm

What this love algorithm is suggesting is that whoever does the asking (and is willing to face rejection until receiving the best available option) is better off. Meanwhile, the person who waits for advances settles for their last option. Let’s take a look at this algorithm in action below.

function stableMatching {
Initialize all m ∈ M and w ∈ W to free
whilefree man m who still has a woman w to propose to {
w = first woman on m's list to whom m has not yet proposed
if w is free
(m, w) become engaged
else some pair (m', w) already exists
if w prefers m to m'
m' becomes free
(m, w) become engaged
else
(m', w) remain engaged
}
}

Setup

We would like to match 4 pairs of boys and girls.

Boy List Of Preferred Girl:

Boy0 List : Girl0, Girl1, Girl2, Girl3
Boy1 List: Girl1, Girl2, Girl3, Girl0
Boy2 List: Girl2, Girl3, Girl0, Girl1
Boy3 List: Girl3, Girl0, Girl1, Girl2

Girl List Of Preferred Boy:

Girl0 List: Boy0, Boy1, Boy2, Boy3
Girl1 List: Boy1, Boy2, Boy3, Boy0
Girl2 List: Boy2, Boy3, Boy0, Boy1
Girl3 List: Boy3, Boy0, Boy1, Boy2

Verbose Results

1: Round 1
2: Boy0 prefers Girl0
3: Girl0 is previously unmatched
4: Boy0 becomes…

--

--

No responses yet

Write a response