Pillar 6: Algorithms
The step-by-step recipes behind your search results, your feed, and your elections
October 23, 2026
Part 6 of 8 in a series on the eight "pillars" of useful math in Ted Dintersmith's book Aftermath: The Life-Changing Math That Schools Won't Teach You (2026). The framework is his; the explanations and practice problems are written for Math Thinking Coach. Read the series introduction.
An algorithm is a precise list of steps that solves a problem. Long division is an algorithm. So is the code that decides what shows up next in your social media feed. You don't need to write code to benefit from thinking algorithmically: asking what steps a process follows, and what it is trying to achieve.
Halving: the power of binary search
I'm thinking of a whole number from 1 to 1,000. You guess, and I say "higher" or "lower." What's your strategy?
Always guess the middle of the remaining range. Each answer cuts the possibilities in half: 1,000 → 500 → 250 → 125, and so on. Since 2¹⁰ = 1,024, you'll always find the number in 10 guesses or fewer.
Here's the remarkable part: doubling the range adds only one more guess. A sorted list of a billion items can be searched in about 30 steps, because 2³⁰ is just over a billion. That's a big reason computers can search enormous databases almost instantly.

What is the algorithm trying to do?
Recommendation algorithms on streaming services and social media, examples Dintersmith highlights, work roughly like this: find people whose past choices resemble yours, and show you what they liked. The key question is what the algorithm is optimizing. A feed tuned to keep you scrolling is not the same as a feed tuned to keep you informed. The math is neutral; the goal someone chose for it isn't.
Voting is an algorithm
An election takes a stack of ballots and runs a counting procedure. Change the procedure and you can change the winner, with the very same ballots. Dintersmith includes voting methods in this pillar, and it's easy to see why.
Imagine 100 voters ranking three candidates. First choices: A gets 40, B gets 35, C gets 25. Every C voter ranked B second.
Plurality (most first-place votes wins): A wins with 40.
Ranked choice (no one has a majority, so drop last place and move those ballots to their next choice): C's 25 votes go to B, and B wins 60 to 40.

Neither result is a counting error. They're two different algorithms answering slightly different questions.
Easy one way, hard the other
Multiplying two prime numbers is easy: 61 × 53 = 3,233. Going backward, finding which two primes multiply to 3,233, is much harder; you have to hunt. Modern encryption, which protects your bank logins and messages, is built on that asymmetry, using primes hundreds of digits long. Multiplying them takes a computer a fraction of a second. Factoring the result would take longer than anyone could wait.
Try it yourself
Using the halving strategy, what's the most guesses you'd ever need to find a number from 1 to 1,000,000?
Bonus: 391 is the product of two primes. Find them.
Answers: (1) 20 guesses, since 2²⁰ = 1,048,576 is just over a million. (2) 17 × 23 = 391. You probably had to try several primes before finding them, which is exactly the point.
Go deeper
Dintersmith's Aftermath devotes a chapter to algorithms, opening with students doing this math in real classrooms and closing with challenges to try yourself.
Next in the series: Pillar 7: Decision Analysis.