Ranked-Choice Voting Algorithm for Pie Club

Key lime pie decorated with lime-slice palm trees and crushed nuts.
The Pie Club
Since August 2024, I’ve been part of a pie club that meets roughly every quarter to bake, eat, and talk pies. Everyone shows up with a pie, sweet or savory, often tied to a theme, and at the end of the meeting, we vote on the World’s Best Pie (WBP).
For our first three meetings, WBP was decided in a simple fashion: one vote per person, most votes wins. It worked fine when there were fewer pies and a clear favorite, but as the club size grew and the pies got more ambitious, we kept running into the same problem: a crowded field would split the vote, and a pie that most people’s second choice could easily lose to a pie that only a third of the room actually loved.
Starting with Meeting #4 in December 2025, the group unanimously voted to switch to ranked-choice voting instead, and it’s held ever since.
How Ranked-Choice Voting Works
The rules are simple, and they’re now baked directly into our club bylaws (otherwise known as the “PieLaws”):
- Each voter is encouraged to rank up to 3 of their favorite pies, though only a first-choice vote is required.
- A winner is declared the moment any single pie collects a majority (at least 50%) of all first-choice votes.
- If no pie has a majority, the remaining pie(s) with the fewest first-choice votes are eliminated. Every ballot that had an eliminated pie ranked first then has its vote redistributed to whichever pie is ranked next on that ballot.
- This repeats, round after round, until one pie crosses the majority threshold.
- If two or more pies are tied at any point, either for elimination or for the win, and a tiebreaker is required, we break the tie using Total Support: the sum of a pie’s 1st, 2nd, and 3rd-choice votes across all ballots.
This is generally standard logic used in many real-world civic elections, but scaled down to decide something far more important: whose pie was best.
The Fun Data Part
I couldn’t resist integrating two of my favorite things (pie and data), so I decided to DIY our own ranked-choice voting algorithm. I wrote an R script that reads ballot data from a Google Sheet, tabulates the ballots and runs the elimination rounds automatically, and then sends the ranked-choice voting results (round by round) back to the same sheet. It’s a fun part of every pie club meeting to see how the voting algorithm plays out and which pie is crowned victorious. Full repo code here.
A Real Example: Meeting #6
Meeting 6 (December 2025) is a good example of the system actually doing its job. Eleven pies were on the ballot, and ten ballots were cast. Here’s how it played out:
Round 1 — first-choice votes only:

Round 1 results of the ranked-choice voting algorithm.
No pie had a majority (5 of 10 votes), and six pies with zero first-choice votes were eliminated at once.
Round 2 — after redistribution:

Round 2 results of the ranked-choice voting algorithm.
Sweet Mexican Corn (40%) and Double Cheeseburger (30%) still led, but Raspberry Brownie Hand Pies, Spinach Leek Quiche, and Cheesy Orange Marmalade were now tied for last with one first-choice vote each, so they were all eliminated.
Round 3 — with those votes redistributed:

Round 3 results of the ranked-choice voting algorithm.
Sweet Mexican Corn crossed 50% (5 of 10 votes) and was declared the winner, edging out Double Cheeseburger’s 40%.
Without ranked-choice voting, Sweet Mexican Corn would have won outright in Round 1 anyway with 4 of 10 votes. But we’ve also had meetings where the outcome truly depended on the later rounds, with winning pies able to overcome deadlocked ties and fully reach the majority threshold after 3 or 4 rounds. Plus, it’s just more fun this way, and it’s also rewarding to throw votes of appreciation towards more than one pie.
Why It’s Worth the Extra Math
Is this entire process overkill? Probably. But here are a few reasons why I think ranked-choice voting should stick around as a pie club tradition:
- The winner reflects broad support, not just a plurality. A pie that’s everyone’s solid second choice can beat a pie that’s a smaller group’s obsession.
- It rewards making a crowd-pleasing pie rather than just showing up with something polarizing that peels off a narrow slice of first-choice votes.
- No one’s vote is “wasted.” Ranking a long-shot pie that you loved first doesn’t hurt your ability to have a say in choosing the winner once it’s eliminated.
- It scales. As the club has grown from 6 pies to 11+ pies per meeting, a single-choice vote would only get noisier. Ranked-choice voting handles a crowded field more gracefully.
- More pies get at least some support. Even though many pies don’t receive any first-choice votes, it’s still rewarding to see many (if not all) pies receiving second- and/or third-choice votes. No pie efforts shall go unappreciated!
Thank you for joining me on this journey through math and pie (and not the pi you might expect in this context). As we say in our pie club: stay crusty, my friends!