Perfect WORDLE algorithm (and how I found it)

  Рет қаралды 11,697

Games Computers Play

Games Computers Play

Күн бұрын

This is part to of the Wordle series. After collecting all your suggestions on how the previous algorithm caould have been improved, I have implemented 3 most promising ones: letter position, reuse green, and answer tree.
Wordle (do you really need a lnk for that?): www.nytimes.com/games/wordle/...
Source code: github.com/gamescomputersplay...
Solution in Excel: docs.google.com/spreadsheets/...
------------------------------
"Vadim Krakhmal - Runic Hills" is under a Creative Commons (CC BY-SA 3.0) license
Music promoted by BreakingCopyright: bit.ly/bkc-runic
------------------------------
Virtual Trip by Niwel / niwel-516897768
Creative Commons - Attribution-ShareAlike 3.0 Unported - CC BY-SA 3.0
Free Download / Stream: bit.ly/virtual-trip
Music promoted by Audio Library • Virtual Trip - Niwel (...
------------------------------
Music: You're No Help - Silent Partner • You're No Help - Silen...
------------------------------
Track: Retro Future - Another Kid [Audio Library Release]
Music provided by Audio Library Plus
Watch: • Retro Future - Another...
Free Download / Stream: alplus.io/retro-future
------------------------------
Track: Back to 1981 - Iaio [Audio Library Release]
Music provided by Audio Library Plus
Watch: • Back to 1981 - Iaio | ...
Free Download / Stream: alplus.io/back-1981
------------------------------

Пікірлер: 66
@Ecl1psed276
@Ecl1psed276 2 жыл бұрын
Very interesting that you got the exact same result as 3B1B even though the exact distribution was slightly different. You had slightly less 2s, 3s, and 5s than 3B1B, and more 4s, but the average was identical for both of you.
@Chloe-ju7jp
@Chloe-ju7jp 2 жыл бұрын
Good on you for including that message in the start
@factbanana5876
@factbanana5876 Жыл бұрын
Agreed
@jimbobago
@jimbobago 2 жыл бұрын
Your "naïve" solution was still better than what people would come up with without computer aid and the fact that you have the knowledge and skill to create *any* sort of computer solution puts you well above most people (certainly me). Of course, it's impressive that you weren't content to rest on your laurels and looked to improve on Version 1.0 also so congratulations all around.
@alc202
@alc202 2 жыл бұрын
Love the video! Also thank you for including the Excel sheet, as far as I can tell you are the only person with a good algorithm who has released something like that
@1.4142
@1.4142 2 жыл бұрын
3 brown 1 blue is from an alternate universe. Also, today's wordle is...
@aleksszukovskis2074
@aleksszukovskis2074 2 жыл бұрын
Good job on intro
@misterbobEA
@misterbobEA 2 жыл бұрын
Another great video and awesome results. Certainly near to the limit- I've been trying to work out if there's a way to prove what the minimum number of guesses for all 2315 words is, but I think this challenge is beyond me. I especially like the graphical representation of the graph, something I wanted to do with mine but never got round to. I will definitely be poring through your code as I'm intrigued how you did it.
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
Actually, sorry, I didn't publish the part with the visual version. Usually these ad hoc visualization programs end up being very messy and "out of context" - as they are literally one-time use. I can tell you though that I used a library called ete3. It's quite well doumented, so was quite easy to use. Building a tree from answers I had (pretty much the same structure as in excel file) was a little tricky. Adding those little colorful squares was also not super straightforward - I had to generate them separately. And finally, I had it generating the tree many times for nodes 1, 1-2, 1-3 ... 1-2315 and put it all together as video frames.
@purplenanite
@purplenanite 2 жыл бұрын
oh my god - I love the excel sheet! wow. I did see a version of wordle with 11 letters though...
@ltsMeNoodle
@ltsMeNoodle 2 жыл бұрын
That just narrows down the tree, since there are more 5 letter words than 11 letter ones
@purplenanite
@purplenanite 2 жыл бұрын
@@ltsMeNoodle I have counted 27893 11-long words, compared to around 12478 5-letter long words.
@ltsMeNoodle
@ltsMeNoodle 2 жыл бұрын
@@purplenanite is that so? My bad then
@Raf99
@Raf99 2 жыл бұрын
Didn't expected it :o or maybe? Good job man.
@arn0000
@arn0000 2 жыл бұрын
a friend introduced me to this game and i made a small part of my presentation on it with you videos to help me test a theoretical best i could achieve and lo and behol, just starting with the right wordalone made my success rate go from 50 to almost 65%, however as a human i do have vocabulary limitations and don't know the 'solution words or the potentially correct words' but i'm still quite happy with those results when i see how unusual the solution words are i do not get lol, ps : stats made with less than 100 played games obviously
@darcipeeps
@darcipeeps 2 жыл бұрын
To me, the only perfect algorithm would be an exhaustive search or one that’s proven to be as good. But it is satisfying that you came to the same conclusion as 3b1b
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
True. I thing I did 50x top branches for the top 20-30 words, or somethign like that. And from the looks of it the results for the words after 10-15 are obviously worse than for those at the top. SALET, the winner, was #3 in the list. with a few winning brances being #15-20 i the list (but literally just one or two of them, most are in top 5) I am not saying it is absolutely impossible that there is #400 somewhere in the list that would beat it. But from the looks of it it is highly unlikely.
@david203
@david203 Жыл бұрын
Ah, finally you reveal that the New York Times version of Wordle is what you use! I wondered about that. I always use a different version, since NYT tends to limit you to one game a day, which for me is about 199 games a day too few for real fun. "SLAVE" was an actual word in the version I play, so it is better than NYT in at least that way.
@UofU10
@UofU10 2 жыл бұрын
I was wondering if you were going to mention the 3b1b video which coincidentally came out very close to your previous one. I thoroughly enjoyed the video and the fact that your average guess was exactly the same was more exciting than you gave credit for. Love the videos keep it up!
@DeathClawz
@DeathClawz 2 жыл бұрын
Love the videos GCP! I hope you're doing well and are somewhere safe, especially if you live in the RU/UA area. I was wondering, what software do you use to code and visualize it all? I watch a bunch of channels that do these sort of things and would love to try to learn how to do it myself. I've occasionally dabbled in Visual Studios and Unity (in C#) for fun to make "games" so maybe I could mess around there. I haven't learned even close to all the names of everything yet, making it's slow and confusing, so I was wondering if a different software or language was more suited or more common for algorithmic work. As an engineering student I've thought that I could probably make it work in Matlab, but even just the thought of it makes me laugh.
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
Hey, thanks! I'm okay - I left Russia a few years ago, but my parents and friends are there. Anyway, terrible thing is going on: for Ukranians very directly right now, but for Russians too - our future, at least for my lifetime, is probably destroyed. As for the visualisations. I did it in a very low-fi back-of-the-envelope way, really. I wrote an ugly and simple program that drew a frame given a set of data (histogram used pyplot library, the rest is also home-made; tree used ete3 library). And then just loop it for all the data I have (maybe skip some frames for speed). Then just put all the frames together in a video editor - done. 3b1b, as far as I know, has his own visualisation engine, he has been developing for a while. Looking at his videos, it must be a powerful tool! It is open source too: github.com/3b1b/manim I haven't tried it, but I'd say if you plan to do it professinally, it seems worth looking into.
@Ashley.D
@Ashley.D 2 жыл бұрын
10:35 was it a deliberate choice not to add in the vowel U? Does that not add enough value because it's the least common vowel?
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
Yes, deliberate. I tried several versions with several sets of vowels - somehow removing U from that set gave better results. Not sure why, to be honest.
@pdrg
@pdrg 2 жыл бұрын
Cwtch is Welsh (for happy cuddly time, loosely), w acts as a vowel
@TheWolfboy180
@TheWolfboy180 2 жыл бұрын
Ayo he’s back ✨
@willguggn2
@willguggn2 Жыл бұрын
Oh, didn't expect to be greeted by the forbidden words. Kudos to you.
@egwenealvereiscool7726
@egwenealvereiscool7726 Жыл бұрын
*Me upon seeing the title - copying 3b1b, I see *Me at **13:27** - He doesn't even know the channel's *name* properly?!?!?! *Me at 13:30 - Aha! A CONFESSION! 10:08 The W-words (such as Crwth and Cwm) actually use 'W' as a vowel. This is more common than you might think - in "now", for example, the 'w' is technically a vowel. However, there are very few words with 'w' as the *only* vowel. 'Cwtch' I had never actually heard of before.
@MightyElemental
@MightyElemental Жыл бұрын
I had a go creating a solver and came up with a similar solution to the "Reuse green Version A" shown here. Issue was, I didn't realize you could get the dictionary used for wordle so I ended up using a regular dictionary 💀
@sedasavas7017
@sedasavas7017 Жыл бұрын
I hope one day everyone will be as peaceful and humane as you. Thank you for this thought.🙏🙏🙏
@Mr76Pontiac
@Mr76Pontiac 2 жыл бұрын
I'm not sure if there's some kind of filter that's preventing me from seeing all the words, but, the list I see on Google Sheets counts up to 2316 rows. I entered SALET as the guess word, and didn't find a _ _ _ E _ in the list (E as yellow).
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
oh, that's not what it means. the answers mean to be _ for grey, Y for yellow and G for green. so you need to look for _ _ _Y _
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
2316 is correct: 2315 potential secret words + header
@kooobnet7252
@kooobnet7252 2 жыл бұрын
Fibre is how you spell it in English... Fiber is how you spell it in American (which isn't English!)
@loris_redstone3518
@loris_redstone3518 2 жыл бұрын
Heyy a video !
@ScorpioneOrzion
@ScorpioneOrzion 2 жыл бұрын
just wondering what about the variants of wordle that uses multiple words?
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
You mean those you can play several times a day? I haven't looked into it, but I think they all change the set of words they use (and being JS games, they usually have lists of words open for an inquisitive viewer). I'd say general principles will probably hold, but actual numbers can be vastly different.
@ScorpioneOrzion
@ScorpioneOrzion 2 жыл бұрын
@@GamesComputersPlay No i mean variants like Quordle - Wordle on four different grids at once. Octordle - Wordle on eight different grids at once. Sedecordle - Wordle on sixteen different grids at once.
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
@@ScorpioneOrzion Wow, I haven't seen this one before, really cool. I'm checking it out - maybe this is where a bot may truly shine.
@ScorpioneOrzion
@ScorpioneOrzion 2 жыл бұрын
@@GamesComputersPlay their is also a variant where you have 1000 words, with 1005 guesses, but then the goal is to get them all 1000, in as few turns as possible. I think they all follow the same style as play, and that is guess N different words at the same time, with 5+N guesses. And the guesses are all the same for all boards.
@vishwajeetbharadwaj138
@vishwajeetbharadwaj138 7 ай бұрын
can anyone tell me whther this is a ML (re-inforcement)algorithm..?!
@GamesComputersPlay
@GamesComputersPlay 7 ай бұрын
I can. It isn't. It's a good old depth first search with pruning.
@vishwajeetbharadwaj138
@vishwajeetbharadwaj138 7 ай бұрын
@@GamesComputersPlay but isnt this logic similar to group clustering where you eliminate non-feasible solutions and the game actually learns from your previous guesses , so it is not exhaustive DFS but can be considered as ML algo , ANY sense ..?
@GamesComputersPlay
@GamesComputersPlay 7 ай бұрын
@@vishwajeetbharadwaj138 This is the part that is missing to make it a ML: "learns from your previous guesses". It doesn't. It uses the same logic in the first, second, third and so on turns. Check all possible guesses, pick top N that break the remaining list of words into max number of pieces. (Although N could be different between turns for better efficiency).
@vishwajeetbharadwaj138
@vishwajeetbharadwaj138 7 ай бұрын
@@GamesComputersPlay thanks for the insight.. Good work brother 🔥
@cgumas1430
@cgumas1430 2 жыл бұрын
Thank you Dmitry - more than anything, for your heartfelt introductory statement about the horrific war in Ukraine. Regarding Wordle, I too was (quite recently) bitten by the bug to lose sleep while searching for a good algorithm and, being an old programmer, gave it a shot without looking up anyone else's solutions. Your video is the first since I reached a solution that I am happy with. So, it is great to see that someone else went through a similar (error prone!) process on the way toward algorithmic success. And at 14:25, I was ecstatic to see that you quoted the same results that I discovered! Hurray! Even so, I've known that this is not quite optimal and that a tree-descent approach would yield better results ...but not by much. You had me ROFLOL at 14:38. Sure enough, you (and 3B1B) improved the result. Not only that, but you made an awesome video to illustrate and explain it. Incredible! Thank you very much!
@Taterzz
@Taterzz 2 жыл бұрын
oh snap name reveal D:
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
Yep. I didn't plan to, but such messages don't sound the same with pseudonyms. It is still a realtively popular name though - I tried to Google myself and it looks like there is a small crowd of people with this name.
@Chloe-ju7jp
@Chloe-ju7jp 2 жыл бұрын
Id be interested in what the 10 words it failed at were
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
Here are the 10 lost games: cares tolan quina ephod aking awing axing aging cares rebut whelp vigor drink infer inner cares pound vital foamy gighe jammy mammy cares rebut whelp vigor donko kayak joker cares dowry nempt bilge reggo jager eager cares bonie flout hadji mawed podge dodge cares rebut pride glory hakam fovea ferry cares pound vital foamy yowza gobbi baggy cares rebut whelp vigor donko order odder cares rebut dowry manor kappa rover roger Quite a few (7 out of 10) have double letters. Maybe there is a weakness.
@Chloe-ju7jp
@Chloe-ju7jp 2 жыл бұрын
@@GamesComputersPlay thank you!
@david203
@david203 Жыл бұрын
But all your simulations were for naive Wordle, where you pick one initial word to start with. Not one mention of picking more than one word to start with, but this is well within the rules of Wordle! I find that, even with my poor ability to rearrange letters in my mind, I can achieve a 94% win rate starting with four words that, with no repetitions, cover the 20 most frequent letters of the alphabet. Four words leave me with only two lines, but that is enough so that I can allow myself to make one mistake and still win the game. In my version of Wordle I have participated in tournaments against other users and readily win the highest position in the tournament with just an hour or two of constant playing. The playing itself is easy, since all I do is enter the same four words (in any order), then do a little thinking to find the goal word. I wonder if your complete simulation of this four-word method would show a 100% win rate or not. I find, in practice, that I rarely have a problem with the goal word using any of the six letters not covered by the initial four words, or with the goal word using repeated letters. But these two cases should mean that two lines is not enough for trial and error, which would mean a win rate of less than 100%. This particular four word strategy is discussed at kzbin.info/www/bejne/omqVmGmPrp2na8k . My original strategy was to cover only the vowels, which requires fewer initial words, but doesn't work as well.
@GamesComputersPlay
@GamesComputersPlay Жыл бұрын
That’s an interesting question. For other people reading this comment who didn’t see the video in questions, those words were: TUBES, FLING, CHAMP, WORDY And those words and not too shabby: 2167 (93.6%) cases - secret narrowed down to one word, victory is possible on guess 5 132 (5.7%) cases - secret narrowed down to two word, victory is possible on moves 5 or 6 In 16 cases, there are more than 2 possible words remain. Here they are: 12 (.5%) cases would leave 3 words: GAUZE, VAGUE, GAUGE - can be won be guessing GAUZE or GAUGE RESET, ESTER, STEER - either of those 3 will determine the secret word SAVVY, ASSAY, SASSY - same PIPER, RIPER, VIPER - there are 67 allowed guesses that can identify the secret word in 2 moves. For example, RIVAL Finally, 4 cases (.2%) would leave 4 words: STAKE, SKATE, STAVE, STATE - as far as I can simulate, there are NO guesses that can break these 4 down in 2 guesses. Overall, those 4 words to start your Wordle with could (with perfect play) guarantee the victory in 2311/2315 = 99.8% cases. Pretty close to 100%, Not 100% tho.
@GamesComputersPlay
@GamesComputersPlay Жыл бұрын
Actually, I have made a mistake - there are 43 words that can differentiate those 4 words. (including "skate", one of the word from the list). So here you have it: 100% guaranteed victory. Confirmed.
@david203
@david203 Жыл бұрын
@@GamesComputersPlay Wow. I didn't believe the claim of that other author, but you confirmed it. I'm impressed with both of you. I will copy this comment to the other thread.
@Breadcrochets
@Breadcrochets Жыл бұрын
Pupal is a word I’ve never heard of and is way too close to pupil, so I can see pupal being an infuriating answer. Fibre and fiber are basically equally acceptable spellings, so picking one would piss a bunch of ppl off. Agora I have no idea
@empty5013
@empty5013 2 жыл бұрын
hi mom!
@rotatingmind
@rotatingmind Жыл бұрын
Remember, your wife is always right.
@rijenkii
@rijenkii 2 жыл бұрын
I'm also Russian. What is happening in Ukraine is wrong and horrifying. Thank you.
@MrDammed1
@MrDammed1 Жыл бұрын
heres another suggestion: either make political statements at the beginning of every video or never
@EebstertheGreat
@EebstertheGreat 2 жыл бұрын
BTW, if you win 89% of the time, you don't call that an "89 winning rate" or "1 in 9 fail rate," you call it an "89 percent win rate." If you leave out the word "percent," the sentence doesn't make any sense. That is approximately an 8 in 9 win rate or 1 in 9 loss rate, but you wouldn't normally say it that way.
@GamesComputersPlay
@GamesComputersPlay 2 жыл бұрын
Yes, must have been a slip. It should be either 0.89 or 89 percent rate. Agree.
@vishwajeetbharadwaj138
@vishwajeetbharadwaj138 7 ай бұрын
is this an ML algo brother ..?! @@GamesComputersPlay
@EvilDMMk3
@EvilDMMk3 2 жыл бұрын
🇺🇦
@leesweets4110
@leesweets4110 Жыл бұрын
I hope the war in Ukraine ends, too, with Russian victory. Now, do you want to keep talking politics, or do you want to talk about wordle algorithms like your title suggests?
Jimmy Fallon Attempts to Play Wordle | The Tonight Show Starring Jimmy Fallon
7:25
The Tonight Show Starring Jimmy Fallon
Рет қаралды 2,1 МЛН
1🥺🎉 #thankyou
00:29
はじめしゃちょー(hajime)
Рет қаралды 56 МЛН
Be kind🤝
00:22
ISSEI / いっせい
Рет қаралды 15 МЛН
Simulating Wordle: in search of the perfect strategy
13:01
Games Computers Play
Рет қаралды 29 М.
Destroying WORDLE spin-offs: Quordle, Absurdle, Survival (with coding)
8:39
Games Computers Play
Рет қаралды 4,6 М.
Solving Wordle using information theory
30:38
3Blue1Brown
Рет қаралды 10 МЛН
Claimeven - Connect 4 Strategy
10:43
2swap
Рет қаралды 246 М.
Python Bot Plays Connect Four (using Minimax and some heuristics)
20:31
Games Computers Play
Рет қаралды 17 М.
Can you find: five five-letter words with twenty-five unique letters?
19:50
An expert's hacks for winning Wordle
7:00
Breakfast Television
Рет қаралды 58 М.
I Turned Wordle Into a Twitter Bot
10:04
PolyMars++
Рет қаралды 182 М.
СОБИРАЕМ РАДУЖНУЮ ИГРУШКУ #shorts
0:41
Ал Плей
Рет қаралды 3,2 МЛН
Kaiju Buzz absence 😔 | Brawl Stars #brawlstars #shorts
0:20
Ghostify Labs
Рет қаралды 6 МЛН
Minecraft Villagers Uses Mods #minecraft #villager #grox
0:47
Froppy Craft
Рет қаралды 16 МЛН
Minecraft RTX 203% CLUCK KENT #Shorts
0:29
Jake Fellman
Рет қаралды 12 МЛН