2/18/2024

An Exact Solution to Wordle

 Dimitris Bertsimas, Alex Paskov (2024) An Exact Solution to Wordle. Operations Research.

In this paper, we propose and scale a framework based on exact dynamic programming to solve the game of Wordle, which has withstood many attempts to be solved by a variety of methods ranging from reinforcement learning to information theory. First, we derive a mathematical model of the game, present the resultant Bellman equation, and outline a series of optimizations to make this approach tractable. We then outline how to extend the framework to solve variants of the game—such as Wordle Hard Mode, optimizing for the worst case, and optimizing under nonuniform word probabilities—and present results for all game variants considered. We show that the best starting guess is SALET, that the algorithm finds all hidden words in at most five guesses, and that the average number of guesses starting with SALET is 3.421. We conclude by presenting experiments that illuminate why some approximate methods have struggled to solve the game, which our framework successfully circumvents because of its exact nature. We have also implemented our algorithm at wordleopt.com, so that the reader may interact with the optimal policy.

沒有留言:

張貼留言