UNIVERSITY OF NAIROBI

lynxherringAI and Robotics

Oct 18, 2013 (3 years and 11 months ago)

426 views


1

UNIVERSITY OF NAIROBI

S
ECOND SEMESTER EXAMINATIONS 2008/2009

SECOND YEAR EXAMINATIONS FOR THE DEGREE OF BACHELOR OF

SCIENCE IN COMPUTER SCIENCE

ICS 220:

ARTIFICIAL INTELLIGENCE PROGRAMMING

Date: 00
th

June
, 2009






Time 9.00 P.M.


11.00 P.M.

________
____________________________________________________________________

Instructions:

Answer Question ONE and any other TWO questions


Question ONE (20 marks)


Compulsory

a)

Clearly distinguish between the activities involved in AI programming using knowledge b
ase approach and
machine learning approach.








(
2

marks)

b)

Briefly describe on any three methods of knowledge representation in AI.



(3 marks)

c)

Salim and Khadija loved each other and decided to be married. A month before the wedding, Salim
discovered tha
t Khadija’s father was secretly smuggling stolen art through Lamu. After struggling with his
conscience for days, Salim reported Khadija’s father to the police. Khadija understood Salim’s decision, but
she despised him for it nonetheless, and she broke off

their engagement knowing he would suffer.

i)

Devise a semantic network to represent the characters and events in the story.

ii)

Represent the above knowledge using predicate logic.

iii)

Convert the above logic
-
knowledge base into a

production rule
-
knowledge base
.

(9
marks
)

d)

Briefly explain the additional components that you would construct in Q1 c) iii above in

order to form a
comprehensive expert system.









(2 marks)

e)

Explain how
an expert system that uses machine vision for disease diagnosis can be constructed.

B
e sure to
explain
how
the knowledge acquisition, knowledge representation and reasoning components are designed
and interact.










(4 marks)


Question TWO (15

marks)

a)

Represent each of these sentences in propositional logic.

i)

If I take History, I ca
nnot take Economics.

ii)

I must take either Japanese or Italian but not both.

iii)

I must take at least two of ICS 220, ICS 221, and ICS 222.




(3 marks)

b
)


Put the following in
clausal form
.

i)

(P





(X




ii)

(P






Z)


(X


Y)








(3 marks)



c
)

Consider t
he information given here below
:

John and Mary get sick every rainy season
.Pebbles, the child of Fred
an
d Wilma, will get sick next

rainy
season
.

Every
rainy season

Maggie sits next to Pebbles on the school bus.

People who sit next to sick
people will get
sick
that same
rainy season
.

Parents catch every cold their children get

that same
rainy
season
.

Having a cold is one way of getting sick.

Maggie is the daughter of John and Mary
.
Maggie,
John, Mary, Fred, Wilma, all Parents and their children are people.

i)

Use wff notation to represent the above knowledge.





(3 marks)

ii)

Convert the wff clauses and rules in a i) into Prolog statements. Explain your predicates by including
appropriate comments.








(3 marks)

iii)

Write a Prolog program that captures the
above

wo
rld knowledge

and answers the query: will John
and Mary get sick next rainy season
.







(3 marks)



2

Question THREE (15

marks)


a)

Consider
a section of a

Prolog program below.

c(1,4).

c(2,1).

c(2,3).

c(2,6).

c(3,5).

c(5,4).

r(X,X).

r(X,Y) :
-

c(Z,Y), r(X,Z
).

What would Prolog return if given the following queries? (Report
all
the answers returned, in

the order Prolog would return them.)

i)

?
-

r(2,4).

ii)

?
-

r(W,4).










(4 marks)

b)


Consider the following system of rules and facts, where the variable
x

stands for a patient,

“red_spots(
x
)” stands for “patient
x
has red spots”, and so forth.

IF:
fever(
x
) & red_spots(
x
)
THEN:
measles(
x
)

IF:
measles(
x
)
THEN:
contagious(
x
)

IF:
runny_nose(
x
)
THEN:
cold(
x
)

IF:
cold(
x
)
THEN:
contagious(
x
)

IF:
fever(
x
) & stiff_n
eck(
x
)
THEN:
meningitis(
x
)

IF:
meningitis(
x
)
THEN:
contagious(
x
)

IF:
contagious(
x
) & dangerous(
x
)
THEN:
isolated(
x
)

IF:
meningitis(
x
)
THEN:
dangerous(
x
)

Initial facts:

runny_nose (mary), stiff_neck (john), fever (john), red_spots (mary), fever (mary)

i)

What
can be derived from this knowledge base by forward reasoning? Explain

(4 marks)



ii)

Using backward chaining determine if we need to isolate John.




(3 marks)



c)

Explain how frames can be used to solve the following types of problems

i)

Classification o
f biological organisms such as bacteria.

ii)

Trouble shooting computer hardware problems




(4 marks))


Question FOUR (15

marks)


a)

Briefly explain how AI problems are represented using state
-
space trees and state graphs.

(2 marks)



b)

Explain the basic alg
orithms for implementing the following searching procedures;

i)

Uniform cost search

ii)

Iterative deepening search






(
3

marks)


b)

Consider the search
tree

drawn below. The initial state is at the top, and goal states are

represented by
double circles.

For each of the search strategies listed below, indicate

which
goal state is reached

(if any) and
list, in order
, the states explored.










3











2




7











11


3



15

2
0


3





3



9



9


8


5


6



6













L







17


18 11



28


20 12






N



Q



S


S







i)

Depth
-
First Search

ii)

Breadth
-
First Search

iii)

Greedy
Best
-
First Search


iv)

A* Search

v)

Bidirec
tional search








(10 marks)


Question FIVE (15

marks)

a)

Represent the following facts as a set of frames:

"The aorta is a particular kind of artery which has a diameter of 2.5cm. An artery is a kind of blood
vessel. An artery always has a muscular wall,

and generally has a diameter of 0.4cm. A vein is a kind of
blood vessel, but has a fibrous wall. Blood vessels all have tubular form and contain blood.'' (5 marks)

b)

You are on the bank of a river with a boat, a cabbage, a goat, and a wolf, and your task

is to get
everything to the other side. Only you can handle the boat, and there is only space in the boat for you and
one additional item. You can’t leave the goat alone with the wolf or the cabbage, or something will get
eaten. Solve the problem computat
ionally and with the use of a state space search formulation.
(5 marks)

c)

Apply the
minimax
algorithm to the game tree below, where it is the
maximizer’s
turn to play

and
determine the move that the maximizer should take between A and B.



(5 marks)





























3
























-
2


4


6

-
8


7



-
1


-
3


-
5


E

S

A

J

B

C

H

D

G

F

I

M

P

K

R

T

E

S

A

J

B

C

H

D

F

F

P

K

R

T

R