Docsity

Unification - Artificial Intelligence - Solved Quiz, Exercises of Artificial Intelligence

Toggle sidebar
bg1
CS-271, Intro to A.I. — Quiz#4 — Fall Quarter, 2011 — 20 minutes
YOUR NAME AND EMAIL ADDRESS:
YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT:
1. (28 pts total, 7 pts each) Probability.
1a. (7 pts) Write down the definition of P(H | D) in terms of P(H), P(D), P(H D), and P(H D).
P(H | D) = P(H D) / P(D)
1b. Write down the expression that results from applying Bayes' Rule to P(H | D).
P(H | D) = P(D | H) P(H) / P(D)
1c. Write down the expression for P(H D) in terms of P(H), P(D), and P(H D).
P(H D) = P(H) + P(D) − P(H D)
1d. Write down the expression for P(H D) in terms of P(H), P(D), and P(H D).
P(H D) = P(H | D) P(D)
2. (42 pts total, 7 pts each) Unifiers and Unification.
Write the most general unifier (i.e., the MGU) of the two terms given, or “None” if no
unification is possible. Write your answer in the form of a substitution as given in your
book, e.g., {x / John, y / Mary, z / Bill}. The first one is done for you as an example.
2a. UNIFY( Knows( John, x ), Knows( John, Jane ) ) { x / Jane }
2b. UNIFY( Knows( John, x ), Knows( y, Jane ) ) { x / Jane, y / John }
2c. UNIFY( Knows( y, x ), Knows( John, Jane ) ) { x / Jane, y / John }
2d. UNIFY( Knows( John, x ), Knows( y, Father (y) ) ) { y / John, x / Father (y) }
2e. UNIFY( Knows( John, F(x) ), Knows( y, F(F(z)) ) ) { y / John, x / F (z) }
2f. UNIFY( Knows( John, F(x) ), Knows( y, G(z) ) ) None
2g. UNIFY( Knows( John, F(x) ), Knows( y, F(G(y)) ) ) { y / John, x / G (y) }
**** TURN PAGE OVER. QUIZ CONTINUES ON THE REVERSE ****
It is OK if you substituted some constants for variables, as long as
the final result of all substitutions makes the terms syntactically
identical. For example, { y / John, x / Father (John) } is OK for 2.d.
You do not get
partial credit
for { y / John }
because the
unification fails
and the terms
cannot be
made identical.
pf2

Partial preview of the text

Download Unification - Artificial Intelligence - Solved Quiz and more Exercises Artificial Intelligence in PDF only on Docsity!

CS-271, Intro to A.I. — Quiz#4 — Fall Quarter, 2011 — 20 minutes

YOUR NAME AND EMAIL ADDRESS:

YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT:

1. (28 pts total, 7 pts each) Probability. 1a. (7 pts) Write down the definition of P(H | D) in terms of P(H), P(D), P(H D), and P(H D).

P(H | D) = P(H D) / P(D)

1b. Write down the expression that results from applying Bayes' Rule to P(H | D).

P(H | D) = P(D | H) P(H) / P(D)

1c. Write down the expression for P(H D) in terms of P(H), P(D), and P(H D).

P(H D) = P(H) + P(D) − P(H D)

1d. Write down the expression for P(H D) in terms of P(H), P(D), and P(H D).

P(H D) = P(H | D) P(D)

2. (42 pts total, 7 pts each) Unifiers and Unification. Write the most general unifier (i.e., the MGU) of the two terms given, or “None” if no unification is possible. Write your answer in the form of a substitution as given in your book, e.g., { x / John, y / Mary, z / Bill }. The first one is done for you as an example.

2a. UNIFY( Knows( John, x ), Knows( John, Jane ) ) { x / Jane }

2b. UNIFY( Knows( John, x ), Knows( y, Jane ) ) { x / Jane, y / John }

2c. UNIFY( Knows( y, x ), Knows( John, Jane ) ) { x / Jane, y / John }

2d. UNIFY( Knows( John, x ), Knows( y, Father (y) ) ) { y / John, x / Father (y) }

2e. UNIFY( Knows( John, F(x) ), Knows( y, F(F(z)) ) ) { y / John, x / F (z) }

2f. UNIFY( Knows( John, F(x) ), Knows( y, G(z) ) ) None

2g. UNIFY( Knows( John, F(x) ), Knows( y, F(G(y)) ) ) { y / John, x / G (y) }

**** TURN PAGE OVER. QUIZ CONTINUES ON THE REVERSE ****

It is OK if you substituted some constants for variables, as long as the final result of all substitutions makes the terms syntactically identical. For example, { y / John, x / Father (John) } is OK for 2.d.

You do not get partial credit for { y / John } because the unification fails and the terms cannot be made identical.

3. (30 pts total) Bayesian Networks.

Consider the following Bayesian Network. Variables A-D are Boolean:

B C P(D=true | B, C)

false false 0.

false true 0.

true false 0.

true true 0.

3.a. (5 pts) Use the chain rule to factor the full joint probability distribution over these

variables into a product of conditional probabilities, ignoring conditional independence

from the figure. Factor out the conditional probability of D first, C second, etc.

P(A, B, C, D) = P(D | C, B, A) P(C | B, A) P(B | A) P(A)

3.b. (15 pts) Use the structure of the network to eliminate irrelevant variables from 3.a

based on conditional independence, giving the minimum equivalent expression.

P(A, B, C, D) = P(D | C, B) P(C | B, A) P(B) P(A)

3.c. (10 pts) Substitute probabilities from the network into your equation 3.b to answer

the query: What is the probability that all four of these Boolean variables are false?

Here, the notation ¬A abbreviates A=false.

P(¬A, ¬B, ¬C, ¬D) = P(¬D | ¬C, ¬B) P(¬C | ¬B, ¬A) P(¬B) P(¬A)

A B P(C=true | A, B)

false false 0.

false true 0.

true false 0.

true true 0.

A

D

C

P(A=true) = 0.2 B P(B=true) =^ 0.

It is OK if you left this as the product of the four numbers, without multiplying them out to get the final answer. as long as they are the correct four numbers.