Just stumbled across this. I think there are a couple of things which make this look better than it is. Firstly using the wordle answer list ranges from cheating to merely overfitting depending on your point of view. Having said that, 3Blue1Brown gets around 3.4 even when using the wordle answer list. Secondly, you say you are removing answers that have previously appeared. That's what allows you to beat 3Blue1Brown and most of the other solvers out there, which start with a clean slate (no I didn't pick that word deliberately) for each word they are solving. It's an interesting approach (it's similar to the one I used in my first solver, though I used the sum of the logs of the letter counts instead, your scoring is probably better). I've implemented another solver similar to the 3B1B approach, it will be interesting to see how it compares to your numbers if I also drop already seen answers each time. I may get around to that and report back.
Maybe it is borderline cheating, but my approach is the same as I would do as a human player (i.e. never guess a word that I know it cannot be). If you find out something interesting, it would be great to share!
@@TheDodgyEngineer I'm back. So yes a human could in theory remember all the previous answers. The bit that many would consider cheating is knowing the list of 2315 words (which has changed to 2309 words since this video) that the answers come from. Without that, remembering previous answers is substantially less useful. Even with the wordle answer list, remembering previous answers only really starts to pay off after a few years of wordle play. Anyway, I did some testing. My solver based on 3B1B maths scores an average of 3.10 when using the same test method as you do. If I test your solver using the same method most others do (I took out the numpy random fuzzing and added an auto-marker), it seems it averages 3.68 (compared to 3.43 for mine and 3B1B). I tried to replicate the results of your video with your code, though I got 2.98 rather than 2.95. I can't explain the 0.03 discrepancy, but it's fairly small so I didn't investigate further. I'm genuinely surprised by these results. It seems your letter frequency method performs quite well with a small list of possible answers. My theory is that it stumbles onto the correct answer early by luck whereas the 3B1B-style, entropy-based solvers are trying harder to be certain of the answer, even guessing words that they know to be impossible because that will narrow down the options more. I should probably tweak my solver to more strongly prefer guesses that are actually possible if I keep trying to use it with small answer lists. The entropy based solvers scale much better to larger answer lists (like the 12972-word allowed-guess list a lot of solvers use in order to play "fairer"). I know from having written a letter-position frequency based solver like yours it can get stuck really badly on certain words where it has worked out 4 letters and then tries to find the last letter by going through words mostly arbitrarily. eg. there are 8 words in the allowed-guess list that end in "inge", 10 that end in "atch", 10 that end in "itch", 7 that start with "tri" and end in "e", etc.
@@shopt6933 This is really cool, such dedication to the project haha! How does an entropy based solver avoid the "inge" situation, because each possible starting letter has equal probability? Does it just guess a word that cannot be correct, but utilises as many of the possible starting letters?
@@TheDodgyEngineer One way is weighting words, but you are asking about all being equally likely, so I'll leave word weighting aside. In some ways it's simpler than what you suggest as the technique just falls out from the maths. The effect often turns out as you describe, but it's not always a sudden transition, ie. it might see that there's not a lot of information to be gained in the 2nd-5th letters and start leaning towards words which rule more 1st letters in/out, even before it knows precisely what are in spots 2-5. In general though, entropy based solvers are always looking for which word will give the most informative results on average, and knowing you will get 4 greens from your guess is not very informative. To make things a bit more concrete, of the 8 "inge" words in the 12972 word guess list (they start with bdghmstw), 3 are actually possible wordle answers (bhs). If I give my solver no information beyond the 12972 word list (ie. neither the wordle answer list nor any word weightings), it gets "singe" in 4 and "binge"/"hinge" in 5. I'll try to step through the solve for "hinge" here (though the solve for "binge" is identical except for the final "guess"). Guess 1: "tares" (not the best guess if you know the wordle answer list, heavily slanted by the number of plurals and words ending in "ed" that are in the 12972 list but absent from possible wordle answers). Result is bbbyb. So we already eliminated "tinge" and "singe". 637 possible words remain. Guess 2: "doily". The solver knows it's not the answer (as we don't have an 'e') but nevertheless thinks this will be the most informative word on average. Result is bbybb. We've now also eliminated "dinge". 58 possible words remain. Guess 3: "menge". Once again, known not to be the answer (no 'i'). We can guess that the solver is trying to rule the "nge" suffix in/out, and also pin down the location of the e (though it's really just following the maths). Result is bbggg. We also rule out the "inge" word that starts with 'm' (not sure exactly what the rules are on YT so I don't want to type the word). 4 possible words remain, all of them "inge" words. Guess 4: "howbe". Obviously not the answer. We can see it's going for the b, h, w, and will know it's the g if they are all not in the answer. So this guess is guaranteed to leave us with 1 valid word for a guaranteed solve on guess 5. We got lucky that there was a word that would cover 3 of the 4 letters, in fact this was the only one in the 12972 words which would do so. Plenty of other words only covered 2 letters, which would leave us with a 50% chance of a 50/50 on guess 5. This would have at least guaranteed a solve on guess 6, whereas walking through the "inge" words one at a time has a 25% chance of needing a 7th guess.
I recreated your program on my own, but there's a thing. In 2:37, Why you choose cumulative multiple product, rather than comparing euclidean distance? (or vector difference)
Using a product amplifies the difference in score compared to simply summing the differences. The idea being that with using a product, a larger range of scores are possible, reducing the chance two words score the same. Maybe that's flawed logic, but using distance shouldn't make a difference really.
Welcome to the Wordle Solver! The suggested starting word is: slate Enter your first guess: slate Enter your first result: wwyyy ['begat', 'adept', 'after', 'facet', 'agent', 'water', 'taken', 'terra', 'cadet', 'tweak', 'wheat', 'taker', 'extra'] The suggested word is: taker Enter your next guess: taker Enter your new result: ggwgg [] Oh no! You made a mistake entering one of your results. Please try again. === Code Execution Successful === I am getting this issue my word is taper, which is present in your dictionary
hmm i tried implementing this solving algorithm into my wordle api and i am only getting a 90% solve rate. it seems to do really well for the most part until for example, i get to a word like 'joyed', where it ends up cycling through a bunch of _o_ed words seemingly at random before failing. i.e. it played coned, bowed, doped, domed, joked. is it possible i have implemented it incorrectly? my api gives me a list of remaining words, and from that i am able to create a dictionary of letter frequencies in position. then i was able to essentially copy and paste the algorithm on screen and generate a list of words and their respective scores and play the word with the lowest score. I also began each turn with slate. is there a reason why you haven't posted this up on github? if it actually can on average get it in 2.9 guesses, that is pretty remarkable for such little code
This algorithm isn't necessarily going to guess the correct answer every time, but I think it should be better than 90%? However, I'm not a very experienced programmer so I'm sure I've over-looked various cases/bugs! A GitHub link is now in the description, have fun dissecting my garbage code haha
@@TheDodgyEngineer it must be better than 90% because that's what I get when I randomize my possible/remaining wordslist for each guess. ill give it a crack now
@@TheDodgyEngineer ok turns out part of my word remover algorithm was wrong, so that's why it wasn't working for me. i wrapped your code in a loop choosing a random word each time to guess, and it had a 97% solve rate after 1000 games. awesome stuff