Hank Stoever
part time nerd, part time gnar.

What I learned from creating algorithmic March Madness brackets

posted over 3 years ago - 2 min read

tl;dr: I got 3rd place at Coders bracket, and both of the 2nd place winners used my code

Coders bracket came out this year as a way for programmers to write code and generate a bracket for March Madness. I fell in love as soon as I saw it. I love writing algorithms with such a clear 'fitness' function, because any tiny little changes have an interesting, visual feedback.

coders bracket image

The winners

March Madness just finished, and I went to check out the standings. First of all, I tied for 3rd! I am extremely happy about that and it's highly rewarding. When I started looking into the winners, though, things got really interesting.

The first place winner had a COMPLETELY random bracket. Seriously, here is the code:

if (Math.random() <= 0.5) {
  team1.winsGame();
} else {
  team2.winsGame();
}

It just goes to show you how poorly you can guess how these tournaments will unfold, and that randomness can be just as good as our best human attempt.

Two people tied for second place. I looked at there code and it was... extremely familiar.

Back up to when CodersBracket first came out. I was really excited, and I posted one of my algorithms to Github, with a single tweet to it. It never got any stars and I never heard about it. But it turns out that BOTH of the 2nd place winners used exactly my code! I posted this code on Github to share, so I'm not mad at all that they used it. In fact, I'm all the more flattered that my code did so well.

I had two (similar) brackets tie for 3rd place. In my brackets, I actually used a completely different algorithm then the one I posted on Github. In these brackets, I personally gave a weight to specific statistics. In doing this, I was able to test out different 'bracket theories'.

Defense wins championships

My best bracket, which tied for 3rd place, is called 'Defense wins championships'. This is a commonly stated phrase, and is one that I personally agree with. I believe that defense is a vitally important part of a championship winning team, mostly due to my history as a defenseman.

'Offense wins championships' was another bracket that I did, which performed well but not nearly as well as 'defense wins championships'. Another theory I tested relied solely on strength of schedule and win percentage. This algorithm usually ended up with higher-ranking teams winning. This algorithm performed very well early on in the tournament, and poorly in later rounds.

my standings

Overall, it's clear - defense wins championships. But the beauty of March Madness is the randomness - there is no truly 'best' algorithm. Even our best algorithms don't do as well as randomness can. Still, making these brackets was quite fun, and I can't wait to see how they perform next year!

comments powered by Disqus