Вы находитесь на странице: 1из 12

CPSC 481- Artificial Intelligence

Handout – Intro, StateSpaceSearch & Heuristics

1. Short answer questions

1) What is an intelligent agent?

2) Create and justify your own definition of artificial intelligence.


An AI in its simplest form is a program created to solve some problem or achieve some goal. For
example, a chess AI has the goal to defeat the other agent. More elaborately an AI is a program that

Page 1 of 12
adapts to environments to achieve its goal. For example a chess AI adapts to a change in the
environment every time the opposing agent makes a move.

3) What is the general problem-solving process?

4) What is data-driven search? For what types of problems do we want to use data-driven search?

Page 2 of 12
5) If a machine passes the Turing test, can the machine solve most AI problems? Why or why not?

No because TT only focuses on problem solving skills and doesn’t test things like perception and
doesn’t help us do things like generate theories

6) If the opponent makes a mistake, will the Mini-max still work?


Yes because the opponent making a mistake actually puts the agent in a equal or more optimal
position.

Page 3 of 12
7) What are the different types of environment for agents?

Page 4 of 12
Page 5 of 12
2. Search
1

A S 12
3 1
2

C G
B 1

D 3
3

Answer the following questions about the search problem shown above. S is the start state, G is the goal state.
Break any ties alphabetically. For the questions that ask for a path, please give your answers in the form `S - A -
D - G.'

(a) What path would breadth-first graph search return for this search problem?
Output: S
Queue: A G

Output: S A
Queue: G B C

Output: S A G
Queue: B C

ANSWER: S – A – G (S -G)

(b) What path would depth-first graph search return for this search problem?
Stack: S
Stack: S A
Stack: S A B
Stack: S A B D
Stack: S A B D G

ANSWER: S – A – B – D - G

Page 6 of 12
(c) What path would A* graph search, using h1 heuristic as shown in the table below, return for this
search problem?
State h1 h2
S 5 4
A 3 2
B 6 6
C 2 1
D 3 3
G 0 0

F(A) = 3 + 1 = 4
F(G) = 0 + 12 = 12
A < G so S- A

F(B) = 6 + 3 = 9
F(C) = 2 + 1 = 3
C < B so S – A – C

F(D) = 3 + 1 = 4
F(G) = 2 + 0 = 2
G < D so S-A-C-G

(d) Consider the heuristics for this problem shown in the table above.

i. Is h1 admissible? Yes No

Page 7 of 12
ii. Is h2 admissible? Yes No

iii.
Is h1 consistent (monotone/local admissible), why or why not?

Not consistent because h(S) – H(A) = 2 > Cost(S,A) = 1

iv.
h1 and h2, which one is more informed and why?

H1 is more informed because h1(n) >= h2(n) for all states

Page 8 of 12
3. Heuristics
The sliding-tile puzzle consists of three black tiles, three white tiles, and an empty space in the
configuration shown in the following figure. The puzzle has two legal moves with associated costs: A tile
may move into an adjacent empty location. This has a cost of 1. A tile can hop over one or two other tiles
into the empty position. This has a cost equal to the number of tiles jumped over. The goal is to have all
the white tiles to the left of all the black tiles. The position of the blank is not important.

B B B W W W
a. (6 pts) Draw the first three levels (level 0 - 2) of the state space graph.

0:

B B B W W W
1 Reduced by symmetry
a.

B B B W W W
b

B B B W W W
c.

B B B W W W
2:

a.

B B B W W W
B B B W W W
B B B W W W
Page 9 of 12
B B W B W W
B B W B W W
b.

B B B W W W
B B B W W W
B B B W W W
B W B B W W
c.

B B B W W W
B B B W W W
B B B W W W

Page 10 of 12
b. (8 pts) Propose an admissible heuristic for solving this problem. You are to describe and define h(n)
and explain why it is admissible.
h(n) = # of out of place Bs and Ws

4. Game Tree
1) The game tree below illustrates a position reached in the game. It is MIN's turn to move. Inside each
leaf node is the estimated score of that resulting position returned by the heuristic static evaluator.
FILL IN EACH BLANK SQUARE WITH THE PROPER VALUE ACCORDING TO MINI-MAX SEARCH.

(A) 6 (B)
Min
6 7
Max
6 2 7 3
Min
6 8 4 2 7 9 3 6
Max
6 4 8 6 4 0 2 2 7 4 9 3 3 3 2 6

2) (2 pts) What is MIN's best move (write A or B) A

3) This is the same tree and conditions as above. CROSS OUT EACH LEAF NODE THAT WILL NOT BE
EXAMINED BECAUSE IT IS PRUNED BY ALPHA-BETA PRUNING. You do NOT need to cross out branches.
You do not need to indicate the branch node values again.

6
Min
6 7
Max
6 4 7 3
Min
6 8 4 x 7 9 3 x
Max
6 4 8 x 4 0 x x 7 Page411 of912 x 3 3 x x
6
Min
6 x
Max
6 x 7 x
Min
6 x 4 x 7 x x x
Max
6 4 8 6 4 0 2 2 7 4 9 3 3 3 2 6

Page 12 of 12

Вам также может понравиться