1. Home
  2. 3Blue1Brown

Feb 12, 2022

A code bug crowned the wrong best Wordle opener

10 min → 1:19

Overview

The 3Blue1Brown creator fixes a coding bug in his information theory analysis to find the truly optimal Wordle starting word for both computer algorithms and human players.

3 things to know

Bug Correction

The central theme is acknowledging and correcting a coding error.

More

The bug specifically related to how Wordle assigns colors (yellow/gray) when a guess contains a duplicate letter that appears fewer times in the answer.

▶ Watch at 2:30

Optimal Algorithm vs. Human Strategy

The speaker highlights that the word an algorithm finds to be mathematically optimal (like "SALET") may not be the best choice for a human, who relies on different heuristics and may not know the optimal follow-up moves.

▶ Watch at 9:10

One-Step vs. Two-Step Optimization

The video distinguishes between a "greedy" approach (choosing the word with the highest information gain for the first guess only) and a deeper, two-step analysis that considers the expected information gain after the second guess as well.

Also in this episode

Information Theory

The concept of entropy, or expected information gain, is revisited as the primary metric for evaluating the quality of a guess.

More

A good guess is one that, on average, provides the most information to narrow down the remaining possibilities.

Quotes

“But one of the very few things of substance that does change and that arguably does matter a fair bit, was the final conclusion around how if we want to find the optimal possible score for the Wordle answer list, what opening guess does such an algorithm use.”

▶ Watch at 2:30

“But the thing is, I don't actually think this is the best opener for a human playing the game.”

▶ Watch at 9:10

“It turns out there was a very slight bug in the code that I was running to recreate Wordle and then run all of the algorithms to solve it...”

▶ Watch at 0:14

Full summary

Episode Overview

  • This episode is a follow-up and correction to a previous video about solving Wordle using information theory.
  • The creator admits to a bug in his original code that incorrectly handled the logic for words with duplicate letters, which skewed the initial results.
  • After fixing the bug, he re-runs the analysis to determine the new, truly optimal starting word based on different metrics like one-step information gain, two-step information gain, and lowest average score.
  • The video contrasts the technically "best" word for a computer algorithm with what might be a more practical or intuitive choice for a human player.

Key Concepts

  • Bug Correction: The central theme is acknowledging and correcting a coding error. The bug specifically related to how Wordle assigns colors (yellow/gray) when a guess contains a duplicate letter that appears fewer times in the answer.
  • Information Theory: The concept of entropy, or expected information gain, is revisited as the primary metric for evaluating the quality of a guess. A good guess is one that, on average, provides the most information to narrow down the remaining possibilities.
  • One-Step vs. Two-Step Optimization: The video distinguishes between a "greedy" approach (choosing the word with the highest information gain for the first guess only) and a deeper, two-step analysis that considers the expected information gain after the second guess as well.
  • Optimal Algorithm vs. Human Strategy: The speaker highlights that the word an algorithm finds to be mathematically optimal (like "SALET") may not be the best choice for a human, who relies on different heuristics and may not know the optimal follow-up moves.

Quotes

  • At 0:14 - "It turns out there was a very slight bug in the code that I was running to recreate Wordle and then run all of the algorithms to solve it..." - The creator begins the episode by confessing to the error in his previous analysis that led to the incorrect conclusion.
  • At 2:30 - "But one of the very few things of substance that does change and that arguably does matter a fair bit, was the final conclusion around how if we want to find the optimal possible score for the Wordle answer list, what opening guess does such an algorithm use." - He explains that while many core concepts remain the same, the bug significantly impacted the most-cited result of the original video: the best starting word.
  • At 9:10 - "But the thing is, I don't actually think this is the best opener for a human playing the game." - After revealing "SALET" as the new optimal word for the algorithm, he emphasizes that a technically perfect solution for a computer isn't necessarily a practical or enjoyable strategy for a person.

Takeaways

  • The theoretically best starting word for Wordle, when optimized for the lowest average score over all possible games, is "SALET".
  • Small bugs in logic, especially for edge cases (like duplicate letters), can lead to completely different conclusions in a complex analysis.
  • Optimizing for a single step (a "greedy" approach) is not always the best long-term strategy; looking multiple steps ahead can yield a more globally optimal solution.
  • For human players, a good starting word is not just about mathematical optimality but also about intuition and the ability to easily formulate subsequent guesses. Words like "TRACE" or "CRATE" are excellent practical choices.

Watch the full episode 10 min

Read along with the audio summary

A slight coding bug changed the entire conclusion about the mathematically best opening guess for the game Wordle, according to the creator of this video. In this follow-up episode released on February twelfth, twenty twenty-two, the speaker corrects a previous analysis of the game.

How a tiny mistake with duplicate letters skewed the whole analysis. The error specifically involved how the game assigns yellow or gray colors when a guess has a duplicate letter that appears fewer times in the actual answer. Fixing this edge case changed the final conclusion about which opening guess an algorithm should use for the optimal possible score.

With the bug fixed, you can measure the quality of a guess using information theory. The primary metric for this is entropy, which simply means expected information gain.

Why looking two moves ahead beats a greedy first guess. You can use a greedy approach, which means choosing a word with the highest information gain for the first guess only. However, a deeper two-step analysis looks at the expected information gain after the second guess as well.

Why the best word for a computer might not be the best word for you. When optimized for the lowest average score over all possible games, the theoretically best starting word for an algorithm is SALET. Yet the speaker points out that this may not be the best opener for a human, who relies on intuition and may not know the optimal follow-up moves. Try starting your games with words like TRACE or CRATE, which are excellent practical choices that make it easy to formulate your next guesses.

Small bugs in logic can lead to completely different conclusions, and mathematical perfection for a computer does not always translate to human intuition. While an algorithm gets the lowest average score with SALET, human players are better off with practical openers like TRACE or CRATE.

More from 3Blue1Brown

Related Episodes