Sunteți pe pagina 1din 4

CS 331, CS 531 - Introduction to Artificial Intelligence

Assignment 1
Due Date: January 17, 2005
Attempt all questions.

Question 1
Consider the graph (of driving times in Vancouver; not drawn to scale) with arc lengths shown
on the arcs:

Note that the arc costs are for both directions.


For example the arc _UBC, PG_ has
length 10, and the arc _PG, UBC_has length
10. Suppose the neighbours are given in the
following order:

DT: KT
KT: SG, PG, DT
PG: SL, UBC, KT, SG
SG: KD, PG, KT
UBC: PG, SL
SL: PG, KD, MP, UBC
KD: SG, MP, SL
MP: KD, AP, SL
AP: MP

We want to find a path from UBC to DT. For each of the following search methods specify
whether it
halts for this particular graph. If it does halt, specify which solution path is found first and give
the path
length. If it doesnt halt, briefly explain why.
a) Depth-first search.
b) Depth-first search with loop detection.
c) Breadth-first search.
d) Best-first search.
e) A* search.
Question 2
Using the predicates Bx (x is a barber in Podunk) and Sxy (x shaves y), translate the
following argument into a sentence of the predicate calculus.

Any barber in Podunk shaves exactly those individuals who do not shave themselves.
Therefore, there is no barber in Podunk.

Question 3
Describe a search space (and/or a search tree) in which iterative deepening performs (increase
depth by 1 in each iteration) much worse than depth first search.

Question 4
List the order in which nodes are visited in the tree below for each of the following tree
searching strategies (choosing leftmost branches first in all cases):

Depth-first search
Breadth-first search

Question 5
Consider the problem of missionaries and cannibals: 3 missionaries and 3 cannibals are on one
side of a river, along with a row boat that is capable of transporting either 1 or 2 occupants.
The objective is to find a way in which to move both the missionaries and the cannibals to the
opposite side of the river, without ever allowing the number of annibals on a river bank to
exceed the number of missionaries (including the occupants of the boat), because then the
cannibals would eat the missionaries. We would like to do this as quickly as passible.

Formulate this as a search problem. Specify the representation of the states, operators, goal,
start state and cost function. Can you find an admissible heuristic?
Question 6
Sesshomaru, Naraku (pronounced naa-rak) and Inuyasha belong to the Warring Era ^_^. Every
member of the Warring Era is either a demon or a human or both. No human likes rain and all
demons like snow. Naraku dislikes whatever Sesshomaru likes and likes whatever Sesshomaru
dislikes. Sesshomaru likes rain and snow.

a) Write a first-order logic description of the text above.


b) Can you find a member of the era who is a human but not a demon? Prove that your
answer is correct.

Solve both a) and b) again using PROLOG statements.

Question 7
Are the following statements true or false?
a) All search algorithms are complete.
b) A* is complete.
c) A* terminates immediately when a goal state is found.

Question 8
Translate the following sentences into first order logic, using a consistent vocabulary (which
you must define):

a) Not all students take both history and biology.


b) Only one student failed in history.
c) Only one student failed both history and biology.
d) The best score in history was better than the best score in biology.

Question 9
Consider the following assertions:

In every program there is a bug


A program that contains a bug does not work
P is a program

a) Write First Order Logic knowledge base corresponding to these assertions.


b) Prove that P does not work.

Question 10
Translate the following sentences to first-order logic.
a) All students who take AI like to play games.
b) No students who take AI like to play games.
c) On Saturday, all students either go to a party or work, but not both.
d) All students go to a party on Saturday, except those taking AI.
e) Exactly two students go to a party.

Question 11
Given the following, can you prove that the unicorn is mythical? How about magical? Horned?
Begin by providing a propositional description of the given text.

The unicorn is mythical, then its is immortal, but if it is not mythical, then it is a mortal
mammal. If the unicorn is either immortal or a mammal, then it is horned. The unicorn is
magical if it is horned.

The following questions are for practice for the mid-term These are not to be submitted.

From your Luger book:


Exercise 2.6
4, 6, 7(a), 8, 10, 11, 12
Exercise 4.6
1, 2, 3, 9, 10, 11, 12, 13, 14

S-ar putea să vă placă și