0% found this document useful (0 votes)
14 views2 pages

Disc01 Regular

The document discusses the Towers of Hanoi problem, focusing on its application in studying recursion and recurrence equations. It outlines key components such as state representation, state space size, start state, legal actions, and goal test. Additionally, it explores various graph search strategies including depth-first, breadth-first, and uniform cost search, detailing the order of state expansion and paths returned.

Uploaded by

dinhbaolrr123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Disc01 Regular

The document discusses the Towers of Hanoi problem, focusing on its application in studying recursion and recurrence equations. It outlines key components such as state representation, state space size, start state, legal actions, and goal test. Additionally, it explores various graph search strategies including depth-first, breadth-first, and uniform cost search, detailing the order of state expansion and paths returned.

Uploaded by

dinhbaolrr123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS 188

Spring 2024 Regular Discussion 1

1 Towers of Hanoi

The Towers of Hanoi is a famous problem for studying recursion in computer science and recurrence equations
in discrete mathematics. We start with N discs of varying sizes on a peg (stacked in order according to size),
and two empty pegs. We are allowed to move a disc from one peg to another, but we are never allowed to move
a larger disc on top of a smaller disc. The goal is to move all the discs to the rightmost peg (see the figure above).

In this problem, we will formulate the Towers of Hanoi as a search problem.

(a) Propose a state representation for the problem.

(b) What is the size of the state space?

(c) What is the start state?

(d) From a given state, what actions are legal?

1
(e) What is the goal test?

2 Search Algorithms in Action

For each of the following graph search strategies, work out the order in which states are expanded, as well
as the path returned by graph search. In all cases, assume ties resolve in such a way that states with earlier
alphabetical order are expanded first. Remember that in graph search, a state is expanded only once.

a) Depth-first search.

b) Breadth-first search.

c) Uniform cost search.

You might also like