Jane Street's paid internships are amazing! Tell people graduation by 2026/2027. jane-st.co/SUM-internships And yes, I'll visit at least the Hong Kong interns this June 2025. Maybe other Jane Street offices as well.
@Deragaergadgfadsfasd3 ай бұрын
I think M.C. Escher would have loved all this, especially the bit about assembling the puzzle. 🧩
@wbfaulk3 ай бұрын
What exactly is "quantitive trading" (24:16) and how does it differ from "quantitative trading"?
@AexisRai3 ай бұрын
Anyone interested in jigsaw puzzles and pure deduction should look up the puzzle "Cornered" by game developer Portponky.
@cicik573 ай бұрын
nice puzzle, sorry very bad programming :D
@smithsmith64023 ай бұрын
I would desperately love to see this image generation applied to a Hexaflexagon for multiple finished images in the various configurations.
@Rubrickety3 ай бұрын
I wrote what I thought was improved code for this problem, but when I ran it the lights on my Christmas tree went insane.
@LeeAnnC3 ай бұрын
😆
@dinhero213 ай бұрын
I don't get it, are you referring to the quality (or lack thereof) and inconsistency (not really the word I was looking for but whatever) of the original code?
@xinpingdonohoe39783 ай бұрын
@@dinhero21 or perhaps the lights are flickering on and off in an attempt to create two distinct patterns simultaneously?
@OliverMarkewärn3 ай бұрын
@@dinhero21I think he’s refering to when a fan made matt’s code like a billion times better, and that fans made programs to light his christmas tree
@patu80103 ай бұрын
I thought it was a reference to Stranger Things. Like your code was so cursed, your house is haunted now.
@Thagrynor3 ай бұрын
The look of Matt's soul dying just a little when Steve uttered the phrase "public code review" is priceless lol .....
@NigelMelanisticSmith3 ай бұрын
"Terrible Python Code" is at "Say The Line, Bart" levels by now lol
@brianphelps24153 ай бұрын
I'm not complaining, it helps me with Parker Bingo!
@RavenMobile3 ай бұрын
Maybe bad Python code should be called Monty Python code.
@guiorgy3 ай бұрын
Parker Code?
@1st2nd23 ай бұрын
Cowabunga!
@vincentpelletier573 ай бұрын
I didn't do it.
@IceMetalPunk3 ай бұрын
Matt: "I wrote some terrible Python code." Me: "You're always so hard on yourself, Matt. I'm sure it's not *that* bad." Matt: "It brute-forces a combinatorics problem by exploring millions of permutations for guess-and-check at every iteration." Me: "...why must you Parker it again?"
@MatheusC17293 ай бұрын
Matt wrote MiracleSort Wikipedia page
@sixty5023 ай бұрын
this would be so faster if it included not rechecking the same permutation twice...
@bandana_girl65073 ай бұрын
Hey, the *code* isn't terrible, it's the algorithm
@billybionicle3 ай бұрын
@@bawilson999thats like pointing out there's chip in the paint of a car when the entire engine is missing
@unusedTV3 ай бұрын
@@bawilson999 Recusion is fine if you can make it tail end recursion and avoid spamming the call stack, especially with Python's function overhead. But there's other low hanging fruit too: lists instead of tuples for the puzzle pieces mean he's allocating way more memory than necessary, as Python's lists are dynamic and preallocate extra room for future appends which he'll never need.
@SJrad3 ай бұрын
Topologically consistent jigsaw puzzle
@aleksitjvladica.3 ай бұрын
What everybody thought but as a sentence.
@Supermath1013 ай бұрын
You forgot to add the adjective "bistable" to the phrase.
@seventoast3 ай бұрын
I am pleased that someone beat me to this comment 😂 What an audience Matt has
@hilburn-3 ай бұрын
I think they should be called "ambigsaws"
@gm24073 ай бұрын
@@seventoastI am pleased there are so many topologist comments.
@ares3953 ай бұрын
Oh I can't wait for the "a viewer made my code *obscene number*% better"
@Thk101889653 ай бұрын
Fairly sure that is a past video. Possibly with christmas lights if I remember correctly
@3nertia3 ай бұрын
@@Thk10188965 That's the joke!
@EggBastion3 ай бұрын
@@Thk10188965/videos Yes, it's referenced right here in the video 12:48, but it'll happen again. Believe me. Unless Matt really turns a number of corners with his coding... it'll happen again.
@TheRenegade...3 ай бұрын
@@Thk10188965 You're thinking of "Someone improved my code by *obscene number*%". Completely different concept
@xinpingdonohoe39783 ай бұрын
If he makes code that doesn't work, and a random guy improves it to make it work, we can just say the guy improved his code by ∞% which is probably the ultimate victory.
@WizoML3 ай бұрын
Even though it gets called terrible python code, I think this is a beautiful thing about python that lets people solve interesting problems with computing power. Putting optimization aside, 1. the problem statement and 2. an approach to solving it both show incredible creativity on Matt's part. That's why people click on the video in the first place. I'd be proud of writing "terrible" python code that can actually solve an interesting problem.
@oncedidactic3 ай бұрын
This for sure
@creativecraving2 ай бұрын
Exactly. And, Matt's code is unoptmized for the same reason that every bit of code s less perfect than it "should" be: deadlines and competing priorities.
@finchhawthorne13022 ай бұрын
Yep. Programming is a tool!
@FriedMonkey3622 ай бұрын
And the best part is the code might not be optimal but it is already written, slightly more advanced programmers dont really have to understand how it works, because the code already works, they can read it and make slight/low hanging fruit performance improvements
@aidenkoh24263 ай бұрын
I love that the mathematician in you felt the need to say “distinct” in the title.
@Zarunias3 ай бұрын
And now I wish that a jigsaw publisher takes this concept and publish a little series of these with different pictures.
@KenLieck3 ай бұрын
JIGAZO from Hasbro.
@danhorus3 ай бұрын
Somebody call Karen Puzzles
@Stratelier3 ай бұрын
As a kid, I could've sworn Mom had a jigsaw puzzle which advertised the ability to assemble it in like six different ways (including a semblance of the Mona Lisa). And this was back in the 80s. I think the picture(s) had a square-tile-based mosaic aesthetic, with colors ranging from black to brown to orange to yellow. BUT as a childhood memory it is unreliable at best ... unless, of course, I actually find it again.
@AdnanAli-rb3lt3 ай бұрын
@Stratelier it might be Tenyo Jigazo. Not sure how old that puzzle is
@KenLieck3 ай бұрын
@@AdnanAli-rb3lt 2010.
@pseudo_goose3 ай бұрын
The Python code isn't as bad as the "version control"
@Bobbias3 ай бұрын
I felt a chill run up my spine when I saw that.
@lindhe3 ай бұрын
Love that! 😂
@hentielover3 ай бұрын
At first I though Matt implemented some sort of version control software for whatever reason, so I thought "Sounds kinda difficult, it makes sense that it would suck", but then I read your comment again and understood that you meant 16:18, where you can see the interesting "version control"
@v0id_d3m0n3 ай бұрын
oh lord
@icefreez3r8153 ай бұрын
amongus
@apokatastasian28313 ай бұрын
this has made me question every puzzle i've ever assembled. what lovecraftian horror, or forbidden knowledge eluded perception once again, simply because i followed the picture on the box
@nikkiofthevalley3 ай бұрын
Nothing, because all normal jigsaw puzzles will only have one solution.
@5thearth3 ай бұрын
Fun fact: companies often reuse cutting patterns on different puzzles, so two puzzles with different images may have pieces of the same shape. So you can mix the pieces from one puzzle with another and make a combination image.
@bzboii3 ай бұрын
goated comment
@wintersxlstice213 ай бұрын
this would be an awesome scp
@dinklebob13 ай бұрын
@@nikkiofthevalley Look up The Magic Puzzle Company. Technically different (and certainly not normal), but still mind blowing.
@not_David3 ай бұрын
I’m about half way through the video and really loving it but I’m starting to think/realize that years of blender donut tutorials have really done some irreparable psychological damage…
@chemistrymickey3 ай бұрын
Oh my gosh, not_David! I love your maths videos too!
@WoolyCow3 ай бұрын
rare footage of an elusive not david spotted in the wild!
@oyora3 ай бұрын
sprinkles 🥹
@mtarek20053 ай бұрын
those blender donuts!!!
@Brandon-oc8lr3 ай бұрын
I can’t look at a sprinkle donut without a shiver going down my spine
@brandyballoon3 ай бұрын
As a software engineer currently studying intelligent systems and path finding search algorithms at post graduate level, this was fascinating and has given me a new problem to attack! Often the greatest challenge with something novel like this is figuring out how to make it fit an established algorithm. Sometimes you have a "oh it's just that one in disguise" moment, other times it truly is a unique problem.
@NonTwinBrothers3 ай бұрын
A simple 'context' or 'result' would do, but Matt books it with SPUD. Very on brand
@baksatibi3 ай бұрын
It reminds me of how you make a non-tail recursive function tail recursive. It doesn't really matter because jigchecker is a backtracking algorithm so it uses the call stack to store state and Python doesn't support tail call optimization anyway.
@johnrehwinkel72413 ай бұрын
Every time it has a vision, it adds an eye. So eventually you end up with a potato with many eyes, or the Lovecraftian horror @apokatastasian2821 mentioned.
@HaloInverse3 ай бұрын
"It took _how_ long to complete? What are you running your code on, a potato?"
@Imperial_Squid3 ай бұрын
16:44 it causes me physical pain to see Matt naming his python files the way people label their English essay drafts lol
@xinpingdonohoe39783 ай бұрын
What would you name yours?
@LethalChicken773 ай бұрын
Honestly still better version control than github 😂
@bigsmoke64143 ай бұрын
@@LethalChicken77lol no
@Anohaxer3 ай бұрын
amongus
@stefanalecu95323 ай бұрын
@@LethalChicken77 you're as """good""" of a programmer as Matt is with that opinion
@geothermie_3 ай бұрын
Now I want to see the version with 10 solutions : the mug and the donut plus - A mario pipe - A watch - An unknnot - A top hat with the closing part ripped like in old disney shorts - The chaos emerald minigame from sonic 3 - The twisty scares on a 2x2 grid - A pair of trousers with one leg knotted (bc why not?) - A squircle (I would have loved to find all 15 of them but that's all for me)
@clobre_3 ай бұрын
that wouldn't generate very well :p
@im.empimp2 ай бұрын
still needs a coffee pot
@wdvorak3 ай бұрын
I'm a coder by passion and training. I love a simple bit of program code -- C, Python, Pascal, Forth, Lisp, Basic -- that does a simple operation (usually in the nature of a "tool"), but it can be easily followed (doesn't need excessive amounts of documentation), that fits on a screen or a couple of screens, that computes something quite complex. I actual like your coding. With time it can be optimized and refined, but it's not about the code, but the solution that you were after.
@kakaz983 күн бұрын
I 110% agree. It's much more important to get your initial program working than spend time trying to make it fast or elegant
@konstanty80943 ай бұрын
The code is good if it does the job and you don't intend to reuse it. some simple fixes: - instead of int(a/b) you can do a // b - instead of using lists to represent the pieces, you can use tuples (they are easier on the memory) - instead of putting a large portion of code in the body of `if candidate_poential`, you can do `if not candidate_poential: continue` to make the code less nested.
@daniel.watching3 ай бұрын
You could massively save time with a bit of numpy. Start by representing each "pair" as a byte where they are each other's compliment (bitwise inverse). It would fit in a byte or even a nibble. Then you can pre-calculate an array of the top-two edges of every price in its four orientations (so 25x4 or 100 bytes/16-bit uints). Then for each iteration of the "checker" all it needs to do it concat the left and top edge for that slot and then bit-wise OR against the array. Then logical NOT the result and you'll have a logical array of every match. If you pass down a list of "already used" indicies (or a boolean array) then you don't have to copy the puzzle or the pieces with each recursion step. Finally, wrap the whole thing up in a numba decorator so it can JIT-compile the recursive part of the function and you've got a ~1000x speed improvement without changing any of the behaviour or doing anything particularly fancy. Of course the best way to save time would be to turn the problem on its head and generate a puzzle with the properties you want rather than find one in randomness. Matt's approach is the equivalent of trying to generate a sudoku puzzle by randomising all the numbers and checking if it's still valid. It's conceptually easier but so many orders of magnitude slower.
@kakaz983 күн бұрын
Good suggestions
@LinusBoman3 ай бұрын
In and out combos? I prefer the technical term "knobbly bits".
@lrizzard3 ай бұрын
oh it's you!
@wiiza4ever3 ай бұрын
If we don't require the edge of the jigsaw to be straight, there should be a pleasant cut that achieves the rotating square effect from Steve's demonstration.
@xinpingdonohoe39783 ай бұрын
With all those holes and lumps, we can say they're already not straight, so let's do it.
@lrizzard3 ай бұрын
if the puzzle includes false edges, it might be possible to have both have straight edges with different edge pieces. but that makes it very complicated
@ApothecaryTerry2 ай бұрын
Given the context of the video, someone has to get an AI to solve the puzzle bit...
@wiiza4ever2 ай бұрын
@@ApothecaryTerry The AI is to create the picture, not to solve the puzzle.
@ApothecaryTerry2 ай бұрын
@@wiiza4ever I know, that was my point - we're looking for a solution to solve the puzzle so, given the context of the video, someone should train an AI to do that.
@SupercriticalSnake3 ай бұрын
5:18 Person with a British accent: Open source. My brain: Mmmm.... open sauce.
@bacon.cheesecake3 ай бұрын
William Osman has a convention for you
@MichaelPiz3 ай бұрын
Language barriers are fun. 😁
@ares3953 ай бұрын
@@MichaelPiz That's not... relevant here...?
@jameswise91713 ай бұрын
@@ares395The distinctions between language, dialect, and accent get VERY blurry
@gswcooper71623 ай бұрын
I, a British person: Wait, you pronounce "sauce" and "source" differently?
@genericgamer20033 ай бұрын
Haha 12:48 poor Matt is never going to live down the fourty billion percent increase in code efficiency
@xM0nsterFr3ak3 ай бұрын
That's what i thought 😂
@MttGaming9043 ай бұрын
ikr
@vsm14562 ай бұрын
that was not the end. by the time the video came out people found even better solutions, so fast that reading file with words from a disk took more time that the execution of the code
@permalost40593 ай бұрын
I was thinking about laser cutting it on cardboard as Matt was talking about making it yourself. Very happy when Steve mentioned it directly afterward, and devastated when I found out there is no already made file.
@Yatornado3 ай бұрын
One obvious optimisation if you haven't done so. When you fit a piece it only depends on the pieces to the left and to the top. You could've precalculate answers to each combination of 3 pieces incliding empty space (26*25*24 combinations) and get a precalculated answer instead of computing them each time. All this rotations etc done only 26*25*24 times instead of 25! times.
@daniel.watching2 ай бұрын
I said this on another post but yes and you could take it a step further and concat the two pre-calcualted edges into a single digit (with some bit shifting etc) and then you can store them in a numpy array and use a single operator to find every valid piece/rotation, no loops required. You should probably do the edges and corners first though because they're an exception. Each only has one valid rotation and the middle and edge pieces are mutually exclusive.
@nsiivola2 ай бұрын
This ☝️
@Sjoerd-gk3wr3 ай бұрын
they are 2 donuts I dont see the difference
@mimasweets3 ай бұрын
Lol
@XxKilleredxX3 ай бұрын
I don't even plan on watching this video until later; just came here to make sure someone made this joke.
@Carbon_Crow3 ай бұрын
We found the topologist!
@Fanny-Fanny3 ай бұрын
That is no way to speak about these two announcers 😉
@orterves3 ай бұрын
Nonsense, those are two coffee mugs
@andrasbiro30073 ай бұрын
Reminds me of old factories that were primarily making civilian stuff, but could be quickly reconfigured to make weapons. There's an old joke about this, where a guy working in a sewing machine factory steals pieces one by one, but when he tries to put it together at home he always gets an assault riffle.
@MeisterKleisterHeisstEr3 ай бұрын
This reminds me of an idea I read in a philosophy book. It's theoretically possible via radical translation to create two very different dictionaries of some foreign language x, both equally valid. The book also contained a 4x4 crossword puzzle that had 2 possible solutions. He called it a "Quinian Crossword Puzzle", in case you wanna look it up.
@BramCohen3 ай бұрын
If you're going the route of simply taking random assignments of edges and checking if that has other solutions then you can get a big speedup by having the alternate checker start in the upper left corner then go right, down, left, down, right, right, up, up, right, etc. forming a sort of zig-zag going out. But I suspect that's not a great overall approach. Far more promising is to a priori decide what the remapping is between the two solutions, check for what the different potential assignments of edges can be given those restrictions (there will be a lot of chains of 'these edges must be the same' and you can specifically tailor it so the chains are 'good' lengths) then check those to see if they have extraneous solutions.
@NolieRavioli3 ай бұрын
my 4k video buffered for a minute when you introduced the noise to the screen thats pretty epic
@bacon.cheesecake3 ай бұрын
Being a mess with no patterns, noise is really hard to compress, so it takes a lot more data than video of a couple blokes sitting in front of a still background
@OmateYayami3 ай бұрын
Ooohhhhh, so that's why the video stuttered... I thought I need to check my WiFi signal and router antenna lol.
@NolieRavioli3 ай бұрын
@OmateYayami I thought it was part of the video for a couple seconds, ngl
@dielaughing733 ай бұрын
That's entropy for ya
@NolieRavioli3 ай бұрын
@@dielaughing73 what's entropy?
@theminecraft42023 ай бұрын
I like to imagine Steve got the coffee mug again when reassembling it and had to give it another go around
@thedayb4tomorrow3 ай бұрын
The Matt Parker Process: Strange idea -> terrible python code -> spreadsheets -> magic 🙂
@riuphane3 ай бұрын
Steve's video was fascinating, but i did not expect this video to be so dramatically different for being related and having overlap
@dojelnotmyrealname40183 ай бұрын
Fun fact: Jigsaw puzzle makers often reuse cuts. So you can replace pieces of one jigsaw pieces with pieces of a different jigsaw puzzle, as long as they have the same amount of pieces and came from the same manufacturer.
@dankeseb48253 ай бұрын
A point noticed by Dave Gorman (and family members who receive jigsaws as gifts from him) 😊 kzbin.info/www/bejne/rYPbpJ-qar1_pM0si=e3BqV5yiTEX6sLFG
@amarissimus293 ай бұрын
And the same picture on them.
@richardking45143 ай бұрын
@@amarissimus29There's a fun series where someone combined two puzzles at a time to make creative mashups. I just did a quick search, the artist is Tim Klein.
@Caltor_Storm3 ай бұрын
Dave Gorman did it too in Modern Life is Goodish
@GetToTheFarm2 ай бұрын
@@Caltor_Storm was just thinking the same thing that was a funny episode!
@lexbailey3 ай бұрын
14:15 "fade from reality" is my new favourite synonym for "terminate"
@M4TCH3SM4L0N33 ай бұрын
Variants #15 and #20 were my preferred mug/donut examples.
@dielaughing733 ай бұрын
11 for me
@larspos82643 ай бұрын
Now we want a three solution jigsaw puzzle
@SupremeInvigilator3 ай бұрын
Infinitely many!
@d3vitron7793 ай бұрын
@@SupremeInvigilatorpixels
@dropkickedmurphy64633 ай бұрын
Yes, a puzzle with n solutions
@xinpingdonohoe39783 ай бұрын
@@SupremeInvigilator would you need to break the initial photo into a continuum?
@terry_the_terrible3 ай бұрын
I think it would be much easier to find a 4 solution puzzle rather than a 3 solution puzzle.
@mister19stick3 ай бұрын
i like the way you convinced Steve it's inTERNship, and kept it up in person. Matt, well played.
@asitisrequiredasitisrequir34113 ай бұрын
genuinely amazing. I want one of those block things that steve played with halfway through
@furbyfubar3 ай бұрын
I feel like I'm *probably* missing something crucial here? Couldn't this problem be solved with just pen and paper? If we select two different piece orders that are sufficiently different and then simply pair up the edge shapes so that we have the 7:50 "terrible way to do it" of having each edge fit in exactly two places? If we do that naively I can see that we will run into one issue with parity, but I think I found two different ways around it. So here's my best solution explained with way more words: 1. We start with a single jigsaw layouts with all (non edge/corner) pieces have alternating innie and outie edges when going around the piece. Let's say all innies are identical for now so pieces can be moved around. 2. We then move around and rotate the pieces so that we break up as many edges as possible. But we take care to preserve the the parity of innies and outies. A rotation of 90 degrees changes the parity, as does one more left, right, up, or down. If we want to be able to swap corner pieces around this means that we need a puzzle size that has an even number of pieces along each side, so 5x5 is out. But that's OK, I'm looking to draw a proof of concept on paper, so 2x2 is probably a better size to start. Let's name the pieces ABCD in reading order and make a terrible ASCII representation that youtube not having uniform character width will no doubt mess up. (You can copy paste this comment to notepad if you need to make it easier to read.) A | B ----- C | D 3. Let's number all the (non-straight) edges of the pieces. Since we care about innie and outie, (as an innie can't become an outie when later make some edge shapes identical), we make all the innies even numbers and all the outies odd numbers. A1|2B 4 | 5 ----- 3 | 6 C8|7D In the ASCII above I'm *trying* to show that I made the pairs (1,2) (4,3) (5,6) (8,7) connect. 4. So having drawn up a 2x2 jigsaw it looks like any corner piece can now be moved to any other corner; the rotation to make the corners be rotated correctly to still end up with a square puzzle afterwards works out for the parity of having the innie and outie edges always stay in the same place on the grid. This should still work for any jigsaw size where the side lengths are even. 5. Time to move some pieces: So we have 4! possible orderings on the 4 pieces. But 4 re-orderings are out since they either *are* the original ordering, or a rotation of it. So we now semi-arbitraryly select to swap places of the top two pieces, and then also swap places of the bottom two pieces. This isn't obvious without drawing it, but this means all original connected edges have been broken up. This gives us: B5|4A 2 | 1 ----- 7 | 8 D6|3C All the pieces are now moved and rotated 90 degrees, and our new edge pairs are: (5,4) (2,7) (1,8) (6,3). As all the odd numbers are still in positions where they were odd before we haven't accidentally changed any innie to be an outie. 6. This means that to make our four piece jigsaw with two solutions we should only need to make these edges be identical: (1,7) (2,8) (3,5) (4,6) So, am I missing something? Is there some reason why this couldn't scale up to a puzzle of bigger size? Oh right, I wrote that I found two different ways around the parity issue. The other solution is to make it so that each edge shape is rotationally symmetrical. But this means that all edges are both innies and outies, so that solution didn't feel like it was in the spirit of the problem Matt was trying to solve.
@georgelionon90503 ай бұрын
I'm thinking the same, the problem is solveable manually, just first make up which pieces you want to switch, then draw the in/out edges as duplicates of those edges, every pair with a unique in/out.
@Txyxy13 ай бұрын
You can try it, but I guess you would end up with puzzle that has more than two solutions.
@furbyfubar3 ай бұрын
I just drew up a 4x4 example to see if you were right. You don't seem to be, but proving that it can't happen with any rigor isn't all that easy. Or not easy enough that I'm about to get nerd sniped into trying to do it at 1:40am. I can tell for sure that the first quick 4x4 example I drew up only has two unique solutions though. I can sort of see why you'd think that it might cause multiple solutions though, as each piece goes into subgroup of spaces it can be moved to. (For 4x4 the groups are: Corners, even edges, odd edges, and middles. The two edge groups can't swap between each other without swapping innies for outies. For a bigger puzzles the number of subgroups seem to stay at 4 though.) So I agree that it *feels* like this might mean that since the multiple smaller subgroups will have to have their own loops/swaps of what pieces they trade places with, these groups could be independent for the solutions as well creating multiple unintended solutions. But that would only be true if puzzle pieces only had a single edge each. Since each puzzle piece has 2 to 4 edges each decision you make force the decisions for other edges. So the way it actually works out is that since each edge is only possible to connects to two other edges, once you select two pieces to connect, this leaves some other piece with only one possible connection. So since that connection is forced we make it. But using that piece removes the only possible connection from some other piece and so on. (The thing I can't prove with much rigor is that this *always* happens no matter what swap choices I make for the two solutions.) Or the other way to look at it: If I connect two edges that only go together in the first solution and I also connect another edge on one of *those* pieces with an edge it only goes with in the seconds solution I will quickly run into a contradiction where some edge either needs to be connected to two different edges, or it will lead to some unused edge that won't have any legal connection left.
@jonasla40113 ай бұрын
Is there anything better than this duo? The smile on my face every time I see a new collab on one of the channels
@mimasweets3 ай бұрын
Make a 500 piece one and take it to the speed puzzle solving world championship 😂
@Ryan251163 ай бұрын
'Matt Parker - lower third enthusiast' while placed in the lower third is a deep level of humor that tickles my brain in just the right way
@mikerich323 ай бұрын
1:11 this needs to become a meme, I swear 😂
@thinecyber_cat3 ай бұрын
Someone please make a gif of it
@danijelandroid3 ай бұрын
What?
@mr.duckie._.2 ай бұрын
donutjumpscare.gif
@TeagueChrystie3 ай бұрын
Watching that puzzle UV animate blew my mind.
@stoatystoat1743 ай бұрын
As someone born before home computers were in homes I am still a bit amazed by The machine learning for making the images Matt using computer to do his maths for him A network of other humans who will use machine learning to help them with code to use computers to do Matt's maths better
@joseville3 ай бұрын
You could model the edges as positive numbers for outies and negative numbers for innies. Outie A fits into innie alpha iff outie A is represented by +n and innie alpha is represented by -n. A solved puzzle will have all outie and innie pairs adding to 0. 15:50 If that's all SPUD is doing, and it doesn't ever get modified, then you can just define SPUD outside your recursive function (no need to pass it in as a parameter), and it can be accessed from any call to the function.
@oasntet3 ай бұрын
It's an interesting application of AI, but I wonder if an artist could now step in and drastically improve both solutions, using a drawing application that shows both permutations side-by-side.
@hoebare3 ай бұрын
I would love to see that process and hear the artist's thoughts before, during and after.
@Bedinsis3 ай бұрын
Probably someone like John Langdon (who made the ambigrams for the Dan Brown novel Angels and Demons).
@lucbloom3 ай бұрын
That tool exists, in Steve’s video. Need to find the artist.
@geekjokes84583 ай бұрын
it's not exactly the same, but it reminds me of those drawings of like "how many people" where you move something and count, then there are 11 or 12... (i think there's even a numberphile video on that)
@eragon783 ай бұрын
It would be extremely difficult, but maybe its possible.
@quadrplax3 ай бұрын
This is one of the most interesting ideas I've seen for using AI image generation! Now I want one of these and look forward to viewers improving on the idea
@Dalemoooooon3 ай бұрын
"Technically, there is a better one out there" So is this one the Parker Puzzle? Close to perfect, but not quite.
@weaselcon3 ай бұрын
Oh man, I feel like a Collab between Matt and Stuff Made Here would be EPIC!!!
@teddy42713 ай бұрын
So for code optimizations it would be helpful to generate edges first without considering interior pieces at all. If you only consider edges and corners, they must have two connections each, which makes permuting them very cheap relative to the full 5x5 brute force method. Since nothing else can go in the edge slots, either, you can consider edge connections as belonging to a separate group from the center connections. 16 unique connection types for a single solution puzzle mean you'd need at most 8 unique connections dedicated just for the edges, none of which need to be considered again for the interior, leaving a 3x3 interior that just needs to satisfy two different edge configurations. And those interior pieces only need 24 connectons, leaving 12 in the perfect case. Generate pieces as you need them, don't just guess and check.
@theyruinedyoutubeagain3 ай бұрын
With all this effort, Matt will eventually become a half-decent programmer 😄FWIW the code is indeed terrible, but that's why we love you
@feffy3803 ай бұрын
If anyone's wondering why the images look kinda distorted (oversaturated, noisy, etc), this is because Stable Diffusion's VAE (image encoder) is not robust to transformations on the encoded latents. Some of the latent pixels encode global information that gets corrupted when you rearrange things. I think the only way to avoid this would be to perform the transformations in pixel space instead of latent space, but this is incredibly expensive because that means you need to decode and re-encode the image on every single denoising step
@dave70383 ай бұрын
How expensive are we talking, and do you suppose that the resulting image would be substantially better? If it's only, like, an order of magnitude or two more expensive it seems like it would be worth trying.
@dave70383 ай бұрын
Partially answering my own question, it appears to take around 3 times longer to decode/re-encode on each step. Since I don't have a clue how to use this thing, I'm doing something wrong and can't get a valid image out of a step-by-step image generation, but the basic process isn't absurdly slow.
@Pleeze3 ай бұрын
Can't wait to see everyone's better Python code. I don't know if it helps much, but I could create Photoshop Actions for rearranging the pieces in 1 go. Also, maybe it's worth a try to make human art the same way, so like, the artist starts sketching something loosely, rearranges the pieces, continues the drawing, rearranges the pieces again and continues... repeat until both versions look decent
@whyitisme24103 ай бұрын
Sounds so cool to draw both version at the same time manually
@thedead4563213 ай бұрын
2:56 I could swear when i was younger I had a toy like this that wouls display two differents images with this sytem. But I was like 5 or 6 and it was a time at the peak of cassette tapes.
@xinpingdonohoe39783 ай бұрын
I feel like I did, but then I realised it might have just been those sliding square puzzles.
@ahirshfield3 ай бұрын
I like the little circle with realtime reaction of Steve’s expressions whilst Matt takes him through the graphs and code. Just so that we can all see if Steve does one of those stifled internal yawns through clenched teeth.
@macronencer3 ай бұрын
OK, too many comments queued in my brain so bullet points. * I'm a big fan of puzzles of all kinds. This is one of the greatest videos you've made, and the detail level was appreciated very much! * This might be the thing that finally makes me a little bit interested in AI... and that's a high bar. * I appreciate the appropriate choice of mugs on the table. * M C Escher would probably have LOVED to see this happen.
@andonel3 ай бұрын
You never get to hear Steves hearty laugh in his own videos (Probably because he's by himself). It's great and I love it!
@uninable3 ай бұрын
I enjoy the unnecessary rotoscoping on Steve's hand and the mug at 1:43
@MichaelJM3 ай бұрын
Ha nice catch. I appreciate it though. Makes for a cleaner video. I didn't even notice.
@MichaelDarrow-tr1mn3 ай бұрын
Pretty sure that's done with luma keying
@gus_melton3 ай бұрын
@@MichaelDarrow-tr1mn my money is on roto
@jack-mil91503 ай бұрын
what a good video format! I love that you are explaining to each other instead of the audience!
@joseywales61683 ай бұрын
Why is Steve EVERYWHERE I love all the science tuber collabs
@insu_na3 ай бұрын
Matt and Steve have been friends for a very long time, probably before KZbin even existed. They've been doing maths comedy together for many years
@lucbloom3 ай бұрын
Where is he else?
@xerfrex78693 ай бұрын
@@lucbloom He recently made an Assasin's Water Bottle with Vsauce
@Apophlegmatis3 ай бұрын
I am especially pleased the fact that the solutions have the same implied topography
@thefoxoverlord3 ай бұрын
i wonder if you could make an art program that shows two simultaneous viewports, one in each puzzle arrangement, of the same canvas, so that you could draw both solutions at the same time
@egodreas3 ай бұрын
There are many image editing applications that can apply ST maps and show both the original and remapped image. I work in VFX, and can do it with the industry standard compositing application called Nuke, for example. And I can paint on it while viewing both images simultaneously. Not sure what the simplest available program would be though. All the ones I can think of are rather specialized, and perhaps a bit technical (not to mention expensive).
@Gudine3 ай бұрын
I know Blender has UV Map support, so maybe it can do that
@potetopancakes3 ай бұрын
yes !!! the AI images are interesting but i would love to see someone draw one of these themself, since a lot of people are iffy on the morals of generative AI
@Purplesquigglystripe3 ай бұрын
It would be cool if you could input your own images too and the computer finds a way to make them compatible.
@eragon783 ай бұрын
@@potetopancakes I mean this is one of the best applications of AI, I dont think there really is much of a moral problem with this specific use case.
@jonathanjoestar19383 ай бұрын
This jigsaw has 2 solutions. Topologist: no it doesn’t.
@atomic36913 ай бұрын
I can't wait until Matt comes out with his 10th Jigsaw sequel
@Nacimota3 ай бұрын
lol "Lower Third Enthusiast"; you're killing me already, Matt
@dpatts3 ай бұрын
For those (like me) who didn't know: The lower third is the area of the screen that videographers use for text and graphics, usually to identify who's on camera and what they do. It's a frivolous and self-referential joke, and yes it's very funny, but nobody tell Matt. It will only encourage him
@lucbloom3 ай бұрын
@@dpatts thank you captain 🫡
@meijuta3 ай бұрын
@@dpatts ty
@fudgesauce3 ай бұрын
I have a puzzle that has 1280x1024 pieces and the number of images I can generate by rearranging the pieces is astounding.
@karlhendrikse2 ай бұрын
You aren't rearranging them though, and also, please get a new monitor
Ай бұрын
@@karlhendrikse An aspect ratio of 5:4 is rather strange. 4:3 is the usual old format, and 16:9 is the most common one now.
@oc-steve2 ай бұрын
Forget the maths and code for the jigsaw, i just love the examples of making two different pictures from the same pieces. Looks like magic.
@jrouquie3 ай бұрын
Another approach : 1. postulate a reordering of the pieces. E.g. piece (x,y) goes to new position (a×x % p, b×y %p) where prime p is the puzzle side length. 2. compute the constraints on which piece edges must be identical 3. check (with your existing code) there aren't spurious new solutions. If there are, back to step 1. Maybe also rotate the pieces. Maybe you tried it already ?
@scottwright71773 ай бұрын
A couple of my favorite KZbinrs together! Amazing!
@matthewmilunic6123 ай бұрын
The hidden joke that to a mathematician a coffee mug and a donut are the same is very sneaky.
@andrasbiro30073 ай бұрын
You can tell he's a mathematician, because he used a coffee mug instead of a teapot (famous computer graphics object).
@elementw743 ай бұрын
@@andrasbiro3007 A teapot has a genus of 2 (handle + spout) while donuts and mugs have a genus of 1 (handle), so the joke would fall apart.
@saarl992 ай бұрын
It really isn't...
@KeaveMind2 ай бұрын
How is it the same? I dont get how math people see the world.. Is it cause both have a ring??
@matthewmilunic612Ай бұрын
@@KeaveMind Well its a common topology joke basically saying that since a donut and a coffee mug both have one hole, they are topologically equivalent. The joke is that since they're topologically equivalent they're the same (which obviously isn't true), but it does come with some symbolism that through some rearranging, you can morph one into another.
@VaughanMcAlley3 ай бұрын
The history of music is full of people creating musical lines that will fit in more than one context, and (usually) mathematically inclined theorists showing how to do so. Jacob Gran recently did a series of videos about the late 19th century Russian theorist Taneev which I found very interesting.
@MichaelJM3 ай бұрын
12:14 "Technically there is a better one out there." I'd expect nothing less from a Parker Puzzle!
@dolphinbro33003 ай бұрын
I love that warm chuckle that Steve gave when seeing how Matt named his constant for mutations per round ( 17:02 )
@platinummyrr3 ай бұрын
matt: technically there is a better one out there everyone: so what you're saying is that this is the parker jigsaw puzzle?
@JohnDoe-nq4du2 ай бұрын
The intro wasn't the surprise you were hoping it'd be, because we all already know that mathematicians can't tell a donut from a coffee cup: they're the same shape.
@vighneshsivakumar34183 ай бұрын
I would love to see an artist take a crack at drawing a two solution puzzle
@sierpinskibrot3 ай бұрын
2 incredible collaborations in the span of 4 days this is exactly what i needed thank you matt parker
@matt_miles3 ай бұрын
Computer science student here.Your jig checker quite fundementally is a jig solver. What you're doing is a version of the backtracking algorithm where rather than trying to solve as much as possible and then going back (depth first search) you're finding all the solutions for the next step first and testing those (breadth first search), which is to say you're doing all the same steps but in a different order. It's a little misleading to say that just because you thought of a different order to do the same operations in, it makes it an entirely different concept (checker vs solver) but I totally understand the confusion.
@JoachimFavre3 ай бұрын
Great video! Can't wait for the follow-up video where viewers optimise your code o/
@paulosebresos78643 ай бұрын
This all looks like a super advanced captcha
@brololler2 ай бұрын
that was a very convoluted way of proving that a donut and a coffee cup is homeomorphic
@kingasparagoose68492 ай бұрын
Does not prove it. While its true that they are, you could make this with things that are not
@sntbrski3 ай бұрын
16:14 wait, "amongus" folder? what's inside? WHAT'S INSIDE WE NEED TO KNOW
@dorol63753 ай бұрын
I think the amongus folder would be from when he tried to find amongi in the digits of pi using python
@sntbrski3 ай бұрын
@@dorol6375 ahhh, indeed! that explains it
@SeanHoulihane3 ай бұрын
I do like the way that you show how functional code beats performant code, at least if you only need it to run once, and if you have enough time. For non-programmers, this is important. Its probably important to know there are more optimal solutions, but all to often its not really worth the final stages of optimisation.
@noahblack9143 ай бұрын
I feel like the people complaining about the problems with the code and the file naming don't understand that Matt has different motivations and concerns than them. He's trying to get an answer. He's not trying to pass code review.
@westonmarkham12943 ай бұрын
quick construction for a jigsaw puzzle that has exactly two configurations that fit together: Take a puzzle with all distinct edges and exactly one solution, and replace the edges on one corner piece so that that piece is a duplicate of another corner piece. It should be fairly easy to show that this has exactly one more solution, in which those two pieces are swapped.
@MikeBindschadler3 ай бұрын
Agree that this is a pretty trivial solution for a 2-solution jigsaw puzzle, but it also obviously will fail pretty terribly at having two meaningfully different images, since all but those two corner pieces will be in identical arrangements. Solutions along this vein are why it made lots of sense to apply some sort of "maximally different" metric for all piece positions.
@westonmarkham12943 ай бұрын
@@MikeBindschadler yes. And he does address that in the video. I was just responding to the initial question of whether any such thing even exists. For maximum degeneracy, though, we can continue with my idea, and make the image be a Necker cube.
@Marconius63 ай бұрын
15:30 Matt slowly discovering functional programming...
@JohannaMueller572 ай бұрын
can't express how much i love steve and matt
@KenLieck3 ай бұрын
I picked up a fascinating thing at a thrift store -- it's a jigsaw puzzle, but comes with software (horribly out of date and obsolete, unfortunately) that enables you to take any photograph and process it so that by renumbering the pieces, the puzzle can be assembled to match the photograph. So you can go much farther than the mug/donut combo -- to infinity, I suppose -- with the help of a computer, and a commercially available novelty product allowing you to do so came out a couple of decades ago.
@diestormlie3 ай бұрын
So, basically, it's a bunch of physical pixels?
@KenLieck3 ай бұрын
I managed to dig the thing up out of my stuff! It's called JIGAZO from Hasbro, came out in 2011 based on a Japanese design from the year before. The software is now available free on the Internet Archive but I don't know if that's of any use without the puzzle pieces themselves. The Hasbro site described it thusly: "JI GA ZO's 300 pieces have varying levels of Sepia-colored gradations on one side and distinguishing symbols on the other. When the pieces are locked together, any face can be created. The key to this puzzle is the advanced JI GA ZO software. Upload a digital image to the JI GA ZO CD-ROM included in the box, and the software will produce a unique map that shows where each of the 300 pieces should be placed on the assembly grid to complete the JI GA ZO image. "The symbols make it possible for the JI GA ZO pieces to be individually identified and arranged in the correct position. In under an hour, the approximate time needed to place all of the pieces together, the JI GA ZO image will be revealed. Since the puzzle is assembled based on a custom map, the pieces can be continuously reshuffled and put back together to create new designs based on new maps."
@cosmicjenny45083 ай бұрын
That sounds amazing! Do you have any more information about it please?
@KenLieck3 ай бұрын
@@cosmicjenny4508 Its called JIGAZO from Hasbro. There's plenty of info online including demo videos on KZbin.
@natescode3 ай бұрын
@@cosmicjenny4508just use mini Rubik's cubes
@Verrisin2 ай бұрын
Matt is so kind to provide code with SO MUCH potential for optimization. XD
@Crawsome_Crustacean3 ай бұрын
You should make 2 of these puzzles on each side of the puzzle piece so you can have 4 solutions in one
@joshuascholar32203 ай бұрын
This is the most entertaining thing I've seen in days.
@davidfinch74183 ай бұрын
Them talking about taking the noise and leaving a donut reminds me of how to carve an elephant out of marble. 1. Take a block of marble 2. Remove all the parts that don't look like an elephant 3. Done.
@Cyrribrae2 ай бұрын
Steve's video has an explanation of the AI process that exactly uses this analogy. Two different sculptors working on the same block of marble to make two different sculptures from each of their own perspectives, that are nevertheless still one unified carving.
@Kratokian3 ай бұрын
Ooh I do really like that Variant #21, there's a slight bit more mind blowing when the two objects aren't actually the same color.
@Supermath1013 ай бұрын
A good name for these would be "bistable jigsaw puzzles".
@tarocalypse3 ай бұрын
Great collab! More - love you both!
@sociallysupreme71013 ай бұрын
donut and a mug, do i smell topology?
@rickseiden13 ай бұрын
I love the Mould/Parker colab videos!
@minaballerina3 ай бұрын
omg karen puzzles needs to do this
@mracin243 ай бұрын
Came here to add this comment and saw it's already here!