IDEAS home Printed from https://ideas.repec.org/a/inm/oropre/v73y2025i3p1384-1394.html
   My bibliography  Save this article

An Exact Solution to Wordle

Author

Listed:
  • Dimitris Bertsimas

    (Operations Research Center, Massachusetts Institute of Technology, Cambridge, Massachusetts 02139)

  • Alex Paskov

    (Operations Research Center, Massachusetts Institute of Technology, Cambridge, Massachusetts 02139)

Abstract

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.

Suggested Citation

  • Dimitris Bertsimas & Alex Paskov, 2025. "An Exact Solution to Wordle," Operations Research, INFORMS, vol. 73(3), pages 1384-1394, May.
  • Handle: RePEc:inm:oropre:v:73:y:2025:i:3:p:1384-1394
    DOI: 10.1287/opre.2022.0434
    as

    Download full text from publisher

    File URL: http://dx.doi.org/10.1287/opre.2022.0434
    Download Restriction: no

    File URL: https://libkey.io/10.1287/opre.2022.0434?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:inm:oropre:v:73:y:2025:i:3:p:1384-1394. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Chris Asher (email available below). General contact details of provider: https://edirc.repec.org/data/inforea.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.