How can a jigsaw have two distinct solutions?

  Рет қаралды 348,669

Stand-up Maths

Stand-up Maths

Күн бұрын

Learn more about Jane Street’s internship opportunities: jane-st.co/SUM...
Check out Steve’s video: • This new type of illus...
This is Ryan’s Diffusion Illusions site: diffusionillus...
And here is the full “Diffusion Illusions: Hiding Images in Plain Sight” paper by Ryan Burgert, Xiang Li, Abe Leite, Kanchana Ranasinghe and Michael S. Ryoo. diffusionillus...
Download of the jigsaw: www.dropbox.co...
Here’s the layout of the different edge types: www.dropbox.co...
Huge thanks to my Patreon supporters. They provide all the valid solutions I need. / standupmaths
CORRECTIONS
- None yet, let me know if you spot anything!
Filming by Alex Genn-Bash
Editing by Gus Melton
Written and performed by Matt Parker and Steve Mould
Produced by Nicole Jacobus
Music by Howard Carter
Design by Simon Wright and Adam Robinson
Dice on loan from the Bec Hill collection
MATT PARKER: Stand-up Mathematician
Website: standupmaths.com/

Пікірлер: 1 100
@standupmaths
@standupmaths 4 күн бұрын
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.
@Deragaergadgfadsfasd
@Deragaergadgfadsfasd 3 күн бұрын
I think M.C. Escher would have loved all this, especially the bit about assembling the puzzle. 🧩
@wbfaulk
@wbfaulk 3 күн бұрын
What exactly is "quantitive trading" (24:16) and how does it differ from "quantitative trading"?
@AexisRai
@AexisRai 3 күн бұрын
Anyone interested in jigsaw puzzles and pure deduction should look up the puzzle "Cornered" by game developer Portponky.
@cicik57
@cicik57 3 күн бұрын
nice puzzle, sorry very bad programming :D
@smithsmith6402
@smithsmith6402 3 күн бұрын
I would desperately love to see this image generation applied to a Hexaflexagon for multiple finished images in the various configurations.
@IceMetalPunk
@IceMetalPunk 3 күн бұрын
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?"
@MatheusC1729
@MatheusC1729 3 күн бұрын
Matt wrote MiracleSort Wikipedia page
@sixty502
@sixty502 3 күн бұрын
this would be so faster if it included not rechecking the same permutation twice...
@bawilson999
@bawilson999 3 күн бұрын
I'm a seasoned developer. Heavy use of copying data and recursion will kill performance. Especially in interpreted (managed) languages like Python.
@bandana_girl6507
@bandana_girl6507 3 күн бұрын
Hey, the *code* isn't terrible, it's the algorithm
@billybionicle
@billybionicle 3 күн бұрын
​@@bawilson999thats like pointing out there's chip in the paint of a car when the entire engine is missing
@NigelMelanisticSmith
@NigelMelanisticSmith 3 күн бұрын
"Terrible Python Code" is at "Say The Line, Bart" levels by now lol
@brianphelps2415
@brianphelps2415 3 күн бұрын
I'm not complaining, it helps me with Parker Bingo!
@RavenMobile
@RavenMobile 3 күн бұрын
Maybe bad Python code should be called Monty Python code.
@guiorgy
@guiorgy 3 күн бұрын
Parker Code?
@1st2nd2
@1st2nd2 3 күн бұрын
Cowabunga!
@vincentpelletier57
@vincentpelletier57 3 күн бұрын
I didn't do it.
@SJrad
@SJrad 3 күн бұрын
Topologically consistent jigsaw puzzle
@aleksitjvladica.
@aleksitjvladica. 3 күн бұрын
What everybody thought but as a sentence.
@Supermath101
@Supermath101 3 күн бұрын
You forgot to add the adjective "bistable" to the phrase.
@seventoast
@seventoast 3 күн бұрын
I am pleased that someone beat me to this comment 😂 What an audience Matt has
@hilburn-
@hilburn- 3 күн бұрын
I think they should be called "ambigsaws"
@gm2407
@gm2407 3 күн бұрын
​@@seventoastI am pleased there are so many topologist comments.
@Thagrynor
@Thagrynor 3 күн бұрын
The look of Matt's soul dying just a little when Steve uttered the phrase "public code review" is priceless lol .....
@Rubrickety
@Rubrickety 3 күн бұрын
I wrote what I thought was improved code for this problem, but when I ran it the lights on my Christmas tree went insane.
@LeeAnnC
@LeeAnnC 3 күн бұрын
😆
@dinhero21
@dinhero21 3 күн бұрын
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?
@xinpingdonohoe3978
@xinpingdonohoe3978 3 күн бұрын
​@@dinhero21 or perhaps the lights are flickering on and off in an attempt to create two distinct patterns simultaneously?
@user-hm6hv3qh2r
@user-hm6hv3qh2r 3 күн бұрын
@@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
@patu8010
@patu8010 3 күн бұрын
I thought it was a reference to Stranger Things. Like your code was so cursed, your house is haunted now.
@ares395
@ares395 3 күн бұрын
Oh I can't wait for the "a viewer made my code *obscene number*% better"
@Thk10188965
@Thk10188965 3 күн бұрын
Fairly sure that is a past video. Possibly with christmas lights if I remember correctly
@3nertia
@3nertia 3 күн бұрын
@@Thk10188965 That's the joke!
@EggBastion
@EggBastion 3 күн бұрын
@@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...
@TheRenegade... 3 күн бұрын
@@Thk10188965 You're thinking of "Someone improved my code by *obscene number*%". Completely different concept
@xinpingdonohoe3978
@xinpingdonohoe3978 3 күн бұрын
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.
@aidenkoh2426
@aidenkoh2426 3 күн бұрын
I love that the mathematician in you felt the need to say “distinct” in the title.
@WizoML
@WizoML 3 күн бұрын
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.
@oncedidactic
@oncedidactic 2 күн бұрын
This for sure
@apokatastasian2831
@apokatastasian2831 3 күн бұрын
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
@nikkiofthevalley
@nikkiofthevalley 3 күн бұрын
Nothing, because all normal jigsaw puzzles will only have one solution.
@5thearth
@5thearth 3 күн бұрын
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.
@bzboii
@bzboii 3 күн бұрын
goated comment
@wintersxlstice21
@wintersxlstice21 3 күн бұрын
this would be an awesome scp
@dinklebob1
@dinklebob1 3 күн бұрын
​@@nikkiofthevalley Look up The Magic Puzzle Company. Technically different (and certainly not normal), but still mind blowing.
@Zarunias
@Zarunias 3 күн бұрын
And now I wish that a jigsaw publisher takes this concept and publish a little series of these with different pictures.
@KenLieck
@KenLieck 3 күн бұрын
JIGAZO from Hasbro.
@danhorus
@danhorus 3 күн бұрын
Somebody call Karen Puzzles
@Stratelier
@Stratelier 3 күн бұрын
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-rb3lt
@AdnanAli-rb3lt 3 күн бұрын
​@Stratelier it might be Tenyo Jigazo. Not sure how old that puzzle is
@KenLieck
@KenLieck 3 күн бұрын
@@AdnanAli-rb3lt 2010.
@pseudo_goose
@pseudo_goose 3 күн бұрын
The Python code isn't as bad as the "version control"
@Bobbias
@Bobbias 3 күн бұрын
I felt a chill run up my spine when I saw that.
@lindhe
@lindhe 3 күн бұрын
Love that! 😂
@hentielover
@hentielover 3 күн бұрын
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_d3m0n
@v0id_d3m0n 3 күн бұрын
oh lord
@icefreez3r815
@icefreez3r815 3 күн бұрын
amongus
@Imperial_Squid
@Imperial_Squid 3 күн бұрын
16:44 it causes me physical pain to see Matt naming his python files the way people label their English essay drafts lol
@xinpingdonohoe3978
@xinpingdonohoe3978 3 күн бұрын
What would you name yours?
@LethalChicken77
@LethalChicken77 3 күн бұрын
Honestly still better version control than github 😂
@bigsmoke6414
@bigsmoke6414 3 күн бұрын
​@@LethalChicken77lol no
@Anohaxer
@Anohaxer 3 күн бұрын
amongus
@stefanalecu9532
@stefanalecu9532 3 күн бұрын
​@@LethalChicken77 you're as """good""" of a programmer as Matt is with that opinion
@SupercriticalSnake
@SupercriticalSnake 3 күн бұрын
5:18 Person with a British accent: Open source. My brain: Mmmm.... open sauce.
@bacon.cheesecake
@bacon.cheesecake 3 күн бұрын
William Osman has a convention for you
@MichaelPiz
@MichaelPiz 3 күн бұрын
Language barriers are fun. 😁
@ares395
@ares395 3 күн бұрын
@@MichaelPiz That's not... relevant here...?
@jameswise9171
@jameswise9171 3 күн бұрын
@@ares395The distinctions between language, dialect, and accent get VERY blurry
@gswcooper7162
@gswcooper7162 3 күн бұрын
I, a British person: Wait, you pronounce "sauce" and "source" differently?
@not_David
@not_David 3 күн бұрын
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…
@chemistrymickey
@chemistrymickey 3 күн бұрын
Oh my gosh, not_David! I love your maths videos too!
@WoolyCow
@WoolyCow 3 күн бұрын
rare footage of an elusive not david spotted in the wild!
@oyora
@oyora 3 күн бұрын
sprinkles 🥹
@mtarek2005
@mtarek2005 3 күн бұрын
those blender donuts!!!
@Brandon-oc8lr
@Brandon-oc8lr 3 күн бұрын
I can’t look at a sprinkle donut without a shiver going down my spine
@Sjoerd-gk3wr
@Sjoerd-gk3wr 3 күн бұрын
they are 2 donuts I dont see the difference
@mimasweets
@mimasweets 3 күн бұрын
Lol
@XxKilleredxX
@XxKilleredxX 3 күн бұрын
I don't even plan on watching this video until later; just came here to make sure someone made this joke.
@Carbon_Crow
@Carbon_Crow 3 күн бұрын
We found the topologist!
@Fanny-Fanny
@Fanny-Fanny 3 күн бұрын
That is no way to speak about these two announcers 😉
@orterves
@orterves 3 күн бұрын
Nonsense, those are two coffee mugs
@NonTwinBrothers
@NonTwinBrothers 3 күн бұрын
A simple 'context' or 'result' would do, but Matt books it with SPUD. Very on brand
@baksatibi
@baksatibi 3 күн бұрын
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.
@johnrehwinkel7241
@johnrehwinkel7241 3 күн бұрын
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.
@HaloInverse
@HaloInverse 3 күн бұрын
"It took _how_ long to complete? What are you running your code on, a potato?"
@wiiza4ever
@wiiza4ever 3 күн бұрын
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.
@xinpingdonohoe3978
@xinpingdonohoe3978 3 күн бұрын
With all those holes and lumps, we can say they're already not straight, so let's do it.
@lrizzard
@lrizzard 3 күн бұрын
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
@larspos8264
@larspos8264 3 күн бұрын
Now we want a three solution jigsaw puzzle
@SupremeInvigilator
@SupremeInvigilator 3 күн бұрын
Infinitely many!
@d3vitron779
@d3vitron779 3 күн бұрын
@@SupremeInvigilatorpixels
@dropkickedmurphy6463
@dropkickedmurphy6463 3 күн бұрын
Yes, a puzzle with n solutions
@xinpingdonohoe3978
@xinpingdonohoe3978 3 күн бұрын
​@@SupremeInvigilator would you need to break the initial photo into a continuum?
@terry_the_terrible
@terry_the_terrible 3 күн бұрын
I think it would be much easier to find a 4 solution puzzle rather than a 3 solution puzzle.
@NolieRavioli
@NolieRavioli 3 күн бұрын
my 4k video buffered for a minute when you introduced the noise to the screen thats pretty epic
@bacon.cheesecake
@bacon.cheesecake 3 күн бұрын
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
@OmateYayami
@OmateYayami 3 күн бұрын
Ooohhhhh, so that's why the video stuttered... I thought I need to check my WiFi signal and router antenna lol.
@NolieRavioli
@NolieRavioli 3 күн бұрын
@OmateYayami I thought it was part of the video for a couple seconds, ngl
@dielaughing73
@dielaughing73 2 күн бұрын
That's entropy for ya
@NolieRavioli
@NolieRavioli 2 күн бұрын
@@dielaughing73 what's entropy?
@genericgamer2003
@genericgamer2003 3 күн бұрын
Haha 12:48 poor Matt is never going to live down the fourty billion percent increase in code efficiency
@xM0nsterFr3ak
@xM0nsterFr3ak 3 күн бұрын
That's what i thought 😂
@GladionD.Pierce
@GladionD.Pierce 3 күн бұрын
ikr
@matthewmilunic612
@matthewmilunic612 3 күн бұрын
The hidden joke that to a mathematician a coffee mug and a donut are the same is very sneaky.
@andrasbiro3007
@andrasbiro3007 3 күн бұрын
You can tell he's a mathematician, because he used a coffee mug instead of a teapot (famous computer graphics object).
@elementw74
@elementw74 2 күн бұрын
@@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.
@dojelnotmyrealname4018
@dojelnotmyrealname4018 3 күн бұрын
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.
@dankeseb4825
@dankeseb4825 3 күн бұрын
A point noticed by Dave Gorman (and family members who receive jigsaws as gifts from him) 😊 kzbin.info/www/bejne/rYPbpJ-qar1_pM0si=e3BqV5yiTEX6sLFG
@amarissimus29
@amarissimus29 2 күн бұрын
And the same picture on them.
@richardking4514
@richardking4514 2 күн бұрын
​@@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_Storm
@Caltor_Storm 2 күн бұрын
Dave Gorman did it too in Modern Life is Goodish
@geothermie_
@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)
@Dalemoooooon
@Dalemoooooon 3 күн бұрын
"Technically, there is a better one out there" So is this one the Parker Puzzle? Close to perfect, but not quite.
@mikerich32
@mikerich32 3 күн бұрын
1:11 this needs to become a meme, I swear 😂
@thinecyber_cat
@thinecyber_cat 3 күн бұрын
Someone please make a gif of it
@danijelandroid
@danijelandroid 2 күн бұрын
What?
@brandyballoon
@brandyballoon 3 күн бұрын
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.
@Ryan25116
@Ryan25116 3 күн бұрын
'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
@uninable
@uninable 3 күн бұрын
I enjoy the unnecessary rotoscoping on Steve's hand and the mug at 1:43
@MichaelJM
@MichaelJM 3 күн бұрын
Ha nice catch. I appreciate it though. Makes for a cleaner video. I didn't even notice.
@MichaelDarrow-tr1mn
@MichaelDarrow-tr1mn 3 күн бұрын
Pretty sure that's done with luma keying
@gus_melton
@gus_melton 3 күн бұрын
⁠@@MichaelDarrow-tr1mn my money is on roto
@lexbailey
@lexbailey 3 күн бұрын
14:15 "fade from reality" is my new favourite synonym for "terminate"
@riuphane
@riuphane 2 күн бұрын
Steve's video was fascinating, but i did not expect this video to be so dramatically different for being related and having overlap
@oasntet
@oasntet 3 күн бұрын
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.
@hoebare
@hoebare 3 күн бұрын
I would love to see that process and hear the artist's thoughts before, during and after.
@Bedinsis
@Bedinsis 3 күн бұрын
Probably someone like John Langdon (who made the ambigrams for the Dan Brown novel Angels and Demons).
@lucbloom
@lucbloom 3 күн бұрын
That tool exists, in Steve’s video. Need to find the artist.
@geekjokes8458
@geekjokes8458 Күн бұрын
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)
@eragon78
@eragon78 Күн бұрын
It would be extremely difficult, but maybe its possible.
@LinusBoman
@LinusBoman 3 күн бұрын
In and out combos? I prefer the technical term "knobbly bits".
@lrizzard
@lrizzard 3 күн бұрын
oh it's you!
@konstanty8094
@konstanty8094 3 күн бұрын
The code is good if it does the job if 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.lupton
@daniel.lupton Күн бұрын
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.
@Yatornado
@Yatornado 3 күн бұрын
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.
@thefoxoverlord
@thefoxoverlord 3 күн бұрын
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
@egodreas
@egodreas 3 күн бұрын
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).
@Gudine
@Gudine 3 күн бұрын
I know Blender has UV Map support, so maybe it can do that
@potetopancakes
@potetopancakes 3 күн бұрын
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
@Purplesquigglystripe
@Purplesquigglystripe 2 күн бұрын
It would be cool if you could input your own images too and the computer finds a way to make them compatible.
@eragon78
@eragon78 Күн бұрын
@@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.
@Nacimota
@Nacimota 3 күн бұрын
lol "Lower Third Enthusiast"; you're killing me already, Matt
@dpatts
@dpatts 3 күн бұрын
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
@lucbloom
@lucbloom 3 күн бұрын
@@dpatts thank you captain 🫡
@metactal
@metactal 3 күн бұрын
@@dpatts ty
@mimasweets
@mimasweets 3 күн бұрын
Make a 500 piece one and take it to the speed puzzle solving world championship 😂
@fudgesauce
@fudgesauce 3 күн бұрын
I have a puzzle that has 1280x1024 pieces and the number of images I can generate by rearranging the pieces is astounding.
@thedayb4tomorrow
@thedayb4tomorrow 3 күн бұрын
The Matt Parker Process: Strange idea -> terrible python code -> spreadsheets -> magic 🙂
@furbyfubar
@furbyfubar 3 күн бұрын
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.
@georgelionon9050
@georgelionon9050 3 күн бұрын
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.
@Txyxy1
@Txyxy1 3 күн бұрын
You can try it, but I guess you would end up with puzzle that has more than two solutions.
@furbyfubar
@furbyfubar 2 күн бұрын
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.
@andrasbiro3007
@andrasbiro3007 3 күн бұрын
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.
@M4TCH3SM4L0N3
@M4TCH3SM4L0N3 3 күн бұрын
Variants #15 and #20 were my preferred mug/donut examples.
@dielaughing73
@dielaughing73 2 күн бұрын
11 for me
@MeisterKleisterHeisstEr
@MeisterKleisterHeisstEr 3 күн бұрын
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.
@wdvorak
@wdvorak Күн бұрын
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.
@BramCohen
@BramCohen 3 күн бұрын
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.
@theminecraft4202
@theminecraft4202 3 күн бұрын
I like to imagine Steve got the coffee mug again when reassembling it and had to give it another go around
@TeagueChrystie
@TeagueChrystie 3 күн бұрын
Watching that puzzle UV animate blew my mind.
@ahirshfield
@ahirshfield 2 күн бұрын
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.
@joseywales6168
@joseywales6168 3 күн бұрын
Why is Steve EVERYWHERE I love all the science tuber collabs
@insu_na
@insu_na 3 күн бұрын
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
@lucbloom
@lucbloom 3 күн бұрын
Where is he else?
@xerfrex7869
@xerfrex7869 3 күн бұрын
@@lucbloom He recently made an Assasin's Water Bottle with Vsauce
@theyruinedyoutubeagain
@theyruinedyoutubeagain 3 күн бұрын
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
@minaballerina
@minaballerina 3 күн бұрын
omg karen puzzles needs to do this
@mracin24
@mracin24 3 күн бұрын
Came here to add this comment and saw it's already here!
@weaselcon
@weaselcon 3 күн бұрын
Oh man, I feel like a Collab between Matt and Stuff Made Here would be EPIC!!!
@MichaelJM
@MichaelJM 3 күн бұрын
12:14 "Technically there is a better one out there." I'd expect nothing less from a Parker Puzzle!
@davidfinch7418
@davidfinch7418 3 күн бұрын
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.
@jonathanjoestar1938
@jonathanjoestar1938 3 күн бұрын
This jigsaw has 2 solutions. Topologist: no it doesn’t.
@mister19stick
@mister19stick 3 күн бұрын
i like the way you convinced Steve it's inTERNship, and kept it up in person. Matt, well played.
@asitisrequiredasitisrequir3411
@asitisrequiredasitisrequir3411 3 күн бұрын
genuinely amazing. I want one of those block things that steve played with halfway through
@vighneshsivakumar3418
@vighneshsivakumar3418 3 күн бұрын
I would love to see an artist take a crack at drawing a two solution puzzle
@joseville
@joseville 3 күн бұрын
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.
@JoachimFavre
@JoachimFavre 3 күн бұрын
Great video! Can't wait for the follow-up video where viewers optimise your code o/
@atomic3691
@atomic3691 3 күн бұрын
I can't wait until Matt comes out with his 10th Jigsaw sequel
@jonasla4011
@jonasla4011 2 күн бұрын
Is there anything better than this duo? The smile on my face every time I see a new collab on one of the channels
@thedead456321
@thedead456321 3 күн бұрын
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.
@xinpingdonohoe3978
@xinpingdonohoe3978 3 күн бұрын
I feel like I did, but then I realised it might have just been those sliding square puzzles.
@sociallysupreme7101
@sociallysupreme7101 3 күн бұрын
donut and a mug, do i smell topology?
@olegyakunin3849
@olegyakunin3849 3 күн бұрын
16:14 wait, "amongus" folder? what's inside? WHAT'S INSIDE WE NEED TO KNOW
@dorol6375
@dorol6375 3 күн бұрын
I think the amongus folder would be from when he tried to find amongi in the digits of pi using python
@olegyakunin3849
@olegyakunin3849 3 күн бұрын
@@dorol6375 ahhh, indeed! that explains it
@jrouquie
@jrouquie 2 күн бұрын
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 ?
@avramlevitter6150
@avramlevitter6150 3 күн бұрын
Something that's both a donut and a coffee cup? You've just summoned the topologists!
@Pleeze
@Pleeze 3 күн бұрын
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
@whyitisme2410
@whyitisme2410 3 күн бұрын
Sounds so cool to draw both version at the same time manually
@feffy380
@feffy380 3 күн бұрын
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
@dave7038
@dave7038 19 сағат бұрын
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.
@dave7038
@dave7038 15 сағат бұрын
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.
@jonathanfontaine2325
@jonathanfontaine2325 3 күн бұрын
With the given transformation of the jigsaw pieces, to go from the mug to the donut, you cannot have 20 pairs of identical in-out edge pairs. That would require all pieces to swap neighbours in pairs, which is not the case here. In fact in this specific transformation you have rather long chains of neighbour swaps, allowing for at most 14 distinct edge types. To illustrate, I'll number the pieces in the assembled mug picture from left to right and top to bottom by their x,y-coordinates as follows: 11 12 13 14 15 21 22 23 24 25 31 32 33 34 35 41 42 43 44 45 51 52 53 54 55 I'll label each of their edges by their cardinal direction N, W, S, E. So for example, in the mug assembly the edges 12E and 13W are matched, so their in and out must match. But in the donut picture that same edge 12E is matched with 11S, and 13W is matched with 35S. So we must have 11S=13W and 12E=35S. In turn, in the mug picture 11S is matched with 21N, and 35S with 45N, so 21N=12E and 45N=13W. Continuing this way in both directions we find a chain/loop: 11E-54E-55W-45N-35S-13W-12E-11S-21N-14W-13E-12W-11E In this chain every edge must match with both its neighbours, and so all odd-indexed edges are the same, and all even-indexed edges are the same. Going over all edges we find the following chains: 11E-54E-55W-45N-35S-13W-12E-11S-21N-14W-13E-12W-11E 14E-15W-14E 12S-43W-42E-22E-23W-34W-33E-22N-12S 13S-33W-32E-22S-32N-23N-13S 14S-23E-24W-32S-42N-24N-14S 15S-53E-54W-25N-15S 21E-32W-31E-44N-34S-22W-21E 24E-41E-42W-25W-24E 21S-45S-55N-41N-31S-52W-51E-31N-21S 23S-53N-43S-33N-23S 24S-45W-44E-35W-34E-44W-43E-42S-52N-34N-24S 25S-41S-51N-35N-25S 33S-44S-54N-43N-33S 52E-53W-52E So in the best case, the maximum number of distinct edge pair types is the number of chains, which is 14. There might of course be a different transformation with more chains.
@paulosebresos7864
@paulosebresos7864 3 күн бұрын
This all looks like a super advanced captcha
@macronencer
@macronencer 3 күн бұрын
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.
@platinummyrr
@platinummyrr 3 күн бұрын
matt: technically there is a better one out there everyone: so what you're saying is that this is the parker jigsaw puzzle?
@VaughanMcAlley
@VaughanMcAlley 2 күн бұрын
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.
@matt_miles
@matt_miles 3 күн бұрын
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.
@gcewing
@gcewing 2 күн бұрын
Now we just need the Banach-Tarski version that can be reassembled into two identical pictures of the same size.
@Nolan-3835
@Nolan-3835 3 күн бұрын
The image of a Yoda becomes itself a Yoda
@maht0x
@maht0x 3 күн бұрын
I need a Sodoku solver, I know I'll enumerate all the possible 9x9 grids and see which ones are valid Sodoku solutions!
@MrMastergeek
@MrMastergeek 3 күн бұрын
The "hello darkness" bit killed me 🤣
@Apophlegmatis
@Apophlegmatis 2 күн бұрын
I am especially pleased the fact that the solutions have the same implied topography
@KenLieck
@KenLieck 3 күн бұрын
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.
@diestormlie
@diestormlie 3 күн бұрын
So, basically, it's a bunch of physical pixels?
@KenLieck
@KenLieck 3 күн бұрын
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."
@cosmicjenny4508
@cosmicjenny4508 3 күн бұрын
That sounds amazing! Do you have any more information about it please?
@KenLieck
@KenLieck 3 күн бұрын
@@cosmicjenny4508 Its called JIGAZO from Hasbro. There's plenty of info online including demo videos on KZbin.
@natescode
@natescode 2 күн бұрын
​@@cosmicjenny4508just use mini Rubik's cubes
@stoatystoat174
@stoatystoat174 3 күн бұрын
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
@gardenofava
@gardenofava 3 күн бұрын
23:30 the parker puzzle
@ruolbu
@ruolbu 3 күн бұрын
I like variant 15 the most. It still clearly has artifacts, but it looks the cleanest in pure shape difference
@nanamacapagal8342
@nanamacapagal8342 3 күн бұрын
Now I know the point of generative AI was to make things quick, but I'm already curious about a hand-drawn version.
@Kratokian
@Kratokian 3 күн бұрын
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.
@existenceisillusion6528
@existenceisillusion6528 3 күн бұрын
Saying 'terrible python code' is like saying 'wet water'. Fight me!
@existenceisillusion6528
@existenceisillusion6528 3 күн бұрын
@@georgihristov4415 didn't say it wasn't. I'm saying python is good for rapid ideation, which coincides with 'not elegant'.
@stefanalecu9532
@stefanalecu9532 3 күн бұрын
Facts
@lukew6725
@lukew6725 3 күн бұрын
Water is not wet, water makes other things wet.
@existenceisillusion6528
@existenceisillusion6528 3 күн бұрын
@@lukew6725 You are technically correct, the best kind of correct.
@westonmarkham1294
@westonmarkham1294 Күн бұрын
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.
@MikeBindschadler
@MikeBindschadler 2 сағат бұрын
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.
@LuxFerre4242
@LuxFerre4242 3 күн бұрын
4:30 it's weird seeing Perlin noise as TV static.
@SeanHoulihane
@SeanHoulihane 2 күн бұрын
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.
@erwinjohannarndt4166
@erwinjohannarndt4166 3 күн бұрын
2am Europe time video? OH GOD YES!
@scottwright7177
@scottwright7177 Күн бұрын
A couple of my favorite KZbinrs together! Amazing!
@SpencerTwiddy
@SpencerTwiddy 3 күн бұрын
I bet the people that make that art in Vsauce shorts would (or maybe has already) be able to make one of these without the artifacts!
@SpencerTwiddy
@SpencerTwiddy 3 күн бұрын
I’m referring to the ambigrams and such.
@arturtrzebinski2112
@arturtrzebinski2112 2 күн бұрын
Innie and outie battle. Didn't expect it on KZbin.
@mikeyallen6758
@mikeyallen6758 3 күн бұрын
When people say that AI is a tool, this is always what i hope they mean. Where you are using it as a framework to customise the output to fit a specific need. Not just "type prompt get stolen art". It's not trying to pass itself as art, the double solution puzzle is the art, the picture on top is just a way to show it off.
@an_asp
@an_asp 3 күн бұрын
Yeah, I think generative AI is much, much more palatable when you're using it for novel capabilities that a human wasn't trying to do in the first place. Not trying to replace human artists, but making something cool and new.
@dolphinbro3300
@dolphinbro3300 2 күн бұрын
I love that warm chuckle that Steve gave when seeing how Matt named his constant for mutations per round ( 17:02 )
@privacyvalued4134
@privacyvalued4134 3 күн бұрын
17:10 LOL. Showing someone your code always produces this obvious effect on people's faces where they really, desperately want to tell you to stop but don't out of courtesy and hope that it will end very soon. Hilarious.
@permalost4059
@permalost4059 Күн бұрын
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.
@AdamBourke25
@AdamBourke25 3 күн бұрын
Ahh, I thought it was too coincidental that you both released videos about similar topics at basically the same time... made sense as soon as I saw both of you sat there!
This new type of illusion is really hard to make
17:58
Steve Mould
Рет қаралды 445 М.
Simulating the Evolution of Rock, Paper, Scissors
15:00
Primer
Рет қаралды 1,6 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
Making an atomic trampoline
58:01
NileRed
Рет қаралды 7 МЛН
The unexpected probability result confusing everyone
17:24
Stand-up Maths
Рет қаралды 539 М.
Holographic Optics Break My Brain
21:58
The Thought Emporium
Рет қаралды 356 М.
Why we should go back to writing in runes
20:39
RobWords
Рет қаралды 290 М.
The Bingo Paradox: 3× more likely to win
30:15
Stand-up Maths
Рет қаралды 600 М.
VFX Artist Reveals the True Scale of Minecraft
14:28
Corridor Crew
Рет қаралды 1,2 МЛН
That Alien Message
12:48
Rational Animations
Рет қаралды 225 М.
More Bizarre Attempts at Perpetual Motion Machines
14:40
Sideprojects
Рет қаралды 485 М.
AI can't cross this line and we don't know why.
24:07
Welch Labs
Рет қаралды 549 М.
These Illusions Fool Almost Everyone
24:55
Veritasium
Рет қаралды 3,6 МЛН