TheRensselaerIDEA / WordleR

WordleR: An R-based WORDLE Helper
3 stars 0 forks source link

Comments #1

Open astrowonk opened 2 years ago

astrowonk commented 2 years ago

More of a question than an issue: Why are you ranking choices based on how common the word is?

Using the top 3000 of you ordered short list, based on letter frequency and position frequency the top words are more like:

arose, rates, tears, stare, aster, raise, arise

Much like other analysis found on the internet, including the reddit thread you linked in the readme.

I would argue the best initial guess (and guess every round) is the one that on average reduces the remaining possible words the most so as to help narrow down to one possible remaining answer. Or that minimizes the worst case scenario, depending on one's preferences.

Another thought: why I have been reluctant to analyze the actual 2315 target list in Wordle as it feels like too much inside information, we have seen the first 200+ actual wordles. There are no plural nouns in that sample. So, I have removed plural nouns from my target dictionary. This changes both starting word choice and reduces the number of remaining target words.

olyerickson commented 2 years ago

These are all good points! FYI, regarding your recommended starter words, this is how they perform in WordleR:

image

I would agree that the best initial guess is that which reduces the possible search space. Each guess should help the user:

If you always start WordleR with BAYOU and play carefully, you will find every word but six on the "official" Wordle list in six or fewer moves, and you'll find the other six in seven moves....

olyerickson commented 2 years ago

FYI I have (finally) added a notebook so people can perform their own analysis. By choosing what is and isn't commented, the user can play with the 39K word Kaggle set, the Knuth set (or some subset of that), or the 2315-word Wordle "Magic Word" set.

astrowonk commented 2 years ago

Thanks for running the alt starter words through your graph. I think the graph is dependent on how one plays after the starting word; is it continuing to play out the game based on word commonality? If it's just guessing common words until the end, then yes I believe you'll fail to solve in 6 fairly often. If you make each round an effort to minimize remaining choices, I don't believe any word can't be solved in 6, most in 5 or less by an algorithm.

For example my initial code could get stuck in mound/hound/sound/found type situations, so if it has those words left it guesses something else to remove uncertainty. With your dictionary it solves 'hound' in 3: raise, month, hound, sound in 4: raise, cloth, bound, sound.

What are some words were taking 6+ rounds on your plot up there?

I have only tested the first ~200 words with my own algorithm, where it's found everything in 5 or less.

olyerickson commented 2 years ago

RE "What are some words were taking 6+ rounds," here is the complete list of your suggested starter words and the challenge words that required seven or more iterations to find.. missed_words.csv

By "challenge" words I mean entries in the word list that the guesses are being tested against...

astrowonk commented 2 years ago

Thanks! Seeding my code with your top 3000 words as target and allowable, my alg solves "carry', a 9 iteration example on your list, for example, in 3:

['raise', 'cloth', 'carry']

Raise eliminates all but 28, cloth leaves only carry.

Wordlebot Wordle 3/6

🟨🟩⬜⬜⬜ 🟩⬜⬜⬜⬜ 🟩🟩🟩🟩🟩

I'll go through the missed words more systematically later...

olyerickson commented 2 years ago

BTW, I agree with your feelings about the Wordle "Magic Word" list --- feels a bit like too much insider knowledge. When WordleR runs it does NOT consider Wordle words already used. And I tested the algorithm against the 39K-word Kaggle set, the 5757-word full Knuth set, as well as the trimmed 3000-word Knuth set --- just to see. It does worse against 39K words! ;)

astrowonk commented 2 years ago

Your missed list has words not in the top 3000, was this based on the full 5757 list?

Of the 21 fail words with raise in the top 3000, my alg with the top 3000 list and allowable and target:

Score of 4: 12
Score of 3: 9
astrowonk commented 2 years ago

Ran the full missed_words.csv for raise using the full 5757 dictionary and the only 1 took 6: jazzy. Every other one was 5 or less:

