Tower of Hanoi is a mathematical game consisting of three pegs (P1, P2 and P3) and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Tower of Hanoi is a mathematical game consisting of three pegs (P1, P2 and P3) and a stack of disks of different diameters. Disks can slide onto any peg. The game starts with all disks stacked on P1 and ends at the point where all disks stacked on P3. The game player is required to move all disks from P1 to P3 using P2 as a buffer. Three rules must be followed when playing the game (1) Only one disk may be moved at a time. (2) Each move involves taking a disk on the top of a peg and place it on the top of another peg. (3) A disk of a larger diameter should never be placed on top of a disk of a smaller diameter. The diagrams below demonstrate the starting state and goal state of the game with 5 disks. P1 P2 P3 P1 P2 P3 AN Starting state Goal state Requirements In this assignment, students are required to solve the Tower of Hanoi (with five disks) using state space search algorithms implemented in Python. Two state space search algorithms: (1) a blind search (depth-first search with depth limit) and (2) a heuristic (A*) search algorithms must be included to complete the assignment. The completion of the assignment consists of two steps as listed below. Step 1 Problem Analysis and Design Before writing the python code, students are required to perform an analysis in order to determine the best design to solve the problem. This includes (1) The representation of the state (2) The representation of the state space (3) The design of the heuristic evaluation function in the A* algorithm The problem analysis and design should be documented in the analysis and design document. Step 2 Coding Write the Python program to implement the design created in Step 1 The program must implement both Depth-First Search and A* Search algorithms. When running the program, it should output (1) The state space with each unsafe state marked and made a dead end. (2) The action plan (the path from the initial state to the goal state) generated by the Depth-first search algorithm. (3) The action plan generated by the A* algorithm. Tower of Hanoi is a mathematical game consisting of three pegs (P1, P2 and P3) and a stack of disks of different diameters. Disks can slide onto any peg. The game starts with all disks stacked on P1 and ends at the point where all disks stacked on P3. The game player is required to move all disks from P1 to P3 using P2 as a buffer. Three rules must be followed when playing the game (1) Only one disk may be moved at a time. (2) Each move involves taking a disk on the top of a peg and place it on the top of another peg. (3) A disk of a larger diameter should never be placed on top of a disk of a smaller diameter. The diagrams below demonstrate the starting state and goal state of the game with 5 disks. P1 P2 P3 P1 P2 P3 AN Starting state Goal state Requirements In this assignment, students are required to solve the Tower of Hanoi (with five disks) using state space search algorithms implemented in Python. Two state space search algorithms: (1) a blind search (depth-first search with depth limit) and (2) a heuristic (A*) search algorithms must be included to complete the assignment. The completion of the assignment consists of two steps as listed below. Step 1 Problem Analysis and Design Before writing the python code, students are required to perform an analysis in order to determine the best design to solve the problem. This includes (1) The representation of the state (2) The representation of the state space (3) The design of the heuristic evaluation function in the A* algorithm The problem analysis and design should be documented in the analysis and design document. Step 2 Coding Write the Python program to implement the design created in Step 1 The program must implement both Depth-First Search and A* Search algorithms. When running the program, it should output (1) The state space with each unsafe state marked and made a dead end. (2) The action plan (the path from the initial state to the goal state) generated by the Depth-first search algorithm. (3) The action plan generated by the A* algorithm.
Expert Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these operating system questions
-
Beauty of Recursion. Tower of Hanoi Tower of Hanoi is a logic puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the...
-
Lang Enterprises was started when it acquired $4,000 cash from creditors and $6,000 from owners. The company immediately purchased land that cost $9,000. Required a. Record the events under an...
-
On January 1, 2018, White Water issues $600,000 of 7% bonds, due in 10 years, with interest payable semiannually on June 30 and December 31 each year. Required: Assuming the market interest rate on...
-
A boy tosses a ball onto the roof of a house. For the launch conditions shown, determine the slant distance s to the point of impact. Also, determine the angle which the velocity of the ball makes...
-
The John Gore Organization owns and operates the Charles Playhouse, a theater in Boston, Massachusetts. Evelyn Castillo has diabetes, a disability under the Americans with Disabilities Act (ADA)....
-
Financial Condition. Write the letters a through o on a sheet of paper. Beside each letter, put a plus (+) if a high or increasing value of the item is generally associated with stronger financial...
-
how to transform this from an EERD to a relational model diagram. Attribute_1-1A Attribute_1-1B Attribute_1-1 Attribute_1-1C Attribute_1-2 Entity 1 FK3 (M,M) Attribute_R_1-2-1 Rel_1-2 Attribute_2-1...
-
a. What is the maximum throughput rate for Product Valentine? b. What is the (minimal) theoretical cycle time? c. Assume that the operator of machine C has come up with an innovation that has reduced...
-
The fund balance category that must be zero if unassigned fund balance is a deficit is a. assigned fund balance. b. committed fund balance. c. nonspendable fund balance. d. restricted fund balance....
-
Appropriation requests for the General Fund are approved, controlled, accounted for, and reported in which of the following expenditure categories? a. Function or program. b. Organizational unit. e...
-
(Proprietary Fund Balance Sheet) Prepare a skeleton balance sheet for a proprietary fund using the headings in Illustration 2-12 (i.c., Current Assets, Capital Assets, Current Liabilities) that shows...
-
The following descriptions appear in the note disclosures of the city of St. Louis, Missouri, financial statements for the year ended June 30, 20X5: The St. Louis Municipal Finance Corporation is...
-
A government adopts its General Fund budget on the GAAP basis as required by regulations in its state. Encumbrance accounting is used during the year, and it distinguishes unreserved fund balance and...
-
A 4-module array has two south-facing modules in series exposed to 1-sun insolation, and two west-facing modules exposed to half-sun insolation. The 1-sun I-V curve for a single module with its MPP...
-
Huntingdon Capital Corp. is a competitor of Plazacorp and First Capital Realty. Huntingdon reported the following selected information (in millions):...
-
What is the inchworm approach? What advantages does this approach have over other approaches for examining a linked list?
-
If you create a new empty stack and push the values 1, 2, and 3 in that order, and call pop on the stack once, what value will be returned?
-
Write a program called Squares that uses the DrawingPanel to draw the shape shown in Figure 3G.28 . The DrawingPanel is 300 pixels wide by 200 pixels high. Its background is cyan. The horizontal and...
-
In a large office building, there is a woman dead in her locked office, sitting at her desk. Except for the desk, chair, and contents on the desk, the office is empty and the air conditioner is...
-
How many birthdays does the average person have?
-
A murderer is condemned to death. He has to choose between three rooms. The first is full of raging fires, the second is full of assassins with loaded guns, and the third is full of lions that havent...
Study smarter with the SolutionInn App