0% found this document useful (0 votes)
22 views3 pages

AI Homework 1 Solution: March 24, 2007

This document contains solutions to AI homework problems. 1. It describes a water jug problem and provides a PEAS description of the task environment, including the performance criteria, environment components, actuators, and sensors involved. 2. It analyzes a state space problem where the goal is to reach state 11 from state 1. It compares breadth-first, depth-limited, and iterative deepening searches, and describes how bidirectional search could solve the problem with minimal exploration. 3. It proves that uniform-cost search and breadth-first search are optimal when costs are constant, and provides an example state space where iterative deepening search using GRAPH-SEARCH would find a suboptimal solution due to varying
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)
22 views3 pages

AI Homework 1 Solution: March 24, 2007

This document contains solutions to AI homework problems. 1. It describes a water jug problem and provides a PEAS description of the task environment, including the performance criteria, environment components, actuators, and sensors involved. 2. It analyzes a state space problem where the goal is to reach state 11 from state 1. It compares breadth-first, depth-limited, and iterative deepening searches, and describes how bidirectional search could solve the problem with minimal exploration. 3. It proves that uniform-cost search and breadth-first search are optimal when costs are constant, and provides an example state space where iterative deepening search using GRAPH-SEARCH would find a suboptimal solution due to varying
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/ 3

AI Homework 1 Solution

March 24, 2007

1. Water Jug Problem


You are given two jugs with no measuring marks, a 4-gallon one and a
3-gallon one. There is a pump to fill the jugs with water. How can you
get exactly 2 gallons of water into the 4-gallon jug? For the agent of water
jug, develop a PEAS description of this task environment.
Ans. Any reasonable answer will be accepted.
Performance:
(a) correctness. (successfully reach the goal?)
(b) speed (how many steps this agent takes?)
Environment:
(a) the jugs
(b) the pool
Actuator:
(a) the pump
(b) the robotics arm
Sensor:
(a) the eyes
(b) camera
(c) weight sensors

2. AIMA[3.8]
Consider a state space where the start state is number 1 and the successor
function for state n returns two states, numbers 2n and 2n + 1.
a. Draw the portion of the state space for states 1 to 15.
b. Suppose the goal state is 11. List the order in which nodes will be
visited for breadth-first search, depth-limited search with limit 3, and
iterative deepening search.
c. Would bidirectional search be appropriate for this problem? if so,
describe in detail how it would work.
d. What is the branching factor in each direction of the bidirectional
search?
e. Does the answer to (c) suggest a reformulation of the problem that
would allow you to solve the problem of getting from state 1 to a
given goal state with almost no search?

1
Figure 1: The state space

Ans.
(a) The state space of this problem is as Figure 1:
(b) BFS: 1 → 2 → 3 → 4 → 5 → 6 → 7 → 8 → 9 → 10 → 11.
DFS: 1 → 2 → 4 → 8 → 9 → 5 → 10 → 11.
IDS: 1; 1 → 2 → 3; 1 → 2 → 4 → 5 → 3 → 6 → 7; 1 → 2 → 4 → 8 →
9 → 5 → 10 → 11.
(c) Yes. In this problem, the predecessor of each state x is b x2 c, which is
easily computable. Assume that we use breadth-first search in both
forward and backward direction, the search steps may be as Table 1.

visited node fringe


forward 1 ForwardFringe={2,3}
backward 11 BackwardFringe={5}
forward 2 ForwardFringe={3,4,5}
backward 5 BackwardFringe={2}

Table 1: The search steps

Note that the algorithm stops when the search in backward direction
visited node 5, because node 5 is in the fringe of forward direction.
(d) 2 in forward direction, and 1 in backward direction.
(e) Yes. We start from goal state, and let node 1, the original start state,
be our new goal. For each state i, we have only one next state b x2 c.
Since the new problem has branching factor=1, we will not need to
search.
3. AIMA[3.12]
Prove that uniform-cost search and breadth-first search with constant step
costs are optimal when used with the GRAPH-SEARCH algorithm. Show

2
a state space with varying step costs in which GRAPH-SEARCH using
iterative deepening finds a suboptimal solution.
Ans.
Uniform-cost search is identical to breadth-first search if all step costs are
equal, you can just prove any one of the two methods.
Since the costs of each step are constant, when an unvisited node is visited
by breadth-first search (uniform-cost search), the cost will be the lowest
one. Moreover, since we use GRAPH-SEARCH algorithm, no node will
be visited more than once. Thus if the goal node is visited, we will get
the optimal solution.
The state space that iterative deepening search with GRAPH-SEARCH
algorithm will fail to find the optimal solution can be Figure 2, where I is
the initial state and G is the goal state:

Figure 2: The example that IDS finds a suboptimal solution.

You might also like