And you can solve it in a tree- at least for the lower levels when the search space has been reduced
Solving Wordle in 3.64 guesses on average, 99.4% of the time
41–50 of 181 posts
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#42Going for greens is a good heuristic, but the general solution is to seek guesses that shrink the size of the set of compatible words the most. https://langproc.substack.com/p/information-theoretic-analys...
> From an information-theoretic perspective, the optimal initial guess is the one which is maximally informative about the target, given the resulting pattern. This statement (which motivates the rest of the analysis) isn't correct, because it doesn't take into account the highly irregular search space of what you're actually allowed to guess. Sets of possible words can vary a lot in terms of how easily they can be f…
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#43I wrote a solver a few weeks ago that solves easy mode in 3.45 guesses and hard mode in 3.55 guesses. Rather than using heuristics, it explored a large portion of the game tree (with a little pruning) and I'm hopeful that it's optimal. Interestingly, the EV-optimal hard mode strategy takes 3.52 guesses on average, but requires 7 guesses a tiny fraction of the time, so I instead exposed the best strategy that always r…
As a point of curiosity, what do you mean by optimal? To me, I can see at least two (potentially different) cost functions that a Wordle strategy can aim to minimise. Firstly, you can try to minimise the expected number of guesses, and secondly you can try to minimise the expected number of guesses conditional on never losing the game. In principle you could optimise for the first but not the second by allowing a sma…
I would be interested to know if 6 is the lowest you can constrain it. Can you guarantee a solution in 5, and if so what is the best EV with that constraint?
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#44Going for greens is a good heuristic, but the general solution is to seek guesses that shrink the size of the set of compatible words the most. https://langproc.substack.com/p/information-theoretic-analys...
I wrote a very simple O(N^3) algorithm to determine that: for each possible actual word and the guessed word, figure out whether or not a word is eliminated. Then calculate a score based on how many words can be eliminated from a particular guessed word, averaged over all possible actual words.
(I originally thought O(N^3) would be way too slow to be useful. But it runs fast enough with a few thousand words.)
Like a sibling comment, I also found that the best initial guess is RAISE, although when I tried a different word list, I got different words like LARES (I don't think it's in the Wordle list).
One thing that surprises me is that by the time you get to the mid-game stage (after 2 guesses or so), occasionally it can be more optimal to guess a word with repeated letters; I did not originally expect that because I thought repeated letters are wasted opportunity to test more letters, but it turns out Wordle's handling of repeated letters can give you helpful information about the number of occurrences of a letter. (For example if you picked a word with 2 a's, the first one can be green the second one can be black, essentially telling you there is exactly one letter "a" in the word.)
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#45I wrote a solver a few weeks ago that solves easy mode in 3.45 guesses and hard mode in 3.55 guesses. Rather than using heuristics, it explored a large portion of the game tree (with a little pruning) and I'm hopeful that it's optimal. Interestingly, the EV-optimal hard mode strategy takes 3.52 guesses on average, but requires 7 guesses a tiny fraction of the time, so I instead exposed the best strategy that always r…
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#46Earlier quoted context omitted.
> From an information-theoretic perspective, the optimal initial guess is the one which is maximally informative about the target, given the resulting pattern. This statement (which motivates the rest of the analysis) isn't correct, because it doesn't take into account the highly irregular search space of what you're actually allowed to guess. Sets of possible words can vary a lot in terms of how easily they can be f…
Yeah, the analysis doesn't really work for hard mode as noted in a footnote.
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#47Why optimize for greens? Better to rule out more first no matter the position. I think it narrows the search space better. If you want to go fancy somehow calculate with bigramms. If you guess c you don't have to guess k blindly too, etc.
If you want to get really fancy, a full minimax solution is probably feasible without massive resources. Pretend it’s a two player game with one player guessing and the other player thinking of a potentially different word for each guess subject to the constraint of being consistent with all previous answers.
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#48>so far what was taking 1GB of RAM in Python is taking, literally 1MB in Rust Is anybody hiring people to fix situations like this at work? i.e. this script that was written in a hurry needs to be revised to be 10^3 times more efficient, in space or time.
This specific task, the next program I'm working on, seems to be a very "algo" based, comp sci type problem. I think most companies want to say that they have these kind of problems, but the reality often is, they need a batch script on a laptop.
So like, yeah, I have done things like this before in my work, but often, solutions in Python are "good enough".
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#49Why optimize for greens? Better to rule out more first no matter the position. I think it narrows the search space better. If you want to go fancy somehow calculate with bigramms. If you guess c you don't have to guess k blindly too, etc.
The generally optimal thing is to choose guesses to reduce the set of possible targets as much as possible. This is the same as choosing guesses with maximal entropy over the resulting patterns (that is, the result you get back from the game should be maximally informative). Because greens are rare, by maximizing the probability of greens, you are approximately maximizing the entropy of patterns, by distributing prob…
E.g. if RAISE is the optimal reduction in search space for the given word list, what's the best 2nd guess for every possible word? Now taking the average 2nd guesses into account, is there a better first guess?
Re: Solving Wordle in 3.64 guesses on average, 99.4% of the time
#50Earlier quoted context omitted.
I thought of yellows. Taking frequent letters over words with sub-optimal letters but in the right positions. But manually I'm no where close to 3.6 either :). Also often too lazy.
Yeah, I think my average is closer to 4, ugh! But the program has shown me some strategies that seem interesting. It always guesses "slate" first, and if that has no greys it guesses "crony", and that one-two punch seems to do me well fairly often.
apart from "h" and "i" it's the same letters (and I do have c and y in my optional 3rd).