\documentclass[11pt]{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb,amsthm,microtype,booktabs} \usepackage[hidelinks]{hyperref} \hypersetup{pdftitle={Two-letter Wordle is hard to approximate on average},pdfauthor={Peiwei Wu and Qian Peng}} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newcommand{\opt}{\operatorname{OPT}} \newcommand{\tri}{T} \title{Two-letter Wordle is hard to approximate on average} \author{Peiwei Wu\qquad Qian Peng\thanks{Corresponding author.}} \date{1 December 2026} \begin{document} \maketitle \begin{abstract} Rosenbaum asked whether it is NP-hard to minimize the expected number of guesses in Wordle. We prove that even approximation within a fixed factor greater than one is NP-hard for dictionaries of words of length two. The alphabet may grow with the input. Each word has distinct letters, each letter appears in at most three words, and the secret is uniform on the dictionary of legal guesses. We encode the edges of a graph as words. Adding words on fresh letters makes their waiting times reveal the minimum size of an edge dominating set. At length one, sequential guessing is optimal. We also give an exact polynomial-time algorithm for a two-letter variant in which both positions of each possible secret contain the same letter. \end{abstract} \section{The two-letter threshold} A nonempty dictionary \(D\) is given as an explicit list of words of a common length over a finite alphabet. We fix the word length at two and allow the alphabet to grow. A secret \(w\) is chosen uniformly from \(D\). At every turn all words in \(D\) are legal guesses, including those ruled out as secrets. A green tile marks a letter in its correct position. After removing the green matches, scan the remaining positions of the guess from left to right. A letter receives a yellow tile if an unused copy remains in the secret, in which case that copy is consumed. The other tiles are gray. The game ends when the player guesses the secret itself. If feedback uniquely identifies the secret without guessing it, the final guess still costs a turn. For a strategy \(\pi\) that wins on every secret, let \(c_\pi(w)\) count all guesses through the winning guess. Write \[ C(D)=\min_\pi\sum_{w\in D}c_\pi(w), \qquad H(D)=\min_\pi\max_{w\in D}c_\pi(w). \] The minimum expected cost is \(C(D)/|D|\). Randomization cannot improve this value: fixing all random choices gives a deterministic strategy, and averaging over those choices recovers the randomized cost. \begin{theorem}\label{main} Unless $\mathrm P=\mathrm{NP}$, no polynomial-time algorithm approximates the minimum expected number of guesses within a factor $1+1/50{,}000{,}000$, even for two-letter dictionaries in which each word has distinct letters and each letter occurs in at most three words. The threshold decision problem for expected cost is NP-complete on this class. For one-letter dictionaries of size $N$, the exact minimum expected cost is $(N+1)/2$. \end{theorem} For a small example, take the four words \(\mathtt{ab},\mathtt{ac},\mathtt{bc},\mathtt{cd}\). The guess \(\mathtt{ab}\) produces four different responses. \begin{center} \begin{tabular}{@{}lllll@{}}\toprule Secret & \(\mathtt{ab}\) & \(\mathtt{ac}\) & \(\mathtt{bc}\) & \(\mathtt{cd}\)\\ \midrule Tile for \(\mathtt a\) & green & green & gray & gray\\ Tile for \(\mathtt b\) & green & gray & yellow & gray\\ \bottomrule\end{tabular} \end{center} Interpret each word as an edge between its letters. The gray--yellow response reports a shared endpoint, \(\mathtt b\), in a different position. Two gray tiles mean that the edges are disjoint. With this dictionary \(\mathtt{cd}\) is the only all-gray possibility; it must still be guessed. In a larger graph a long sequence of gray responses leaves exactly those edges untouched by the guesses so far. Rosenbaum proved that a worst-case decision problem for Wordle is NP-complete. His model allows separate guess and secret lists, and his hardness construction already uses a common dictionary. Section~5 asks separately whether minimizing the expected number of guesses is NP-hard \cite{rosenbaum}. Lokshtanov and Subercaseaux proved worst-case hardness of approximation with equal guess and secret dictionaries at word length five \cite{ls}. Bertsimas and Paskov \cite{bp} and Cunanan and Thielscher \cite{ct} studied exact expected-cost optimization on specific dictionaries. Here the dictionary itself is the input to the optimization problem. Two ingredients of our proof have precedents. Rosenbaum uses the all-gray response to encode nonadjacency in a dominating-set reduction \cite[Lemma~4.2]{rosenbaum}. Feige, Lov\'asz and Tetali add isolated edges to a graph to transfer a vertex-cover gap to min-sum vertex cover \cite[Theorem~14]{flt}. Here both the queries and the secrets are edges. We prove bounds for arbitrary adaptive Wordle strategies, counting the extra guesses after a non-gray response. They yield a reduction at the smallest word length at which computational hardness can occur. \section{Graph dictionaries} Number the vertices of a finite simple graph $G$. Encode each edge $\{u,v\}$, $u2n^2$, then \[ \gamma=\left\lfloor\frac{C(D_m)-\tri(m)}{m}\right\rfloor . \] \end{theorem} \begin{proof} For $S\subseteq O$, let $\gamma(S)$ be the minimum number of queries from \emph{all} of $O$ needed to cover $S$. Then $\gamma(S)\le |S|$. If a query $a\in O$ is made and $S'$ consists of the edges of $S$ disjoint from $a$, then $\gamma(S')\ge\gamma(S)-1$, since adding $a$ to a cover of $S'$ covers $S$. Consider any node with remaining original secrets $S$ and $b$ remaining isolated secrets. We prove a lower bound \[ \tri(b)+b\gamma(S) \] for the sum of their remaining completion times. At a nonempty node every active secret pays one turn. For an original query, retain the all-gray child, which still contains all $b$ isolated secrets and the original secrets in $S'$. The query cost is at least $b$, enough to offset a unit decrease in $\gamma(S)$. If the query is an active isolated word, its all-gray child contains $S$ and the other $b-1$ isolated secrets. The cost paid now is \(|S|+b\), at least \(\gamma(S)+b\), the increment in the lower bound. An already excluded isolated word preserves the bound. At an empty active set the claim is immediate. Induction over the finite tree proves the lower bound. This accounts for the time of all secrets jointly, including strategies that guess isolated words early. For the upper bound, guess an edge dominating set of size $\gamma$ in any order until a response has a non-gray tile. A winning response ends the game. Any other non-gray response rules out every isolated secret. At most $n$ more guesses then suffice by listing the original words. Each original secret therefore costs at most $\gamma+n$. If all $\gamma$ responses are gray, the secret is isolated. Guess the $m$ isolated words in a fixed order. Their total cost is $m\gamma+\tri(m)$. Finally $\gamma\le n$, so the error in the upper bound is at most $2n^2$. This proves the recovery formula. \end{proof} \begin{corollary}\label{worst} If $m\ge n$, then $H(D_m)=m+\gamma$. \end{corollary} \begin{proof} The strategy above uses at most $\gamma+\max(n,m)$ guesses. For the reverse inequality follow the all-gray responses until no secret remains untouched. At this point the original queries have covered $O$, and all $m$ isolated words have been guessed. At least $\gamma+m$ queries have been made. A secret first touched by the last query produces the prescribed preceding all-gray responses, so its actual play lasts at least this many turns. If a query covers no new secret, the additional turn can only increase the bound. \end{proof} \section{Hardness for the uniform average} The decision problem for Minimum Edge Dominating Set is NP-complete on graphs of maximum degree three~\cite{yg}. For the exact decision reduction we use quadratic padding: consecutive possible values of \(m\gamma\) must differ by more than the \(2n^2\) error in Theorem~\ref{sandwich}. For $k\le n$, take $m=2n^2+1$. Theorem~\ref{sandwich} yields the decision equivalence \[ \gamma\le k \quad\Longleftrightarrow\quad C(D_m)\le \tri(m)+mk+2n^2. \] All words have length two, their number is polynomial, and the largest fresh vertex label can be encoded using $O(\log(n+1))$ bits after numbering the nonisolated vertices consecutively. For membership in NP, take a winning strategy and delete any query for which every active secret produces the same nonwinning response. Each remaining nonterminal path step strictly reduces the number of active secrets. The union of the paths for $|D|$ secrets has at most $1+|D|^2$ nodes. A verifier computes the feedback on each path, verifies the winning guesses, and sums the durations. This is the strategy-tree certificate of Rosenbaum with total cost in place of maximum depth \cite{rosenbaum}. The same exact decision hardness persists when no yellow tile can occur. Yannakakis and Gavril proved NP-completeness also for bipartite graphs of maximum degree three \cite{yg}. Give the two parts disjoint letter sets, write each edge left to right, and assign each new isolated edge one fresh letter from each side. A letter occurring in both words can now occur only in the same position. The all-gray criterion and both bounds of Theorem~\ref{sandwich} still apply. Corollary~\ref{worst} gives the corresponding exact worst-case reduction, for example with $m=n$. For the approximation assertion we use the explicit gap of Chleb\'ik and Chleb\'ikov\'a \cite[Theorem~5]{cc}. Their source graph has $s$ vertices and its transformed graph has $n=21s/2$ edges and maximum degree three. The two hard cases have edge domination number below $2.5103305s$ or above $2.51549586s$. Weakening the gap slightly gives \[ \text{yes: }\ 10000\gamma\le2391n,\qquad \text{no: }\ 10000\gamma\ge2395n. \] A multiplicative gap calls for a different choice of padding. With \(m\) proportional to \(n\), a linear gap in \(\gamma\) yields a quadratic gap in \(m\gamma\), of the same order as the baseline \(\tri(m)\). Let $m=10000n$ and $B=\tri(m)+2393n^2$. In the yes case the upper bound in Theorem~\ref{sandwich}, together with $\gamma\le n$, gives $C(D_m)\le B$. In the no case the lower bound gives $C(D_m)\ge B+2n^2$. For $n\ge1$ we have $B\le50{,}007{,}393 n^2$, so \[ (1+1/50{,}000{,}000)B < B+2n^2 . \] A polynomial-time approximation with the displayed ratio would distinguish the hard cases. Division by $|D_m|$ scales both the objective and the comparison threshold by the same quantity. The numerical constant witnesses a complexity separation. The proof does not identify the optimal approximation ratio. On the sparse class of Theorem~\ref{main}, guessing the words in any fixed order gives a factor-five approximation. For a guess \(ab\), let \(D_a,D_b\) be the words containing \(a,b\), respectively. Each set has at most three members and their intersection contains the guess itself. Hence a guess can give a non-gray response on at most \(|D_a\cup D_b|\le5\) secrets. This counting argument also permits both orders \(ab\) and \(ba\) in the dictionary. Put \(N=|D|\). Among the first \(i\) guesses on the all-gray branch, at most \(5i\) secrets can get a first non-gray response. Every secret solved within \(i\) turns has had such a response: its guesses preceding that first response agree with the all-gray branch. If the branch ends earlier, the same bound holds because by then all secrets have been touched. Order the completion times as \(d_1\le\cdots\le d_N\). Then \(5d_j\ge j\). Summing gives \(5\sum_j d_j\ge N(N+1)/2\), which is the total cost of the fixed ordering. Taking \(j=N\) gives the factor five for the worst-case objective as well. For a one-letter dictionary, a guess either wins or gives the same gray response for every remaining secret. After suppressing repeated guesses, a winning strategy specifies an ordering of the $N$ letters. Their costs are $1,\ldots,N$, which proves the final assertion of Theorem~\ref{main}. \section{A polynomial two-letter case} Consider an explicit guess dictionary containing every possible secret, where the secrets are the monochromatic words $aa$ for $a$ in an $n$-element set $U$. The prior is uniform on these secrets. Build a graph on $U$ with edge $\{a,b\}$ whenever $a\ne b$ and $ab$ or $ba$ is a legal guess. Write $\nu$ for its maximum matching size. \begin{theorem}\label{matching} The minimum total cost is \[ \min_{0\le j\le\nu} \left[j(j+s+3)+\frac{s(s+1)}2\right],\qquad s=n-2j . \] An optimal strategy can be constructed in polynomial time. \end{theorem} \begin{proof} Against $aa$ a guess containing $a$ marks exactly its occurrences of $a$ green, so any non-gray response to a two-letter probe identifies the secret. If a probe meets only one active letter, directly guessing that letter's monochromatic word wins sooner on a hit and leaves the same active set after a miss. A probe meeting no active letter can be skipped. This also eliminates queries using letters outside $U$. The probes that meet two active letters select disjoint graph edges on the continuing gray branch. If a direct guess immediately precedes such a probe, their letters are distinct. Swapping the moves saves one unit of total cost, since the probe removes two candidates before the next move. Thus an optimum first probes $j$ disjoint edges and guesses the $s=n-2j$ remaining letters in sequence. At a probe with $r$ active letters all $r$ pay for the query and both hits need one confirming guess. Summing $r+2$ over the probes gives $j(j+s+3)$. Conversely each matching realizes this cost. A maximum matching supplies all feasible sizes by taking subsets, and can be computed in polynomial time \cite{edmonds}. \end{proof} \paragraph{Proof verification.} The \href{https://doi.org/10.5281/zenodo.24616074}{archived Lean~4 development} defines the feedback rule and the number of guesses along an adaptive decision tree. It checks the padding bounds, the decision threshold, and the numerical separation in the approximation proof. The formal factor-five result uses the graph encoding with an ordered pair for each edge; the union count above also covers dictionaries containing both orders of a pair. The hardness of the source problem and the polynomial-time matching algorithm enter through the cited literature. \paragraph{Author contributions and use of AI.} Peiwei Wu and Qian Peng chose the question of the expected number of guesses and directed the preparation of the manuscript for public release. They used OpenAI Codex to search the literature, develop the reductions, implement the proofs in Lean, and draft and revise the manuscript. \begin{thebibliography}{9} \bibitem{rosenbaum} W. Rosenbaum. Finding a winning strategy for Wordle is NP-complete. \href{https://arxiv.org/abs/2204.04104}{arXiv:2204.04104}, 2022. \bibitem{ls} D. Lokshtanov and B. Subercaseaux. Wordle is NP-hard. In \emph{FUN 2022}, LIPIcs 226, article 19. \href{https://doi.org/10.4230/LIPIcs.FUN.2022.19}{doi:10.4230/LIPIcs.FUN.2022.19}. \bibitem{bp} D. Bertsimas and A. Paskov. An exact solution to Wordle. \emph{Operations Research} 73 (2025), 1384--1394. \href{https://doi.org/10.1287/opre.2022.0434}{doi:10.1287/opre.2022.0434}. \bibitem{ct} M. Cunanan and M. Thielscher. On optimal strategies for Wordle and general guessing games. In \emph{IJCAI 2023}, 5541--5548. \href{https://doi.org/10.24963/ijcai.2023/615}{doi:10.24963/ijcai.2023/615}. \bibitem{flt} U. Feige, L. Lov\'asz and P. Tetali. Approximating min sum set cover. \emph{Algorithmica} 40 (2004), 219--234. \href{https://doi.org/10.1007/s00453-004-1110-5}{doi:10.1007/s00453-004-1110-5}. \bibitem{yg} M. Yannakakis and F. Gavril. Edge dominating sets in graphs. \emph{SIAM Journal on Applied Mathematics} 38 (1980), 364--372. \href{https://doi.org/10.1137/0138030}{doi:10.1137/0138030}. \bibitem{cc} M. Chleb\'ik and J. Chleb\'ikov\'a. Approximation hardness of edge dominating set problems. \emph{Journal of Combinatorial Optimization} 11 (2006), 279--290. \href{https://doi.org/10.1007/s10878-006-7908-0}{doi:10.1007/s10878-006-7908-0}. \bibitem{edmonds} J. Edmonds. Paths, trees, and flowers. \emph{Canadian Journal of Mathematics} 17 (1965), 449--467. \href{https://doi.org/10.4153/CJM-1965-045-4}{doi:10.4153/CJM-1965-045-4}. \end{thebibliography} \end{document}