From Love to Logic: How Algorithms Decide Our Matches
Explore the Gale-Shapley Algorithm and the Stable Matching Problem. Learn how algorithms create stable pairings, not just perfect matches.
Explore the Gale-Shapley Algorithm and the Stable Matching Problem. Learn how algorithms create stable pairings, not just perfect matches.
The sun dipped low over the bustling City of Königsberg, casting golden reflections over the Pregel River. Its waters divided the town into four distinct land masses, connected by seven foot-bridges that had become a curious point of both pride and frustration for its residents. By day, the bridges bustled with merchants and townsfolk, but as the evenings drew in, they became the source of a mysterious puzzle. Could someone, starting from any point on land, cross each of the seven bridges exactly once and return to where they began? It may sound simple, almost trivial, yet no matter how the townspeople tried, no one could find a solution.
Let’s face it: that report you worked on — nobody’s actually going to read it.
In the best-case scenario, people might skim through it, pausing briefly under the allure of a brightly-coloured diagram.
But if you’ve designed your diagrams properly, a brief glance is all someone should need to understand what the data is saying — at least at a high level.
Alan Turing, a pioneering figure in the world of Computer Science, is often celebrated for his work on breaking the Enigma code during World War II. However, one of his lesser-known achievements is creating one of the first chess algorithms — a small yet significant early step in the development of artificial intelligence systems.
Prime numbers are among the most intriguing puzzles in mathematics — seemingly random yet deeply significant.
Their elusive pattern defies easy detection, making them both a source of fascination and frustration. The challenge grows exponentially with larger numbers, where determining if a number is prime becomes immensely time-consuming.
However, some clever shortcuts can speed up the search and help us swiftly eliminate impostors.
Have you ever climbed a staircase that just didn’t seem to be made for human legs?
The steps are too small to comfortably take one at a time, but too large for an easy double-stair.
You either end up shuffling along with baby-steps, or stretching so far that it feels like you’re trying out for the gymnastics team.
Suppose you’ve just been hired as the new manager of Hilbert’s Infinite Hotel.
On your first day, you arrive at work only to be greeted by an infinitely long line of people in the lobby each expecting a room.
The Problem? All of the infinite number of rooms are already occupied by an infinite number of guests. The Infinite Hotel is full.
You’ve probably seen this puzzle before.
You could probably solve it without too much hassle.
But let’s ask a more interesting question…
What is the fewest number of moves required to solve the puzzle?
Can we prove we’re correct?
Luckily, studying for a degree in mathematics is very different from high school.
Math class didn’t exactly get the best reputation in school — and I can see why. It tells students to learn about seemingly pointless techniques and memorise different formulas that 99% of them will never use again… unless they go on to become math teachers.
Things change, however, when you decide to study maths at a higher level.
This is exciting! We’re nearly ready to start simulating a whole game of Chess. There’s just a few more components we need.
To begin, let’s first consider what information we need to encode to fully describe a move.
In standard chess move notation, we are given only the type of piece, and it’s new location. E.g. Ne2 which indicates that a knight should be moved to the square e2.