Docsity

Complementary Literals - Introduction to Artificial Intelligence - Solved Exams, Exams of Artificial Intelligence

Toggle sidebar
bg1
CS 188 Introduction to AI
Spring 2002 Stuart Russell Final Solutions
1. (12 pts.) True/False
(a) (2) False—meaning can depend on context, and some sentences are ambiguous.
(b) (2) True—HMMs are a special case of DBNs.
(c) (2) True—images are scale-invariant
(d) (2) True—a self-resolving clause contains complementary literals, each of which remains in the resolvent.
(e) (2) True—a corollary of the theorem stating that POP is sound and complete.
(f) (2) True—a positive literal is a Horn clause but is falsified by such a model.
2. (15 pts.) Logic
(a) (2) A reasonable translation is, “If two people speak the same language then they understand each other.”
One could quibble about whether this covers the case where x=y.
(b) (3) Understands(x, y) means that xunderstands y;F riend(x, y ) means xis a friend of y.
i. ∀x, y U nderstands(x, y)⇒F riend(x, y).
ii. ∀x, y, z F riend(x, y)∧F riend(y, z )⇒F riend(x, z)
(c) (5) Let the KB contain the following sentences, all Horn clauses:
A1: ∀x, y, l Speak s(x, l)∧Speaks(y , l)⇒Understands(x, y)
A2: ∀x, y, l Speak s(x, l)∧Speaks(y , l)⇒Understands(y, x)
B1: ∀x, y U nderstands(x, y)⇒F riend(x, y)
B2: ∀x, y, z F riend(x, y)∧F riend(y, z )⇒F riend(x, z)
C1: Speaks(Ann, F rench)
C2: Speaks(Bob, F rench)
C3: Speaks(Bob, German)
C4: Speaks(Cal, Ger man)
We will prove Friend(Ann, C al) using forward chaining.
•FC on A1, premises C1, C2, {x/Ann, y/Bob, l/Fre nch}, P1: U nderstands(Ann, B ob).
•FC on A1, premises C3, C4, {x/Bob, y /Cal, l/Ger man}, P2: U nderstands(Bob, C al).
•FC on B1, premise P1, {x/Ann, y/Bob}, P3: F riend(Ann, Bob).
•FC on B1, premise P2, {x/Bob, y /Cal}, P4: F riend(Bob, C al).
•FC on B2, premises P3, P4, {x/Ann, y/Bob, z /Cal}, P5: F riend(Ann, Cal ).
(d) (5) We need to show that D|=A, i.e., D∧ ¬Ayields a contradiction. The CNF KB is
Q1: ¬S(x, l)∨ ¬S(y, l)∨U(x, y )
Q2: S(A, F )
Q3: S(B, F )
Q4: (¬U(A, B)∨ ¬U(B, A))
We will prove a contradiction using resolution:
•Resolving Q1, Q2, {x/A, l/F }, gives Q5: ¬S(y, F )∨U(A, y)
•Resolving Q5, Q3, {y/B }, gives Q6: U(A, B )
•Resolving Q1, Q2, {y/A, l/F }, gives Q7: ¬S(x, F )∨U(x, A)
•Resolving Q7, Q3, {x/B}, gives Q8: U(B, A)
•Resolving Q6, Q4, { }, gives Q9: ¬U(B, A)
•Resolving Q8, Q9, { }, gives the empty clause.
1
pf3

Partial preview of the text

Download Complementary Literals - Introduction to Artificial Intelligence - Solved Exams and more Exams Artificial Intelligence in PDF only on Docsity!

CS 188 Introduction to AI

Spring 2002 Stuart Russell Final Solutions

  1. (12 pts.) True/False

(a) (2) False—meaning can depend on context, and some sentences are ambiguous. (b) (2) True—HMMs are a special case of DBNs. (c) (2) True—images are scale-invariant (d) (2) True—a self-resolving clause contains complementary literals, each of which remains in the resolvent. (e) (2) True—a corollary of the theorem stating that POP is sound and complete. (f) (2) True—a positive literal is a Horn clause but is falsified by such a model.

  1. (15 pts.) Logic