image

olyerickson commented 2 years ago

I think that "missed list" I generated may have been based on the Wordle "Magic Words" list. I'll take a look...

olyerickson commented 2 years ago

This is the "missed list" for the top 3000 Knuth words... missed_words_3000.csv

astrowonk commented 2 years ago

This is the "missed list" for the top 3000 Knuth words... missed_words_3000.csv

image

My code with your 3k dictionary as target and guessable gets all of those in your list with start word raise in 5 or less, the two worst ones: Dolly in 4: [raise, month, guild, dolly] Sound in 4: [raise, cloth, bound, sound]

A big enough dictionary will have some ambiguous words. In one dictionary I have seen there were a bunch of words like zills / vills etc and that proved too hard to disentangle. But I think the real trick is, as you said, to reduce the possible search space by covering the letter and position space with each guess, and do that in each round.

My alg implements that idea by checking hypotheticals assuming each remaining word was the target word. Not my original idea, I got it from here.

olyerickson commented 2 years ago

I think my pipeline had the wrong filter --- it was early in the morning here! ;)

I'll re-run, after a massive test I'm currently running.

olyerickson commented 2 years ago

Interesting results, comparing four-vowel starter words... image

astrowonk commented 2 years ago

Still fuzzy on the 'iterations required' metric if it's playing a game to the end using word commonality to pick rounds 2+... I think for a starting word you want the average (or max) words remaining after guess 1 as the metric, and then minimize that.

There's probably something to getting lots of vowels in guess 1 but probably a triple 'e' like eerie is bad!

olyerickson commented 2 years ago

Your comment just made me realize that in my evaluation using the 2315-word Wordle list as a source of suggested guesses (as well as challenges) I am not rearranging by word frequency, which I do for the Knuth list. This is an issue (to me, at least!) since my "algorithm" assumes using the most frequent word remaining, instead of simply the next word in the list. I need to tweak this...

astrowonk commented 2 years ago

Your comment just made me realize that in my evaluation using the 2315-word Wordle list as a source of suggested guesses (as well as challenges) I am not rearranging by word frequency, which I do for the Knuth list. This is an issue (to me, at least!) since my "algorithm" assumes using the most frequent word remaining, instead of simply the next word in the list. I need to tweak this...

Honestly, I'm not sure it makes much difference? The most frequent word based on the Knuth list doesn't correlate with the best word for eliminating possible words in order to narrow down the search. Word frequency in a corpus is random as far as 'how many answers will be left after I guess this." The most common word left might be pappa or something which only gets you 2 letters. Whereas if you pick to maximize coverage of untried letters in the remaining possible words, you could get something obscure like nymph or my alg the other day guessed bewig in order to cover a b,w, and g.

olyerickson commented 2 years ago

A couple points:

The best guesses should give us the most clues about the characteristics of the hidden word. Currently WordleR doesn't rank the remaining possibilities in a useful way, e.g. de-emphasizing (but not eliminating) words with repeating letters, prioritizing words with more common letters, etc.

One possible "rank" might be to always prioritize words with higher Levenshtein distances from the current guess, ie the remaining words that are most "different," (but that mostly addresses letter position rather than what the different letters actually are).

olyerickson commented 2 years ago

As I noted, I added a step that rearranges the recommended guesses by the frequency of letter occurrence in the Wordle "Magic Words" list and de-emphasizes words with multiple letters; in other words, it prefers guesses that will provide new information. I've actually seen performance improve, which is fascinating!

ALSO: The Levenshtein distance is really not useful in this scenario.

olyerickson commented 1 month ago

@astrowonk FYI, increasingly I'm finding that the NYTimes Wordle Word Editor has strayed from the original Wordle Word List, thus "foiling" WordleR's algorithm. As a result, a few weeks ago I added the Knuth 5-letter word list (5757 words, down to 4652 with used words removed) as a reload option; I may soon simply make Knuth the default.