Тёмный

The Dumbest Way To Solve A Maze - Numberphile 

Numberphile
Подписаться 4,6 млн
Просмотров 378 тыс.
50% 1

Featuring Matt Henderson. Check brilliant.org/... for Brilliant and get 20% off their premium service (episode sponsor)
More links & stuff in full description below ↓↓↓
Matt Henderson on Twitter (he posts lovely animations there): / matthen2
Matt Henderson Numberphile Playlist: bit.ly/MattHen...
Computerphile: / computerphile
Numberphile is supported by the Mathematical Sciences Research Institute (MSRI): bit.ly/MSRINumb...
We are also supported by Science Sandbox, a Simons Foundation initiative dedicated to engaging everyone with the process of science. www.simonsfoun...
And support from The Akamai Foundation - dedicated to encouraging the next generation of technology innovators and equitable access to STEM education - www.akamai.com...
NUMBERPHILE
Website: www.numberphile...
Numberphile on Facebook: / numberphile
Numberphile tweets: / numberphile
Subscribe: bit.ly/Numberph...
Videos by Brady Haran
Patreon: / numberphile
Numberphile T-Shirts and Merch: teespring.com/...
Brady's videos subreddit: / bradyharan
Brady's latest videos across all channels: www.bradyharanb...
Sign up for (occasional) emails: eepurl.com/YdjL9

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 559   
@numberphile
@numberphile 2 года назад
Check Brilliant (episode sponsor): brilliant.org/numberphile Matt Henderson on Twitter (he posts super animations there): twitter.com/matthen2 Matt Henderson Numberphile Playlist: bit.ly/MattHendersonPlaylist
@jamescollier3
@jamescollier3 2 года назад
Make pressure, so they go the right way slightly more often than the wrong way each loop
@MichaelMantion
@MichaelMantion 2 года назад
Who imports numpy as numpy. Everyone I know imports numpy as np. He might want to use numba to speed up his code.
@Anonymous-df8it
@Anonymous-df8it 2 года назад
It would still work with only one particle... if you want an even dumber way!
@chrisvandermerwe8321
@chrisvandermerwe8321 2 года назад
L
@diegofrota
@diegofrota 2 года назад
What programming languages are Matt Henderson using to produce those beatiful animations? Can anyone tell me?
@KasranFox
@KasranFox 2 года назад
finally, the maze-solving equivalent of bogosort
@WinterDew.Studio
@WinterDew.Studio 2 года назад
This is the first thing which came to my mind
@rewanthnayak2972
@rewanthnayak2972 2 года назад
What mught be the sorting equivalent of lightning maze solver??🤔
@HyperHrishiHD
@HyperHrishiHD 2 года назад
Since you were first to say it then you get likes
@yuvalne
@yuvalne 2 года назад
+
@dagothur8037
@dagothur8037 2 года назад
now throw a NEAT instead of pure randomness and now its NEATboggosolver!
@superscatboy
@superscatboy 2 года назад
I once made a "rat with a terrible memory" maze-solving AI: It could do perfect A-star, but it only knew about walls it had "seen" (had a line of sight with), and at random it could forget a wall that it previously knew about.
@HappyBeezerStudios
@HappyBeezerStudios 2 года назад
That sounds intriguing. I'd love to see the results.
@wolfmoz2232
@wolfmoz2232 2 года назад
2. that
@PC_Simo
@PC_Simo Год назад
@@wolfmoz2232 3. that.
@aaroncroft7514
@aaroncroft7514 Год назад
4. that
@wojtekburzynski654
@wojtekburzynski654 Год назад
" A-star, but it only knew about walls it had "seen" "so kinda like D-star?
@MuJoeTheMean
@MuJoeTheMean 2 года назад
Interestingly, this concept actually has real world application in the world of mechanical engineering. Labyrinth seals are a type of seal in which a fluid is contained simply by making the leak path very long and torturous for the fluid particle to escape out of. This simulation is a pretty good demonstration of how surprisingly difficult it can be for a particle to escape when it just has random collisions to guide it. You can imagine that if designed to be intentionally difficult (narrow, long passages with lots of turns), a maze like this could do an excellent job at stopping leaks. They are most commonly used to seal spinning axels, where a normal seal may not be suitable due to friction or durability concerns. In these applications, the path usually makes many trips to and away from the axle so that centrifugal motion of the fluid can help prevent any leakage as well.
@jasonrubik
@jasonrubik 2 года назад
Now, that's a fun fact !
@NickACrowley
@NickACrowley 2 года назад
Is that the same principle used in a Tesla valve?
@Kwauhn.
@Kwauhn. 2 года назад
@@NickACrowley That's the first thing I thought of! Is there a telsa valve such that particles escaping through it at a specific initial preassure is statistically impossible?
@MuJoeTheMean
@MuJoeTheMean 2 года назад
@@NickACrowley It's similar. In a Tesla valve, the side path ways reverse the momentum of some fluid and then send it back into the main stream, so it's like you're subtracting the velocities from each other (that's not strictly true in a physics sense, but it's the right idea). The end result is fluid flow with an average velocity much closer to 0. Labyrinth seals rely much more on random chance instead of intentionally 'subtracting' velocity.
@finnaustin4002
@finnaustin4002 2 года назад
@@Kwauhn. no, Labyrinth seals mostly used for high viscosity fluids like grease. All they do is make the path much longer and higher friction than a straight path
@trevorgreenough6141
@trevorgreenough6141 2 года назад
Is simulating a molecule hard or easy? Yes, it is hard or easy.
@recompile
@recompile 2 года назад
As they did in this video? Very easy. Though it looks like he over-complicated things quite a bit...
@eragonawesome
@eragonawesome 2 года назад
"that depends, do you want the big effects or the really tiny ones?"
@Triantalex
@Triantalex 8 месяцев назад
??
@donaldasayers
@donaldasayers 2 года назад
I have a 3D cube maze, it's in the form of a 5x5x5 cube, transparent and you roll a ball through it. But if you blow through it, the correct path steams up. This is exactly the same method.
@DaedalusYoung
@DaedalusYoung 2 года назад
Similar, in your cube there is air. If you blow through it, the air in the 'wrong' path can't escape, you're pushing it into a dead end. Your breath will take the path of least resistance. Since this model doesn't simulate air pressure, or any interaction between the molecules, there is the same resistance going into a dead end as there is following the correct path (none at all), where in the real world there is a difference in resistance. That makes your real world example more efficient than this model.
@oddlyspecificmath
@oddlyspecificmath 2 года назад
So basically if I'm ever trapped in a huge cube, follow the breeze, or perhaps the condensation...
@thekingoffailure9967
@thekingoffailure9967 2 года назад
@@oddlyspecificmath light some incense
@hamjudo
@hamjudo 2 года назад
Long ago, my robotics club had a maze solving competition for small autonomous robots. Before the contest began, I put a toy into the maze. It was a battery powered sphere with a picture of Santa Claus on it. There was a motor driven offset weight inside the Santa Ball. The Santa Ball would roll in a straight-ish line until it hit an obstacle. Then it would bounce in a random direction and continue on. The actual robots moved much more slowly. Even though they didn't ever retrace their path, they were much slower. Fortunately, the Santa Ball was disqualified. It was store bought, not built by a contestant. Thus one of the robot builders got the official first place prize.
@bobson_dugnutt
@bobson_dugnutt 2 года назад
A local engineering competition had a remote controlled robot challenge. You got points for completing various tasks. Then some points for time. The year before I participated, the team from my school just made basically a RC car and went straight for the finish without doing any of the tasks. They got first place. Needless to say they changed the scoring grid for the following year.
@Triantalex
@Triantalex 8 месяцев назад
??
@jeffreydemattos5619
@jeffreydemattos5619 2 года назад
I like your idea of solving a maze with gas pressure. this is mathematically very simple to simulate, and even a bad simulation would be very fast. For example, you could assign a fixed pressure of 1 to the maze entrance and zero to the maze exit. All the other cells start with zero pressure. Then iteratively calculate the pressure for every cell as the average of the pressures of adjacent connected cells. The length of the shortest path is simply the number of iterations it takes for the cell adjacent to the exit to get some non-zero pressure. And the shortest path would simply be from the beginning to the cell with the next highest pressure for each step and so forth. For larger mazes, processing time could be saved by keeping a list of all the cells with some positive pressure and in each iteration, add to the list the cells adjacent to the ones that have already been calculated at least once. Unfortunately this is not much different than simply enumerating the entire maze search, with the exception that you only have to store one value (the pressure) for each cell.
@TheEternalVortex42
@TheEternalVortex42 2 года назад
This is basically the Bellman-Ford algorithm for finding shortest paths.
@DeenBoi
@DeenBoi 2 года назад
I didn't expect the word 'sperm' being mentioned in a Numberphile video
@moth.monster
@moth.monster 2 года назад
A different kind of -philia?
@interbeamproductions
@interbeamproductions 5 месяцев назад
numberphallic
@shohamsen8986
@shohamsen8986 2 года назад
This problem of maze solving screams calculus of variation. The function that minimizes the distance between the beginning and the end point subject to the wall constraints. I would model the walls as lines (some thickness) of infinite potential. So that functions intersecting the walls have answer infinite. Im sure someone must have thought about it (it would be a shame if nobody tried this tool with 500 years of research backing it up).
@leodarkk
@leodarkk 2 года назад
One of our professor at the university made us code exactly this, while of course also explaining the mathematics. It was 10 years ago and still one of my favorite algorithm, I was kind of blown away by it. As far as I remember, it also gives a very beautiful visual representation of the answer as a gradient (?), with as you said, the walls with value infinite. So yes, you are not the first to think about it, but it is indeed an awesome idea!
@shohamsen8986
@shohamsen8986 2 года назад
@@leodarkk sounds about right. I would sincerely hope I'm not the first person to come up with this idea. like i said there is 500 years of research behind these subjects.
@frankfahrenheit9537
@frankfahrenheit9537 2 года назад
Like letting an electric current flow through the maze. Pour carbon power onto the floor, same conductance everywhere, except walls which are modelled as conductors with zero conductance. Solve poisson equation of the electric field with boundary condition entry maze=1V, exit maze=0V, constant conductance everywhere except where wall present.
@SgtSupaman
@SgtSupaman 2 года назад
2:24 Well, by definition, the dumbest way to solve a maze has to work because it would have to solve it, so this could still be the dumbest way. On the other hand, the dumbest approach to a maze would be to just stand still. That, however, can't be called the dumbest way to solve a maze, because it never solves the maze.
@jasonrubik
@jasonrubik 2 года назад
Semantics to the rescue ! In the best way possible ! :)
@TheJunky228
@TheJunky228 2 года назад
turn around and exit at the entrance! 4d chess solution to a maze
@jasonrubik
@jasonrubik 2 года назад
@@TheJunky228 that's a big brain move
@JimBalter
@JimBalter 2 года назад
It depends on what "way" means. Not all ways to solve a problem work.
@DqwertyC
@DqwertyC 2 года назад
It's like the Jack Sparrow meme: "This is, without a doubt, the worst way to solve a maze!" "Ah, but it does solve the maze."
@PlayerSalt
@PlayerSalt 2 года назад
I thought I was stupid for always turning left , which surprisingly would have got me out of this maze fairly quickly , at least quickly enough
@Aaron-cs3xl
@Aaron-cs3xl 2 года назад
So long as you don't run into a loop, which shouldn't be possible if the exits are on the outside of the maze, it will always get you through the maze.
@lonestarr1490
@lonestarr1490 2 года назад
@@Aaron-cs3xl And the maze is purely 2-D without "wormholes".
@kindoflame
@kindoflame 2 года назад
That is called the Left-Hand Rule, and it actually works very well. If the maze is simply-connected, meaning all the walls touch one another, then you are guaranteed to eventually reach the exit.
@George4943
@George4943 2 года назад
@@kindoflame And, of course, the Right-Hand-Rule works equally well in such mazes.
@NLGeebee
@NLGeebee 2 года назад
@@George4943 only for British mazes ;)
@cyndicorinne
@cyndicorinne 2 года назад
This approach to solving problems is quite effective as it is interesting. In computer science there are many algorithms which emulate physical processes. It is always a pleasure watching Numberphile because of its closeness to the field. Thank you 🙏 for another awesome video!
@redryder3721
@redryder3721 2 года назад
It would be interesting to see what sort of maze design results in the Brownian motion taking the longest time to reach the exit. Would it simply be a zigzag path using 100% of the area of the maze or would it look more like a Tesla valve?
@freshrockpapa-e7799
@freshrockpapa-e7799 2 года назад
A Tesla valve wouldn't be anything interesting since the particles don't interact with each other.
@dmitryrybin7831
@dmitryrybin7831 2 года назад
Heuristically longer path means longer exit time, hence you want your maze tree to be a path, which results in zig-zag path maze (the zig-zag pattern can be altered aswell).
@glenneric1
@glenneric1 2 года назад
I'm thinking zig zag with as few straight-aways as possible. Though maybe a succession of ever smaller chambers with a single entry and exit for each. Would be interesting I agree.
@landsgevaer
@landsgevaer 2 года назад
@@glenneric1 Maybe as many straight-aways as possible, since on a diagonal you can reach the next box with an average step size of sqrt(1/2), whereas on a straight path the required distance is 1. Atoms don't have memory regarding their direction, and straight alleys doesn't allow you to cut corners, so to say.
@mitchellsteindler
@mitchellsteindler 2 года назад
A particle could never reach the exit... so forever
@xapemanx
@xapemanx 2 года назад
I confirmed this simulation; i created the same maze in a liquid and then placed my sperm on one end. amazing
@flleaf
@flleaf 2 года назад
i love the internet
@flamencoprof
@flamencoprof 2 года назад
Sorry to burst your bubble, but that solution is not forthcoming. Sperm are attracted to progesterone, which is secreted from the egg's companion cells. Sperm are not randomly swimming in every direction.
@imallfordabulls
@imallfordabulls 2 года назад
The guests in Roller Coaster Tycoon mazes be like:
@scottbarrie1279
@scottbarrie1279 2 года назад
I would love to see how adding more molecules decreases the average time of the fastest exit
@jvdw843
@jvdw843 2 года назад
+ as a function of the length of the shortest exiting path.
@charleslivingston2256
@charleslivingston2256 2 года назад
Since he has the molecules just doing a random walk, doubling the number of molecules would cut the average time in half. If he were using pressure, I would expect the average time to drop more than that. [Edit: not true. See responses]
@jursamaj
@jursamaj 2 года назад
@@charleslivingston2256 Can't be just the inverse of the number of molecules. There is a non-zero minimum to cross the maze. Rather, I'd expect it to exponentially decay towards the minimum.
@mitchellsteindler
@mitchellsteindler 2 года назад
@@jursamaj yes
@landsgevaer
@landsgevaer 2 года назад
@@charleslivingston2256 It doesn't work like that, I fear. That would mean you could find an arbitrarily quick/short path by having an arbitrarily large number of atoms, but the shortest path doesn't have length zero. It even doesn't qualitatively scale like that when you have few atoms. Unimpeded brownian motion spreads according to a gaussian bell curve; twice as many samples doesn't get you twice as far then.
@Noobinski
@Noobinski 2 года назад
Mazing!
@martincohen8991
@martincohen8991 2 года назад
Considering that each particle has to keep track of its path, this would require a tremendous amount of storage.
@thumper8684
@thumper8684 2 года назад
If the simulation is deterministic you can recover all the data from the initial conditions.
@cyndicorinne
@cyndicorinne 2 года назад
A-maze-ing demonstration of this physical approach to problem solving, which for me as a computer scientist is always cool to see.
@johndododoe1411
@johndododoe1411 2 года назад
If you were an actual CS, you would know how entirely bogus the arguments are.
@Muhahahahaz
@Muhahahahaz Год назад
@@johndododoe1411 if you were an actual human, you would have kept this to yourself
@PetraKann
@PetraKann 2 года назад
If the simulation ran infinitely, would all the particles find their way out of the maze?
@itismethatguy
@itismethatguy 2 года назад
Yeah i guess unless there's a place they can get stuck and keep going in cycles
@MKVideoful
@MKVideoful 2 года назад
Do not forget, some infinities can be bigger than other infinities.
@MKVideoful
@MKVideoful 2 года назад
You will end up with infinity amount of success particles and also with infinity amount of failed particles. The failed infinity amount will be bigger.
@dontbothertoreply9755
@dontbothertoreply9755 2 года назад
Yes, as all paths will be taken.
@charleslivingston2256
@charleslivingston2256 2 года назад
If there exists a path through the maze, every random walk will eventually exit
@invisibules
@invisibules 2 года назад
Or we could build the maze out of copper strips, and connect a battery between the start and end point. Use a magnetic compass to find the path, or turn the current up and watch it glow. This would even work if there were loops, like the air blowing method.
@philippelepilote7946
@philippelepilote7946 2 года назад
30 years ago, I had the idea to "inflate" a grid of walls with random strength in order to create a "simply connected" maze. I eventually wrote the algorithm in Visual Basic for Excel, associated to the "follow-the-right-hand-wall" solver. So happy to discover that somebody else finally blew into a maze !
@valovanonym
@valovanonym 2 года назад
Je serais intéressé par les détails de ton algorithme!
@philippelepilote7946
@philippelepilote7946 2 года назад
@@valovanonym My algo is very basic. Hereafter is its pseudo-code. Unfortunately YT prevents me from giving a link in the comment so that I cannot share the Excel file. // First assign a random number to the walls of each cell For each cell in the grid assign a random value to the right and bottom walls // and taking care of grid borders Do some init While all cells have not been inflated // Loop until all cells are inflated, and each time, explode the less resistant wall on the border of the already inflated cells Do some init For each inflated cell in the grid // Find the cell whose wall (left, top, right or bottom) is the less resistant if its left/top/right/bottom cell is not inflated yet // and taking care of grid borders if the left/top/right/bottom wall is the less resistant already seen // the cell is a candidate to explode one of its walls if none of the walls already seen had the same strength remember the current cell else // Bring a little randomness randomly choose between the current cell and the other already remembered cell and remember it end end end end //for // all inflated cells have been visited : explode the less resistant wall delete the left/top/right/bottom wall of the remembered cell mark the new left/top/right/bottom cell as inflated continue end //while Bon amusement
@PunmasterSTP
@PunmasterSTP 2 года назад
That was…a-maze-Ing. 😎
@HappyBeezerStudios
@HappyBeezerStudios 2 года назад
How they are stuck in the first third and the density becomes progressively lower reminds me of mazes in Roller Coaster Tycoon. The way the pathfinding works causes the guests to practically get stuck (and walk back) on specific layouts with a very slim chance to move further.
@CharlesVanNoland
@CharlesVanNoland 2 года назад
While it *is* random if people become successful, the odds become more in their favor the more they act on opportunities - and the trick to opportunities is recognizing them when they are there, which most people don't.
@rianantony
@rianantony 2 года назад
If you wanted to find the dumbest way, it'd be fun to wait for every single molecule gets out. And then highlight the path taken by the single last one to find the exit
@NickCombs
@NickCombs 2 года назад
Often with optimization problems, it's a good idea to start with the dumbest solution as a sort of sanity check.
@thecakeredux
@thecakeredux 2 года назад
I love the merge between logic and programming and creativity. It's how I conceptualized creating code forever, but this illuminates that intersection so well. I'm amazed.
@johnchessant3012
@johnchessant3012 2 года назад
Love this guy!
@cbuchner1
@cbuchner1 2 года назад
How to solve a maze with a fart
@blindleader42
@blindleader42 2 года назад
I like how the automatic captions deal with Matt's accent and translates his "Brownian motion" as "brainy in motion"...🤔 Hmmm. Maybe the machine is on to something. 🙃
@George4943
@George4943 2 года назад
There ought to be a quantum computer solution to maze solving which does "all the paths" at once.
@GGoAwayy
@GGoAwayy 2 года назад
If you can represent the problem as a quadratic unconstrained binary optimization
@liweicai2796
@liweicai2796 2 года назад
It isn't going to be faster, since you nonetheless have to obtain information of the whole map, the complexity can't be lower than linear to the size of the map, which classical computers can already do.
@johndododoe1411
@johndododoe1411 2 года назад
Quantum computers should not be allowed to exist. No honest person should forward the research into their creation and use.
@mrosskne
@mrosskne 2 года назад
@@johndododoe1411 Why?
@johndododoe1411
@johndododoe1411 2 года назад
@@mrosskne Currently, quantum computer algorithms exist that will break even encryption and signature tech widely deployed. We need to hold back quantum computer creation until everyone has non-NSA post-quantum encryption protecting everything they've done since birth. Which won't be this century.
@user-pw5do6tu7i
@user-pw5do6tu7i 2 года назад
Interviewer: i see you made a maze solver, did you use AStar? This guy: *I wrote a physics engine*
@Martial-Mat
@Martial-Mat 2 года назад
Given enough time, EVERY molecule would eventually get out by sheer random chance. Imagine if you were betting on a particular molecule and it randomly got all the way to the exit cell, before bouncing off a wall and working all the way back to the start position!
@MaryamMaqdisi
@MaryamMaqdisi 2 года назад
That’s hilarious to me fsr
@Martial-Mat
@Martial-Mat 2 года назад
@@MaryamMaqdisi :)
@DW-vk5hv
@DW-vk5hv 2 года назад
Extreme simplification of thunking an ill-defined "complex" task. If one does not simplify and limit the conditons one can easily solve this. You're cloaking your intellect with simple-minded compromise.
@Novalarke
@Novalarke 2 года назад
The best (but slow) way to solve a maze: pick a wall, follow it. You will never get lost.
@theblinkingbrownie4654
@theblinkingbrownie4654 2 года назад
But what if _3D_
@Hermaniac8
@Hermaniac8 2 года назад
(as long as the maze doesn't have loops)
@andvil01
@andvil01 2 года назад
@@Hermaniac8 No. You can only be stuck in the loop If you follow the inner wall of the loop. If you stick to one wall in the beginning you will never touch the inner wall off the loop. The outer wall must have an opening to the end.
@Novalarke
@Novalarke 2 года назад
Actually, I don't think that matters, as any wall loop would have to be free floating in the maze matrix, and thus defined by the outer housing which will have to be a left or right wall. But if you have a link to a maze that beats the "choose a wall" method, I'd totally dig that.
@Novalarke
@Novalarke 2 года назад
@@andvil01 - exactly, that's what I thought as well.
@MrLoukizz
@MrLoukizz 2 года назад
The hair dryer approach is actually the exact same as the gas approach because the hair moves (just like the expanding gas) to the point of lowest pressure. But to simulate pressure you would need to simulate particle collision with each other or calculate the local gas density in any other fashion and map it onto the labyrinth (for example counting the number of particles per square). However this approach might still fail because of turbulences ;-)
@thiyagutenysen8058
@thiyagutenysen8058 2 дня назад
Does anyone know the github link to code presented in this video?
@marklonergan3898
@marklonergan3898 2 года назад
"...or i could do it in the dumbest way... So i switched over to python..." Shots fired!
@GeofreySanders
@GeofreySanders Год назад
Yeah I felt that one.
@kicking222
@kicking222 2 года назад
The dumbest way would be to just go straight through the walls. Or to simply not finish it.
@JohnLeePettimoreIII
@JohnLeePettimoreIII 2 года назад
nah... there are dumber ways. humanity: hold my beer.
@andvil01
@andvil01 2 года назад
Walk on top of the wall.
@rg8766
@rg8766 2 года назад
"...or I could, you know, solve the maze in the dumbest way. So I switched over to Python..." :)
@dvilardi
@dvilardi 2 года назад
If you simulate one batch long enough, all particles should come out the other way no?
@JohnLeePettimoreIII
@JohnLeePettimoreIII 2 года назад
dumbest way: smash it to powder with a hammer, then throw the maze-powder in the air while loudly declaring, _"I win!!"_
@Michael-mh2tw
@Michael-mh2tw 2 года назад
Pretty sure becoming a billionaire is only random chance if you're playing the lottery..
@jadeyjung
@jadeyjung 2 года назад
what if the title was "the dumbest way to be a billionaire" then you've got a billion views in the easiest way for sure
@RoySchl
@RoySchl 2 года назад
wait a minute I could get payed for stuff I did for shits and giggles in 7th grade decades ago? damn
@FuncleChuck
@FuncleChuck 2 года назад
Oh so that’s how my city’s roads and utilities were planned! I always wondered.
@peppybocan
@peppybocan 2 года назад
My question: how would the random walks differ if the length of the random step was bigger?
@jursamaj
@jursamaj 2 года назад
Mathematically? Not much, until the step size gets comparable to the maze box size.
@H0A0B123
@H0A0B123 2 года назад
@@jursamaj you pulled that out of your ah without doing the math. didn't you?
@landsgevaer
@landsgevaer 2 года назад
If the step size becomes too big, it may never be solvable (if you always hit a wall). But as long as the step size is much smaller than the boxes, you would expect the number of required steps to increase quadratically with the reduction in step size: i.e. 10x smaller steps require 100x more steps, so the total length of the path becomes 10x longer too.
@saavestro2154
@saavestro2154 2 года назад
​@@landsgevaer isn't quadratically first order approx? my guess is larger step sizes would also increase the time spent on a deadend
@Martial-Mat
@Martial-Mat 2 года назад
You could add an evolutionary "movement with purpose" parameter to this. On a grid with right angled cells, you can immediately simplify by limiting the movements to 45 degree increments, and by eliminating "back on yourself" as an option, you could speed up the solution by 12.5%. If rather than adding a wind modifier, you added a weak suction modifier, you could refine still further.
@henkolsonpietersen2242
@henkolsonpietersen2242 2 года назад
Just “randomly becomes a billionaire”
@gurgleblaster2282
@gurgleblaster2282 2 года назад
I could listen to him describe things for days lol.
@handreieiacasa
@handreieiacasa 2 года назад
Great, now we know that in order to escape backrooms we just need to turn ourselves into a gas
@markkaidy8741
@markkaidy8741 2 года назад
Program a maze to solve for large prime numbers (one path to the prime) and then use it for solving unknown primes. This method may be invaluable.
@komojo
@komojo 2 года назад
Is running the simulation for 1000 particles any more efficient than running a single particle 1000 times longer?
@Joecoleman84
@Joecoleman84 2 года назад
It's hard to explain, but brain feels refreshed by this.
@aveenmahabal
@aveenmahabal 2 года назад
pick a direction (left or right) always make that turn and follow to the end and exit
@dovos8572
@dovos8572 2 года назад
doesn't work in every maze (it depends on what/where the goal is)
@Math.Bandit
@Math.Bandit 2 года назад
That fails if there is a loop though, right?
@dovos8572
@dovos8572 2 года назад
@@Math.Bandit if the maze is from outside to outside then it works even with loops. it can fail if the goal or start is somewhere isnide the maze and all starting walls aren't connected to the outside wall.
@Math.Bandit
@Math.Bandit 2 года назад
@@dovos8572 Even if it's from outside to outside, wouldn't it fail to a very simple "around a block" type of loop, where you're making the same four left (or right) turns around a single area over and over again?
@LiamPilot120
@LiamPilot120 2 года назад
There’s a bug in his code, looks like molecules can cross walls.
@anon6514
@anon6514 2 года назад
Matt has the best job. I love making simulations like this.
@sabinrawr
@sabinrawr 2 года назад
Sorry, Brady. Normal gyms ARE lots of fun!
@SquirrelASMR
@SquirrelASMR Год назад
Does this kind of research get funded lol?
@Jkauppa
@Jkauppa 2 года назад
gas pressure simulation is fast, breadth first style propagation, or also electric current
@Jkauppa
@Jkauppa 2 года назад
if you have max 1 particle in cell pressure, you expand in new cells always, through known path
@Jkauppa
@Jkauppa 2 года назад
ironically most of your science is done this way you just demonstrated, rip
@Jkauppa
@Jkauppa 2 года назад
you claim to be smart but you are not, complex is not always better than simple, monte carlo random walk simulations is what you just demonstrated
@Jkauppa
@Jkauppa 2 года назад
ok so first construct a tree of all possible connections, then find the shortest path to the exit
@Jkauppa
@Jkauppa 2 года назад
cause of law is trash ways of doing things
@WhiteSpatula
@WhiteSpatula 2 года назад
If you had a maze where every wall was a mirror, and you shone a laser into it from the starting point, sweeping around to test all possible angles of entry, I wonder what sort of correlations would manifest between successfully exiting the maze and the maze’s key attributes such as block size (vs laser width), overall dimensions, and complexity. I think it might also be fun to see a geometry wiz or a billiards pro venture some guesses beforehand.
@b.a.r.c.l.a.y
@b.a.r.c.l.a.y 2 года назад
i wanna know this too i imagined more like a circle, with its circumference made of infinite points, and all of them bouncing around the walls until it reaches the end i wonder what the pattern of the circle would look like if every point that went to the exit was colored differently
@GodwynDi
@GodwynDi 2 года назад
Didn't they do a similar video on that already? The illumination problem is the one I was thinking of. Box where it is impossible for light to reach all of it from a single source.
@caparn100
@caparn100 2 года назад
3:50 I think the example of putting a fan to create wind is really just the same as adding a lot more molecules to the maze.
@longleaf1217
@longleaf1217 2 года назад
only if you program in the collisions between each of the molecules which would have the same effect of creating higher pressure where there are more molecules. He mentioned the he has it programmed now each molecule just ignores all the others like they aren't there. so there is no pressure in the system. all adding more molecules might do is find the solution faster purely as a result of it being more likely you have a lucky molecule. the point of having a fan is just to create high and low pressure, which is the same effect you would get with the collisions.
@jursamaj
@jursamaj 2 года назад
No, the way he has it implemented, the molecules have no effect on each other, so more molecules doesn't actually matter. The wind would change the distribution of the random steps, making each molecule more likely to step towards the exit.
@caparn100
@caparn100 2 года назад
@@longleaf1217 That sounds like a much more lengthy running and complicated program. It would be much simpler if each particle, for each move, just picked a random adjacent cell to the one it's in that it hadn't been in before and doesn't have a wall along the side then to get the result just select the particle that exists the maze first.
@ChrisLee-yr7tz
@ChrisLee-yr7tz 2 года назад
@@jursamaj What would the 'wind' be and how would it interact with the molecules? What would makes the wind different to the path finding molecules? Surely the whole idea of a wind is just having the molecules interact and flood the maze with more of them?
@bable6314
@bable6314 2 года назад
@@ChrisLee-yr7tz The wind would literally just be a net force in the direction of the exit that gets weaker as a particle gets further from the start.
@cycklist
@cycklist 2 года назад
'Dumb' in this context is an abhorrent Americanism. Come on Brady, you're more eloquent than that.
@Anonymous-df8it
@Anonymous-df8it 2 года назад
???
@CamAlert2
@CamAlert2 2 года назад
this is more something akin to a computerphile video
@andvil01
@andvil01 2 года назад
Keep a hand om the right wall and just walk...
@tabaks
@tabaks 2 года назад
"Air from the air dryer" is also atoms...SMH.
@honeybee9455
@honeybee9455 2 года назад
Instead of moving in a random 360 direction per tick, why doesn't it move in a random cardinal direction?( Per tick moving up, down, left or right and not some random theta). Would this be less computationally taxing?
@boelwerkr
@boelwerkr 2 года назад
forget "bumping" in each others. Make a repelling force. If the molecule go below a defined distance a repelling force dependent of their distance is applied (you could also make it an attraction force beyond that "0-point" to hold the cloud together). This way you can use "wrong" but much faster distance/repelling calculation. It works really great for "emulating" pressure dispersion.
@kilimanjarocruz660
@kilimanjarocruz660 2 года назад
It's lovely that this 'demonstrates' both the pressure drop that a gas would have in such a flow and the statistical origin of the ideal gas law. Awesome.
@hobbitassassin1
@hobbitassassin1 2 года назад
It's easier to just stick to the left hand wall.
@chrisodillman3355
@chrisodillman3355 2 года назад
maybe this is the dumbest way for a orthogonal maze but it could work better on really weird mazes.
@lucassippel7516
@lucassippel7516 2 года назад
Looks like they get halfway quite quickly. You could also diffuse gas from the exit and then check pairwise between particles from opposite ends for line of sight. Then stitch a forward path and backward path together for a complete solution. Pairwise checking might be inefficient so you could limit it to particles which are past some predefined halfway - like a vertical line down the middle of the maze. This is the sort of thing that is only obvious when you have an appropriate visualization. Always love watching these animations!
@V1ctoria00
@V1ctoria00 2 года назад
Collision physics is in so many video games. Look at "oxygen not included" great example of a game where you could literally use gas to fill a maze.
@sergeyklinov3780
@sergeyklinov3780 2 года назад
Can we have a Github link go the code?
@FloydMaxwell
@FloydMaxwell 2 года назад
This isn't the dumbest way, but rather the random way, to solve a maze. The guaranteed / deterministic way...is to put your right hand on the maze wall, and never take it off. Eventually you will find the exit.
@landsgevaer
@landsgevaer 2 года назад
Depends a bit, only if the maze is planar and the start & finish are both on the "outside". Doesn't work to reach the exit if you get lost in a cave system.
@thecarman3693
@thecarman3693 2 года назад
If a maze has no free walls (walls that do not touch the outer perimeter through continuous contact) it can always be solved by keeping (remaining in contact) to either wall from the entrance. I have also found that many mazes can be solved more easily by traveling through them in reverse.
@TheJunky228
@TheJunky228 2 года назад
reminds me of using electricity (connect start and end and it will find path of least resistance) or another analog method of solving these sorts of puzzles
@mekkler
@mekkler 2 года назад
Maybe that concept could be applied to the traveling salesman problem.
@mustelidify
@mustelidify 2 года назад
I'm interested in letting all the molecules escape and looking at the path of the LAST molecule to escape and what proportion of the maze area it traversed.
@dominiquelaurain6427
@dominiquelaurain6427 2 года назад
Random waks in the plane is an amazing subject. I like that "physic view" of the problem, because it is local to every particle (with its path as only memory data). I will qualify the idea more like "the blindest way" to solve a maze because same as many people in a maze with no light (bumping to a wall, and maybe another people, is the only information). There are less blind ways, if you imagine people has a lamp ligntening to the random direction, people can accelerate to the next lightened wall. Another extension is for the random step : you can imagine a lattice drawn over the maze and people are only at vertices.
@anteaters-R-us
@anteaters-R-us 2 года назад
I always start at the end and go backwards
@phileo_ss
@phileo_ss 2 года назад
This video reminded me of a friend who, thirty years ago, wrote a computer programme that made random seven-storey mazes in which you can walk around in and collect various items to earn points or maps to help you solve the maze.
@TheBlackbirdii
@TheBlackbirdii 2 года назад
is that henry cavil younger brother
@zebfross
@zebfross 2 года назад
Love this guy's stuff! Always fascinating
@azyfloof
@azyfloof 2 года назад
Now we just need Steve Mold to built a maze out of clear perspex and blow smoke through it to see if the smoke "solves" the maze :D
@U014B
@U014B 2 года назад
This is even more brute force than brute force, and I'm all for it.
@kirylbah
@kirylbah Год назад
It looks nice and interesting but very inefficient in term of consumed resources. I was in school around Intel 8080 CPU and less than 64 of RAM. Same type of task. Just array to store each cell of maze that you are filling with numbers incrementally and had to scan array to find empty cell near with cell that already have numbers. It might sound complex but it was simple program that works on very very slow CPU and you had to use assembler almost always. The second option was Basic
@yoxnod
@yoxnod 2 года назад
This video reminded a paper by Bennett of 1982 where he described concept of Brownian computer which solves problems by random motion, and most interestingly, he argued that RNA is basically a natural Brownian computer
@alexmcmahon2810
@alexmcmahon2810 Год назад
"That's harder to program." Yeah, running a molecular dynamics simulation on your maze would be a pretty horridly inefficient (but awesome) to way traverse a maze.
@mercuriete
@mercuriete 2 года назад
A particle system just want equal pressure. You are putting high pressure on the start and low pressure on the end, so there is a potential diference. Calling it random its a little bit misleading. Because It is just as random as water on a pipe. Try again with the particles randomly and evenly placed without any potential difference and your algorithm will fail. I think still the dumbest way of solving a maze is using Depth First Search (DFS) and still brillant because the code is very small.
@robertsteffler5155
@robertsteffler5155 2 года назад
So the video is great and all, and it actually points out some really cool things that commenters have noted, but... just imagine being the person who made this, and you're showing it off to a guy for a RU-vid video, and he goes, "You know what this reminds me of? Sperm."
@redountilgreat
@redountilgreat 2 года назад
Idea: Apply a value of zero to every square of a maze. Create pressure and sucktion on entry and exit at every iteration: Add one at the entry square and substrackt one at the exit square. Let both spread until they connect. Interesting? Wonna try? I can't code well enough. Have fun.
@LazyLoneLion
@LazyLoneLion 2 года назад
You could have simplified this simulation by just randomly choosing a neighbouring cell for the next position, not caring about the precise coordinates. It would still be a random search, not very effective, but much faster.
@fetzkochl
@fetzkochl 2 года назад
This is by worlds not the dumbest way. Som recursive stuff visiting the old paths (Pixels in the maze) over and over again would be slower by complexity classes.
@giddyjigga
@giddyjigga 2 года назад
I'd love to see all the paths overlayed to see how densely some areas were explored while other areas were only superficially discovered.
@Spencer0616Gaming
@Spencer0616Gaming Год назад
you could improve this by giving each particle a radius and allowing particle collision, it seems the current method doesn't use a realistic gas particle as they do not interact with one another. This could possibly increase the variation in trajectories of the particles thus acting much more like a high-low density situation and possibly speeding up the solution time. As it stands you may as well use one particle with a minutely curved taken path. Given one particle or a set number I would assume that there will always exist some maze that can effectively capture every particle in an infinite loop, the curve on the trajectory for a perfect maze finder is questionable but would be interesting to learn more about. Supposing every maze has a specific curve that makes it solve the maze the fastest. Thank you for the videos
@Veptis
@Veptis Год назад
what about a random Fourier series? As a cyclist. I often plan my routes not to be the shortest or "fastest" but with the least or no traffic lights so I don't have to stop. It's a navigation problem which is finding the optimal path through a graph. But all nodes (road intersections) with traffic lights get removed.
@gedstrom
@gedstrom Год назад
I still remember a maze generation program that I coded in Basic back in 1978...45 years ago! I had a lot of fun with it in my very first personal computer.
Далее
Two Candles, One Cake - Numberphile
14:22
Просмотров 290 тыс.
I used to hate QR codes. But they're actually genius
35:13
Can water solve a maze?
9:09
Просмотров 13 млн
A Problem with Rectangles - Numberphile
17:12
Просмотров 476 тыс.
How I Made a Planet Renderer in Python
5:10
Просмотров 7 тыс.
The Assassin's Teapot Is Weird
9:12
Просмотров 47 млн
The Yellowstone Permutation - Numberphile
21:00
Просмотров 212 тыс.
This Liquid Can Solve Complex Mazes By Itself
7:30
Просмотров 1,2 млн
Lewis Carroll's Pillow Problem - Numberphile
10:27
Просмотров 469 тыс.
I Solved The World's Hardest Maze (with Code)
9:54
Просмотров 158 тыс.
The Distance Between Numbers - Numberphile
21:34
Просмотров 282 тыс.
Calculating a Car Crash - Numberphile
8:25
Просмотров 430 тыс.