Can you find: five five-letter words with twenty-five unique letters?

430,157
143
Publicado 2022-08-03
Five words. Twenty-five letters. Can you find them? That's the Q.

I'm not sure I mentioned this enough, but I have a podcast and it caused this video. Search for "A Problem Squared" wherever you get podcasts and you shall find. aproblemsquared.libsyn.com/

Get ALL THE WORDS as "words_alpha.txt" here: github.com/dwyl/english-words

Here is the vastly superior code that Benjamin sent in: gitlab.com/bpaassen/five_clique

My tweet here: twitter.com/standupmaths/status/154934321840745676…

Against my better judgement, I have put my code on github: github.com/standupmaths/fiveletterworda

You can also see me talk about two lines of the code over on the second channel.    • Deleted scene: five words with twenty...  

I downloaded the Wordle words from here:
www.reddit.com/r/wordle/comments/s4tcw8/a_note_on_…
gist.github.com/cfreshman/a03ef2cba789d8cf00c08f76…
gist.github.com/cfreshman/cdcdf777450c5b5301e43906…

3blue1brown video about Wordle:    • Solving Wordle using information theory  

Cheers to my Patreons for motivating me to film a thing from the podcast as a quick youtube video. And helping me justify to Lucie why I need to film a thing while we are "on holidays". www.patreon.com/standupmaths

CORRECTIONS
- Nothing yet. Let me know if you spot any mistakes!

That is all! Stop reading the description and go do a better job coding this challenge yourself.

Original question from Daniel Bingham
Filming and editing by Alex Genn-Bash
Additional filming by Matt Parker
Beer by some hotel in Athens
Music by Howard Carter
Design by Simon Wright and Adam Robinson
J̸I̸G̵ ̸C̸O̴U̶L̶D̴ ̶H̵A̵V̵E̸ ̸F̷O̴U̴N̷D̷ ̷A̸L̴L̸ ̵5̵3̶8̷ ̶I̶N̶ ̸U̸N̸D̵E̸R̴ ̶3̴2̷ ̴D̸A̶Y̴S̶

Todos los comentarios (21)
  • @liamlaverty9631
    There's people out there abbreviating headquarters to HDQRS instead of HQs. This appeared to the author as optimisable
  • @trizgo_
    "This appeared to the author as optimizable" is a legendary quote with vast meme potential
  • @mattchaney1177
    I think this is a great intersection of Linus's Law, "given enough eyeballs, all bugs are shallow," and Cunningham's Law, "the best way to get the right answer on the internet is not to ask a question; it's to post the wrong answer." "The best way to get to an optimized algorithm on the internet is to post a naïve implementation and wait for replies."
  • @solhsa
    One fun low-level optimization trick: 32 bit ints have more bits than 27 letters in the alphabet. Since anagrams and duplicate letters are removed, you can just compare the bit patterns.
  • @MonkeySimius
    I really like that you included your viewer's more optimized code, even though you spent the first half of the video talking about how you didn't want to hear about how your code isn't optimized and you didn't want to hear about it. Stuff like that is just endearing as all heck.
  • @ericgoldman7533
    To be fair, Matt has never claimed (and in fact, routinely disclaims) that his code would be neat, efficient, or fast.
  • @MichaelHendriks
    Q is the 6th 5-letter word to complete the whole alphabet! The other 4 letters in Q are completely unnecessary anyway
  • This is called "the Jotto problem". There were papers published in '68 and '96. I spent a bunch of time when Wordle came out doing the same thing, then I searched for the set I found and realized I could have just done a literature search.
  • @semitangent
    11:11 - can we talk about how apparently these notes were handwritten with such enormous pressure that you can almost decipher the contents from the backside of the paper?
  • The "Matt from the future" part with improved code was a good addition. It's a nice demonstration how much extra perofrmance you can get with improved algorithm instead of just using better hardware. You could have improved the code or run the original code on 3000 computers in parallel to get the results in identical time.
  • @gameXylinder
    The countdown music, the live "photos", the surprise twist at the end tying everything up in a neat bow - you knocked this video out of the Park(er)!
  • @Particelomen
    It would be really interesting hearing Matt giving a deeper explanation of how graph theory was used to solve this problem. It always amazes me how different fields can use different tools to solve the same problem, and that some tools obviously are much more effective than others.
  • @Karolomen
    So if Benjamiin's code had to run for approximately 1/30th of the day, and your code ran for approximately 30 days, it means that Matt's code was about 900 times slower than Benjamin's, which was running for 900 seconds. I like that.
  • @Sykar24
    10:05 The ‘y’ in glyph is, in fact, a vowel. There are a few rules you can use to determine when ‘y’ is (or isn’t) a vowel, but in this case, it undoubtedly is a vowel.
  • @ingomancer
    Completely off topic to the actual video, but I love the python library used for the progress bars in Benjamin's code. tqdm, just wrap whatever you're looping over (for X in tqdm(thing)) and bam, you get a progress bar! It even calculates iterations per second and time estimates. Very useful and easy to use.
  • @daanwilmer
    Tip for mac and linux users: you can time commands using the "time" command. So, if you want to time how long it takes to run "python ./python-script.py", you run "time python ./python-script.py". I know you love spreadsheets, but this approach might save you some... time.
  • @davishall
    11:32 Even after multiple NYT updates, the code still stores the word lists locally! You can check in the game assets js file. I won't link it here in case Matt filters links, but it's the third script in the source HTML.
  • @NickAskew
    As a software developer this seemed like a wonderful little weekend challenge. So I wrote an initial version and realised I was going to get the kind of times you were initially getting. Then I did some optimisation and then some more and now my release mode software running on a laptop finds 538 results in 15.825 seconds. I'm running C# code and taking advantage of the parallel library but perhaps the biggest leap forward was realising we have 64bits and only 26 possible characters. Now I'm just wondering how I can shave off those pesky 15 seconds 🙂
  • @thatmartolguy
    5:47 Fun fact: If you take the 3,213,696 pairs of words with 10 unique letters and remove the anagram equivalents, the amount of double-words that you have to check goes down by a factor 5 to just 640,023. This could have made the runtime a factor 25 quicker, meaning it would have taken just about 30 hours in total instead of 32 days.