Uploaded by 22030742

Spring-CSCI475-Midterm2022

advertisement
CSCI475
Midterm Exam
Spring 2021 – 2022
Department of Computer Science and Information Technology
Course
Date
Pages
CSCI475 Artificial Intelligence
21 April 2022 Time
09:30 –10:45
6
Calculators Not Allowed
Duration
75 minutes
Documents Not Allowed
Part I: Search [40 points]
Question 1
Consider the following map where A is the start state and M is the goal state (not drawn to scale).
A
40
11
C
B
D
10
22
10
5
20
F
E
H
5
10
I
10
14
K
10
G
J
10
5
20
20
L
M
Using the following cost functions.
 G(n) = The cost of each move as the distance between each town (shown on map).
 H(n) = (heuristic function) The Straight-Line Distance between any town and town M. Distances are in the below
table. Assume that nodes are expanded in alphabetic order.
A B C D E
F G H
I J K
L M
44 20 33 25 31 22 14 10 11 5 40 20 0
1) Using the A* search, show a) the list of expanded nodes and b) the route/path/solution found (traces
and fringes are NOT required) [17 points]
List of expanded nodes: ACDFLM
Solution: ACDFLM
2) Using the DFS, show the route/path/solution found (traces and fringes are NOT required) [10 points]
Solution: ABFEKLM
3) Propose another Heuristic function H2(n) that dominates the Heuristic function H1(n) [13 points]
For each node, any value within the range
A
B
C
D
E
44≥ ≤56
20≥ ≤40
33≥ ≤45
25≥ ≤35
31≥ ≤40
F
22≥
≤30
Page 1 of 3
G
14≥
≤20
H
10≥
≤30
I
11≥
≤15
J
K
L
M
5
40
20
0
CSCI475
Midterm Exam
Spring 2021 – 2022
Part II: Adversarial Search [10 + 20 = 30 points]
Question 1
a) Given the following search tree (MAX player starts at node A), Apply Minimax without
Alpha-Beta Pruning to the tree shown below to conclude the value of node A only (NO other
data or traces are required)
A=3
b) Given the following search tree (MAX player starts at node A), apply the alpha-beta pruning
algorithm to it and show the search tree that would be built by this algorithm. Make sure that you
show where the alpha and beta cuts are applied, and which parts of the search tree are pruned
as a result (traces are not required).
Page 2 of 3
CSCI475
Midterm Exam
Spring 2021 – 2022
Part III: First Order Logic [30 points]
Question 1
Consider the following vocabulary and KB:



Unary predicate:
o Prime (X): X is a prime number
o Null (X) : X = 0
o Even (X): X is an even number
Binary Predicates:
o Divisor (X, Y): the number X is a divisor of the number Y
o Multiple(X, Y): the number X is a multiple of the number Y
Ternary predicates:
o Modulus (X, Y, Z): the number Z = X %Y ( Z is the remaining of the integer division X by Y)
o Digit(X, D, P): D is the digit at position P of the number X (consider that the first digit at the right is
the digit at position 1)
a) Translate the following sentences into FOL: [30 points, 3 points for each]
1. X is a divisor of Y iff X%Y= 0 (there is a mathematical mistake here: it should be Y%X, however, as long
as the FOL statement is true, there is no problem)
∀x∀y Divisor(x, y)  Modolus(x,y,0)
2. X is a divisor of Y iff Y is a multiple of X
∀x∀y Divisor(x, y)  Multiple(y,x)
3. All numbers are divisible by the number 1
∀x Divisor (1, x) OR ∀x ∃y Divisor(y, x) ∧ y =1
4. All numbers are divisible by themselves
∀x Divisor (x, x) OR
∀x ∃y Divisor(y, x) ∧ y = x
5. A number is a prime number iff it is divisible by only 1 and itself
∀x Prime(x)  [ ∃y∃z Divisor(y, x) ∧ Divisor(z, x) ∧ [ ( y = 1 ∧ z = x) ∨ ( y = x ∧ z = 1)]]
OR ∀x Prime(x)  ∀y Divisor(y, x) ( y = 1 ∨ y = x)
6. X is a divisor of Y and Y is a divisor of X iff X = Y
∀x∀y [ Divisor(x,y) ∧ Divisor(y, x) ]  x=y
7. All the multiples of 9 are multiples of 3 also.
∀m [ Multiple (m, 9)  Multiple (m,3) ]
8. X is divisible by 5 iff the first digit at the right of X is 0 or 5
∀x [ Divisor(5, x)  (Digit(x,0,1) ∨ Digit(x, 5, 1))]
9. Even numbers are divisible by 2
∀x Even(x)  Divisor(2, x)
10. The number 21 is not an even number and it’s divisible by both 3 and 7
¬Even(21) ∧ Divisor(3, 21) ∧ Divisor(7, 21)
Page 3 of 3
Download