Final Solutions
Final Solutions
Instructions:
1. Duration: 120 Minutes
2. Date: 12/14/2010 from 7:00 – 9:00 pm
3. Maximum credits/points for this midterm: 100 points
4. 5 questions.
5. Credits/points for each question are indicated in the brackets [ ] before the question.
6. This exam is open book and open notes. However, no sharing of reference materials
or books will be permitted. Each person must have his or her own books and -
reference materials. No cell phones or laptops will be allowed.
7. You are expected to adhere to the Academic Integrity code
PROBLEM
MAXIMUM ACTUAL
#
1 20
2 20
3 20
4 10
5 30
TOTAL 100
1) [20 Points] Inference in First Order Logic
Consider the following 5 facts that are added to a knowledge base in turn. Hobbit, Hero,
Hafling are predicates, FinalBattle is a function, Frodo and Mount Doom are
constants, and x and y are variables that are universally quantified.
a) 8 Points
Show how forward chaining can be used to infer whether Frodo is a Hero (i.e.
Hero(Frodo)). Describe each step of the inference in detail in terms of unifications, rule
firings, etc.
Rule 4: Hafling(Frodo)
****Akshay. You see above that Rule 4 and Rule 1 are facts that are given. So these
Rules can be put in any order, but they obviously MUST come before the rules they
imply. For example, Rule 1 at some point has to come before Rule 3. So another
solution might be Rule 1, Rule 4, Rule 3, Rule 2 etc etc.
b) 8 Points
Show how backward chaining can be used to infer whether Frodo is a Hero (i.e.
Hero(Frodo)). Describe each step of the inference in detail in terms of unifications, rule
firings, etc
******AKSHAY. It’s possible they might write down a table instead. That is okay,
but just make sure their rule firings follow the graph above.
c) 4 Points
Consider the Prolog list given below. What is the result after the following Prolog query
is executed?
X = [Frodo]
Y = [Bilbo]
Z = [Gollum, Meriadoc, Peregrin]
2) [20 Points] CNF and Resolution with FOL
a) 10 Points
Convert the following FOL formula to CNF showing all the steps involved.
Determined(Mario)
¬ Determined(x) v Marry(x, Princess)
¬ Practice(x) v Defeat(x, y)
¬ Defeat(x, Bowser) v ¬ Marry(x, Princess) v Joyful(x)
¬ Determined(x) v Defeat(x, y)
¬ Practice(Mario)
Please demonstrate how one can prove Joyful(Mario) using resolution as the inference.
Show all details of unification needed for each step of the inference process. (You may
assume that Mario, Princess, and Bowser are constants, and x and y are variables).
3) [20 Points] Planning in STRIPS
Consider the following block world shown below. The puzzle has four blocks labeled A,
B, C and D and two holes. Initially, the blocks are positioned as shown with block D in
one of the holes. In order to be moved, a block must be “clear” meaning there is not
another block on top of it. The following rules apply:
Only one block may be moved at a time
Blocks can be moved onto the table, onto another block, or in/out
of a hole
A block may be placed inside a hole if there is not another block
already inside
a) 6 Points
Write down the description of the state of the blocks as shown below:
PRECONDITIONS:
Empty(Hole2)
¬ Hole2(X)
Clear(X)
EFFECTS:
Clear(X)
¬ Empty(Hole2)
Hole2(X)
c) 7 Points
Write down the definition of a STRIPS operator MoveOntoA that moves a block that
MUST be inside Hole 1 and places it on top of block A.
PRECONDITIONS:
Hole1(X)
¬ Empty(Hole1)
Clear(X)
Clear(A)
EFFECTS:
Empty(Hole1)
Clear(X)
¬ Clear(A)
On(X, A)
Consider using a partial-order planning system for making an omelette. Assume that in
this domain there exist the following three STRIPS operators:
Suppose we start with the partial plan shown in the following figure. The partial plan
currently contains no ordering constraints other than those implied by the partial order of
the partial plan.
Start
At(Home) Sells(Safeway,Eggs)
Go(Home,Safeway)
At(Safeway)
Buy(Eggs,Safeway)
Have(Eggs)
Make(Omelette)
Have(Omelette)
Finish
Describe the threats to any of the causal links shown in this partial plan, if any. Show
how you would resolve the conflicts in each case (Feel free to propose adding operators if
you feel you need to). If you see no threats to causal links, justify your answer in terms of
each causal link.
The threat is: Go(Home, Safeway) deletes the At(Home) which is the prediction of
Make(Omelette). The resolution is to add the operator Go(Safeway, Home) before
Make(Omelette).
5) [30 Points] Uncertainty
5 Points
1. What is the probability of CollegeGraduate, namely P(CollegeGraduate)?
5 Points
2. What is the probability P(Honest)?
5 Points
3. What is the probability P(¬CollegeGraduate | Smart, Honest)?
So then…
P(C) = 0.5
C P(E) = 0.1
A E
P(A) = 0.2