{"id":146,"date":"2022-02-14T09:00:00","date_gmt":"2022-02-14T09:00:00","guid":{"rendered":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/danielle-notice\/?p=146"},"modified":"2024-03-10T16:46:04","modified_gmt":"2024-03-10T16:46:04","slug":"a-new-reality-tv-show-idea-the-stable-marriage-algorithm","status":"publish","type":"post","link":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/danielle-notice\/2022\/02\/14\/a-new-reality-tv-show-idea-the-stable-marriage-algorithm\/","title":{"rendered":"A new reality TV show idea: the Stable Marriage algorithm"},"content":{"rendered":"Reading Time: <\/span> 3<\/span> minutes<\/span><\/span>\n

As a hopeful romantic, a believer in the principle of marriage and a lover of dating reality TV, I was immediately intrigued by this problem and solution. So to celebrate Valentine’s Day I thought it would be fitting to look at the stable marriage problem.<\/p>\n\n\n\n

1. The Premise<\/h2>\n\n\n\n

Consider two disjoint sets with the same number of elements (for example a group of n<\/em> men and a group of n <\/em>women). A matching<\/strong> is a one-to-one mapping from one set onto the other (a set of n<\/em> monogamous marriages between the men and women). Each man has an order of preference for the women and each woman an order of preference for the men.<\/p>\n\n\n\n

A matching is unstable<\/strong> if there exists a possible pairing of a man and a woman (not currently married) that both prefer each other to their spouses. For example, Johnny is married to Bao but prefers Myrla and Myrla is married to Gil but prefers Johnny (IYKYK). Whereas this would making for entertaining TV, the stable marriage problem is to find a matching that avoids this situation.<\/p>\n\n\n\n

2. The Pitch<\/h2>\n\n\n\n

Firstly, it is always possible to find a stable matching in this situation. One possible way to find a solution is the Gale-Shapley algorithm:<\/p>\n\n\n\n

\n
\n

First Round<\/strong><\/p>\n\n\n\n