NATIONAL UNIVERSITY OF SINGAPORE
SCHOOL OF COMPUTING
SEMESTER I (1999-2000)
EXAMINATION FOR
CS3243: ARTIFICIAL INTELLIGENCE
November 1999 Time Allowed: 2 Hours
INSTRUCTIONS TO CANDIDATES
Matriculation Number:
-- | -- | -- |
For Examiners Use Only |
|
Marks |
|
Question 1 | |
Question 2 | |
Question 3 | |
Question 4 | |
Question 5 | |
TOTAL: |
1. The following diagram shows the start and goal states of an 8-puzzle game.
In the text book, a heuristic function h(n) is defined as the number of tiles out of place. However, assuming that the blank space is also considered a tile, we define a different heuristic function h(n) as follows:
h(n) = the number of tiles (including the blank) that are out of place
Thus h(0) = 4 (for the above start state). Now answer the following questions:
(a) Is h(n) admissible? Why?(4%)
(b) Is h(n) more informed than h(n)? Why?(3%)
(c) Is h(n) monotonic? Why?(3%)
(d) Using f(n) = g(n) + h(n), where g(n) is the number of moves from the start state, draw a search tree from start to goal based on the best first search. In each node of your search tree, draw the board configuration and indicate the value of f(n), g(n) and h(n) for the configuration. (The start and goal states are reproduced here for your easy reference) (10%)
2. A Re-write Production Rule System maintains a rule base containing 10 context free grammar rules as follows:
1. s ® np vp 6. noun ® web
2. np ® art noun 7. noun ® spider
3. vp ® verb np 8. noun ® crawler
4. art ® the 9. verb ® crawls
5. art ® a 10. verb ® searches
The systems working memory contains symbols each of which, upon matching with the left hand side of a rule, will be replaced with the symbols on the right hand side of the rule. Thus if the working memory contains one symbol s, upon firing rule 1, the working memory will then contain symbols np vp.
The systems conflict set contains the set of rules whose left hand side matches with a symbol in the working memory. To resolve the conflict set, select rules that may be fired by the most recently added symbol in the working memory (recency strategy). Note that when np vp replace s in the working memory, vp is considered more recently added than np. When more than one rules may be fired in the recency strategy, select rules that have not been fired for the longest time period (refraction strategy). When more than one rules may be fired in the refraction strategy, select the first rule (first rule strategy) .
(a) Show the operation of the production system by completing the following table until no more rules can be fired (i.e. when the conflict set is empty.)(10%)
Iteration # |
Working memory |
Conflict set |
Rule fired |
0 |
s |
1 |
1 |
2.(b) Draw the space searched by the above execution of rules, indicating the direction of search. (7%)
(c) The search space constructed in 2(b) is actually a parse tree. Is this parse tree a top-down parse tree or a bottom-up parse tree? Explain your answer. (3%)
(append (a b) (c d) (e f))
Þ
(append ((a b) (c d)) (e f))
Þ
(length ((a b) (c d) (e f)))
Þ
length (((a b) (c d)) (e f)))
Þ
(reverse ((a b) (c d) (e f)))
Þ
(reverse (((a b) (c d)) (e f)))
Þ
(b) Define your own "reverse" function, named "my-reverse" that gives the same output as the system function "reverse". Your "my-reverse" function must be recursive. (8%)
(c) A palindrome is a list that has the same sequence of elements whether it is read from left to right or from right to left. A function "palindromize" is to take an input list and returns a parlindrome that is twice as long. Thus
(parlindromize (a b c d e f))
Þ (a b c d e f f e d c b a)
Define parlindromize using "append" and "my-reverse". Your function definition need not be recursive but "append" and "my-reverse" must be used. (4%)
(d) What will be the output of (parlindromize ((a b) (c d) (e f))) ? (2%)
- collie(fred)
- master(fred, sam)
- day(saturday)
- warm(saturday)
- trained(fred)
- " X [spaniel(X) Ú (collie(X) Ù (trained(X)) Þ gooddog(X)]
- " (X,Y,Z) [gooddog(X) Ù master(X,Y) Ù location(Y,Z) Þ location(X,Z)]
- day(saturday) Ù warm(saturday) Þ location(sam,park)
- day(saturday) Ù Ø (warm(saturday)) Þ location(sam,museum)
(a) Transform the above expressions into conjunctive normal form. (10%)
(b) Show that Fred is a good dog by resolution refutation using set-of-support strategy. (5%)
(c) Use answer extraction process of resolution refutation to answer the following question: Where is Sam? (5%)
(i)
(b) Assume that the following diagram has been labelled partially in the middle of execution of Constraint Propagation/Satisfaction Algorithm, leaving only 7 vertices to be further labelled, in the order of A, B, C, D, E, F, G in each cycle.
Using the information of the present state of partial labeling, continue to label these 7 vertices in the order of A, B, C, D, E, F, G until the algorithm halts. To do so, fill in the following table. The labeling should complete in 2 or 3 cycles. (10%)
Vertex |
Cycle 1 |
Cycle 2 |
Cycle 3 |
A |
|||
B |
|||
C |
|||
D |
|||
E |
|||
F |
|||
G |
5.(c) Do you get a unique set of labeling or do you get more than one set of labeling? Show your answer by labeling the following diagrams. (3 diagrams are reproduced for your use but you need not use them all). Interpret your labeling next to the respective drawings. (5%)
END OF PAPER