This is a video on how we can use concept of probability and expected values to create an almost perfect Wordle player. I also make a simple proof of concept to show how good the method is, and do some analysis on why some guesses are better than others (spoiler: "lares" is apparently a very good first guess).
I don't claim this idea to be unique or anything, but I still do want to give the problem a go myself regardless.
If you haven't played Wordle, check it here (I am not the developer of the game): https://www.powerlanguage.co.uk/wordle/
Slight disclaimer: 99.9% win rate is only true for the game's easy mode. It's a slight caveat but it's still quite impressive the solver works
GitHub repository with the codes I wrote (as a Jupyter notebook, currently a bit untidy): https://github.com/thecheesynachos/word-game-solver.
I try my best to check for bugs, and I don't think there are any. If there are though, do let me know. Many improvements to the code can still be made (e.g. use approximation techniques, optimise code, judging words with a different objective, etc.), so I encourage anyone else to build on what I did if you want.
For the record, I don't use the solver when I actually play the game, since it kind of ruins the fun that way (lol).
Chapters
0:00 - Introduction
1:36 - The game
5:12 - Making the game work
8:52 - Setting up the problem
13:58 - How the variables relate to each other
19:03 - What should we try to optimise?
23:28 - The mathematical details
30:29 - Which words should be checked?
34:10 - Comparing the methods
37:31 - Some demo
40:15 - Words that are good (or bad) first guesses
44:29 - Some details on the implementation
45:21 - Other ways to potentially approach the problem
46:19 - Outro and a bit of rambling
14 Comments