SlideShare a Scribd company logo
1 of 4
By: 3Algo
Tower of Hanoi
Story
The French mathematician Edouard Lucas in 1883 was invented this puzzle. There is a story about the Indian
temple in Kashi Vishwanath, which contains a large room with the three-worn posts in it, surrounding by 64 golden
disks. Brahmin priests have been moving these disks by following the rules of Brahma since that time. And the
puzzle is known as the Tower of Brahma puzzle. According to the legend, when the last move of the puzzle is
completed, the world will end. If the priest would move a disk per second using the smallest number of moves, it
would take them 264 − 1 or roughly 585 billion years to finish which is about 42 times the current age of the
universe.
There are many variations of this legend. For instance, in some tellings the temples is a monastery, and the priests
are monks. The temple or monastery may be said to be in different parts of the world – including Hanoi, Vietnam –
and may be associated with any religion. In some versions others elements are introduced, such as the fact that the
tower was created at the beginning of the world, or that the priests or monks may make only one move per day.
Implementation
+ The minimal number of moves required to solve a Tower of Hanoi puzzle is 𝟐 𝒏 − 𝟏 where n is the number of disks.
This is precisely the nth Mersenne number. There are a few solutions:
1. Iterative solution
2. Recursive solution
3. Non-recursive solution
4. Binary solution
5. Gray-code solution
+ Variations:
1. Adjacent pegs: move must be between adjacent pegs
2. Cyclic Hanoi
3. With four pegs and beyond
4. General shortest paths and the number 466/885
5. Magnetic Hanoi
6. Bicolor Towers of Hanoi
+ Application: The Tower of Hanoi is frequently used in psychological research on problem solving. There also exists a
variant of this task called Tower of London for neuropsychological diagnosis and treatment of executive functions.
Resource
1. https://en.wikipedia.org/wiki/Tower_of_Hanoi

More Related Content

What's hot

Dc8c4f010f40.hanoi.towers
Dc8c4f010f40.hanoi.towersDc8c4f010f40.hanoi.towers
Dc8c4f010f40.hanoi.towersSumedha
 
Tower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysisTower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysisShubham Nimiwal
 
Tower of Hanoi Investigation
Tower of Hanoi InvestigationTower of Hanoi Investigation
Tower of Hanoi InvestigationWriters Per Hour
 
Tower of hanoi algorithm
Tower of hanoi algorithmTower of hanoi algorithm
Tower of hanoi algorithmWeaamRaed
 
Time To Live Specifications
Time To Live SpecificationsTime To Live Specifications
Time To Live SpecificationsPaul Chen
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive modelsAkira Tanimoto
 
Lab: Foundation of Concurrent and Distributed Systems
Lab: Foundation of Concurrent and Distributed SystemsLab: Foundation of Concurrent and Distributed Systems
Lab: Foundation of Concurrent and Distributed SystemsRuochun Tzeng
 
MLP輪読スパース8章 トレースノルム正則化
MLP輪読スパース8章 トレースノルム正則化MLP輪読スパース8章 トレースノルム正則化
MLP輪読スパース8章 トレースノルム正則化Akira Tanimoto
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2shwetha mk
 

What's hot (18)

Tower of Hanoi
Tower of HanoiTower of Hanoi
Tower of Hanoi
 
Dc8c4f010f40.hanoi.towers
Dc8c4f010f40.hanoi.towersDc8c4f010f40.hanoi.towers
Dc8c4f010f40.hanoi.towers
 
Tower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysisTower of Hanoi using AI technique - means ends analysis
Tower of Hanoi using AI technique - means ends analysis
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
Tower of Hanoi Investigation
Tower of Hanoi InvestigationTower of Hanoi Investigation
Tower of Hanoi Investigation
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
Tower of hanoi algorithm
Tower of hanoi algorithmTower of hanoi algorithm
Tower of hanoi algorithm
 
Lec21
Lec21Lec21
Lec21
 
Lec20
Lec20Lec20
Lec20
 
Time To Live Specifications
Time To Live SpecificationsTime To Live Specifications
Time To Live Specifications
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive models
 
Mid term solution
Mid term solutionMid term solution
Mid term solution
 
Lab: Foundation of Concurrent and Distributed Systems
Lab: Foundation of Concurrent and Distributed SystemsLab: Foundation of Concurrent and Distributed Systems
Lab: Foundation of Concurrent and Distributed Systems
 
QMC: Operator Splitting Workshop, Forward-Backward Splitting Algorithm withou...
QMC: Operator Splitting Workshop, Forward-Backward Splitting Algorithm withou...QMC: Operator Splitting Workshop, Forward-Backward Splitting Algorithm withou...
QMC: Operator Splitting Workshop, Forward-Backward Splitting Algorithm withou...
 
Discretization
DiscretizationDiscretization
Discretization
 
MLP輪読スパース8章 トレースノルム正則化
MLP輪読スパース8章 トレースノルム正則化MLP輪読スパース8章 トレースノルム正則化
MLP輪読スパース8章 トレースノルム正則化
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Tower of hanoi

  • 2. Story The French mathematician Edouard Lucas in 1883 was invented this puzzle. There is a story about the Indian temple in Kashi Vishwanath, which contains a large room with the three-worn posts in it, surrounding by 64 golden disks. Brahmin priests have been moving these disks by following the rules of Brahma since that time. And the puzzle is known as the Tower of Brahma puzzle. According to the legend, when the last move of the puzzle is completed, the world will end. If the priest would move a disk per second using the smallest number of moves, it would take them 264 − 1 or roughly 585 billion years to finish which is about 42 times the current age of the universe. There are many variations of this legend. For instance, in some tellings the temples is a monastery, and the priests are monks. The temple or monastery may be said to be in different parts of the world – including Hanoi, Vietnam – and may be associated with any religion. In some versions others elements are introduced, such as the fact that the tower was created at the beginning of the world, or that the priests or monks may make only one move per day.
  • 3. Implementation + The minimal number of moves required to solve a Tower of Hanoi puzzle is 𝟐 𝒏 − 𝟏 where n is the number of disks. This is precisely the nth Mersenne number. There are a few solutions: 1. Iterative solution 2. Recursive solution 3. Non-recursive solution 4. Binary solution 5. Gray-code solution + Variations: 1. Adjacent pegs: move must be between adjacent pegs 2. Cyclic Hanoi 3. With four pegs and beyond 4. General shortest paths and the number 466/885 5. Magnetic Hanoi 6. Bicolor Towers of Hanoi + Application: The Tower of Hanoi is frequently used in psychological research on problem solving. There also exists a variant of this task called Tower of London for neuropsychological diagnosis and treatment of executive functions.