Computer Science, CS26210: The Artificial Intelligence Toolbox -
Part II: Programming in An Uncertain World , SPECIAL PAPER

Time allowed: 2 hours
Calculators are permitted, provided they are silent, self-powered, without
communications facilities, and incapable of holding text or other material that
could be used to give the candidate an unfair advantage. They must be made
available on request for inspection by invigilators, who are authorised to remove
any suspect calculators.
Answer THREE from FIVE questions.

Answer ONE question from Section A, ONE question from Section B.

All questions carry equal marks.

                                SECTION A
                  Answer at least ONE from TWO questions

1. This question is about the Prolog language.

  a) Given the following Prolog facts, in this order,

        parent(’Ethel,’ ’Chuffy’).
        parent(’Ethel,’ ’Axel’).
        parent(’Ethel’, ’Eddy’).

      state the first answer that Prolog would give to each of these queries:

        ?-   parent(’Ethel’, ’Chuffy’).
        ?-   parent(X, ’Axel’).
        ?-   parent(’Ethel’, X).
        ?-   parent(X, Y).

                                                                         [5 marks]
  b) Assuming that you use the ’;’ method of getting further answers until
     failure, what would the full answers for part (a) be, in order?            [8]
  c) Given the extra fact,
        parent(’Gubby’, ’Ethel’).
      write down a grandchild() relation and explain how you could use it to
      ask Prolog about the relationships between Gubby and the people defined
      in part (a) of this question.                                         [4]

                                   Page 1 of 6                         Turn over
d) Using recursion, define a relation called younger() that is true when a
   person X is a younger descendant of a person Y. Explain how you intend
   recursion to work in this context, and how Prolog would fully answer the
   question, ?- younger(X,Y). for the facts in parts (a) and (c) above. [10]
e) Discuss whether this is the most efficient way of searching for younger
   family members.                                                         [6]

                               Page 2 of 6                        Turn over
2. This question is about using Prolog to implement a basic AI concept, and
   requires two short essay answers. The following code is taken from Bratko’s
   book. It is a program for traversal of a tree by depth-first search.

  solve(Node, Solution) :-
    depthfirst([], Node, Solution).

  depthfirst(Path, Node, [Node|Path]) :-
  depthfirst(Path, Node, Solution) :-
    edge(Node, Node1),
    depthfirst([Node|Path], Node1, Solution).

  edge(1, 2).             %            1
  edge(1, 3).             %           / \
  edge(2, 4).             %       2         3
  edge(3,5).              %       |         |
  edge(5,6).              %       4         5
  goal(6).                %                 |
                          %                 6 <- goal

  ?- solve(1, Solution).
  Solution = [6, 5, 3, 1]

  a) Describe, in appropriate detail, how the program works, including a full
     trace of the edges/nodes through which the program passes. Be sure to
     explain the recursive nature of this program.                           [17]
  b) The simple form of depth-first search has a known problem that can be
     illustrated as follows. If we were to add two new edge facts, ‘edge(5,4)’
     and ‘edge(4,3)’, in that order, immediately before the ‘edge(5,6)’ fact,
     what would happen when we tried to run the code, and how does this
     illustrate the problem with depth-first search? Explain, problem and
     solution to the problem with both code and description, and show what
     the results of your approach would be.                                  [16]

                                  Page 3 of 6                        Turn over
                                  SECTION B
                  Answer at least ONE from THREE questions

3. This question explores your understanding of knowledge representation and
   expert systems.

  a) (i)    Discuss the purpose of knowledge representation in AI, and the
            different assumptions you are making about the world when you
            define crisp, fuzzy and probabilistic representations of a problem. [7]
      (ii) Explain the advantages and disadvantages of each type of
            representation in part (i) of this question.                        [6]
      (iii) Discuss, in appropriate detail, whether or not it would be a good idea
            to combine all three representation approaches in part (i) of this
            question, in some unified way, so that we could always use that
            representation, whatever the problem.                               [4]
  b) Imagine that you have just had a medical test for a nasty disease. The
     doctor tells you that the test result indicates you have the disease. Test
     always detects the disease when it is present, but falsely reports it is
     present with an error rate of 1 in 20. Does this error rate mean that you
     have a 95% chance of having the disease? Briefly explain your answer. [2]
  c) If the doctor then tells you that of the people tested only 1% actually have
     the disease. Use this information to estimate your chance of having the
     disease.                                                                  [6]
  d) Suppose high temperatures are caused by the disease in 50% of cases, the
     chance of getting the disease is 1 in 50,000, and the chance of getting a
     high temperature is 1 in 20. Use Bayes rule to calculate the chance of
     having the disease if you have a high temperature. Bayes rule is:

                           p(B|A) = p(A|B)p(B)/p(A)


                                   Page 4 of 6                         Turn over
