Tower of Hanoi, 8 disks. Only 255 moves requires to solve it.
The famous Towers of Hanoi puzzle, invented by French mathematician Édouard Lucas in 1883. I will show easy trick which helps to solve the puzzle with minimum steps.
If you have 7 disks version, you have to make 127 moves.
If you have 9 disks version, you have to make 511 moves.
As a thank you for all those who are coming from my videos Puzzlemaster offers Worldwide Free Shipping on orders of $99 and over using the coupon code available here:
www.puzzlemaster.ca/puzzleguy...
If you want to buy The Tower of Hanoi and support my channel, use these links:
North America
amzn.to/2kyD4Zt
www.puzzlemaster.ca/browse/in...
EU stores
www.logicagiochi.com/en/tower...
Download free solution for Tower of Hanoi puzzle www.puzzlemaster.ca/solutions...
Other puzzle stores you may like:
www.siammandalay.com/puzzleguy
Subscribe goo.gl/k4jHYm to my channel so you do not miss anything.
INSTAGRAM - / the_puzzle_guy
Пікірлер: 205
Any computer science student here! Recursion is the key.
@senju8127
4 жыл бұрын
lmao
@babbarutkarsh7770
4 жыл бұрын
@@senju8127 😂😂
@gaurangmanchekar8042
3 жыл бұрын
Yea😂
@md.mehrabhaque2223
3 жыл бұрын
java code => github.com/mehrab-haque/tower-of-hanoi-java/blob/master/src/Hanoi.java
@alial-ameri444
3 жыл бұрын
Electrical engineering here but i have this java programming course...
In order to win with 255 moves (2^8 - 1) do following steps: Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 4 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 5 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 4 from tower C to tower B Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 6 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 4 from tower B to tower A Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 5 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 4 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 7 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 4 from tower C to tower B Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 5 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 4 from tower B to tower A Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 6 from tower C to tower B Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 4 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 5 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 4 from tower C to tower B Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 8 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 4 from tower B to tower A Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 5 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 4 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 6 from tower B to tower A Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 4 from tower C to tower B Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 5 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 4 from tower B to tower A Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 7 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 4 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 5 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 4 from tower C to tower B Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 6 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 4 from tower B to tower A Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 3 from tower C to tower A Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 5 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Move disk 3 from tower A to tower B Move disk 1 from tower C to tower A Move disk 2 from tower C to tower B Move disk 1 from tower A to tower B Move disk 4 from tower A to tower C Move disk 1 from tower B to tower C Move disk 2 from tower B to tower A Move disk 1 from tower C to tower A Move disk 3 from tower B to tower C Move disk 1 from tower A to tower B Move disk 2 from tower A to tower C Move disk 1 from tower B to tower C Done !
@Rahul-uk4su
4 жыл бұрын
dude thats impressive
@ToPoMaNda13
4 жыл бұрын
Did you make a program that tells you every move needed to reach the solution? It sounds like a really fun project to practice recursive programming if that's the case
@nitindahiya6454
4 жыл бұрын
@@ToPoMaNda13 yeah the solution can be easily found out using recursion
@LyNhatPE
4 жыл бұрын
*HELLO I'M VIETNAMESE AND I'M FROM HANOI*
@midpack7776
4 жыл бұрын
How many milligrams of adderall did you snort before writing that one lmao
Solving the Tower of Hanoi is very trivial once you know the secret of how to solve them. 2^n - 1 = T(n) = optimal moves, n = number of discs. Odd: towards the goal Even: away from the goal
@ToshiroTheFirst
2 жыл бұрын
No shit bro
@Caliginosi7y
2 жыл бұрын
Literally was working on this puzzle to come up with an algorithm with my teacher just over a week ago. He has had it in his family for many generations. Neither one of us knew the name but the algorithm that we came up with was/is remarkably close to this exact same thing here. It took us about 2 hours to figure out. Then, a little of a week later, this video comes up in my recommended. Weird?
I used to play with this at school when I was about 8. I got so fast at solving it. I loved it. I started thinking about that game today but I couldn't remember what it was called. I loved it! Thanks for posting!
@Puzzleguy
5 жыл бұрын
You are welcome. I used to play with toys when i was 8. 😆 Such a puzzle would be too difficult for me at that age.
@junjharsingh1899
3 жыл бұрын
Lucas tower
Awesome, I was reading up on this puzzle but this video really showed and made me understand why it is an iterative process I couldn't grasp from just reading about.
I've never seen a channel take a puzzle route! I really love your videos! 👏💖
formula for least amount of moves required to solve for N number of discs. (2^N) -1 in this case N=8 and 2^8=2x2x2x2x2x2x2x2=256. 256-1=255.
Wow that is great. Thank you
Excellent job thank you so much we need more
please solve with 64 disks
@Puzzleguy
5 жыл бұрын
Hahaha. Nice joke 😁. Come back in 100 years for new video .
@AliceDiableaux
5 жыл бұрын
Haha a 100 years? The 64 disc's probably come from the legends surrounding the puzzle, where Brahmin priests have to solve the puzzle with 64 disc's, and when the puzzle is completed the world will end. If you take a second to move each piece, it will take 585 billion years to finish the puzzle.
@vinceg3213
4 жыл бұрын
To solve the Tower of Hanoi with 64 Disks you need at least 18446744073709551615 moves. That are 584554049253,848 years if you make a move each second. Well.... as AliceDiableaux wrote... thats round about 585 billion years ^^
@mrsoggyramen9596
4 жыл бұрын
I think that would take 6 billion moves per second without any sleep for a century to accomplish.
@mfaraday4044
4 жыл бұрын
write a recursive code
Fun. Very fun. Thank you.
For the Tower of Hanoi, I propose a simple and mnemonic solution. The rule is as follows: - move the smallest disk, circularly, clockwise, in two different ways: ˗ for even numbered discs (2, 4, 6, 8…): a -> b -> c -> a ->… ˗ for odd numbered discs (1, 3, 5, 7, 9…): a -> c -> b -> a ... - move the smaller disc, of the two left, on the major, it is the only possible operation, - in the next move, move the smaller disk again in a circular way, as seen above - in the next move, move the disc in the only way possible ... and so on, until all the disks from the initial stake "a" to the final destination stake "c" are brought. I hope I have been clear, thanks for your attention and enjoy.
keep up!!! using this for discrete structure
*HELLO I'M VIETNAMESE AND I'M FROM HANOI*
@Puzzleguy
4 жыл бұрын
Do you have Tower of Hanoi in your city? :)
@LyNhatPE
4 жыл бұрын
@@Puzzleguy Sure we have it. Some towers have more than 16 disks.
@Puzzleguy
4 жыл бұрын
@@LyNhatPE I believe you have living giants who move that disks
Reminds me of the Kotor puzzle in the sith tomb for that sword of Naga shadow. Except its simplified
Not only does the top ring only jump 1>2>3>1, but the 2nd ring only jumps 1
loved it
Bro I'm here 2024 and I need this so much 🙏 Because we have a competition for math .. And the choices were : Sudoku, tower of Hanoi, ruibix cube and I think that's all Thank you so much 🙏
It was created much earlier in a temple in India TOWER OF BRAMHA
@shantanupandey5174
3 жыл бұрын
But history is in by European perspective.
Very good
Instead of going backwards and forwards, try putting the poles (mentally or physically) in a triangle pattern and only move anti-clockwise. You will soon see a pattern developing.
for those who are looking for C code to solve this #include void hanoi(int n,char a,char b,char c); int main(){ int n; char a='A'; char b='B'; char c='C'; printf("entre numbers of rings "); scanf("%d",&n); hanoi(n,a,b,c); printf(" %f steps are taken ",(pow(2,n))-1); } void hanoi(int n,char a,char b,char c){ if(n==1){ printf("move disc %d from %c to %c ",n,a,c); } else{ hanoi(n-1,a,c,b); printf("move disc %d from %c to %c ",n,a,c); hanoi(n-1,b,a,c); } }
Awsome i can now imagine it in programming :)
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 An easier method I found out for myself is to use the left right method. If all my rings are in column A, then column B would be left, and Column C would be Right. If I want all my rings to go to the 'right' column but dont know which column to start in, I name each ring top to bottom using Right left. Start at right, then next ring will be left, then next ring will be right, etc. The last ring you stop on will start your first move at the right or left Column. 5 rings Right Left Right Left Right
Hi! Please how do I draw a DFD from a flowchart of hanoi tower? Do you have any tutorial on that?
Basically if there is a odd number of the disks, you move the top part of the disk to the destination and if it is even, move it to the other one.
here is a challenge do the same thing but you can not jump to the 3rd "stick" you have to go to the 2nd one and then the 3rd one its doable
Great
fire af🔥🔥🔥
I like how you dont have to think about the other moves besides 1,2,3 because all the b other moves are just follow the rules.
@Puzzleguy
3 жыл бұрын
That is the easiest explanation in my opinion. Just follow 1, 2, 3 rule and the puzzle will be solved. People write in comments pretty complicated calculations which are not only hard to follow but also hard to understand.
@namansingla1565
3 жыл бұрын
I can solve this puzzle pretty easily but can you pls elaborate this 1,2,3 approach?
@beastkiller_9998
Жыл бұрын
@@namansingla1565 watch 2:36 part
That’s pretty cool but can you do a 32 disk Tower of Hanoi?
@Puzzleguy
4 жыл бұрын
Easy, if I would be immortal and had nothing else to do 😁
2^n - 1
@xgorzki603
4 жыл бұрын
Nope, that's n! problem. 2^n-1 is millions times faster in sorting.
If the number of disks are n then the least number of moves required to solve is 2^n-1. It can be proved using combinatorics.
I've had this puzzle for decades and counted the moves. My result was always 262. My mother gave me the puzzle and I solved it in about 30 minutes.
Solve the following puzzle for Tower of Hanoi · If puzzle can be accomplished in 3 moves with two discs. Use this to work out how many moves would be needed with three discs? · If puzzle can be completed in 15 moves with four discs. Use this to work out how many moves would be needed with five discs? · In general, describe a way of working out how many moves are needed when one extra disc is added? ye kese hoga
Question: do u have to move each disk or can u move in groups? I’m new to this but it’s really cool
@Puzzleguy
3 жыл бұрын
One disk at a time only.
@tomlxyz
2 жыл бұрын
What would be the challenge if you can move groups
Using recursion we can calculate number of ways
Smallest allways moves 123,123,123 likewise, so keep eye ondu amale onde. Never allow sallery disk to move reverse move, it is athe SECREAT
Дякую!!!
I finished all 3 to 10 disks in least possible moves in just 1 night with sleep of course. It's not that hard. It just need to take a lot of time to finish. By the way, the 10 disks has 1023 least possible moves optimal solution.
@patientred3203
4 жыл бұрын
Tonight I just found it and did 3, 5 and 8. It was fun! If you want, check out my comment on the video about how I did it or let me know how you did :)
Sir through coding can u explain ??
I never noticed the top disk, that's cool. For me, ***SPOLIER ALERT*** Here's how I eventually thought when doing the same 8 disk one of these, and I think it is the most naturally actively brain-teasing way (most fun) for me -- because I just asked as a series of questions to myself to figure it out, trying not to think about patterns, so I could always head toward the end from wherever I was if I made a mistake. (Here I will call the disks by numbers, but I didn't think in numbers when doing the puzzle -- Numbers I think make it easier to write clearly) I will call the big bottom disk, "8" and count up to the small top disk, "1": So I started with the obvious question, then went on: "How do I get the tower over on the far side?" - "I need the bottom disk (8) there first, so I can build the rest of the tower on it" "How do I get the bottom disk to the far pole with the least moves?" - "Get the rest of the disks (7-1) on the middle pole with the least moves, so the far pole is open, and the big disk is free to move there" "How do I get the rest of the disks on the middle pole with the least moves?" - "Get the bottom of *those* disks, (disk 7) on the middle pole so I can stack the rest (6-1) on it" ---- I just kept asking that back and forth, with the next thing being disk 6 on the far pole, disk 5 on the middle pole, disk 4 on the far pole... etc. Things naturally built from there, figuring out what ideas I had to remember and what information I could forget about as I went along. Not going to spoil any of the set of fun ways I found to only have to remember the general idea and not much information, just that if I got lost -- I didn't make any moves, and asked myself the questions again starting at disk 8. The ones I did were also different colours, so it probably would've been harder without that, and if they all looked the same colour I would probably have tried to number them in my head based on bigger size means bigger number, like I used now to write the questions. (Also, this way with the questions it was possible to keep going if I made a mistake, which I did once or twice the first time, making me only get it in 259 moves instead of 255. It makes me really happy to do a puzzle where if I lose patience or focus, all I have to do is forget everything I was thinking, breathe, and start thinking about the original questions. It can take a minute to move forward from the mistake, but I don't have to think about the mistake -- just where my pieces are, and where I want them to be)
what if all the disks has to be moved to a designated pole?
at the end of puzzle clap 👏 👏...
Nice video 👌 Are you native speaker? 🤔
@Puzzleguy
4 жыл бұрын
Thanks. No, I'm not a native speaker.
@TheRealYeipi
4 жыл бұрын
@@Puzzleguy Neither am I, so I could recognize the voice accent xD Thanks for answer!
@Puzzleguy
4 жыл бұрын
I don't hear accent. You sound like native 🤣
and solve 64 disks
Who else is vietnamese but never heard about this game :(( ?
@Puzzleguy
3 жыл бұрын
Hahaha. Looks like you are a fake Vietnamese 🤣
@khanguyen5561
2 жыл бұрын
Me. :))))
Where can I get this please ?
@Puzzleguy
3 жыл бұрын
There are links in a video description. This puzzle is sold in every puzzle store.
@twanasoftwareengineer1754
3 жыл бұрын
@@Puzzleguy I am in Kurdistan : Erbil city , I searched in every store almost 25 , They don't have it , I think It should get it by delivery , Thanks man apprecited ❤
some corrections: it was invented by ancient Hindu god Lord Brahma and it is called tower of Brahma problem, originally these towers are situated in Kashi : ancient city with 64 disks. later on it moved to Vietnam by some east Asian scholars. and as it was french colony at that time, it moved to Europe by some guy named Lucas.
woah. 😳😳
Try doing for 64 disks
@Puzzleguy
2 жыл бұрын
Sure. Come back in 500 billion years for the result.
5:00
i hold the world record for this GGs
I read with 64 discs it would take 500 million years lol
This how 2021 games
Interesting that it takes 255 moves for 8 disks, considering 2^8 - 1 = 255. I wonder if this pattern of movement exists for all disc amounts
@b3z3jm3nny
4 жыл бұрын
Yeah 3blue1brown has a video explicitly connecting it to binary and powers of two
ok
آقا اگه خیلی زرنگی، با پایتون کدش رو بزن!
2x2x2x2x2x2x2x2-1=255 moves OK
It can be done in 32 moves
Oh really if this tower of Hanoi invented in 1833 so why this is also called the tower of Brahma (One of the most biggest god out of 3 in Hinduism) and world biggest Tower of Brahma or Hanoi present in Kashi Vishwanath temple, India
@Puzzleguy
2 жыл бұрын
Probably because you live in India and you have your own gods and legends
@secular786
2 жыл бұрын
@@Puzzleguy What does it mean to you that it was invented in 1833, so I put the correct answer in front of you and Hinduism is the oldest religion in this world.
My teacher made me do this, let’s just say it was fun, took me 60 moves or so to move the 8 disks
@Puzzleguy
3 жыл бұрын
Looks like you found a unique way to solve the puzzle 4 times faster or you cheated.
@hebrewwolf6540
3 жыл бұрын
that is impossible lmao
it spent a lot of years
Any Ha Noi people here ??
That was 256 moves
Send me the Towers Of Hanoi in 1 week.
CS HW anyone?
Wrong. The name is Towers of Hanoi.
@kipkipxd4403
3 жыл бұрын
HOW has no one noticed your comment
@kipkipxd4403
3 жыл бұрын
I love your videos!
The game is jus math. I could do it w 4000 disks if I had the time
@tkmraulro
3 жыл бұрын
With 30 disks and a move at a time it would take 34 years
@s_iri5368
3 жыл бұрын
@@tkmraulro bet I could do it in 33
2⁸-1
I can’t even get 5 dicss
Came here from TikTok 2022 😅
Я решаю ее за 140 ходов
It's invented in India ...
like
thats not how it works
....
noo it take 234 moves to do it
Yugioh vrains anyone XD
Can u do 255 disks with only 8 moves? Jk 😂✌🏽
This is puzzle is invested by Indian . French looted ower intellectual property.
Yeah ONLY 255 moves...
ok
....
like
ok
ok
ok
ok
ok
ok
ok
ok