mark cerqueira well-rounded nerd

Breaking Codenames with Binary

Codenames is an incredibly fun, deep, and addicting tabletop game. The game revolves around a 5 x 5 grid of words. Two teams race to pick out the eight (or nine if you go first) words that belong to your team. Two spymasters give their teams one-word clues that will hopefully guide their teammates to their respective words on a 5 x 5 board. Clues that let teams pick more words correctly are better. The first team to get all their words win!

It’s fun. It’s funny. It’s hard. But we can make this game easy, not fun, and more like a math exercise. How? With binary! We can do this because:

  • While a particular word can be blue (one team), red (the other team), black (instant loss if selected), or beige (turn ends immediately) we only care about whether it’s a word belonging to our team or not. Ours or not ours. Binary.
  • The numbers from zero to a hundred can be expressed as SINGLE words. Yes, the numbers 21 through 99 are hyphenated! This grammar technicality is powerful!
  • Given we’re restricted to one word clues that will be numbers ranging from 0 to 100, we can usually express 6 bits of information and sometimes 7. For reference, 111111 (6 bits) = 63, 1111111 (7 bits) = 127, 1000000 (7 bits) = 64. In some cases were we have a lot of 0s at the end, we will express less than 6 bits of information (e.g. 01 is equivalent to 000000001).

What does this all mean? With 5 x 5 grid of words the spymaster has 25 bits of information they need to get across to their team. Using only one word you can transmit about 6 bits of information. So you’ll about need 5 turns to share 25 bits because 6 + 6 + 6 + 6 + 6 > 25. But depending on how the words you need to pick are placed (i.e. the last few spaces on the board do not belong to your team so you’ll win before you need to share this information), and if you can squeeze in a 7-bit number, you’ll on average only need 4 turns to win!

Here’s an example of what this would look like for a particular configuration. In this example, we’ll play the role of the red team. The red team goes first so we’ll need to pick out 9 words.

Victory in 4 turns!

  • 1st turn say “70” - 1000110, 7 bits, yellow text
  • 2nd turn say “20” - 10100, 5 bits, green text
  • 3rd turn say “64” - 1000000, 7 bits, pink text
  • 4th turn say “44” - 101100, 6 bits, white text

Note that the green text number (i.e. 10100) highlights the case mentioned above about expressing a lower than average amount of bits when we have a lot of 0s.

My friends and I have played a lot but we have not gotten to the point where we can win in 4 turns. That said, are we going to use this system? Probably not… since it ruins in the fun and, more importantly, breaks the rule that the clue must be “about the meaning of the word.” That said, it was a fun thought exercise.

If you want to learn more about Codenames, GeekDad wrote a great overview and review or if you want to buy a copy hop on over to Amazon.