4. The medical expert system MYCIN employs a method of inference based on
   certainty factors (CFs).

  a) Given the fact that you will develop a medical expert system, will you
     adopt the certain factor theory to deal with the uncertain reasoning in
     your medical expert system? Explain your answer.                          [6]
  b) What is the domain of the certainty factor? What conclusion can we draw
     about a hypothesis when its certainty factor approaches the extremes and
     centre of the certainty factor’s domain?                                  [6]
  c) The following table (Table c) lists some uncertain terms and their
     corresponding certainty factors. A fact is given about the description of
     the sky. A rule is given about the association of the weather forecast and
     the sky description. Both the rules and facts are expressed using uncertain
     terms in the table.
                  Table c: Uncertain terms and their interpretation
                              Term           Certainty factor
                          Definitely not            -1.0
                      Almost certainly not         -0.8
                           Probably not            -0.6
                            Maybe not              -0.4
                            Unknown           -0.2 to +0.2
                              Maybe               +0.4
                             Probably             +0.6
                         Almost certainly         +0.8
                            Definitely             +1.0
      RULE: IF the sky is clear, THEN the forecast is almost certainly sunny.
      FACT: The sky is probably clear.
     Answer the following questions:
     (i) Represent the given rule and fact in the style that MYCIN uses. To
           answer this question, you may need to consult the given table
           (Table c) describing the uncertain terms and their corresponding
           certainty factors.                                                    [4]
     (ii) Given the above rule and fact, use the certainty factor theory to
           calculate the certainty factor of the conclusion “the forecast is sunny”.
     (iii) If the conclusion “the forecast is sunny ” derived in the question (ii)
           above is presented using the uncertain terms described in Table c,
           then what is the final weather forecast?                               [3]
     (iv) Discuss what benefits Table c brings in the process of inferring the
           weather forecast above.                                               [6]
     (v) If the premise of a rule consists of a conjunction of a large number of
           different facts, then what happens to the final certainty factor of the
           premise of the rule? How would you avoid this problem in certainty
           factory theory?                                                       [4]

                                   Page 5 of 6                          Turn over
5. This question is about fuzzy sets and logic theory.

       a) Consider the following two facts describing an income (high and low), and
          two rules concluding the degree of risk in issuing a credit card to a
          customer by a bank:
                 1. IF income is high, THEN risk is low
                 2. IF income is low, THEN risk is high
            The following figure (Figure a) depicts the fuzzy sets about low income,
            high income, low risk, and high risk. Assuming a customer has an income
            of 22.5k, answer the following questions. Reading values off the graphs can
            be approximate. Show the steps leading to the final results.

           Membership                                                  Membership

1.0                                                            1.0
0.75                                                           0.75
0.5         Low                     High                       0.5       Low              High
0.25                                                           0.25

       0     5      10 15   20   25 30     35 40   Income(k)     −15      20    40   60   80     100   Risk(%)

                            Figure a : Membership functions for different fuzzy sets.
            (i)      What is the membership value of an income 22.5k relative to the fuzzy
                     sets low income and high income respectively?                         [3]
            (ii)     What is the membership value of an income 22.5k that belongs to
                     both the fuzzy sets low income and high income?                       [2]
            (iii)    What is the membership value of an income 22.5k that does not
                     belong to the fuzzy set low income?                                   [2]
            (iv)     What risk (%) will the bank take if it issues a credit card to the
                     customer?                                                             [9]
            (v)      If the risk is higher than 65%, then the bank will not issue the credit
                     card to any customer. In this case, will the bank issue a credit card to
                     a customer with an income of 22.5k? Explain your answer.              [2]
       b) What main strengths do fuzzy sets and logic theory have for solving
          problems.                                                                                         [7]
       c) Briefly discuss the main difference between certainty factory theory on the
          one hand and fuzzy sets and logic theory on the other. Include and
          explanation of how they represent the facts and rules in knowledge based
          systems.                                                                [8]

                                                    Page 6 of 6

To top