HWCS 4341 Homework #2 Solutions

Problem 2:

Exercise 4.5

Level 1:  S
Level 2:  A  D
Level 3:  B  E
Level 4:  C  F
Level 5:  G  C
Level 6:  G--goal node

Problem 3:

Exercise 7.2.

Part1.
Note: S--succeed, F--fail;
   *Serve Bond's Champagne -- F
    B1 expensive wine is indicated -- F
        B9 wine is indicated -- F
            B11 guest is sophisticated -- S
           guest should be impressed -- F

   *Serve Chateau Earl of Bartonville Red -- F
    B2 expensive wine is indicated -- F
        B9 wine is indicated -- F
            B11 guest is sophisticated -- S
           guest should be impressed -- F

   *Serve Toe Lakes Rose -- F
    B4 cheap wine is indicated  -- S
        B10 wine is indicated -- S
            B11 guest is sophisticated -- S
       entree is unknown  -- F

   *Serve Honest Henry's Apple Wine -- S
    B3 cheap wine is indicated -- S
        B10 wine is indicated -- S
            B11 guest is sophisticated -- S
       entree is chicken  -- S
       guest is not well liked -- S

Part2.
    Yes, with different facts: 
    *It is not New Year's Eve, 
    *Guest is impressed, 
    *Guest is sophisticated, 
    *Entree is Mexican steak. 

Part3.
    No, carrot juice will never be served, since Glop will always be
    tested and satisfied first providing the same facts. 

Problem 4:

Exercise 8.2.

Part 1.
    Fly Rule
        If ?x is-a bird
           ?x is-not-a penguin
           ?x is alive
        then ?x flies

    Bird Rule
        If ?x flies
           ?x is-not-a bat
           ?x is alive
        then ?x is-a bird

Part 2.
    The recast rules will provide careful analysis, while the rules in
    ask-questions-later mode will give a rapid response. 

Problem 7:

  1. Explain why the backward chaining system picks Ostrich and not Penguin.

    The backward chainiing system stops when the it satisfies any hypothesis. The Ostrich hypothesis is confirmed before the Penguin hypothesis can be tested.

  2. Using the same facts and rules, under what circumstances (different rule order, different ordering of clauses, etc.) would backward chaining pick Penguin?

    If the hypotheses were ordered with Penguin first, then Penguin would be selected.

  3. How could you modify the rules in forward chaining to ensure that an animal is identified as only a single species, even though it may satisfy the rules for more than one species?

    One could modify the rules so that if it is known that the bird is a penguin, then it is not allowed to be an ostrich, etc. For example, modify the Penguin rule to be

    IF
      ((? animal) is a bird)
      ((? animal) does not fly)
      ((? animal) swims)
      ((? animal) is black and white)
      (not ((? animal) is a ostrich))
    THEN ((? animal) is a penguin)
    
    if NOT were defined. Another way to proceed is to replace the IS-A statements with SPECIES facts. The species rules could check to be sure that there was not already a species. For example,
    IF
      ((? animal) is a bird)
      ((? animal) does not fly)
      ((? animal) swims)
      ((? animal) is black and white)
      (not ((? animal) species (? anything)))
    THEN ((? animal) species penguin)
    
    This way, if the species is already known, the rule will not fire.

[CS 4341]CS 4341 Home Page

HWCS 4341 Homework

[CS] WPI CS Home Page

[WPI] WPI Home Page 


CS 4341 Staff (cs4341_ta@cs.wpi.edu)
©2003 Michael A. Gennert