(a) (2) A reasonable translation is, “If two people speak the same language then they understand each other.” One could quibble about whether this covers the case where x = y. (b) (3) U nderstands(x, y) means that x understands y; F riend(x, y) means x is a friend of y. i. ∀x, y U nderstands(x, y) ⇒ F riend(x, y). ii. ∀x, y, z F riend(x, y) ∧ F riend(y, z) ⇒ F riend(x, z) (c) (5) Let the KB contain the following sentences, all Horn clauses: A1: ∀x, y, l Speaks(x, l) ∧ Speaks(y, l) ⇒ U nderstands(x, y) A2: ∀x, y, l Speaks(x, l) ∧ Speaks(y, l) ⇒ U nderstands(y, x) B1: ∀x, y U nderstands(x, y) ⇒ F riend(x, y) B2: ∀x, y, z F riend(x, y) ∧ F riend(y, z) ⇒ F riend(x, z) C1: Speaks(Ann, F rench) C2: Speaks(Bob, F rench) C3: Speaks(Bob, German) C4: Speaks(Cal, German) We will prove F riend(Ann, Cal) using forward chaining.

  • FC on A1, premises C1, C2, {x/Ann, y/Bob, l/F rench}, P1: U nderstands(Ann, Bob).
  • FC on A1, premises C3, C4, {x/Bob, y/Cal, l/German}, P2: U nderstands(Bob, Cal).
  • FC on B1, premise P1, {x/Ann, y/Bob}, P3: F riend(Ann, Bob).
  • FC on B1, premise P2, {x/Bob, y/Cal}, P4: F riend(Bob, Cal).
  • FC on B2, premises P3, P4, {x/Ann, y/Bob, z/Cal}, P5: F riend(Ann, Cal). (d) (5) We need to show that D |= A, i.e., D ∧ ¬A yields a contradiction. The CNF KB is Q1: ¬S(x, l) ∨ ¬S(y, l) ∨ U (x, y) Q2: S(A, F ) Q3: S(B, F ) Q4: (¬U (A, B) ∨ ¬U (B, A)) We will prove a contradiction using resolution:
  • Resolving Q1, Q2, {x/A, l/F }, gives Q5: ¬S(y, F ) ∨ U (A, y)
  • Resolving Q5, Q3, {y/B}, gives Q6: U (A, B)
  • Resolving Q1, Q2, {y/A, l/F }, gives Q7: ¬S(x, F ) ∨ U (x, A)
  • Resolving Q7, Q3, {x/B}, gives Q8: U (B, A)
  • Resolving Q6, Q4, { }, gives Q9: ¬U (B, A)
  • Resolving Q8, Q9, { }, gives the empty clause.
  1. (14 pts.) Games

(a) (5) Here is the game tree, complete with annotations of all backed-up values. (1,4)

(2,4)

(2,3)

(1,3)

(1,2)

(3,2)

(3,4)

(4,3)

(3,1)

(2,4)

(1,4)

+

−

?

?

?

−

−

−

+

+

+

(b) (5) The “?” values are handled by assuming that an agent with a choice between winning the game and entering a “?” state will always choose the win. That is, min(–1,?) is –1 and max(+1,?) is +1. If all successors are “?”, the backed-up value is “?”. (c) (5) Standard minimax is depth-first and would go into an infinite loop. It can be fixed by comparing the current state against the stack, and if it occurs on the stack then returning a “?” value. Propagation of “?” values is handled as above. It does not always work perfectly, because some games have terminal states with differing values (e.g., draws or wins of different degrees). It is not clear how to handle these in the propagation process. There are more complex methods that determine whether the node has a well-determined value (as in this example) or is really an infinite loop in that both players prefer to stay in the loop (or have no choice). In such a case, the loop state can be labelled as a draw.

  1. (12 pts.) MDPs and Games

(a) (5) UA(s) = R(s) + maxa

a P^ (s

′|a, s)UB(s′) and UB (s) = R(s) + mina^ ∑ a P^ (s

′|a, s)UA(s′) (b) (5) We simply turn each of them into a Bellman update and apply them in alternation, applying each to all states simultaneously. (1,4) (2,4) (3,4) (1,3) (2,3) (4,3) (1,2) (3,2) (4,2) (2,1) (3,1) UA 0 0 0 0 0 +1 0 0 +1 –1 – UB 0 0 0 0 –1 +1 0 –1 +1 –1 – UA 0 0 0 –1 +1 +1 –1 +1 +1 –1 – (c) (2) The utility vector for one player is the same as the previous utility vector for the same player (i.e., two steps earlier). (Note that typically UA and UB are not the same in equilibrium.)

  1. (22 pts.) Statistical learning, Bayes nets

(a) (2) The probability of a positive example is π and of a negative example is (1 − π), and the data are independent, so the probability of the data is πp(1 − π)n (b) (3) We have L = p log π + n log(1 − π); if the derivative is zero, we have ∂L ∂π

p π

n 1 − π so the ML value is π = p/(p + n), i.e., the proportion of positive eamples in the data. (c) (2) This is the “naive Bayes” probability model described in AIMA2e Ch. 13.

X 1 X (^) k

Y