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

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ส.ค. 2022
  • 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: / 1549343218407456769
    Against my better judgement, I have put my code on github: github.com/standupmaths/fivel...
    You can also see me talk about two lines of the code over on the second channel. • Deleted scene: five wo...
    I downloaded the Wordle words from here:
    / a_note_on_wordles_word...
    gist.github.com/cfreshman/a03...
    gist.github.com/cfreshman/cdc...
    3blue1brown video about Wordle: • Solving Wordle using i...
    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". / 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̶
  • บันเทิง

ความคิดเห็น • 1.9K

  • @liamlaverty9631
    @liamlaverty9631 ปีที่แล้ว +5036

    There's people out there abbreviating headquarters to HDQRS instead of HQs. This appeared to the author as optimisable

    • @ookazi1000
      @ookazi1000 ปีที่แล้ว +210

      Yeah, I was fine with EXPWY. It was HDQRS I had a problem wit.

    • @dodaexploda
      @dodaexploda ปีที่แล้ว +95

      Someone was writing to a file way back when we were limited to 8 characters. That's how you get HDQRS.doc. I assume that it then became a thing.

    • @-_-.-.._.
      @-_-.-.._. ปีที่แล้ว +36

      @@dodaexploda (thats 9 characters)

    • @dodaexploda
      @dodaexploda ปีที่แล้ว +113

      @@-_-.-.._. the extension and dot didn't matter except for the extension itself being limited to 3 characters. But it was 8 characters allowed left of the dot.

    • @UnderfundedScientist
      @UnderfundedScientist ปีที่แล้ว +3

      Fire comment

  • @trizgo_
    @trizgo_ ปีที่แล้ว +1193

    "This appeared to the author as optimizable" is a legendary quote with vast meme potential

    • @tomdekler9280
      @tomdekler9280 ปีที่แล้ว +44

      I really wish he would've said "the Parker algorithm" instead of "Parker's algorithm"

    • @v0id_d3m0n
      @v0id_d3m0n ปีที่แล้ว +1

      Agreed. Absolutely legendary💀💀

    • @diophantine1598
      @diophantine1598 ปีที่แล้ว +6

      I got it down to 13.7 seconds while still using Python, lol. Definitely optimisable.

    • @Hyraethian
      @Hyraethian ปีที่แล้ว +1

      I had to give a good laugh at that.

    • @mihailmilev9909
      @mihailmilev9909 ปีที่แล้ว +1

      Fr this is exactly what I started thinking when I saw the comments

  • @mattchaney1177
    @mattchaney1177 ปีที่แล้ว +687

    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."

    • @landsgevaer
      @landsgevaer ปีที่แล้ว +15

      Should you then post after you ran your own? That still takes a month...
      😉

    • @CraftBasti
      @CraftBasti ปีที่แล้ว +35

      @@landsgevaer you're right, he should have estimated the time his algorithm will take, posted a video 29 days ago, gotten the reply within two days and had the answer way quicker!

    • @BizVlogs
      @BizVlogs ปีที่แล้ว +9

      Ok Blixor’s Law: If you shake a palm tree hard enough, the train that holds all the turkey slot machine pterodactyl.

    • @tassaron
      @tassaron ปีที่แล้ว +3

      @@BizVlogs that's a good one, I'll have to remember it

    • @trueriver1950
      @trueriver1950 ปีที่แล้ว +7

      @@BizVlogs the difference between a duck is that one of its legs is both the same

  • @solhsa
    @solhsa ปีที่แล้ว +143

    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.

    • @robertr7923
      @robertr7923 ปีที่แล้ว +6

      Can you explain? I don't get it

    • @letsmakeit110
      @letsmakeit110 ปีที่แล้ว +28

      @@robertr7923 set one for letters that appear in the word, zero for letters that don't. Each word is a 26-bit number up to 64 million or so. So ABOUT would be 00000000000110000100000000000011 or 1,589,251. The nice thing about doing it this way instead of an array of characters or something, is that comparing bits on a computer is very fast. So you AND the two words together and see if the number of bits set to one is 0.

    • @pauhull
      @pauhull ปีที่แล้ว +14

      @@letsmakeit110 if you would AND two words with distinct letters in this representation the result would actually be 0, you wouldn't even need to count the bits, very efficient indeed

    • @deefdragon
      @deefdragon ปีที่แล้ว +29

      And fun thing. Someone went and did this and a few other optimizations and solved the entire problem in less than a second.

    • @maxwellqklinger
      @maxwellqklinger หลายเดือนก่อน

      I used this as an excuse to make the jump from python to C. I created my own implementation of this using your bit trick and it worked wonders (1.5s). Thanks!

  • @MonkeySimius
    @MonkeySimius ปีที่แล้ว +1709

    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.

    • @irgyn
      @irgyn ปีที่แล้ว +83

      I don't know if you did that on purpose, but you wrote "didn't want to hear about it" twice. Your comment isn't optimized, either, and I love it.

    • @newciousyt
      @newciousyt ปีที่แล้ว

      Yo 🔥th-cam.com/video/rdJ9bsN7JAw/w-d-xo.html..

    • @UnknowinglyDerpy
      @UnknowinglyDerpy ปีที่แล้ว +34

      I’m sure that in Matt’s head he was more or less expecting codes that improve the time from 32 days to maybe a week or two.
      Not a code that solves the problem in 15 minutes….
      And with the follow up code being 3072 times faster (i checked), i guess he just added it on because the extra 15 minutes of verification doesn’t really add much to the total time used to make the final video

    • @PattyManatty
      @PattyManatty ปีที่แล้ว +12

      @@irgyn this appeared to the author as optimizeable

    • @christianstonecipher1547
      @christianstonecipher1547 ปีที่แล้ว +28

      There is also a difference between, "you should have optimized it using this optimization" and "here is a complete optimized implementation that uses somewhat advanced maths".

  • @ericgoldman7533
    @ericgoldman7533 ปีที่แล้ว +782

    To be fair, Matt has never claimed (and in fact, routinely disclaims) that his code would be neat, efficient, or fast.

    • @pvic6959
      @pvic6959 ปีที่แล้ว +51

      exactly! and thats ok! hes a mathematician. code is just a tool for him. hes not trained in it
      this is a huuuuge difference i keep telling people about. i did a computer science degree. i am a software engineer now. I stand by the fact that programming != computer science
      and we see the difference here. programming gets the job done (matts solution (also this is no diss on matt. hes super smart; software just isnt his expertise and thats ok)). Computer science gets the job done well and efficiently (the graph solution). I dont claim I could have gotten to the same solution, but figuring those types of stuff out is the fun bit for me lol

    • @v.sandrone4268
      @v.sandrone4268 ปีที่แล้ว +17

      I was shocked that mentioned the vowels are being key but never used their importance as part of the algorithm.
      If had put words into buckets that included each vowel and a bucket for y and another without vowels he could have greatly reduced comparison.
      For example, if the first word included "a" there is no point testing words from the a bucket, if the second word included "e" you don't check the a and e buckets for the next word etc etc.
      Such an obvious improvement.

    • @orangenostril
      @orangenostril ปีที่แล้ว +7

      @@v.sandrone4268 Even better, if he could verify that all the words need at least one vowel (y included) he could just discard any iteration that has at lease two words using multiple vowels (and technically cut out any individual words that use three) to skip a _ton_ of the processing

    • @y_fam_goeglyd
      @y_fam_goeglyd ปีที่แล้ว +1

      He's a *lot* faster than I could ever be!

    • @landsgevaer
      @landsgevaer ปีที่แล้ว +3

      @@v.sandrone4268 If he uses aggressive pruning, I suspect the gain is moderate, since repeated vowels are found immediately anyways. You do gain a bit because you don't need to check all words, but the time complexity is in the size of the expanded tree, and that doesn't improve.
      Orange nostril's trick *does* prune the search tree, however.

  • @MichaelHendriks
    @MichaelHendriks ปีที่แล้ว +67

    Q is the 6th 5-letter word to complete the whole alphabet! The other 4 letters in Q are completely unnecessary anyway

  • @gameXylinder
    @gameXylinder ปีที่แล้ว +48

    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)!

    • @samtux762
      @samtux762 3 หลายเดือนก่อน +1

      Parker is an interesting combo of a stand up artist and a mathematician. His shows are not for everyone, but they are interesting for those curious in math.

  • @justforplaylists
    @justforplaylists ปีที่แล้ว +894

    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.

    • @saar144
      @saar144 ปีที่แล้ว +4

      You should play Wordle on Hard Mode

    • @seanscott2677
      @seanscott2677 ปีที่แล้ว +24

      @@saar144 beside the point lol

    • @Ulkomaalainen
      @Ulkomaalainen ปีที่แล้ว +17

      Oh, that brings back memories. Had Jotto as a PBM game, wrote my own program (looked flashy, could be optimized probably to certainly) in Turbo Pascal. Only downside was there was no list of words to download at the time so a friend and I spent quite a lot of time on creating a word list. Only to realize it was too much for the array I defined, so we had to weed out "unused" words. Which would have probably killed this exercise. (Different language though)

    • @shoo7130
      @shoo7130 ปีที่แล้ว +6

      How do you code a literature search?

    • @wedding_photography
      @wedding_photography ปีที่แล้ว +13

      @@shoo7130 Mechanical Turk

  • @semitangent
    @semitangent ปีที่แล้ว +426

    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?

    • @coryman125
      @coryman125 ปีที่แล้ว +126

      No pens or pencils were available so he instead hammered the letters in with a metal stamping kit, I presume

    • @columbus8myhw
      @columbus8myhw ปีที่แล้ว +45

      Pen didn't have ink, had to go entirely off pressure, I think

    • @feedbackzaloop
      @feedbackzaloop ปีที่แล้ว +50

      @@coryman125 with a muntz stamp, you mean?

    • @coryman125
      @coryman125 ปีที่แล้ว +17

      @@feedbackzaloop We've gone full circle!

    • @azyfloof
      @azyfloof ปีที่แล้ว +18

      He didn't have anything sturdy to lean on, so instead used a sheet of playdough

  • @BlackEyedGhost0
    @BlackEyedGhost0 ปีที่แล้ว +32

    0:42 Lmao, this bit was really well done. Great recurring joke too

  • @Sykar24
    @Sykar24 ปีที่แล้ว +94

    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.

    • @sergio_henrique
      @sergio_henrique ปีที่แล้ว +2

      That sounds so odd to me. In my language (Portuguese), it's so simple to know what a vowel is. If it's A, E, I, O or U, then it's a vowel, otherwise it's not. 😆

    • @aaronl19
      @aaronl19 ปีที่แล้ว +7

      @@sergio_henrique ye in english 'Y' acting as a vowel is pretty uncommon, so quite a few people dont even know it does lmao

    • @jonathanschnittka5680
      @jonathanschnittka5680 ปีที่แล้ว +26

      @@aaronl19 prett*y* common, actuall*y*

    • @v0id_d3m0n
      @v0id_d3m0n ปีที่แล้ว +11

      Y: the alphabet equivalent of gender fluid

    • @nekomimicatears
      @nekomimicatears ปีที่แล้ว +3

      @@sergio_henrique that's what happens when a language is mostly loan words like English is lmao

  • @Particelomen
    @Particelomen ปีที่แล้ว +575

    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.

    • @crahs8
      @crahs8 ปีที่แล้ว +26

      Assuming you know some basic graph theory: If you imagine a graph, where each node is a different 5-letter word, we can connect two words with an edge if they do not share a letter (e.g. "fjord" and "gucks" are connected). The problem we want to solve is finding 5 words that all don't share letters pairwise or in the context of the graph, find 5 nodes that are all connected to each other. Such a collection of nodes is called a clique, and finding cliques of certain sizes is a well-studied problem. Now it is just a matter of going out an implementing some algorithm that solves this problem (Here's the first one I found, don't know if it is what was used: en.wikipedia.org/wiki/Bron-Kerbosch_algorithm)

    • @qaysed453
      @qaysed453 ปีที่แล้ว +59

      Benjamin describes it in the GitHub readme - he generated a graph by giving each word a vertex and connecting them with an edge if they didn't share any letters. The groups of words we look for then correspond to vertex sets where each two vertices are connected by an edge. That structure is called a clique, and looking for maximally sized cliques is a well known problem. It's NP-complete in the general case, but this instance is small enough that the algorithms developed for the problem can deal with it just fine.

    • @oisyn-
      @oisyn- ปีที่แล้ว +44

      In this particular case, it isn't so much so that the graph solution is way more efficient. It's just so that Matt's brute force implementation was terribly inefficient 😉. My initial brute force did it in 67 seconds, and using some clever lookup techniques I've got it down to 7. I doubt that can be beaten by using a generic maximum clique algorithm from graph theory.

    • @kalecgos1
      @kalecgos1 ปีที่แล้ว +3

      @@qaysed453 Technically we should already know the exact shape of the clique we're trying to find, so a regular subgraph isomorphism algorithm should suffice

    • @qaysed453
      @qaysed453 ปีที่แล้ว +1

      @@kalecgos1 well, a clique is a complete graph, so we always know its shape, aside from the cardinality, so the max clique problem can always be solved by log n applications of a subgraph isomorphism algorithm (this is actually the common proof for subgraph isomorphism being NP complete). I don't know the actual algorithms well enough to tell whether a general isomorphic subgraph search or a clique search would be faster, but the latter is more specific, so presumably it at least wouldn't be slower.

  • @davishall
    @davishall ปีที่แล้ว +468

    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.

    • @user-rv9vk8by5i
      @user-rv9vk8by5i ปีที่แล้ว +42

      Unfortunately, NYT have completely removed some definitely valid English words from the list, so the original is still better. All 4 lists are uploaded to the same github account, iirc

    • @rngwrldngnr
      @rngwrldngnr ปีที่แล้ว +10

      @@user-rv9vk8by5i profanity?

    • @hunterwilhelm
      @hunterwilhelm ปีที่แล้ว +12

      @@rngwrldngnr and offensive words

    • @Rangsk
      @Rangsk ปีที่แล้ว +33

      @@user-rv9vk8by5i To be clear, they removed them as ever being possible answers, but they are still accepted as guesses.

    • @jimtohas1077
      @jimtohas1077 ปีที่แล้ว +26

      @@user-rv9vk8by5i NYT has only removed ['agora', 'pupal', 'lynch', 'fibre', 'slave', 'wench'] without adding any, so the list is functionally the same.

  • @bjonesnet
    @bjonesnet ปีที่แล้ว +31

    Including the Countdown music while the efficient code was running: an absolute masterstroke. Well played.

  • @NickAskew
    @NickAskew ปีที่แล้ว +152

    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 🙂

    • @emorell96
      @emorell96 ปีที่แล้ว +5

      Could you share the code? It would be awesome to learn from it :) thanks!

    • @NickAskew
      @NickAskew ปีที่แล้ว +8

      @@emorell96 Sorry, I have been caught up for weeks installing a new kitchen. I hope I can get some rather ugly code out there at some point. Meanwhile I should mention that while I'm now slightly below two seconds, I've seen somewhere that some other guy has managed to get significantly below 1 second.

    • @jeremyzz
      @jeremyzz ปีที่แล้ว +2

      @@NickAskew That's pretty cool, did you ever manage to improve eve further?Still in C# right?

    • @NickAskew
      @NickAskew ปีที่แล้ว +8

      @@jeremyzz Hi. Yes, I've managed to get it to around 2.3 seconds by using various techniques such as Parallel.For(...) and profiling the code to find the bottlenecks.
      I should mention that others have managed to exceed this by a factor of about 25 times and I am impressed BUT I do not want to see how they did it because I'm looking to see if I can implement my own idea before seeing how they did it, so if you find out no spoiler 🙂
      I'm looking at indexing as an option as my current code is a little brute force. I guess rewriting in assembler would help but that's a step too far, I'll stick with C# and framework net7.0.

  • @Karolomen
    @Karolomen ปีที่แล้ว +252

    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.

    • @DIMOHA25
      @DIMOHA25 ปีที่แล้ว +37

      15 minutes is 1/96th.

    • @Jake-hd7lt
      @Jake-hd7lt ปีที่แล้ว +4

      So does that mean for every 1 second of Ben's code, Matt's code ran for 15 min?

    • @Karolomen
      @Karolomen ปีที่แล้ว +51

      @@DIMOHA25 Ah, so 15 minutes = 1/30th of a day is a new Parker approximation!

    • @kane2742
      @kane2742 ปีที่แล้ว +11

      @@DIMOHA25 For anyone who's curious (but not curious enough to do the calculations themselves...), 1/30 of a day is exactly 48 minutes, assuming a typical 24-hour day with no daylight saving time change or leap second.

    • @gdclemo
      @gdclemo ปีที่แล้ว

      More like a solution squared than a problem squared!

  • @AnonymousPerson-cu7yz
    @AnonymousPerson-cu7yz ปีที่แล้ว +209

    I just wanted to mention that formally this problem is searching for a maximum clique (subset of vertices s.t. there are edges between all pairs of vertices) in a graph. If we build a graph where every vertex is a word, and we have an edge between two vertices if they have different letters, then a maximum clique will be the answer you are looking for.
    Edit: I should not write comments before finishing watching videos.

    • @pafnutiytheartist
      @pafnutiytheartist ปีที่แล้ว +7

      This sounds like a great topic for a follow up video!

    • @martinwhitaker5096
      @martinwhitaker5096 ปีที่แล้ว +2

      I'd love to see a video on that - right now I don't understand it!

    • @danceswithdirt7197
      @danceswithdirt7197 ปีที่แล้ว +1

      I would *love* to see a video about graph theory by Matt Parker. I will bet he has at least one pal who specializes in it.

    • @joshmyer9
      @joshmyer9 ปีที่แล้ว +2

      Thanks for taking one for the team: I was reading the comments while watching the video to see if someone else mentioned this before posting it myself.
      (At least we can feel vindicated that the theory worked out, all without having to actually code it up!)

    • @newciousyt
      @newciousyt ปีที่แล้ว

      Yo 🔥th-cam.com/video/rdJ9bsN7JAw/w-d-xo.html..

  • @MikkoRantalainen
    @MikkoRantalainen ปีที่แล้ว +100

    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.

    • @gonzalo_b762
      @gonzalo_b762 ปีที่แล้ว +5

      Running code on 3000 computers doesn’t make it 3000x faster.

    • @MikkoRantalainen
      @MikkoRantalainen ปีที่แล้ว +7

      @@gonzalo_b762 It depends on algorithm. For "embarrassingly parallel" problems you can get totally linear scaling. For example, if you're brute forcing 64 bit encryption, you could just split the whole range to 3000 parts and use 1...2^64/3000-1 for the first computer, 2^64/3000..2*2^64/3000-1 for the second computer etc. If I understood the algorithm correctly, Matt was brute forcing the whole range so it would have been trivial to split into parts.

    • @gonzalo_b762
      @gonzalo_b762 ปีที่แล้ว +2

      @@MikkoRantalainen Good point. I’m trying to figure out how you could separate it into equal parts given how the output is dependent on all the input though.

    • @MikkoRantalainen
      @MikkoRantalainen ปีที่แล้ว +2

      @@gonzalo_b762 For example, when you know that you have to evaluate a list of words, you only test words where the index of the word mod N is J, where N is the total number of machines running in parallel and J is the index for the machine running the algorithm. Some other machine will test all the skipped words. (Of course, any decent optimizing compiler should be able to avoid division and just add N for every loop.)

    • @casenc
      @casenc ปีที่แล้ว +2

      Someone got it down to a tenth of a second running on a 10yo laptop a couple days ago!

  • @ingomancer
    @ingomancer ปีที่แล้ว +30

    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
    @daanwilmer ปีที่แล้ว +195

    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.

    • @liorramati265
      @liorramati265 ปีที่แล้ว +18

      Depending on exactly what you want to time, this could give an inaccurate number since it times the entire process including spinning up the python interpreter, not just the algorithm. That said, yes, time is a wonderfully handy command

    • @greyed
      @greyed ปีที่แล้ว +8

      @@liorramati265 It includes spinning up the Python interpreter which, upon repeated uses, itself is inconsistent. As the first run might be from disk whereas subsequent runs are from cached memory. This is why when tech sites use time $command as a benchmark they reboot the system between runs.

    • @mskiptr
      @mskiptr ปีที่แล้ว +9

      If you're using Python, it's even better to just use the timeit module

    • @agliacci
      @agliacci ปีที่แล้ว

      @K.D.P. Ross optimized version is sub 1 second

  • @caspermadlener4191
    @caspermadlener4191 ปีที่แล้ว +348

    This is actually an older question than you think. On the Netherlands, there is a magazine called Pythagoras, which asked exactly that question. I myself asked some of my friends from the Mathematical Olympiad whether they could come up with any combination. I concluded that is was probably impossible, after checking every word containing Q and X and Y (those are rare in Dutch)

    • @thibautsnoeijs
      @thibautsnoeijs ปีที่แล้ว +13

      Damn we Dutch are everywhere

    • @belg4mit
      @belg4mit ปีที่แล้ว +16

      What if you allow y for ij as in Old Dutch?

    • @colinwood9717
      @colinwood9717 ปีที่แล้ว +2

      @@thibautsnoeijs but probably mostly in the Netherlands 🇳🇱

    • @captainchaos3667
      @captainchaos3667 ปีที่แล้ว +1

      Op Nederland?

    • @newciousyt
      @newciousyt ปีที่แล้ว

      Yo 🔥th-cam.com/video/rdJ9bsN7JAw/w-d-xo.html..

  • @twertygo
    @twertygo ปีที่แล้ว +32

    I mean the topic was intresting and presented in an accesible way and all, but I loved the pictures of BeChill and the Countdown music for the code running. Just hillarious!

  • @flyingcatpack
    @flyingcatpack ปีที่แล้ว +7

    that photo joke - gold, now I MUST check it out. Also what a satisfying result with just the 1 set of 5 words using 25 letters, well done!!

    • @stefanpochmann5205
      @stefanpochmann5205 ปีที่แล้ว +1

      What about the ten other sets that he overlooked?

  • @therocknrollmillennial535
    @therocknrollmillennial535 ปีที่แล้ว +25

    The Countdown music when waiting for the code to finish "building neighborhoods" was a nice touch, Matt.
    (Also, thank you, weird TH-cam algorithm, for introducing this American to Countdown during lockdown.)

  • @ratinthecat
    @ratinthecat ปีที่แล้ว +121

    I thought Suzie Dent was going to come on when you said you've got the ultimate authority on what is a word. But given the stated problem was about Wordle, it does feel like the Wordle list of acceptable words is correct.

    • @gregmark1688
      @gregmark1688 ปีที่แล้ว +30

      He did include the Countdown theme, which I thought was pretty clever. I'm guessing Suzie was a tad beyond the budget.

    • @steve470
      @steve470 ปีที่แล้ว +8

      In Matt's defence, the video did include (multiple photographs of) someone who has in fact sat in Dictionary Corner next to Susie Dent.

    • @vigilantcosmicpenguin8721
      @vigilantcosmicpenguin8721 ปีที่แล้ว +1

      @@gregmark1688 It just wouldn't be optimizable.

  • @thatmartolguy
    @thatmartolguy ปีที่แล้ว +11

    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.

  • @cmyk8964
    @cmyk8964 ปีที่แล้ว +217

    Actually, having 4 words with 20 unique letters is kinda useful on Quordle, Octordle, Sedecordle, and Duotrigordle, in order to practically guarantee that you get all of them right.

    • @josephatthecoop
      @josephatthecoop ปีที่แล้ว +11

      I concur. I most often play sedecordle. I usually start with three words that share no letters and cover all the vowels. The results from that usually give me an enjoyable challenge that is doable but not too easy.

    • @DeGuerre
      @DeGuerre ปีที่แล้ว +10

      You also want to prioritise the most common letters. Cracking the Cryptic loves to use SONIC TRADE LUMPY. SIREN OCTAL DUMPY is the same set of letters if you prefer base 8.

    • @josephatthecoop
      @josephatthecoop ปีที่แล้ว +4

      @@DeGuerre Indeed. I follow that same principle but rather make up my starters each day. My most recent set was PRUDE MINTY GOALS, which differs only by C/G. I’m sure and C is marginally better, but it’s not a bad set for something made up in the moment.

    • @ianowen3456
      @ianowen3456 ปีที่แล้ว +4

      That's what I do.
      Usually using WEIRD-FANCY-GHOST-PLUMB

    • @DarrellSCady
      @DarrellSCady ปีที่แล้ว

      CAMPY WOULD BIGHT FERNS

  • @NathanSpiwak
    @NathanSpiwak ปีที่แล้ว +3

    Bec's "photo" coming up from the bottom of the screen is amazing!!

  • @DqwertyC
    @DqwertyC ปีที่แล้ว +12

    "This appeared to the author as optimizable" is one of my new favorite lines of Academic Sass

  • @matthewgough9533
    @matthewgough9533 ปีที่แล้ว +36

    I almost lived this. I once guessed:
    GIVER
    DWARF
    JOCKS
    EQUAL
    BLITZ
    and finally got the answer of the day NYMPH. I repeated E, I, L, R, and A once each so it isn't what Matt Parker is looking for, but it sure had me sweating looking at a sea of only grey squares by the end of guess 5.

    • @raphaelnej8387
      @raphaelnej8387 ปีที่แล้ว +3

      that s insane

    • @RQLexi
      @RQLexi ปีที่แล้ว +1

      That must have been scary!
      If I may, though, that's not necessarily a great approach in Wordle - since you can change your strategy based on the feedback from each submitted word, and positive responses almost always contain more information about the solution than negative ones, you want to front load the odds of getting any kind of positive result in the first word to narrow the search space as early as possible ^^ Frequent letters are good, and packing in vowels is great because it's a much smaller search space which in practice will always contain at least one positive result.
      That's min-maxin to get the answer in as few hits as possible, though, which of course isn't the only way to play it or to have fun ^^

    • @ValkyRiver
      @ValkyRiver ปีที่แล้ว +1

      What the heck is a glent brick jumpy vozhd waqfs?

    • @MartinInBC
      @MartinInBC ปีที่แล้ว

      Dubious. If first guess GIVER gives no hits, who would then have an R in the next guess DWARF?

    • @v0id_d3m0n
      @v0id_d3m0n ปีที่แล้ว +2

      ​@@MartinInBC people aren't machines. sometimes u wanna live a little lmao

  • @AlKohaiMusic
    @AlKohaiMusic ปีที่แล้ว +12

    The sheer hubris of live editing in your podcast cohost is so wonderful

  • @astropgn
    @astropgn ปีที่แล้ว +273

    I am highly suspicious that the "photo" of Bec was just Bec going up and down trying to be stationary as possible lol. Such a Bec thing to do!
    Also, at 16:49 "OK, I am Bec" - No, silly, you aren't Bec, you are Matt!

    • @xenialafleur
      @xenialafleur ปีที่แล้ว +26

      I'm thinking the same thing. I could swear I saw some movement other than the up and down.

    • @ilRosewood
      @ilRosewood ปีที่แล้ว +12

      You may be on to something here.

    • @Leoleonpd
      @Leoleonpd ปีที่แล้ว +10

      There are so many times in Matt Parker videos where I am just like, "did that really just happen?"

    • @michael1
      @michael1 ปีที่แล้ว +10

      That's the gag

    • @CraftBasti
      @CraftBasti ปีที่แล้ว +7

      @@michael1 Ahh the obligatory comment of the person not getting the sarcasm and explaining to the sarcastic jokers they did not understand the joke, thereby ironically not understanding theirs. Classic

  • @dfgaJK
    @dfgaJK ปีที่แล้ว +40

    I like how you went to the effort of super imposing a shadow at 0:48..... its almost as if the photo wasn't a photo at all.
    You must have done a full VFX 3d reconstruciton and reprojected the image as an image texture. Corridor ditgital would be proud. The attention to detail is immense!

    •  ปีที่แล้ว

      Those were videos, though, not images.

    • @dfgaJK
      @dfgaJK ปีที่แล้ว +9

      @ "it's almost as if the photo wasn't a photo at all" 😉

  • @Nimasho2go
    @Nimasho2go ปีที่แล้ว +1

    Love the Countdown clock theme over that program bit. Good touch.

  • @dpatts
    @dpatts ปีที่แล้ว +30

    In addition to “building neighbours” there should also be “reticulating splines” “calibrating matrices” and “sidefumbling wainshafts”

    • @KyleJMitchell
      @KyleJMitchell ปีที่แล้ว +6

      "Calibrating matrices"? You can’t just add an engineering word to an algebra word and hope it means something. Oh wait, looks like something’s wrong with the manifold tesselator.

    • @edwardlane1255
      @edwardlane1255 ปีที่แล้ว +3

      manifold tesselator sounds good for packing suitcases

    • @whollypotatoes
      @whollypotatoes ปีที่แล้ว +2

      I can hear the build music now

    • @heartache5742
      @heartache5742 ปีที่แล้ว

      @@KyleJMitchell yes you can

    • @vigilantcosmicpenguin8721
      @vigilantcosmicpenguin8721 ปีที่แล้ว

      Aren't we all?

  • @JohnR31415
    @JohnR31415 ปีที่แล้ว +121

    I was surprised you didn’t start off with a “how many have none of the vowels”, since that eliminates any word with three or more vowels.

    • @Henrix1998
      @Henrix1998 ปีที่แล้ว +11

      Unfortunately (as you may have seen by now) some "valid" English words don't have any vowels

    • @thepardigon178
      @thepardigon178 ปีที่แล้ว +21

      @@Henrix1998 technically y is a vowel in those cases

    • @schurch1569
      @schurch1569 ปีที่แล้ว +3

      @@thepardigon178 phonetically, yes. Orthographically, no.

    • @minamagdy4126
      @minamagdy4126 ปีที่แล้ว +9

      Maybe filter instead by lack of vowels and semivowels (w and y in English). Basically every valid word without a vowel has a semivowel.

    • @JohnR31415
      @JohnR31415 ปีที่แล้ว +3

      @@Henrix1998 yes, but I suspect that all ‘real’ words that don’t have a vowel have a y… hence being able to eliminate those with three (not just two) vowels.

  • @EighteenCharacters
    @EighteenCharacters ปีที่แล้ว

    I LOVE how we just had a video conversation that no one else I showed the video with understood. You are truly a great story teller for the programmer! Horray!

  • @benjaminmoroni
    @benjaminmoroni ปีที่แล้ว

    Thanks for making a video about this! I tweeted a related question to you a few months back, but this one seems more appropriate for your channel.

  • @mekafinchi
    @mekafinchi ปีที่แล้ว +192

    the optimized version is fast entirely due to algorithm, too - both versions are written in python and neither use a fast external library like numpy. If the optimized version were ported to something like optimized rust you could probably get the time down to the seconds range

    • @Henrix1998
      @Henrix1998 ปีที่แล้ว +24

      I don't think seconds but maybe minute or two

    • @Boringpenguin
      @Boringpenguin ปีที่แล้ว +20

      once again, rust is inevitable

    • @xarcaz
      @xarcaz ปีที่แล้ว +18

      Or just do it with constexpr and consteval in C++ (assuming we don't time the compilation time, of course).

    • @Gandarf_
      @Gandarf_ ปีที่แล้ว +2

      @@xarcaz bruh that's not IOI

    • @Luj8n
      @Luj8n ปีที่แล้ว +8

      🦀

  • @toast99bubbles
    @toast99bubbles ปีที่แล้ว +38

    The title alone makes me think this is about Wordle.

    • @jerry3790
      @jerry3790 ปีที่แล้ว +2

      It’s Parker about wordle

    • @sierra5065
      @sierra5065 ปีที่แล้ว +1

      Wordle inspired which is pretty close.

  • @rehpotsirhic
    @rehpotsirhic ปีที่แล้ว +9

    I've been learning Python recently, so it was fun reading through both sets of code and seeing how far my knowledge of Python has come in the last couple of weeks :)

  • @georgiapatrick5154
    @georgiapatrick5154 ปีที่แล้ว

    Listen to the problem squared episode yesterday, excited we get the video as well. Love the podcast, only recently caught up having started at episode 1.

  • @QuantumHistorian
    @QuantumHistorian ปีที่แล้ว +99

    You have to love that, in a segment about Matt writing bad code, he uses excel to find the difference between two variables that he defines. At least do something like _now = time.time() ... print(now - time.time())_

    • @catmacopter8545
      @catmacopter8545 ปีที่แล้ว +3

      yeah i cringed when he did that

    • @wbfaulk
      @wbfaulk ปีที่แล้ว +5

      Or just type "time" before the command.

    • @BeachDix
      @BeachDix ปีที่แล้ว +1

      I thought the same thing 🤣

    • @derekjc777
      @derekjc777 ปีที่แล้ว +2

      start = … finish = … print(finish - start) is more usual. But hey, any excuse to use Microsoft’s bloatware, hey Matt?

    • @pvic6959
      @pvic6959 ปีที่แล้ว +10

      see this is a huuuuge difference i keep telling people about. i did a computer science degree. i am a software engineer now. I stand by the fact that programming != computer science
      and we see the difference here. programming gets the job done (matts solution (also this is no diss on matt. hes super smart; software just isnt his expertise and thats ok)). Computer science gets the job done well and efficiently (the graph solution). I dont claim I could have gotten to the same solution, but figuring those types of stuff out is the fun bit for me lol

  • @bluji1250
    @bluji1250 ปีที่แล้ว +59

    "Vingt"... your pronunciation of this was beautiful, considering it's just "twenty" in French.

    • @watchingaccount
      @watchingaccount ปีที่แล้ว +10

      yeah... caught me off guard lol

    • @szucs3860
      @szucs3860 ปีที่แล้ว +4

      10:56

    • @matthewwhiteside4619
      @matthewwhiteside4619 ปีที่แล้ว +3

      And in true French fashion they use 3 times more letters than they need, considering how they pronounce it.

    • @gregmark1688
      @gregmark1688 ปีที่แล้ว +1

      @@matthewwhiteside4619 The 'g' is pronounced. It's very subtle, but it's there. The 't' might also be pronounced, too, if you happened to have multiple "twenties", as in "les vingts". ;^)

    • @shirou9790
      @shirou9790 ปีที่แล้ว +3

      @@gregmark1688 The 'g' is definitely not pronounced at all lmao, the 't' indeed might or might not be (depending on context and accent)

  • @kimollivier
    @kimollivier ปีที่แล้ว +37

    The first rule when running a program: The Cup of Coffee Rule. If it doesn't finish when you have finished your coffee, interrupt the program and find a better way! This is what I teach all my students. I am amazed that Matt had confidence that his program was going to give any useful result after so long. I would be expecting zero or infinity.

    • @interlooper83
      @interlooper83 ปีที่แล้ว +9

      The exception to this rule is lots of scientific or mathematical problems, especially simulations, but can also be combinatorial problems of the type in this video (of course in this case it was optimizable but to be honest if you have other stuff going on sometimes it really is easier to just set the code running and come back to it when it’s done rather than spend Time making better code.)

    • @kimollivier
      @kimollivier ปีที่แล้ว +2

      @@interlooper83 but you almost always need to re-run it, or some one else will need to verify it. If you are a 'good' programmer then you won't need to spend time writing code that never finishes. You can think up a better approach while drinking your coffee. Especially with Python, which is used extensively in scientific problems now.
      My expectation is that simple functions should finish quickly. I try to set similar expectations in the minds of my students. It's not hard to replace the shell sort with quicksort if you are competent you will know that quicksort exists. Even with simulations that may take hours (surely not days!) you can provide a progress log to monitor the state. Perhaps partition so that the time is divided by n times. It is easy to add in timers to see where the time is being taken. It is easy in python to import modules that are compiled code instead of reinventing the wheel using python. It is easy to isolate a function and optimise it with cython to get 100 times speed improvement.
      Maybe the approach to a simulation is using the wrong variables that are not converging. Maybe you didn't realise that your system does not scale well. So you start with a sample and then release it on a large dataset. Well then, that is when the Cup of Coffee Rule kicks in: interrupt and think about what might have gone wrong or how you can shorten the time. Time is money and also your own valuable attention. Leaving a problem for a week seems to be a waste of both to me. If you are using the cloud a week's processing will cost a fortune.
      I am still not impressed with any workflow that takes days to complete. It just makes you look amateur.

    • @gavinyeet5821
      @gavinyeet5821 ปีที่แล้ว +7

      @@kimollivier He is amateur, he stated that multiple times -_-

    • @berkes
      @berkes ปีที่แล้ว +2

      @@interlooper83 when I'm on such a problem, I'll always try to spend some time producing a sample set. Need to calculate all the roundabouts in the world? Start with all roundabouts in Iceland. Must find how many days were warmer than average since jura? Start with last two months. Even if making the sample costs days, you'll eliminate the chance of having to rerun a computation that takes days.

    • @Paradoxicat
      @Paradoxicat ปีที่แล้ว +1

      @@kimollivier I think this philosophy might be fine to teach in any introductory programming class, but it is naïve in the real world. Many fields in computational science are limited by computing power, and the reason is because some things just take time. Do you think it simply never occurred to the people whose algorithms take hours or days to run (even on the most advanced supercomputing clusters) that they should try to optimize their code?

  • @colonelpopcorn7702
    @colonelpopcorn7702 ปีที่แล้ว +3

    10:08 Ah! Something I learned in a K Klein video: apparently in the UK they teach that the vowels are aeiou, where here in the US we’re taught aeiou and sometimes y.

  • @DingbatToast
    @DingbatToast ปีที่แล้ว +15

    Dude!
    Keep doing what you do
    I love your videos. Sometimes i get it sometimes not, but always I'm entertained.
    Your enthusiasm and passion for your subject is infectious.
    😊🍻

  • @totlyepic
    @totlyepic ปีที่แล้ว +8

    "Vibex" sounds like an old-people medicine that will be marketed to GenZ one day.

  • @RetailerofRagnarok
    @RetailerofRagnarok ปีที่แล้ว +1

    Congratulations on 1 million followers!! I've been away from YT for a short while, and awesome to see you reaching that milestone

  • @Raguna163
    @Raguna163 ปีที่แล้ว +4

    Matt: "Don't send me ways I could have improved it"
    Also Matt: "This is the maths behind the way I could have improved it"

  • @kasuha
    @kasuha ปีที่แล้ว +37

    Given the purpose of the search, each word (or even each valid word combination) could be represented by single 32-bit (or rather 26-bit) integer with only bits corresponding to used letters set to 1. That alone can save quite a lot of time on checking for collisions and collecting valid results, including pretty much automatic pruning of anagrams.

    • @nicholasvinen
      @nicholasvinen ปีที่แล้ว +14

      I wonder if, using that method and written in C, it could be done in under one second given a powerful enough computer. I'd say probably.

    • @loganrussell48
      @loganrussell48 ปีที่แล้ว +2

      I did this, and I get results really quickly

    • @MatthewJacksonTheMuuj
      @MatthewJacksonTheMuuj ปีที่แล้ว +3

      Yes, that's a great hashing algorithm for this purpose. You're just looking for 5 hashes with no bits in common.

    • @tiarkrezar
      @tiarkrezar ปีที่แล้ว +2

      I basically wrote a version of that back when wordle blew up. Depending on the word list, the whole search took anywhere between a few seconds and minutes. Getting a decent wordlist that isn't full of straight up junk words was the hard part, and in the end I could only come up with sensible combinations that had 24 unique letters.

    • @the_senate8050
      @the_senate8050 ปีที่แล้ว +5

      @@nicholasvinen Average C user when python is mentioned.
      /s

  • @omartjo
    @omartjo ปีที่แล้ว +36

    Did you check whether all the "worlde words" appear in your initial database? If the former isn't a subset of the latter, maybe some sneaky wordle words could give you another solution. I guess you could just run your original code on the wordle list and check whether you've missed a five-word set in the initial result?

    • @whyando
      @whyando ปีที่แล้ว +10

      'vozhd' and 'gymps' are in the wordle list, but not in the original wordlist, which leads to some extra worldle solutions

    • @stefanpochmann5205
      @stefanpochmann5205 ปีที่แล้ว

      @@whyando What are those extra solutions?

    • @mustafamotiwala2335
      @mustafamotiwala2335 ปีที่แล้ว +5

      @@stefanpochmann5205 I ran a search a few months ago and remember finding ~9 including waqfs. I only remember this one off the top of my head, but you could just run the script with the improved list and find the rest:
      waqfs, vozhd, jumpy, glent, brick

  • @GraemeMcRae
    @GraemeMcRae ปีที่แล้ว +13

    Matt, I used visual basic for applications (VBA, comes with Excel) to find 10 combinations using a list of Wordle words from which I excluded anagrams and words with repeated letters.
    The program uses a 26-bit bitmap of letters to quickly compare words to ensure no duplicates. At each point in the recursive search, I only consider the subset of wordle words not containing the letters used so far. This way, I spend my valuable computing power to make subsets, avoiding the need to do pairwise comparisons of words to see if they have letters in common. The program completes in well under a minute.
    The program finds 10 combinations of 5 words:
    1. glent, prick, waqfs, vozhd, jumby. Missing letter is x
    2. glent, brick, waqfs, vozhd, jumpy. Missing letter is x
    3. treck, pling, waqfs, vozhd, jumby. Missing letter is x
    4. treck, bling, waqfs, vozhd, jumpy. Missing letter is x
    5. kreng, clipt, waqfs, vozhd, jumby. Missing letter is x
    6. kempt, waqfs, brung, cylix, vozhd. Missing letter is j
    7. cimex, waqfs, blunk, grypt, vozhd. Missing letter is j
    8. gucks, waltz, vibex, fjord, nymph. Missing letter is q
    9. bemix, clunk, waqfs, grypt, vozhd. Missing letter is j
    10. gymps, waltz, vibex, chunk, fjord. Missing letter is q
    That said, Chrome doesn't think glent, jumby, treck, kreng, clipt, brung, grypt, or bemix are words, leaving number 8 as the only one Chrome would agree with, which is the same one you found.

    • @tomdekler9280
      @tomdekler9280 ปีที่แล้ว +1

      It's not exactly fair to say "Wordle words" when waqfs and vozhd definitly would not be legal words in Wordle.
      ... wait, would they?

    • @GraemeMcRae
      @GraemeMcRae ปีที่แล้ว +2

      @@tomdekler9280 As a matter of fact, both "waqfs" and "vozhd" are valid guesses, even now that the NYT took it over. I just tested them to make sure they work.

    • @isaac10231
      @isaac10231 ปีที่แล้ว +1

      You did that in visual basic? Bro who hurt you 😆

  • @celadon2048
    @celadon2048 ปีที่แล้ว +1

    Great content. Loved your pruning and the graph theory was a slick bonus. Bec was funny.

  • @morkmon
    @morkmon ปีที่แล้ว +5

    Strongly suspect that that wasn't a photo of Bec Hill but an actual Bec Hill. Trying to save costs on the special effects?! /s

  • @Lightn0x
    @Lightn0x ปีที่แล้ว +7

    DisguisedToast was doing this strategy for speedrunning wordle like half a year ago in which he would put as many disjoint words in a row. He always put in "fjord waltz quick nymph gybes". There's a repeated Y in the last word though so I guess he found 4.

  • @Radar_of_the_Stars
    @Radar_of_the_Stars ปีที่แล้ว +1

    I love how A Problem Squared is leading to more and more Standupmaths videos

  • @bretscofield
    @bretscofield ปีที่แล้ว

    This is the kind of crossover content I support through patreon for the podcast and this channel. :D

  • @A38
    @A38 ปีที่แล้ว +3

    So delighted and impressed by your work as always, Matt - and super pleased that your interaction with Benjamin spawned a meme! "This appeared to the author as optimizable." Golden

  • @Ellanion
    @Ellanion ปีที่แล้ว +3

    I absolutely love the improved version of the code. I'm not a programmer myself, but the field fascinates me*.
    Just seeing how clever and quick the solution is compared to brute force comparisons is just such a delight ♥️
    *(I am trained in what one of my professors called being a translator between non-programmy clients and the programmers who make their products because the two groups can't communicate (the client doesn't know the difference between what they need and want. They don't know how to ask for either. Programmers don't understand their need or want or how to implement their ask in a way they understand. So I first suss out what the client actually needs, translate that to a graphic both parties can understand, and then give the programmers the parameters and requirements of the product)).

    • @edwardlane1255
      @edwardlane1255 ปีที่แล้ว +1

      that's a chunk of my job too - but without a diagram usually :)

  • @fiveoneecho
    @fiveoneecho ปีที่แล้ว +2

    Matt's mattes have become very excellent! First of all, the key on the chroma screen is pulled very nicely and cleanly, and second, the edge shadow when elements are composited behind him is just... chef's kiss!

  • @dxg1396
    @dxg1396 ปีที่แล้ว

    Hell yeah! Nice follow up to the problem squared pod episode :)

  • @andrewholaway4113
    @andrewholaway4113 ปีที่แล้ว +48

    I'm not sure precisely why, but this video hit me right in the giggles. I haven't laughed this hard at a TH-cam video in a long time, so I just wanted to give a genuine thanks for this Wednesday silliness. Proud to be a Patreon supporter!

    • @standupmaths
      @standupmaths  ปีที่แล้ว +23

      Thanks for making this mid-week silliness possible!

  • @Asterism_Desmos
    @Asterism_Desmos ปีที่แล้ว +4

    It’s always a good day when I get a video from stand up maths

  • @dinklebob1
    @dinklebob1 ปีที่แล้ว +1

    Hahaha that reveal. Showmanship at its finest.

  • @K-o-R
    @K-o-R ปีที่แล้ว

    Those photos are amazing. So lifelike!

  • @RussellBeattie
    @RussellBeattie ปีที่แล้ว +7

    Matt! Thanks for giving all us programmers a momentary feeling of superiority! So nice! Literally every one of us were thinking, “Am I missing something?? It can’t possibly take that long...” and then nodding sagely at the end. (Even though most of us don’t know graph theory from our elbows.)
    If I were you, I would pick some mind bending math for the next video and put us all back in our places as the bit jockeys we are.

  • @lucrebillout
    @lucrebillout ปีที่แล้ว +8

    Bec is an absolute treasure 😄

  • @christianlingenfelter9902
    @christianlingenfelter9902 ปีที่แล้ว +2

    I took a coding class last semester and challenged myself to write wordle in my own code. I ended up doing it in about 850 lines. It also has a feature where the user is able to look up any word and it will tell you the day it is going to be used as a wordle puzzle. This just accesses the wordle database of answers and calculates the day. Pretty cool. I was proud of myself for doing it after only starting coding this year

  • @Qwerasd
    @Qwerasd ปีที่แล้ว +20

    The Wordle word list is created from the "web2" words list, found on most BSD-based Unix systems (e.g. macOS) at /usr/share/dict/words -- this list contains all words from the Webster's New International Dictionary, Second Edition.

  • @jimbobago
    @jimbobago ปีที่แล้ว

    The fact that you got any version of your idea to work is a win. I have a program I'm trying to write that's only 1/10 the size of the Parker Program and it's got some design flaw that I can't figure out. Eleven lines and I can't get it to work. Take your win Mr. Parker, you deserve it.

  • @Magpie_Media
    @Magpie_Media ปีที่แล้ว +3

    .. Damn, That photo was almost life like 'o.O

  • @quelfth4413
    @quelfth4413 ปีที่แล้ว +31

    There are definitely more solutions than this which work in Worldle. One example is BRICK GLENT JUMPY VOZHD WAQFS. I guess your dictionary is missing some words which are in the Wordle dictionary, or maybe some words that you have which are not in the Worldle dictionary have anagrams which are?

    • @nathaniely.236
      @nathaniely.236 ปีที่แล้ว +2

      Yeah it would be best if the wordle list was put into the beginning steps of the process again. Perhaps even you or I could do it and find a few more solutions.

  • @Ziraya0
    @Ziraya0 ปีที่แล้ว

    I've been sitting here this whole video thinking about how to structure the words list in order to trivialize the work of finding matches, so glad to hear somebody else already did it so I don't have to!

  • @notmyname327
    @notmyname327 ปีที่แล้ว

    I loved this episode in the podcast and I'm loving this video. I find it really satisfying that there's just the one answer.

  • @janesk1
    @janesk1 ปีที่แล้ว +12

    There's another wordle-valid set:
    GLENT, BRICK, JUMPY, VOZHD, WAQFS
    The latter two words are loans from Russian and Arabic, respectively.

    • @violetasuklevska9074
      @violetasuklevska9074 ปีที่แล้ว

      I assume whatever word search he used those two had to be excluded (they are missing in some online dictionaries)

  • @Awokenify
    @Awokenify ปีที่แล้ว +4

    This feels like that issue with traveling to another star, where the first people to leave Earth are likely to meet humans when they arrive. Because it takes less time to both invent faster space ships and travel there, than the initial travel time.

    • @BizVlogs
      @BizVlogs ปีที่แล้ว

      Just imagine the looking at each other like 😳😳

  • @dominick253
    @dominick253 ปีที่แล้ว +1

    I just started running your code. I'll check back when it's done.

  • @elmatichos
    @elmatichos ปีที่แล้ว

    I love this! I was so invested the entire video, best topic for real

  • @magica3526
    @magica3526 ปีที่แล้ว +3

    I did a janky version of this puzzle with wordle and got 19 letters in 4 words which i was pretty happy with

  • @DanielDugovic
    @DanielDugovic ปีที่แล้ว +6

    Thanks for explaining the graph theory optimization.
    Bonus problem: how many solutions are there to the set cover problem of using six 5-letter words to cover the entire alphabet?

  • @justinlua4848
    @justinlua4848 ปีที่แล้ว

    What a beautiful and satisfying solution and final answer!

    • @stefanpochmann5205
      @stefanpochmann5205 ปีที่แล้ว +1

      What about the ten others that he overlooked?

  • @nibrazsiddiqui4905
    @nibrazsiddiqui4905 ปีที่แล้ว

    This video really helped me. Thank you very much!

  • @RegebroRepairs
    @RegebroRepairs ปีที่แล้ว +17

    Uhm, Y is definitely a vowel in "glyph". :-)
    Edit: And you can time a command from the command line by just typing "time" before it.

    • @bable6314
      @bable6314 ปีที่แล้ว +4

      In England, Y is not considered a vowel for some reason, despite the fact that it is literally a vowel in that usage lmao.

    • @liorramati265
      @liorramati265 ปีที่แล้ว +1

      Using the Linux time command would also report how long it took to spin up the python interpreter, not just how long it took his code to run. Timing it from inside the python code is going to give a way more accurate result in this case (even if doing print(time.time()) twice and then subtracting the results in excel isn't the optimal way to do that 😅)

    • @RegebroRepairs
      @RegebroRepairs ปีที่แล้ว +1

      @@liorramati265 Spinning up python, importing the libraries used and shutting it down takes between 0.05 seconds on my old laptop. It's not going to change the measurement outcome significantly of anything that takes over a few seconds.

  • @Sh3phrd
    @Sh3phrd ปีที่แล้ว +21

    So, I appreciate the method and the story behind the progress here.
    But, once you had decided to use the wordle dictionary as your source of correctness, surely the best way to get the final solution would be to perform the original search on wordle's list. Rather than comparing the list to the one found by the original search.

    • @lukashavrlant
      @lukashavrlant ปีที่แล้ว +4

      But he would have to wait another month for it :D

    • @robertr7923
      @robertr7923 ปีที่แล้ว

      That would be a more efficient way but it would still produce the same only solution

    • @MatthewJMcIlree
      @MatthewJMcIlree ปีที่แล้ว

      @@robertr7923 Nope: there's also:
      jumby
      clipt
      waqfs
      kreng
      vozhd
      in the original wordle list!

  • @kevinbarnard3502
    @kevinbarnard3502 ปีที่แล้ว +2

    One of my favorite bits of trivia about words and letters...
    20% of the words are used 80% of the time and, yes, 20% of letters are used 80% of the time [I believe] in any language.

  • @IstasPumaNevada
    @IstasPumaNevada ปีที่แล้ว

    The "photos" cracked me up. Nicely done. :D

  • @nathanmihm5528
    @nathanmihm5528 ปีที่แล้ว +3

    Correction: There are more than just one by Wordle definitions, if you include words that are not in the original wordset provided by Matt. Among others, this includes vozhd, waqfs, and gymps. I found 11 sets of five, using my own code and the original wordle dataset (it took under 10 minutes). I think other people have already mentioned this elsewhere in the comments.
    For example,
    bemix, clunk, grypt, vozhd, waqfs
    chunk, fjord, gymps, vibex, waltz
    Out of the ones I've found, I still agree with Matt that the one he presented was the best.

    • @stefanpochmann5205
      @stefanpochmann5205 ปีที่แล้ว

      You're right, all that has already been mentioned.

  • @Berengal
    @Berengal ปีที่แล้ว +4

    My first instinct when seeing this problem was that this could be solved as an exact cover problem using algorithm X. It's been a long long while since I used it, but guessing from the size of the problem it should be faster than finding complete graphs.
    It's also a fun excercise to implement if you feel like spending an evening coding.

    • @BenjaminGoldberg1
      @BenjaminGoldberg1 ปีที่แล้ว

      I'm not sure if you can call this an "exact cover problem", because english has 26 letters, not 25.

    • @Txyxy1
      @Txyxy1 ปีที่แล้ว

      @@BenjaminGoldberg1 It is not exact cover problem, but you can use that algorithm anyway

  • @SomeRandomPerson
    @SomeRandomPerson ปีที่แล้ว +2

    I'm glad someone else optimised that code, it saved me going out and doing it myself.
    Though I was going to use hashtables/dictionaries to do it - the graph theory bits are nice.

  • @jwnomad
    @jwnomad ปีที่แล้ว

    Congratulations on reaching 2^20 subscribers!

  • @MichaelAuslanderJr
    @MichaelAuslanderJr ปีที่แล้ว +32

    Wouldn’t removing the anagrams limit your comparison to the wordle list? You could be throwing away ‘real’ words and keeping the ‘bad’ alternate

    • @landsgevaer
      @landsgevaer ปีที่แล้ว +10

      I thought the same, indeed.
      But since he does use a reasonable trick to retain the most common one, it would only happen if Wordle contains an uncommon anagram of a more common word that it doesn't have.
      Matt later checked that restricting it by anagrams gave the same number of solutions.

    • @MeriaDuck
      @MeriaDuck ปีที่แล้ว +4

      You can bring them back later by a relatively simple anagram search

  • @trolololo720
    @trolololo720 ปีที่แล้ว +3

    Oh, a new hangman cheating set! Thanks!

  • @thomaswalters7117
    @thomaswalters7117 ปีที่แล้ว

    So glad to see all those unique photos of Bec included

  • @bentoth9555
    @bentoth9555 ปีที่แล้ว

    Those Bec Hill photos were so life-like. I could swear they were moving.

  • @yanntal954
    @yanntal954 ปีที่แล้ว +17

    3:58 Now interesting enough, 5977 choose 5 different options isn't that bad provided you have a quantum computer. It only needs to check up to square root of that number, so if you can check a million per second, you'll end up spending 4.2 minutes instead of 2000 years.
    So perhaps the first solution of simply a bigger computer in this case isn't such a bad idea!

    • @pewpewpandas9203
      @pewpewpandas9203 ปีที่แล้ว +9

      "provided you have a quantum computer" is a bit of the problem there then, isn't it

    • @TaranovskiAlex
      @TaranovskiAlex ปีที่แล้ว +1

      That's a very interesting topic for me, could you please provide any link to an quantum algorithm which does that? What exactly do you mean by "check by the quantum computer" and why you think this problem can be managed that way in a quantum computer? My understanding - at least based on the description - a regular graph algorithm isn't a good fit for a quantum computer?

    • @JeremyHurwitz
      @JeremyHurwitz ปีที่แล้ว +4

      @@TaranovskiAlex en.wikipedia.org/wiki/Grover%27s_algorithm
      Basically, you can do unstructured brute force search in O(sqrt(N)*check) time, where N is the number of possible solutions, and 'check' is the time required to verify a potential solution.

    • @JNCressey
      @JNCressey ปีที่แล้ว

      -but wouldn't you also need on the order of (5977 choose 5) amount of time to compile the oracle since its so irregular?- Actually, I guess you could incorporate the knowlege of the graph edges of valid pairs of words in just an order of (5977 choose 2) time, then maybe the instructions for confirming a K5 graph is very regular? And that sounds like you would get the speedup as it's much smaller.
      -And wouldn't you need a quantum computer with a register of (5977 choose 5) many quantum bits?- oopsie

    • @johndododoe1411
      @johndododoe1411 ปีที่แล้ว

      @@JNCressey Incorporate a preprocessed word table as part of the problem, so only q-bits for the word number are needed.

  • @pierreabbat6157
    @pierreabbat6157 ปีที่แล้ว +11

    "Vingt" is pronounced /væ̃/ and means "twenty". Homophones include "vint" (came) and "vin" (wine).

    • @Alex_Meadows
      @Alex_Meadows ปีที่แล้ว +3

      If he didn't already know that, and deliberately mispronounced it as brutally as possible, I will eat my own legs.

    • @benoitst-jean7295
      @benoitst-jean7295 ปีที่แล้ว

      And "vain"

  • @Rapnnex
    @Rapnnex ปีที่แล้ว

    While working on creating a decision tree for Wordle using SAT I used a similar problem as a stepping stone to learn how to work with SAT.
    Instead of trying to find every set of 5 words without letters in common it just searched for the first valid set it could find.
    The resulting CNF DIMACS file has 5202 literals and 17477630 clauses and when run results in the following 5 words:
    chunk, fjord, gymps, vibex, waltz
    Really interesting to see this exact problem on this channel, a really pleasant surprise.

  • @lvx720
    @lvx720 ปีที่แล้ว

    Being left with just one could not have been more satisfying, nor more astonishing.