Midterm Exam

ARTIFICIAL INTELLIGENCE

CMSC 380


SPRING 2004


Problems :


1.    Given an environment of a typical bookstore and you being the agent looking to buy a book on AI, give a PAGE/PEAS description of an agent for the environment. Characterize the environment as being accessible, deterministic, episodic, static, and continuous or not. What agent architecture is best for this domain ?

Bookstore-related Percepts :
    Book Titles, Book Authors, Book Subjects, Book Prices
    Bookstore Personnel
Agent-related Percepts :
    Amount of Money Available, Amount of Money Designated for the Book
    Urgency Level for Getting the Book
Actions :
    Read Book's Title, Read Author's Name, Read Book's Price
    Read Book's Table of Contents
    Ask for a Clarification on Book's Subject
    Compare Book's Price to the Money Available
    Compare Book's Price to the Money Deignated for the Book
    Make a Book Choice
Goal :
    Buy an adequate AI book for the best price possible not exceeding the money designated or money available.
Environment :
    Bookstore with :
        Other Shoppers
        Bookstore Personnel
        Book Stands

   The environment is only partially accessible (complete state of the environment is not known - book availabilities, for instance). It is deterministic (the agent's actions fully determine next state of the affairs. Of course, this assumes that the agent fully understands what the agent read, as well the clarifications provided by the personnel (!!???!!!)). The environment is also episodic (the agents experience is divided into episodes of inquiring about or thinking about book -related issues). The environment is dynamic because the environment (book availability) changes while the agent is deliberating. Finally, the environment is continuous time-wise, because the time spans through the set of continuous values.
 

   (25 (=8+9+8)  points)

2.    Give the initial state, goal test, operators, and path cost function for each of the following. There are several possible formulations for each problem, with varying levels of detail. The most important aspects of your formulation should be its preciseness and coherence so that they could be implemented.

    You are to schedule cars at a car workshop for inspections. The workshop has four mechanics on duty and the cars are parked at the workshop's parking lot. Designate a mechanic to a car in such a way that no two adjacent cars go to the same mechanic.

Initial State :      No cars have a mechanic assigned to them.
Goal Test :        All cars have a mechanic assigned, and no two adjacent cars are to be inspected by a same mechanic.
Operators :        Assign a mechanic to a car.
Path Cost :        Number of assignments.
 

   (25 points)

3.    Represent the following sentences in First Order Logic using a consistent vocabulary (which you must first define) :

    (a)    There is student who programs for all freshmen who don't program themselves.

$x ( Student(x) && ( "y ( (Freshman(y) &&  ! Programs(y)) ==> ProgramsFor(x, y) ) )

    (b)    There is a student who doesn't help anybody except the students who he likes.

$x ( Student(x) && "y (Helps(x, y) <==> (Student(y) &&  Likes(x, y)))

    (c)    Not all professors who have a good research teach well.

! "x ( Prof(x) && GoodResearch(x) ==> TeachWell(x) )

    (d)    Not all professors who teach well have a good research.

! "x ( Prof(x) && TeachWell(x) ==> GoodResearch(x) )
 

   (25 (=12+13)  points)

4.    Convert the following First Order Logic sentence into its Conjunctive Normal Form :

    "x ( Prepared(x) <==> $t ( Training(t) & Prepares(t,x) ) )

( ! Prepared(x) V Training (Trainer(x))) &&
( ! Prepared(x) V Prepares(Trainer(x), x))  &&
( ! Training(z) V ! Prepares(z, x) V Prepared(x) )
 

   (25 points)

6.    For each of the following atomic sentences give the most general unifier, if it exists :

    (a)    Has(y,H(C,D)),                       Has(H(x,x), y)

DOESN'T EXIST (y/H(x,x) and y/H(C,D), so x would have to be C and D at the same time).

    (b)    Loves(Mother(y),y)              Loves(x,x)

DOESN'T EXIST (x / Mother(y),    y / x / Mother(y) ==> x / Mother(Mother(y)) as well).
 

   (25 (=12+13)  points)

7.

    The following is a knowledge base (its sentences numbered and described by Horn Clauses) :

(I)
 
 Pat is a pig. 1.  Pig(Pat)
Steve is slimy.  2. Slimy(Steve)
Steve creeps. 3. Creeps(Steve)
Whoever is slimy and creeps is a slug. 4. ("x) ( Slimy(x) & Creeps(x)  ==> Slug (x) )
A pig is faster than a slug. 5. ("y)("z) ( Pig(y) & Slug(z) ==> Faster (y, z) )

Provide a proof that Pat is faster than Steve . In the proof, for each step indicate :
    (a) the inference rule being used,
    (b) the unifiers being applied,
    (c) the sentences the rule is being applied to, and
    (d) the sentence derived by the rule (number it, as well)

(AI) 2 and 3 :                                Slimy(Steve) & Creeps(Steve)                                                               (6)
(UE) 4 with x / Steve :                   Slimy(Steve) & Creeps(Steve) ==> Slug(Steve)                                     (7)
(MP) 6 and 7 :                              Slug(Steve)                                                                                            (8)
(AI) 1 and 8 :                                Pig(Pat) & Slug(Steve)                                                                           (9)
(UE) 5 with y / Pat and z / Steve :  Pig(Pat) & Slug(Steve) ==> Faster(Pat, Steve)                                      (10)
(MP) 9 and 10 :                            Faster(Pat, Steve)                                                                                  (11)

   (25 points)

8.        The following is a knowledge base (its sentences numbered and described by First Order Logic clauses) :

(I)
 
 Early rising people have more time during a day 1.  EarlyRising(x)  ==>
                                TimeAboundant(x)
Late rising people are relaxed people 2. ! EarlyRising(x)  ==>
                               Relaxed(x)
People with more time at their hands are achieving people 3. TimeAboundant(x)  ==>
                               Achieving(x)
Relaxed people are achieving people 4. Relaxed(x)  ==>
                              Achieving(x)

Provide a proof for Achieving(Joe). In the proof, for each step indicate :
    (a) the inference rule being used,
    (b) the unifiers being applied,
    (c) the sentences the rule is being applied to, and
    (d) the sentence derived by the rule (number it, as well)

We will prove Achieving(Joe) by proving that the knowledge base and the negation of Achieving(Joe) yield a contradiction.

The knowledge base in CNF :
 
 
 Early rising people have more time during a day 1.  ! EarlyRising(x)  V
                                TimeAboundant(x)
Late rising people are relaxed people 2. EarlyRising(x)  V
                               Relaxed(x)
People with more time at their hands are achieving people 3. ! TimeAboundant(x)  V
                               Achieving(x)
Relaxed people are achieving people 4. ! Relaxed(x)  V
                              Achieving(x)

Negated Achieving(Joe)  in CNF :
 
 Joe is not achieving  5. ! Achieving(Joe)

(Res.)  1. and 2.                                                TimeAboundant(x) Relaxed(x)                    (6)
(Res.)  6. and 4.                                                TimeAboundant(x) Achieving(x)                 (7)
(Res.)  7. and 3.                                                Achieving(x)                                                   (8)
(Res.)  8. and 5. with x / Joe                              CONTRADICTION
 

   (25 points)