Key to the Tower of Hanoi - Numberphile

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ต.ค. 2024
  • Featuring Ayliean MacDonald... Check out Brilliant (get 20% off their premium service): brilliant.org/... (sponsor)
    More links & stuff in full description below ↓↓↓
    Extra footage from the making of this video: • Tower of Hanoi (extra)...
    More about Ayliean MacDonald: linktr.ee/Ayliean
    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 Math For America - www.mathforame...
    NUMBERPHILE
    Website: www.numberphile...
    Numberphile on Facebook: / numberphile
    Numberphile tweets: / numberphile
    Subscribe: bit.ly/Numberph...
    Videos by Brady Haran
    Additional sound design by Alan Stewart
    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

ความคิดเห็น • 712

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

    I think we might have a new “neatest brown paper” champion.

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

      That handwriting, so amazing

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

      For sure a podium place

    • @温焘-h4z
      @温焘-h4z 3 ปีที่แล้ว +9

      Who is the old champion? Fedrico?

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

      My thought, as well: A great video ("Serpinski Arrow" - cool!) with truly excellent handwriting

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

      That is indeed very tidy brown paper

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

    It's one of those puzzles which the longer you analyze it, the more amazing properties you find. That Sierpiński triangle really surprised me!

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

      I was trying to work out what the pattern would be for a 4 disc tower rather than the 3 used there.

    • @Fanny-Fanny
      @Fanny-Fanny 3 ปีที่แล้ว +1

      klaatu barada nikto

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

      @@telectronix1368 it’s a bigger Sierpinski triangle (4th iteration)

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

      @@telectronix1368 Start with an n ring graph. To construct an n+1 ring graph:
      - Place an n graph at the top, with A appended to each vertex string.
      - Take another copy of the n graph, append B to each vertex, rotate it 120 degrees clockwise, and place it to the bottom-left.
      - Take a third copy of the n graph, append C, rotate it 120 degrees counter-clockwise, and place it to the bottom-right.
      - Add three edges connecting:
      - the A graph's bottom-left vertex with the B graph's top vertex
      - the A graph's bottom-right vertex with the C graph's top vertex
      - the B graph's bottom-left vertex with the C graph's bottom-right vertex

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

      IKR Absolutely mindblowing

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

    That was one of the best videos I’ve seen in a while. Love this hidden art in math stuff.

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

      Cheers

    • @1994AustinSmith
      @1994AustinSmith ปีที่แล้ว

      Immediately clicked when mentioned how much the smallest piece moves.

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

      ??

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

    Haven't watched Numberphile in a while, now there's a scottish person wearing a fractal hoody talking about my favourite maths puzzle? Feels good to be back.

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

      Not a hoodie. Sorry for being Hanoing.

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

      * Scottish

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

      I like how the fractal t-shirt was foreshadowing.

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

      Same here.

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

      The Scotch are a strange people, so loving towards England they voted against freedom from it. They are not yet ready for self-government, but they are great at explaining things.

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

    My favourite solution is to assign each ring to a digit of binary and start counting from zero, every time you switch a digit from 0 to 1 you move that corresponding ring to the next available spot. This also gets you the optimal solution. This also shows very obviously why the solution is based on powers of two and that each piece moves twice as often as the next largest ring.

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

      That would make a great video

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

      @@ancientswordrage Boy, do I have news for you.
      Go look up 3b1b's video on the same topic

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

      I immediately thought of binary when I heard the musical pattern. I taught myself to count on my fingers in binary a while ago but have since forgotten...

    • @g.ricepad9470
      @g.ricepad9470 3 ปีที่แล้ว +10

      Fun fact: this has an application on Super Mario 64 A button challenge

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

      @@g.ricepad9470 Do tell.

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

    Please get Ayliean back on the channel… never thought about a tower of Hanoi musically before and have to say I could listen to it all day!
    Thanks for the great content :)

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

      Do you have a link to an hour long (or long) Tower of Hanoi TH-cam music version?

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

    First ever Tower of Hanoi video ever to not mention recursion! Also the most musical one...

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

      In my opinion, not showing the recursive solution makes everything else pointless. The recursive solition is the very soul of the puzzle.

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

      Why mention when you can show the beauty of recursive thinking. A simple pattern solving complex problems with attractiveness and soul.
      Can you dig it?

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

      It doesn't mention recursion directly but it is implied by the fact you get a fractal structure

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

      @@Toobula there are so many videos covering the recursive solution, so I think this acts as a complement, rather than treading same ground and turning 14 minute video into say a 20 minute video

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

      In order to understand recursion, you must first understand recursion.

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

    I literally cannot get over how perfect the optimal tower of hanoi solve fits into 4/4 time with a single beat always missing at the end
    perfection

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

      Plot twist: last note is a half note 😉

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

    That was great - more from Ayliean please! Loved the secret jumper spoiler.

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

    I absolutely loved it. Ayliean is so incredibly enthusiastic about the puzzle that it's contagious - you can literally feel her joy as she talks about it

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

    I cannot believe it. Our professor showed the tower of Hanoi problem to us this morning. What a coincidence!

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

      Cool

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

      Did you look at recursion or time complexity?

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

      @@sub-vibes why is that?

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

      Coincidentally, I was thinking about the tower of Hanoi last night as well. "How do I calculate the minimum number of moves... I never did bother to figure that out as a kid."

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

      I have a presentation about this topic today

  • @Matthew-bu7fg
    @Matthew-bu7fg 3 ปีที่แล้ว +71

    I love how Numberphile can be so relevant to my life at times. I planned an activity around the Tower of Hanoi concept the other day so it was great to see it analysed in video!

    • @Joey-rs7uq
      @Joey-rs7uq 3 ปีที่แล้ว +1

      Its probably the youtube algorithm buying info from your facebook or something. xp

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

    I love it when patterns are easier to detect musically/rhythmically rather than visually.

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

    Waaaaaay back in 1979 I wrote a program to solve arbitrary size towers of hanoi puzzles in BASIC for my Computer Studies O level course work :) I've always had a soft spot for this puzzle.

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

      Nice one.

    • @Chris-hf2sl
      @Chris-hf2sl 3 วันที่ผ่านมา

      Yes, I did the same at work on a DEC PDP8 in 1967, but in assembler, using recursion.

  • @davidlyford-tilley1598
    @davidlyford-tilley1598 3 ปีที่แล้ว +281

    My favourite incidence of this puzzle is when it cropped up in Professor Layton while I was relaxing after a long day on a business trip. It was the one night of my life I have spent *in* Hanoi.

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

      Uhm, Google knows where you are/

    • @davidlyford-tilley1598
      @davidlyford-tilley1598 3 ปีที่แล้ว +32

      @@szkoclaw Sure, but Professor Layton on the DS doesn't :p

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

      Never will I see this puzzle and not think of stacks of pancakes…

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

      Which Layton Game it was?

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

      @@pratyushkumarsahoo8591 Pandora's box if I'm not mistaken

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

    Me 5 seconds into the video: Ooh cool jumper she's wearing
    Me at 10 minutes into the video: HEY WAIT A MINUTE

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

    This is so beautiful! Definitely one of my favorite videos from Numberphile!!

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

    This is the most amazing video on tower of hanoi!! OMG how crystal clear explanation!!!

  • @Sarah-re7cg
    @Sarah-re7cg ปีที่แล้ว +1

    When you did it again without the music, the notes played in my head automatically and I love this so much....this gives me such an appreciation for the makers of this video

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

    I've never drawn the state-space graph of the Hanoi towers. Had no idea it has something to do with Sierpinsky triangles. Thank you :-)

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

      Wow, I thought everyone in the world had drawn the state-space graph of the Hanoi towers!

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

    She's great, hope to see more of Ayliean in the future.

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

    I learned the proof in Further Maths - we now play the game with Year 6 students joining our school to see if they can notice any patterns. UKC does it as part of their secondary school enrichment days too. Kids seem to love it!

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

    Wow. Thee music of that alone gave away the inevitability of the solution.

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

    This was the most intuitive explanation of Towers of Hanoi I've seen so far. Back when I was taking Computer Science at school, I learned about the Towers of Hanoi, but my teacher never quite managed to communicate how exactly to solve them, other than stating "you need recursion to solve this problem". He never really elaborated on that much further and I've never quite grasped that. I think I understand a lot better now.

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

      It's recursive because in order to move the bottom piece of a Tower of Hanoi of size N, you must first move all of the other pieces into one stack, which is the same process as solving an N-1 tower. Once you move the bottom piece, you solve the N-1 tower again.

    • @1994AustinSmith
      @1994AustinSmith ปีที่แล้ว

      @@shadowshedinja6124 Knowing the human trick to it, I'd just loop (psudo-code)
      Starting from left peg
      $smallest = left(odd)/right(even) 1
      If peg left of $smallest is greater/less than peg right of $smallest {next valid move}
      Repeat

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

    Omg best Numberphile yet, love your content Ayliean

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

    Great episode! I love the "visualisation" using music. What is that called? Audiation?

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

    Me seeing this video in my feed: Cmon it's a matter of odds and evens.
    Me finishing this video: Mind blown.

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

    This was so good! I hope we get to see Ayliean again. The jumper tie-in made me so happy haha

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

    Love the Tower of Hanoi! It's so simple and profound. I keep learning things from it and it seems that the learning can never stop!

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

    12:52 Once you can hear it as 'hanoitonian' path, you cannot unhear.

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

    This is fantastic. Tempted to go plug a few instances of this pattern into my sequencer and see what comes out of the synths...

  • @Sam-oz8pn
    @Sam-oz8pn 3 ปีที่แล้ว +14

    I can't believe they didn't explain *why* all these elegant mathematical relationships are there. Let's take the 6 tower as an example. When you want to solve that, how do you do it? You need to move the base from the spot it's on (let's call that A) to the new spot (C). To do that you need to move all the ones above it off and restack them on spot B. Then, once you've moved the base to C, you can restack everything else again, but this time on C as well. So to solve a 6 height tower, you're solving the 5 tower, moving the base, and solving the 5 tower again. And when you solve the 5 tower, you're really solving the 4 tower twice, and so on.
    That's why each new disk doubles the time it takes to solve it. That's why the Sierpinski triangle map works: a Sierpinski triangle is composed of a smaller Sierpinski triangle on top (solving the n-1 tower the first time) and two more on each side (solving the n-1 tower the second time, but either in the B or C slot). Both the Hanoi tower and Sierpinski triangle are self-similar, i.e. made up of smaller versions of themselves. It's why you get those patterns in the movement of each disk.
    I think the math is a lot more beautiful when you explain why it all works

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

      3Blue1Brown already has a video on exactly this!

    • @MrAlRats
      @MrAlRats 3 ปีที่แล้ว

      @@SpencerTwiddy Which one?

    • @SpencerTwiddy
      @SpencerTwiddy 3 ปีที่แล้ว

      @@MrAlRats It's a 2-part video titled "Binary, Hanoi, and Sierpinski"
      imo the best ever made on the subject

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

    I never knew how to play this when I was young. I just thought it's supposed to be stacked randomly for fun

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

    You know you've found a real mathematician when they stop to think about 64 minus 1. "Now, what number system are we using...?"

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

      Actually, in all number systems 64 - 1 is still written 63

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

      The value of the number depends on base, and we could be in any base above seximal

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

      @@SpencerTwiddy Oh, if you only have to worry about *base*, sure... :)

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

      @@digitig I guess. I might have missed the joke in your comment, but to me I feel like not doing 64-1 quickly is exactly what a NON-mathematician would do

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

    I love how this made like 5 new connections about concepts I already knew.

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

      The great thing about math is the number of connections that can be made. Its beauty comes from the complexity derived from perceived simplicity!

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

    I knew it from the start that Sierpinski Triangle will come up. I mean, I’m old enough to notice how thoughtful mathematician with their tee shirt.
    Amazing video btw, great representation using notes on tower of Hanoi Love it!!!

  • @AYUSHKUMAR-uk1tr
    @AYUSHKUMAR-uk1tr 3 ปีที่แล้ว +11

    Now I can compose music without any music lessons.
    Thank you.

  • @adityavardhanjain
    @adityavardhanjain 8 หลายเดือนก่อน +2

    The moves also increase in a 2x+1 Pattern where x is the moves it take for the previous number of disks.

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

    It’s actually a pretty nice puzzle to try and figure the method to solve it by yourself. I remember doing that in problem solving class in middle school. It is not as hard as it looks, you just have to spend some time

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

    Ah dang, she pulled a sneaky one on us! I thought that was just a cool shirt!

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

    I love arpeggios, and I gotta say that optimal solve slapped.

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

      There weren’t any arpeggios in it but it did sound pretty🤪

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

    Super great video ! The idea of using a tune to materialize the moves of each block was brilliant ! Another proof maths and fractals can turn musical !

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

    Loved the musical element to this demonstration. We had an eight-piece tower growing up in the 1970s. All the wooden disks were brown. PS - She has beautiful penmanship.

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

    As soon as I saw her shirt, I was thinking: "Oh, it is going to be one of THOSE!" - I was not disappointed. Great video. I love seeing familiar things pop up in unexpected ways :)

  • @alphonsajohnson2657
    @alphonsajohnson2657 11 หลายเดือนก่อน +1

    I had an exhibition and I'm in the maths club
    Your video made me easy to do it
    Thank u soo much❤❤❤

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

    Beautiful way to show this puzzle. Now I know Ayliean and after a few videos of her on TikTok I'm listening "The Less I Know The Better" what a nice afternoon :)
    Thank you for all your excellent work.

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

    That's also really cool because you can see how the Serpinski triangle keeps growing as you add more disks! Imagine adding an A to the end of every node of the one MacDonald drew out, which would represent having 4 disks, and then starting from the BBB and CCC corners (now BBBA and CCCA), you can now move the bottom disk - and from there you get identical copies of the original triangle except now the last letter is something else - BBBA opens up BBBC (and a copy of the original triangle with "C" as the last letter) and CCCA opens up CCCB (and the "B" ending triangle!)

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

    WoW! That a puzzle I did as a kid ends up generating a Sierpiński triangle... AND in a way that I can actually UNDERSTAND... mind blown!

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

    I love things that unexpectedly end up being the Sierpinski triangle.

  • @Denis_Bobrov
    @Denis_Bobrov 3 ปีที่แล้ว

    WOW. From Hanoi tower to Serpinski triangle and Hamiltonian path. Mind-blowing.

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

    This was the project I did a week ago!
    I solved it by using an algorithm where odd-numbered discs must sit on even-numbered discs. In case there exists an empty peg, the disc must be moved there. Like that.

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

    7 with 127 steps could be pretty interesting musically. Certainly gonna work that one out on my guitar. Should shred something wicked at 127 bpm and a gnarly fuzz! Gonna take some practice though...
    3Blue1Brown did one on Tower of Hanoi too. The optimal solve is the same as counting up to 15 in binary.

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

      Do you have a link to a lengthy musical rendition of this? Would love to listen while I'm working...

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

      @@ZandarKoad No, and I can't garantee anything really. Got no decent recording hardware atm.
      But here are all 127 notes, for whoever is interested:
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-G
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-A
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-G
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-B
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-G
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-A
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C-G
      C-D-C-E
      C-D-C-F
      C-D-C-E
      C-D-C
      Quite a fun little finger exercise once you get your head around the pattern.

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

    Every time i come upon these in a video game from now on I'm gonna watch this video again 👍👍👍

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

    The Tower of Hanoi was the subject of a classic Doctor Who episode in 1966 and I remember discussing with my maths teacher at school the optimal solution (without music) which I had worked out.

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

    I did not expect this video to be so interesting. I thought, Tower of Hanoi, done to death, but no, this kicked the door down.

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

    That musical note thing was absolutely amazing.

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

    It gives you goosebumps when she is unfolding Sierpiński triangle. Math is awesome

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

    1:18 My brain kinda expected the music to go for 2 more notes

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

    I love these math nerds that are super nerdy to a very very specific sub category and are so passionate about it. Reminds me of the guy with a basement full of Prince Rupert drops. Meet one of these beautiful bastards early enough in life and you're a math nerd too for ever!

  • @larryscott3982
    @larryscott3982 2 ปีที่แล้ว

    I thoroughly enjoyed that. I had no idea where it was going at the start.

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

    It's been a while since we last had a new face on Numberphile. Great video in every way!

  • @vaakash
    @vaakash 3 ปีที่แล้ว

    Kudos to the editor for audio & video note work

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

    Have you noticed that this starts with the Dies Irae? The first four notes, C B C A, are a very famous and very old theme that is called “Day of Wrath” in Latin and is often found associated with death in movies!

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

      Hear for yourself at 1:42 - 1:45

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

    Mathologer's video on the topic is highly recommended. It's called "The ultimate algorithm".

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

    Another game could be to start with the stack alternating colours, use 4 pegs/spaces and aim to build two towers, each containing all of one colour.

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

    Putting it to musical notes was interesting.
    I kept thinking about the preserved segment from one of the lost Dr. Who episodes where the Dr. is challenged by the Toy Master who challenges him to the Tower of Hanoi in 10 steps.

  • @robertwalah_sk7vv
    @robertwalah_sk7vv 3 ปีที่แล้ว

    I am actually born in Hanoi, and so happy that have a puzzle named it. And now that puzzle is actually on Numberphile, one of the best Math TH-cam channels ever. I can't believe that this can happen!

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

    That puzzle must be way harder when you're trying to solve it in time with the music!
    I like Ayliean's accent; it takes me right back to my youth.

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

    its actually quite simple
    There are a total of f(N+1)=2f(N)+1 operations that needs to be done
    This hanoi works in a recursive manner.
    To move every disk from 1st location to 3rd location for N+1 Disks you would need to apply below 3 steps in a recursive manner:
    1-You would first solve the problem for N disks and move all of them to 2nd location. (f(N) operations)
    2-You would move the N+1th disk to third location (1 Operation)
    3-You would move N disks on the 2nd location to 3rd location. (f(N) operations)

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

    Three stages of me watching this clip
    Phase 1: yes, yes, I know, 2^n-1, easily provable (if n rings require f(n) moves, additional n+1th ring requires moving n rings off, move n+1th, move n onto him back or f(n+1)=2*f(n)+1 which reduces to f(n)=2^n-1). Nothing new to see.
    Phase 2: An easy algorithm? Just alternate moving the smallest in circles and the only other available move? Seriously? Wow, didn't know this. Great video.
    Phase 3: Sierpinski? I am speechless. My mind is blown.

  • @RobG1729
    @RobG1729 2 ปีที่แล้ว

    Thank you!
    I did the musical notes, using a pentatonic scale and six disks, and programmed a four-track synthesizer with different note values for each track, 1/8, 1/4, 1/2, 1. It sounds so cool.

  • @ianfitchett2768
    @ianfitchett2768 7 หลายเดือนก่อน +1

    I just sent this video to my Dad because he texted me complaining that he was playing Mass Effect and couldn't get past "the puzzle in Noveria".

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

    I usually just think of this puzzle inductively. If you need to move an n-stack from position 1 to position 3, simply move the top (n-1)-stack to position 2, then move the bottom piece to 3, then the (n-1)-stack to 3. This gives the same solution but its easier to remember and easier to reconstruct if you forget (though maybe worse for speed solving?).

    • @PanduPoluan
      @PanduPoluan 3 ปีที่แล้ว

      That's a recursive solution in CS.
      hanoi_solve(n) => hanoi_solve(n-1) + move_bottom + hanoi_solve(n-1)
      hanoi_solve(0) => do_nothing

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

    *flashbacks of the tower of Hanoi puzzle from the Noveria mission in Mass Effect 1*

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

    Always love it when Math + Music are combined.

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

    We programmed the problem in class a week ago, its really simple using recursion.

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

      Obama, still making the world a little better every day.

    • @lukasmiller8531
      @lukasmiller8531 3 ปีที่แล้ว

      the classic!

    • @XtecHubble
      @XtecHubble 3 ปีที่แล้ว

      lots of free time now..

    • @chrisseddon5823
      @chrisseddon5823 3 ปีที่แล้ว

      @@XtecHubble Michelle would disagree.

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

    Move the tower above the largest disc (may be a tower of 0 discs) to the spot that is not the destination, move the bottom disk to the destination, then move the remaining tower to the destination.
    This is actually enough of an algorithm to solve it. Just apply it recursively.
    Or, to make it a bit simpler to understand: If we are starting in A and need to go to C, the bottommost disc needs to go to C, the one above to B, the one above that to C, and so on.

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

    Your hair is amazing, and it matches perfectly with your tower😍

  • @alasdairhunter9870
    @alasdairhunter9870 3 ปีที่แล้ว

    A great episode Brady. Thanks to you and Ayliean! This was a novel take (for me) on Towers of Hanoi. The graph representation of the permissable moves is so interesting!

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

    That music sounded really good, thanks!

  • @Superb17C
    @Superb17C 3 ปีที่แล้ว

    I instantly recognized the optimal solve music as "The Ruler Song", a melody that my friends and I "discovered" in grade school while looking at (American) measuring sticks. Every inch was marked with a long line, every half-inch with a shorter line, every quarter-inch with an even shorter line, and so forth down to the sixteenths of an inch. To play The Ruler Song, simply "read" the ruler from left to right and play a note at each marking: the longer the line, the lower the note. So cool to hear the same tune again after all these years in a new mathematical context that's also related to the powers of two.

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

    I would love to hear a version of that piece walking down the whole scale.

  • @TheRingDragon52
    @TheRingDragon52 3 ปีที่แล้ว

    There is a simpler pattern. Using the original board with three spikes in a triangle. Starting with the tower on one spike. Give each block a number, starting with the top most block being '1' and numbering the blocks 2, 3, 4, 5, 6 and so on down the tower. The first move is block '1' to another spike. This is either a clockwise or anticlockwise direction. Which ever it is, it sets the moves for all the other blocks. If, for example you moved '1' in a clockwise direction, to the next spike, then all odd numbered blocks will move in a clockwise direction, from then on, when it is their turn to move and all even numbered blocks will move in an anticlockwise direction when it is their turn to move. Opening moves: '1' cw, '2' ccw, '1' cw (onto '2'), '3' cw, '1' cw, '2' ccw (onto '3'), '1' cw (onto '2' & '3'). '4' ccw', and so on.

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

    Hm... so I can solve the 15-disk version in about three hours when I'm not concentrating on what I'm doing and just kinda going through the motions (mind, this is online, so tap and drag. It would obviously take me longer with an actual physical copy). That would put it at, what, about 180bpm, so roughly three clicks per second? Lol, I never really thought about that.
    Funnily, I also never noticed that the disks follow a directional pattern with where each of them go. I kinda always just treated it as a recursive algorithm. If you have three disks, it's trivially easy to solve. If you have four disks, just solve the first three disks, then move the fourth one space over, and reassemble the first three disks on top. For five disks, do this, then move the fifth disk, and repeat to assemble the four-disk tower in the new position of the fifth disk, and so on.
    The only pattern I ever really cared about was that the smallest disk has to go in whatever position you're *not* trying to assemble your tower in when there is an uneven number of disks in the tower you're working on (either the main tower for your first move or the sub tower you're currently working on to free up a new disk for moving), or it has to go in the place where you *are* trying to assemble the tower if there is an even number of disks in it. This rule has always really been all I needed to solve the towers in the optimal number of steps. That and recursion, of course 😅

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

      Right, I made several tower of hanoi games in the past and you could simply pick one stack by pressing either 1, 2 or 3. Press one button to pick up the top disk from that stack and press another button drop it there. You can get incredible fast with just those 3 buttons ^^. Yes I also often use the recursive approach. Though at larger stacks you can easily get lost.
      I also remember this odd / even rule. However you have it backwards ^^. If the number of disks is uneven (or odd) you have to move the first / top disk directly to the target position. Should make sense if you think about the smallest sub-tower which is just a single disk, so you move it where it should go. Whenever the number of disks is even you have to move the first disk to the other (temporary) stack. It's obvious when you think about a sub tower with 2 disks. Though kinda funny we essentially have the same approach.

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

      @@Bunny99s It would be interesting to see how many approaches are out there. Apparently, the recursive one is a rather intuitive one that several people use. There's also the one from the video of course. Possibly other ones entirely?

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

      The manual for the BBC Micro uses a Tower of Hanoi program to demonstrate recursive subroutines.

  • @guitarbrother1234
    @guitarbrother1234 3 ปีที่แล้ว

    The musical representation of the optimal solve was brilliant!

  • @chrisv4312
    @chrisv4312 2 ปีที่แล้ว

    its so cool seeing how maths patterns translate into different forms of itself, from numbers to nature to music. its so cool. almost would be cool to have a small 100 hour stack sitting in a room as a symbolic sculpture, a reminder upon looking at it of the hard to imagine time something you can so easily see could take.

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

      Have you ever seen Close Encounters of the Third Kind?

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

    I like to imagine Ayliean has spent years determining optimal Tower of Hanoi solutions in this old brick room (perhaps in a tower itself) with its 1960's radiator and Christmas lights which have remained on since 2006. As soon as she solves a 50-disk problem, Eric Liddell himself comes and frees her.

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

    So glad I didn't skip this one.

  • @DingbatToast
    @DingbatToast 3 ปีที่แล้ว

    Watching you solve it with musical notes was beautiful.

  • @Codricmon
    @Codricmon 2 ปีที่แล้ว

    "Heh, that's a nice sweater. Good choice, even if it's unrelated!"
    9:09
    "Oh. Oh, I see."

  • @webasdf
    @webasdf 2 ปีที่แล้ว

    I worked so hard in college to write a recursive function to solve this thing. I kept a printout of the program. I want to go find it now.

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

    The Sierpinski triangle part is really interesting! I believe the optimal solution is unknown for 4 pegs, but maybe there's a similar pattern you could make using the same sort of diagram?
    Edit: Apparently, the optimal solution is known for 4 pegs, but not 5 or more.

    • @riuphane
      @riuphane 3 ปีที่แล้ว

      Took me a while to work it out, but I did get it eventually. Really cool to look at, I highly recommend giving it a go yourself. Also really cool how the last letter is consistent within a corner third of the triangle. Not surprising, but very interesting

    • @aditya95sriram
      @aditya95sriram 3 ปีที่แล้ว

      hmm interesting, maybe the menger sponge has something to do with that

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

      Apparently the "probably optimal" solution for the k-peg problem that's been knwon since 1941 was proven optimal for 4 pegs in 2014 and for k-pegs in 2016, but I don't confirm the correctness of either paper.

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

      @@rmsgrey Oh, thanks for the information! I'll update my post.

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

    it would be neat if we could hear the musical sequence for a 12-disc solve so we could hear what it sounds like with all the notes of the 12-tone equal temperament system

    • @ZandarKoad
      @ZandarKoad 2 ปีที่แล้ว

      Has someone done this? Can you link to it? Would love this as background music.

  • @ShabbaDabb
    @ShabbaDabb 3 ปีที่แล้ว

    I learned most of this from experimentation, but learning its shape and mathematics was truly enlightening. Thanks for sharing!

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

    the sonified result sounds a lot like the main theme of Michel Corrette's first concerto for organ!

  • @xdata8122
    @xdata8122 3 ปีที่แล้ว

    Mind-blowing ...that serpinski triangle and her enthusiasm!!!

  • @mastod0n1
    @mastod0n1 2 ปีที่แล้ว

    So I had figured out the solution to the Hanoi Tower puzzle on my own years ago, but the adding of musical notes was a beautiful twist to the process.

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

    I live in Hanoi and somehow I don't even know this iconic game of ours existed before

  • @spencerkatty
    @spencerkatty 3 ปีที่แล้ว

    I've been obsessed with Sierpinski triangles since I was maybe 5 (Based on Legend of Zelda most likely), so I noticed her sweatshirt quickly into the video. The fact the patterns evolved into the triangle was amazing!