You are on page 1of 4

PirMehr Ali Shah

Arid Agriculture University, Rawalpindi


Office of the controller of Examinations
Mid Exam / Spring 2021 (Paper Duration 12 hours)
To be filled by Teacher

Course No.: CS-632 Course Title: Artificial Intelligence


Total Marks: 18 Date of Exam: 05-05-2021
Degree: BSCS Semester: 6th Section: A & B
Marks
Q.No. 1 2 3 4 5 6 7 8 9 10 Obtained/
TotalMarks
Marks
Obtaine
d
Total Marks in Words:
Name of the teacher:
Who taught the course:Signature of teacher / Examiner:

To be filled by Student

Registration No.: ………………………………………….……… Name:……………………………………………………..

Answer the following questions.

Q.No.1 (3+3)

a) Write and implement the best first search algorithm where we have given the Start state and Goal
state and we want to reach the goal state.

4 7 3 1 2 3

1 8 8 4

2 5 6 7 6 5

Initial state

Goal state

Answer:
b) Add the last two digits of your registration number with leaf node of following tree then apply
alpha-beta pruning algorithm and show the resultant search tree that would be built by this
algorithm. Show the alpha beta cuts and which parts of the search tree are pruned as a result.

MAX A

MIN B
C

MAX D E F G

H I J K L M N O

6 5 8 10 2 1 15 18

Answer:

Q.No.2 (4)

Consider the following map and the straight-line distance to the city entitled “M” from every other
city. Find the shortest path from “A” to “M” using A* searching algorithm. Draw the tree structure
and trace algorithm using open and closed list. Also state the shortest route with cost.
H(n) value of each city is given in the following table. To calculate the final f(n) of each city
use the following formula except city M.
g(n)=Straight line distance(n)+last two digits of your registration number
F(n)=g(n) + H(n)
Heuristic value H(n) of each city given in the following table
A B C D E F G H I J K L M
223 222 166 192 165 136 122 111 100 60 32 102 0

Answer:

Q.No.3.

Choose a domain where an expert system can help as assistant and provide at least 5 rules for the
knowledge base also provide the fact for working memory. (4)
Answer:

Q.No.4. (2+2)
Consider the tree given below in this question. Suppose you have an array of letters where letter ‘A’
is on ‘0’ index and letter ‘Z’ is on ‘25’ index as shown in the given table.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Select last digit of your arid number (i.e. number from 0-9), add 16 in it and then find the
corresponding letter in the array of letters. For example, if last digit of your arid number is 6, then
6+16=22. Therefore, ‘W’ is the letter on 22th index in the array. Now write the complete trace of
operations to search this letter (‘W’ in above
case) by using
a) Breadth-first search algorithm.
b) Depth-first search algorithm.
Answer:

Good Luck

You might also like