Docsity

Homework 5 Sample Solutions - Intelligent Systems | CS 3600, Assignments of Computer Science

Toggle sidebar
bg1
CS 3600 - Introduction to Intelligent Systems
Homework 5 - Sample Solution
STRIPS Planning
Tower of Hanoi
This puzzle has three discs, D1, D2, D3, with holes in their centers, and three pegs, A, B, C, on
which the discs can be placed. Disc D3 is larger than disc D2, which is larger than disc D1. Ini-
tially, all the discs are on peg A, with D3 on the bottom, D2 in the middle, and D1 on top. We
want them on peg C in the same configuration (D3 on the bottom, D2 in the middle, and D1 on
top). The following rules apply:
• Only the top disc on a peg can be moved
• A disc cannot be placed on top of a smaller one
a) Formulate the initial state of the Tower-of-Hanoi puzzle in STRIPS notation
b) Formulate the goal state of the Tower-of-Hanoi puzzle in STRIPS notation
c) Formulate the operator(s) of the Tower-of-Hanoi puzzle in STRIPS notation
It is helpful to try solving the puzzle using your notation and see if it is sensible, for example, a
disc should not be at two places at the same time.
Sample Solution
Initial State
Clear (d1)
Clear (b)
Clear (c)
On (d1, d2)
On (d2, d3)
On (d3, a)
Smaller (d1, d2)
Smaller (d1, d3)
Smaller (d2, d3)
Smaller (d1, a)
Smaller (d1, b)
Smaller (d1, c)
Smaller (d2, a)
Smaller (d2, b)
Smaller (d2, c)
pf2

Partial preview of the text

Download Homework 5 Sample Solutions - Intelligent Systems | CS 3600 and more Assignments Computer Science in PDF only on Docsity!

CS 3 600 - Introduction to Intelligent Systems

Homework 5 - Sample Solution

STRIPS Planning

Tower of Hanoi

This puzzle has three discs, D1, D2, D3, with holes in their centers, and three pegs, A, B, C, on which the discs can be placed. Disc D3 is larger than disc D2, which is larger than disc D1. Ini- tially, all the discs are on peg A, with D3 on the bottom, D2 in the middle, and D1 on top. We want them on peg C in the same configuration (D3 on the bottom, D2 in the middle, and D1 on top). The following rules apply:

  • Only the top disc on a peg can be moved
  • A disc cannot be placed on top of a smaller one

a) Formulate the initial state of the Tower-of-Hanoi puzzle in STRIPS notation b) Formulate the goal state of the Tower-of-Hanoi puzzle in STRIPS notation c) Formulate the operator(s) of the Tower-of-Hanoi puzzle in STRIPS notation

It is helpful to try solving the puzzle using your notation and see if it is sensible, for example, a disc should not be at two places at the same time.

Sample Solution

Initial State Clear (d1) Clear (b) Clear (c) On (d1, d2) On (d2, d3) On (d3, a) Smaller (d1, d2) Smaller (d1, d3) Smaller (d2, d3) Smaller (d1, a) Smaller (d1, b) Smaller (d1, c) Smaller (d2, a) Smaller (d2, b) Smaller (d2, c)

Smaller (d3, a) Smaller (d3, b) Smaller (d3, c) Goal State Clear (d1) Clear (a) Clear (b) On (d1, d2) On (d2, d3) On (d3, c)

Operator Move (X, Y, Z) /* disk X currently on Y is moved to Z */ Preconditions: Clear (X) On (X, Y) Clear (Z) Smaller (X, Z) Effects: ~Clear (Z) ~On (X, Y) Clear(Y) On (X, Z)

One possible solution Move (d1, d2, c) Move (d2, d3, b) Move (d1, c, d2) Move (d3, a, c) Move (d1, d2, a) Move (d2, b, d3) Move (d1, a, d2)