CS 462: TEST #1 Deadline: E-mail to zlatareva@ccsu.edu by March 25, 2003 ------------------------------------------------------- Please remember that everybody must work independently. ------------------------------------------------------- PROBLEM 1: Here is a function FACTORS that returns a list of prime factors of a number. (defun factors (number) (factors-aux number 2)) (defun factors-aux (number1 number2) (cond ((equal number1 1) nil) ((zerop (rem number1 number2)) (cons number2 (factors-aux (/ number1 number2) number2))) (t (factors-aux number1 (+ number2 1))))) Here the REM function is a remainder division number1 by number2. FACTORS returns the list of prime factors of a number. For example: * (factors 60) (2 2 3 5) Number 60 has factors 2 2 3 and 5 (60 = 2 * 2 * 3 * 5). Here is a factorization tree for 60: 60 / \ 2 30 / \ 2 15 / \ 3 5 Write a similar function, FACTOR-TREE, that returns a factorization tree, i.e. * (factor-tree 60) (60 2 (30 2 (15 3 5))) PROBLEM 2: Suppose that we run a greedy search algorithm with h(n) = -g(n). What sort of search will the greedy search emulate? What if h(n) = g(n)? What sort of search does greedy search emulate in this case? Explain your answer -- just stating this or that search is not enought. Problem 3: Consider the sentence "Heads I win; tails you lose." We can represent this sentence and associated domain knowledge by means of the following PL formulas: Heads => I-Win Tails => You-Lose not Heads => Tails You-Lose => I-win A.) Is it possible to prove I-win using only modus ponens and these four formulas? If yes, give the proof, if not - explain why. B.) Convert each of these formulas to a disjunction of literals, and for each of the resulting disjunctions, specify if it is a Horn formula. C.) Is it possible to prove I-win using only the resolution rule and these four formulas? If yes, give the proof, if not - explain why. Problem 4: Consider a world in which there are only four propositions A, B, C and D. How many models are there for the following sentences: A.) A and B B.) A or B C.) A and B and C Problem 5: Explain the limitations of PL as a knowledge representation language. Give examples to illustrate your answer.