Get premium membership and access revision papers, questions with answers as well as video lessons.

Artificial Intelligence Programming Question Paper

Artificial Intelligence Programming 

Course:Bachelor Of Science In Information Technology

Institution: Masinde Muliro University Of Science And Technology question papers

Exam Year:2011



EXAMINATION FOR THE DEGREE OF BACHELOR OF
SCIENCE IN INFORMATION TECHNOLOGY
BIT 4402: ARTIFICIAL INTELLIGENCE PROGRAMMING
DATE: AUGUST 2010 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO questions
QUESTION ONE
a) Programming Languages are of two kinds. Describe these two kinds stating which category
PROLOG belong to [3 Marks]
b) Define horn clause [1 Mark]
c) List 3 areas that PROLOG is good at and 2 that its poor at [5 Marks]
d) Define the following as used in PROLOG
i).Facts
ii).Rules
iii).Clauses
iv).Arity
v).Unification
[10 Marks]
e) State the functional difference between [4 Marks]
i).; (semicolon) and , (comma)
ii).Backtracking and recursion
f) What is the output of the following at the command prompt?
i).X=5+4
ii).X is 5+4
[2 Marks]
g) Write a PROLOG program that returns the bigger of any two numbers using the head unification
[5 Marks]
QUESTION TWO
a) Using the following program,
1) drinks(alan,beer).
2) likes(alan,coffee).
3) likes(heather,coffee).
4) likes(Person,Drink):-drinks(Person,Drink).
5) likes(Person,Somebody):-likes(Person,Drink), likes(Somebody,Drink).
i). Define a subgoal and identify 1 subgoals in the program [2 Marks]
ii). Define a recursive subgoal and identify 2 recursive subgoals in the program [4 Marks]
iii). Using trees, identify exhaustively solutions to the following goal likes(alan,X). [5 Marks]
iv). State 3 reasons giving examples why you think recursion in important in PROLOG
Programming [3 Marks]
b) Describe 3 differences between structures and facts [3 Marks]
c) Define a list and what is the output of the following
i).[[a],[B,c],[]]=[X,[b,c],Y]. [1 Mark]
ii).[a,B,c,D]=[A,b,C,d]. [1 Mark]
iii).[(a+X),(Y+b)]=[(W+c),(d+b)]. [1 Mark]
typed at the command prompt
QUESTION THREE
a) Given the following facts and rule, write a general recursive rule that is going to output Ancestors
of a jim or tom
• parent(tom,jim).
• parent(mary,tom).
• is_older(Old,Young):-parent(Old,Young).
[4 Marks]
b) By using the following user defined member list predicate
member(H,[H|_]).
member(H,[_|T]):-member(H,T).
Trace the output of the following statements
member(ringo,[john,paul,ringo,george]).
[6 Marks]
c) When processing data in Prolog there are three ways to collect the results, name them. [3 Marks]
d) Write a PROLOG program to compute the factorial of a number. [5 Marks]
e) Define cut (!) and differentiate between red and green cut [2 Marks]
QUESTION FOUR
a) Write a PROLOG program to compute the GCD of two numbers given as follows
[6 Marks]
b) Describe 5 predicates that are used to test numbers [5 Marks]
c) Describe the meaning of the following
i. X = Y
ii. X is Y
iii. X =:= Y
iv. X =\= Y
v. X = = Y
vi. X \= = Y
[6 Marks]
d) Describe the Byrd Box model used by the tracer in PROLOG [3 Marks]
QUESTION FIVE
a) Define the following as used in Searching
i.State [2 Marks]
ii.State-space [2 Marks]
iii.Identify all the possible state-space in the above graph [5 Marks]
iv. Define the branching factor. In the above graph, what is the BF [2 Marks]
v. Define the depth, and with respect to the above, what is the depth of (Goal state) [2 Marks]
b) Develop a tree for the above graph and write a prolog program demonstrating a depth first search
for the tree [7 Marks]
Goal
State
Initial
State
A B
C
D E F
G H






More Question Papers


Popular Exams



Return to Question Papers