0% found this document useful (0 votes)
23 views5 pages

2024 11 12 CSC407StudyGuide4Midterms

Uploaded by

adokwu60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views5 pages

2024 11 12 CSC407StudyGuide4Midterms

Uploaded by

adokwu60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Nile University of Nigeria, Abuja STUDY GUIDE FOR FINALS

CSC 407 Prof. N. Agwu Nnanna


Artificial Intelligence November 12, 2024

• AI; Software Agents; LISP Programming


– Basic LISP Primitives; Function definition and Invocation.

• Net and Tree Search


– Search in State Space
– General state-space search algorithm
– Evaluating search strategies: completeness, complexity (time,space), optimality/admissibility.
– Depth-First and Breadth-First Search
• Optimal Search
– Branch-and-bound; branch-and-bound with underestimates; branch-and-bound with dynamic
programming; A* Search

• PREDICATE CALCULUS AND THEOREM PROVING


– Propositional Logic;
– First-order (predicate) logic (FOPL) Relations and Predicates; Quantifiers and sentences;
– Inference in First-order logic (IFOL): Resolution theorem proving. Conversion to clause form

1
Practice Problems
1. List and briefly describe the properties of an intelligent agent

2. What is a simple reflex agent? What is goal-based agent. What are the key diffences between
these two types of intelligent agents?
3. (a) Evaluate the following:
(i) > (list ’(a) ’(b c) ’d ’(e))
(ii) > (cons ’(a) ’(b c))
(iii) > (append ’(a) ’(b c d))
(iv) > (member ’z ’(a b z c z d))
(v) > (member ’(b c) ’(a (b c) d) :test #′ equal )
(b) Consider the function
(defun mystery (x)
(let (( result 1))
(dotimes (count x result)
(setf result (* (+ 1 count) result)))))
(i) What is the purpose of this function?
(ii) What is the value of >(mystery 4)?
4. (a) Write recursive function in LISP to compute n!
(b) Write a function called displaySquares in Lisp that prints out the squares of the integers from
a given starting integer to a given final integer. For example,
(displayIntegers start end)
3 9
4 16
5 25
DONE

4 4
A B C

S 5 5 G

4 3

D E F
2 4

Figure 1: A net to be searched

5. (a) Show how depth-first search would search the net shown in figure 1.
(b) Draw the complete search tree produced during branch-and-bound search with dynamic pro-
gramming of the net shown in figure 1.

6. (a) Show how breadth-first search would search the net shown in figure 1.
(b) Draw the complete search tree produced during branch-and-bound search with underesti-
mates of the net shown in figure 1.

2
A(3, 6) B(7, 6) C (11, 6)

S(0, 3) G (14, 3)

D (4, 0) E(6, 0) F (10, 0)

Figure 2: A net to be searched

7. (a) Draw the complete search tree produced during hill-climbing search of the net shown in figure
2.
(b) Draw the complete search tree produced during best-first search of the net shown in figure 2.
(c) Draw the complete search trees produced during Branch-and-Bound with Underestimates
and A∗ search of the net shown in figure 2.
8. (a) Show that ¬( p ∧ (¬ p ∨ q)) and ¬ p ∨ ¬q are logically equivalent.
(b) Show that ( p ∧ q) =⇒ ( p ∨ q) is a tautology.
9. Use the following to write quantified first order predicate logic formulas.
• P( x ) = x is a programmer.
• S( x ) = x is smart.
• L( x, y) = x loves y.

a. All programmers are smart.


b. Some programmers are smart.
c. Someone is not a programmer.
d. Not everyone is a programmer.
e. Some programmers are not smart.
f. Everyone loves someone.

10. Consider the following set of premises.


1. Some children will eat any food.
2. No children will eat food that is green.
3. All children like food made by Nestle.
We like to prove that the following conclusion follows from these premises:

No food made by Nestle is green.

a. Represent the premises and the negated conclusion in predicate calculus.


b. Convert the expressions to clause form.

11. Consider the following predicate logic argument:

A horse is an animal
Therefore, the head of a horse is the head of an animal.
Define the following:

3
• H ( x, y) = x is the head of y.
• A( x ) = x is an animal.
• S( x ) = x is a horse.
The premise and conclusion are

(∀ x )(S( x ) ⇒ A( x ))
(∀ x ){[(∃y)(S(y) ∧ H ( x, y))] ⇒ [(∃z)( A(z) ∧ H ( x, z))]}.

Prove the conclusion using resolution refutation. Show all ten steps in clausal conversion for the
conclusion.
12. Consider the following set of premises:
1. Some programmers hate all failures.
2. No programmer hates any success.
Use Resolution Refutation to prove that the following conclusion follows from these premises:

No failure is a success.
You may use the following predicates:
• P( x ) = x is a programmer.
• F ( x ) = x is a failure.
• S( x ) = x is a success.
• H ( x, y) = x hates y.
13. Consider the following statement: “All persons have a hobby; all professors are persons; DrNo is
a professor.” The predicate calculus sentences for this knowledge may be expressed in clause form
as
a. ¬Person(x) ∨ hasHobby(x,f(x))
b. ¬Professor(u) ∨ Person(u)
c. Professor(DrNo)
Use the set-of-support strategy for resolution refutation to prove the theorem below. (Remember
that a refutation proof is proof by contradiction using the negation of the theorem.) Show all the
steps and substitutions.

∃h hasHobby(DrNo, h) the theorem to be proved.

14. Show the steps required to put the following axioms into clause form:

∀ x ∀y[On( x, y) ⇒ Above( x, y)]


(1)
∀ x ∀y∀z[Above( x, y) ∧ Above(y, z) ⇒ Above( x, z)]

15. The following axiom says that,if x is above y, but is not directly on y, then there must exist some
third bloc, z, in between x and y :

∀ x ∀y[Above( x, y) ∧ ¬On( x, y) ⇒ ∃z[Above( x, z) ∧ Above(z, y)]].

Put the axiom in clause form. Note that you need to introduce a Solem function.
16. The logical operator ”⇒” is read ”if and only if.” ”P ⇔ Q” is defined as being equivalent to
( P ⇒ Q) ∧ ( Q ⇒ P). Based on this definition, show that P ⇔ Q is logically equivalent to
( P ⇒ Q) ∧ ( Q ⇒ P) :
a. By using truth tables.

4
b. By a series of substitutions using the logical identities.

17. Convert the following predicate calculus sentences to clausal form.

(i) (∃ x )[ P( x ) ∧ (∀y)( F (y) ⇒ H ( x, y))]


(ii) (∀ x )[ P( x ) ⇒ (∀y)(S(y) ⇒ ¬ H ( x, y))]
(iii) ¬(∀y)( F (y) ⇒ ¬S(y))

You might also like