• 沒有找到結果。

AI Homework 1 Solution

N/A
N/A
Protected

Academic year: 2022

Share "AI Homework 1 Solution"

Copied!
3
0
0

加載中.... (立即查看全文)

全文

(1)

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

(2)

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 bx2c, 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 bx2c.

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

(3)

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.

3

參考文獻

相關文件

Based on your un- derstandings on rolling/fixed release models from the previous question, what are the pros and cons of using a rolling release Linux distribution (such as Arch)

Network Administration/System Administration (NTU CSIE, Spring 2018) Homework #1 Solution1. Homework

Show a state space with varying step costs in which GRAPH-SEARCH using iterative deepening finds a suboptimal

– Runs replay mode to search for a solution – Reports to the user to run observation

Using the solution U of Riemann problem to obtain an e approximate solution for the solution U of balance laws..

Next, we may note that along x = 3 the function is similar to the sine function, whose derivative is the cosine function... Thus f xy is not continuous at (0,0) and Clairaut’s

In Section 3, the shift and scale argument from [2] is applied to show how each quantitative Landis theorem follows from the corresponding order-of-vanishing estimate.. A number

Algorithm kDomG finds a minimum L-dominating set in lin- ear time for graphs in which each block is a clique, a cycle or a complete bipartite graph, including block graphs, cacti