• Aucun résultat trouvé

CS 188 Introduction to AI

N/A
N/A
Protected

Academic year: 2022

Partager "CS 188 Introduction to AI"

Copied!
3
0
0

Texte intégral

(1)

CS 188 Introduction to AI

Spring 2005 Stuart Russell Final Solution

1. (12 pts.) Some Easy Questions to Start With (a) (2)False. DBNs can include continuous variables.

(b) (2)True. The two clauses resolve to giveQ(F(F(z))), which entailsQ(F(F(G(A)))) for anyG,A.

(c) (2)False. αmight just be consistent withβ, e.g.,α= (A∨B) andβ= (A∨ ¬B).

(d) (2)True. In this case,αeither specifies a complete model (in which caseβ’s truth value is fixed by it) or αcontains contadictory unit clauses, in which case it is equivalent toF alseand entailsβ anyway.

(e) (2) True. The states and actions are identical (except goals map to terminal states in the MDP), the transition model is deterministic, and the reward function is just minus the cost function.

(f) (2)True. It helps to overcome local ambiguity in the signal, just as with speech.

2. (10 pts.) Propositional Logic and CSPs (a) (2)

X1 X2 X3 X4

(b) (2) (v)n+ 1 solutions. Once anyXi is true, all subsequentXjs must be true. Hence the solutions are i falses followed byn−i trues, fori= 0, . . . , n.

(c) (2) (iii) quadratic inn. This is somewhat tricky. Consider what part of the complete binary tree is explored by the search. The algorithm must follow all solutions sequences, which themselves cover a quadratic-sized portion of the tree. Failing branches are all those trying af alseafter the preceding variable is assigned true. Such conflicts are detected immediately, so the tree looks like this (conflicts shown as squares):

(d) (1)True. Forward-chaining algorithm given in book.

(e) (1)True. Directed arc-conistency algorithm given in book.

(f) (2)False. Horn-form SAT problems do not necessarily map into tree-structured CSPs. (This was stated in lecture.)

3. (20 pts.) First-Order Logicfollowing vocabulary: IsA(x, c) means that object xis a member of product categoryc;W eight(x, w) means that objectxweighswgrams;SKU1286 is the name of a particular category of aluminium bolts.

(a) (2)∀x IsA(x, SKU1286) ⇒ W eight(x,18).

(b) (2) (ii) linear inm. The query unifies with the RHS of allmrules, so allmpremises must be tested.

(c) (2) (i) constant time. The asserted fact unifies with only one rule premise.

(d) (2) (iii) linear inn. All nproperties will be asserted for the object.

(e) (3)IsA(x, c)∧IsA(y, c)∧W eight(x, w) ⇒ W eight(y, w).

It is not necessary to forcex andy to be distinct: the case wherex=y is a tautology.

1

(2)

(f) (6) The proof looks like this. (Can do as refutation also.)

~I(x,c) v ~I(y,c) v ~W(x,w) v W(y,w) I(T,S) I(B,S) W(T,18)

~I(y,S) v ~W(T,w) v W(y,w)

~W(T,w) v W(B,w)

W(B,18) {x/T,c/S}

{y/B}

{w/18}

(g) (3) (i) constant time. Now the query matches just one rule, and each premise can be solved in constant time by lookup.

4. (20 pts.) Bayesian networks

(a) (3) (iii). The equation describes absolute independence of the three genes, which requires no links among them.

(b) (3) (i) and (ii). Theassertionsare theabsentlinks, and (iii) asserts independence of genes which contradicts the inheritance scenario.

(c) (2) (i) is best. (ii) has spurious links among theH variables, which are not directly causally connected in the scenario described. (In reality, handedness may also be passed down by example/training.)

(d) (4) Notice that thel →r andr→l mutations cancel when the parents have different genes, so we still get 0.5.

Gmother Gf ather P(Gchild=l|. . .) P(Gchild=r|. . .)

l l 1−m m

l r 0.5 0.5

r l 0.5 0.5

r r m 1−m

(e) (4) This is a straightforward application of conditioning:

P(Gchild=l) = X

gm,gf

P(Gchild=l|gm, gf)P(gm, gf)

= X

gm,gf

P(Gchild=l|gm, gf)P(gm)P(gf)

= (1−m)x2+ 0.5x(1−x) + 0.5(1−x)x+m(1−x)2

= x2−mx2+x−x2+m−2mx+mx2

= x+m−2mx

(f) (4) Equilibrium means thatP(Gchild=l) (the prior, with no parent information) must equalP(Gmother=l) andP(Gf ather=l), i.e.,

x+m−2mx=x, hencex= 0.5.

But few humans are left-handed (x ≈0.08 in fact), so something is wrong with the symmetric model of inheritance. The “high-school” explanation is that the “right-hand gene is dominant,” i.e., preferentially inherited, but current studies suggest also that handedness is not the result of a single gene and may also involve cultural factors. See http://www.well.ox.ac.uk/˜clyde.

5. (20 pts.) Learning

(a) (4) There are many possible trees. Here is one.

2

(3)

A

2 > 15

A

1 > 4

F T

F T

false

true false

(b) (2) With 2 examples of each kind, the initial entropy is 1 bit. After the test, we have one subset with counts 0,1 (hence zero entropy) and one subset with counts 2,1. Hence the information gain is

1−((1/4)·0 + (3/4)(−1/3 log(1/3)−2/3 log(2/3)) = 1 + (1/4) log(1/3) + (1/2) log(2/3)≈0.3113bits.

(c) (4) Suppose the split gives two buckets withp1, n1and (p−p1),(n−n1) positive and negative examples respectively. Information gain is increased by moving these ratios towards 0 or 1. If the split is between two examples with the same classification, we can move it left or right to improve the left bucket by increasing or decreasingp1 (if they are positive) orn1(if they are negative) as desired. This will also have the desired effect on the counts in the right bucket.

(d) (2) False. E.g., a test-once tree with one attribute creates exactly two regions on the real line, whereas the data may alternate between +ve and -ve more than once.

(e) (4) Yes. A test-many tree can define arbitrarily small hyper-rectangles, each containing exactly one example.

(f) (2) (i) (iii) (iv). Although (ii) can be classified, it requires many thin horizontal or vertical strips. The problem is that every split must be axis-parallel.

(g) (2) (i) (ii). The other two are not linearly separable.

6. (18 pts.) Natural language

(a) (6) (i) (iii). The grammar cannot generate (ii) because the modifier must be “red red rose”, which is neither Adjective* nor Noun*.

(b) (4)

First she watered the rose then it smelled

Pronoun Verb Determiner Noun Pronoun IntransitiveVerb

VP

NP NP

S

Modifier NP VP

S

S

(c) (2) (iv) 4. Each “violet violet” modifier can be either Adjective* or Noun*, and 2 times 2 = 4.

(d) (1) (i) lexical. It arises from multiple meanings of “violet”.

(e) (4) Again, several possibilities. The most obvious seems to be S →first NP VP ThenClause+

ThenClause→then NP VP

(f) (1)False. A word can have multiple meanings in the same syntactic category; a pronoun reference can be ambiguous; etc.

3

Références

Documents relatifs