How many different possible Wordle tweets can exist

combinatoricsrecreational-mathematics

Wordle is a viral web game where you have up to six attempts to guess a secret five-letter English word* using the letters A-Z.

After each $5$-letter guess (which must itself be a real English word*),
an emoji describes the secret word for each letter guessed:

  • ⬜ (White) means the guessed letter is not in the secret word.
  • 🟨 (Yellow) means the guessed letter is in the secret word, but in a different position.
  • 🟩 (Green) means the guessed letter is in the secret word, in that position.

For example, if the secret word is ENTER, here is a possible playthrough:

  • PIZZA
  • TROUT
  • TROUT (pointless, but legal)
  • SHEEP
  • ENTER

would result in the following, tweetable, output (with letters to help folks whose browsers don't parse the emoji as intended):

⬜⬜⬜⬜⬜ (WWWWW)
🟨🟨⬜⬜⬜ (YYWWW)
🟨🟨⬜⬜⬜ (YYWWW)
⬜⬜🟨🟩⬜ (WWYGW)
🟩🟩🟩🟩🟩 (GGGGG)

Note that the last row may not be 🟩🟩🟩🟩🟩 (GGGGG) if the correct answer is not found in six tries. Also note that the repeated T in TROUT only was colored once as it only appears once in the secret word.

I know that the total possible combinations of ⬜🟨🟩 (WYG) used in a string of five emoji would be equal to $3^5=243$. But this is ignoring the English word restriction (is every combination of emoji even possible?).

* A specific answer may depend on the dictionary used. The actual game of Wordle uses a restricted dictionary of words that can be guessed (including obscure "Scrabble words"), and a further restricted dictionary of words that might be used as a solution (words more likely to be recognized as such by most players).

Best Answer

A precise answer will likely require computational assistance, with knowledge of the specific dictionaries used in Wordle for valid guesses and valid final answers. This answer will aim to answer the question for a very permissive dictionary, where any combination of 26 letters A-Z may be used as a guess or secret word.

First, an upper bound. A full game with $n$ guesses results in $5n$ emoji shown. There are $3^{5n}$ combinations of three characters in a string of length $5n$, so $\sum_{n=1}^6 3^{5n}$, or 206,741,921,896,692, is a very rough upper bound.

We could be more careful. A game ends with GGGGG, or after six incorrect guesses. Likewise, any of the five permutations of GGGGY is impossible, since the single yellow cannot be both in the word but in the incorrect position (an extra letter that appears elsewhere is marked as Black, not Yellow). So a more careful upper bound would be $\sum_{n=0}^6(3^{5}-6)^n$, or 177,961,648,104,787, where $n$ counts the number of incorrect guesses in a game (any correct guess GGGGG is fixed), and $3^{5}-6$ counts the number of possible ways to make each incorrect guess.

Finally, we can show this upper bound may be realized (with our permissive dictionary). Given a secret word $l_0l_1l_2l_3l_4$ we should show that any emoji output besides a permutation of GGGGY is possible; we may assume the $l_n$ are distinct. Permutations of Gs/Bs are easy: use correct letters for G and distinct $x\not=l_n$ for each B otherwise.

Given emoji output with multiple Y (and any number of G,B), we may use correct letters for each G, distinct incorrect letters for each B, and rotate the correct letters among the Y. For example, GBYBY could be realized using $l_1xl_5yl_3$, where $x,y,l_n$ are all distinct.

Finally we only have the case where we have at least one B and exactly one Y. In this case, fix one B and the Y. Let $l_i$ be the correct letter for the B position; we may guess a word with $l_i$ in the Y position, and a letter $x$ distinct from every $l_n$ in the B position. We then complete the word using correct letters for each G and new incorrect (and distinct) letters for every other B position.

Thus for a permissive enough dictionary, there are 177,961,648,104,787 possible Wordle tweets. (We leave open the cases where players must use information gained from previous guesses to make future guesses.)

Related Question