Docsity

Biconditional - Artificial Intelligence - Solved Exam, Exams of Artificial Intelligence

Toggle sidebar
bg1
1
CS-271, Intro to A.I. — Final Exam — Fall Quarter, 2011
1. (1 pt) NAME AND EMAIL ADDRESS:
YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT:
The exam will begin on the next page. Please, do not turn the page until told.
When you are told to begin the exam, please check first to make sure that you
have all ten pages, as numbered 1-10 in the bottom-left corner of each page.
The exam is closed-notes, closed-book. No calculators, cell phones, electronics.
Please clear your desk entirely, except for pen, pencil, eraser, an optional blank
piece of paper (for optional scratch pad use), and an optional water bottle.
This page summarizes the points available for each question so you can plan your time.
1. (1 pt) Name and email address.
2. (10 pts total, -2 pts each error or wrong step, but not negative) FOPC.
3. (10 pts total) Decision tree learning.
4. (10 pts total, 1 pt each) Machine Learning concepts.
5. (10 pts total) Naïve Bayes Classifier Learning.
6. (5 pts total, -1 pt each wrong answer, but not negative) Search Properties.
7. (5 pts total, 1 pt each) Machine Learning.
8. (9 pts total, 1 pt each) Bayesian Networks.
9. (10 points total, 2 pts each) Constraint Satisfaction Problems
10. (10 points total, -1 each error, but not negative) FOPC to CNF.
11. (8 points total, 1 pt each) Knowledge Engineering in the genealogy domain.
12. (12 pts total, 1 pt each) Logic Concepts.
The Exam is printed on both sides to save trees! Work both sides of each page!
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Biconditional - Artificial Intelligence - Solved Exam and more Exams Artificial Intelligence in PDF only on Docsity!

CS-271, Intro to A.I. — Final Exam — Fall Quarter, 2011

1. (1 pt) NAME AND EMAIL ADDRESS:

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

The exam will begin on the next page. Please, do not turn the page until told.

When you are told to begin the exam, please check first to make sure that you have all ten pages, as numbered 1-10 in the bottom-left corner of each page.

The exam is closed-notes, closed-book. No calculators, cell phones, electronics.

Please clear your desk entirely, except for pen, pencil, eraser, an optional blank piece of paper (for optional scratch pad use), and an optional water bottle.

This page summarizes the points available for each question so you can plan your time.

  1. (1 pt) Name and email address.
  2. (10 pts total, -2 pts each error or wrong step, but not negative) FOPC.
  3. (10 pts total) Decision tree learning.
  4. (10 pts total, 1 pt each) Machine Learning concepts.
  5. (10 pts total) Naïve Bayes Classifier Learning.
  6. (5 pts total, -1 pt each wrong answer, but not negative) Search Properties.
  7. (5 pts total, 1 pt each) Machine Learning.
  8. (9 pts total, 1 pt each) Bayesian Networks.
  9. (10 points total, 2 pts each) Constraint Satisfaction Problems
  10. (10 points total, -1 each error, but not negative) FOPC to CNF.
  11. (8 points total, 1 pt each) Knowledge Engineering in the genealogy domain.
  12. (12 pts total, 1 pt each) Logic Concepts.

The Exam is printed on both sides to save trees! Work both sides of each page!

3. (10 pts total) Decision Tree Classifier Learning. You are a robot in a lumber yard, and must learn to discriminate Oak wood from Pine wood. You choose to learn a Decision Tree classifier. You are given the following examples:

3a. (2 pt2) Which attribute would information gain choose as the root of the tree?

Hardness.

3b. (4 pts) Draw the decision tree that would be constructed by recursively applying information gain to select roots of sub-trees, as in the Decision-Tree-Learning algorithm.

Answer 3c and 3d with Oak or Pine depending on how your decision tree labels them. 3c. (2 pts) What class is [Density=Light, Grain=Small, Hardness=Hard]? Pine 3d. (2 pts) What class is [Density=Light, Grain=Small, Hardness=Soft]? Oak

4. (10 pts total, 1 pt each) Machine Learning concepts. For each of the following terms on the left, write in the letter corresponding to the best answer or the correct definition on the right. The first one is done for you as an example.

A. Learning A Improves performance of future tasks after observing the world H Regression B Fixed set, list, or vector of features/attributes paired with a value I Decision Boundary C Agent learns patterns in the input with no explicit feedback K Overfitting D Agent observes input-output pairs & learns to map input to output J Cross-validation E Example input-output pairs, from which to discover a hypothesis C Unsupervised Learning F Examples distinct from training set, used to estimate accuracy B Factored Representation G Supervised learning with a discrete set of possible output values D Supervised Learning H Supervised learning with numeric output values F Test Set I Surface in a high-dimensional space that separates the classes E Training Set J Randomly split the data into a training set and a test set G Classification K Choose an over-complex model based on irrelevant data patterns

Example Density Grain Hardness Class Example #1 Heavy Small Hard Oak Example #2 Heavy Large Hard Oak Example #3 Heavy Small Hard Oak Example #4 Light Large Soft Oak Example #5 Light Large Hard Pine Example #6 Heavy Small Soft Pine Example #7 Heavy Large Soft Pine Example #8 Heavy Small Soft Pine

Hardness?

Density?

Oak (^) Pine

Soft

Light

Hard

Heavy

Density?

Pine Oak

Heavy (^) Light

If root is Density: Heavy = OOOPPP, Light = OP If root is Grain: Small = OOPP, Large = OOPP If root is Hardness: Hard = OOOP, Soft = OPPP (O = Oak, P = Pine)

5. (10 pts total) Naïve Bayes Classifier Learning. You must make a Naïve Bayes classifier to discriminate Dogs from Cats. You are given the following (noisy) examples:

You may use the optional customary convention thatis a normalizing constant. 5a. (2 pts) Apply Baye’s rule to rewrite the conditional probability of the class given the attributes as the conditional probability of the attributes given the class (“^” means AND). Give a mathematically exact formula (i.e., do not yet assume independence).

P(Class | Sound ^ Fur ^ Color) =  P(Sound ^ Fur ^ Color | Class) P(Class) 5b. (2 pts) Now assume that the attributes (Sound, Fur, and Color) are conditionally independent given the Class. Rewrite your expression for 5a, under this assumption of conditional independence (i.e., rewrite it as a Naïve Bayes Classifier expression).

P(Class | Sound ^ Fur ^ Color) =  P(Sound | Class) P(Fur | Class) P(Color | Class) P(Class) 5c. (4 pts total; -1 for each wrong answer, but not negative) Fill in numerical values for the following expressions. Leave your answers as common fractions (e.g., 1/4, 3/5). (You do not need a calculator; the numbers have been chosen to be easily solved.)

P(Dog)= 1/2 P(Cat)= 1/

P(Sound=Meow | Class=Dog)= 1/4 P(Sound=Meow | Class=Cat)= 3/

P(Sound=Bark | Class=Dog)= 3/4 P(Sound=Bark | Class=Cat)= 1/

P(Fur=Coarse | Class=Dog)= 3/4 P(Fur=Coarse | Class=Cat)= 1/

P(Fur=Fine | Class=Dog)= 1/4 P(Fur=Fine | Class=Cat)= 3/

P(Color=Brown | Class=Dog)= 1/2 P(Color=Brown | Class=Cat)= 1/

P(Color=Black | Class=Dog)= 1/2 P(Color=Black | Class=Cat)= 1/

5d. (2 pt) Classify a new example (Sound=Bark ^ Fur=Coarse ^ Color=Brown).

P(Class=Dog | Sound=Bark ^ Fur=Coarse ^ Color=Brown) = (3/4)(3/4)(1/2)(1/2)=9/

P(Class=Cat | Sound=Bark ^ Fur=Coarse ^ Color=Brown) = (1/4)(1/4)(1/2)(1/2)=1/

Example Sound Fur Color Class Example #1 Meow Coarse Brown Dog Example #2 Bark Fine Brown Dog Example #3 Bark Coarse Black Dog Example #4 Bark Coarse Black Dog Example #5 Meow Fine Brown Cat Example #6 Meow Coarse Black Cat Example #7 Bark Fine Black Cat Example #8 Meow Fine Brown Cat

7

8. (9 pts total, 1 pt each) Bayesian Networks. Write down the factored conditional probability equation that corresponds to the graphical Bayesian Network shown. The first one is done for you as an example.

8a. P(C|A,B)P(A)P(B)

8b. P(A)P(B) P(C)

8c. P(B|A)P(C|A)P(A)

8d. P(C|B)P(B|A)P(A)

8e. P(B|A)P(A)P(C)

Draw the Bayesian Network that corresponds to the conditional probability equation.

8f. P(D|A,B,C)P(A)P(B)P(C)

8g. P(C|A,B)P(B|A)P(A)

8h. P(D|B,C)P(C|A,B)P(B)P(A)

8i. P(D|A,B,C)P(C|A,B)P(B|A)P(A)

8j. P(D|B,C)P(C|A)P(B|A)P(A)

A AA C A

B A

A AA

C A

B A

B AA

A A C A

A AA

B (^) C A

A AA

B A

C A

A AA D A

C A

B A

A AA C A

B A

A AA D A

C A B A

A AA D A

C A B A A AA D A

C A B A

9. (10 points total, 2 pts each) Constraint Satisfaction Problems

You are a map-coloring robot assigned to color this Southwest USA map. Adjacent regions must be colored a different color (R=Red, B=Blue, G=Green). The constraint graph is shown.

9a. (2pts total, -1 each wrong answer, but not negative) FORWARD CHECKING. Cross out all values that would be eliminated by Forward Checking, after variable AZ has just been assigned value R as shown: CA NV AZ UT CO NM R G B R G B R R G B R G B R G B

9b. (2pts total, -1 each wrong answer, but not negative) ARC CONSISTENCY. CA and AZ have been assigned values, but no constraint propagation has been done. Cross out all values that would be eliminated by Arc Consistency (AC-3 in your book). CA NV AZ UT CO NM B R G B R R G B R G B R G B

9c. (2pts total, -1 each wrong answer, but not negative) MINIMUM-REMAINING- VALUES HEURISTIC. Consider the assignment below. NV is assigned and constraint propagation has been done. List all unassigned variables that might be selected by the Minimum-Remaining-Values (MRV) Heuristic: CA, AZ, UT.

CA NV AZ UT CO NM R B G R B R B R G B R G B

9d. (2pts total, -1 each wrong answer, but not negative) DEGREE HEURISTIC. Consider the assignment below. (It is the same assignment as in problem 9c above.) NV is assigned and constraint propagation has been done. List all unassigned variables that might be selected by the Degree Heuristic:. AZ.

CA NV AZ UT CO NM R B G R B R B R G B R G B

9e. (2pts total) MIN-CONFLICTS HEURISTIC. Consider the assignment below. AZ has been selected to be assigned a new value. What new value would be chosen below for AZ by the Min-Conflicts Heuristic?. R.

CA NV AZ UT CO NM B G? G G B

NV

CA

AZ

UT

CO

NM

CA

NV UT (^) CO

AZ (^) NM

X X X X

X X XX X X

11. (8 points total, 1 pt each) Knowledge Engineering in the genealogy domain.

Use resolution to prove Sue is Jill’s grandparent, i.e., to prove Grandparent(Sue, Jill).

For ease in naming the statements in the KB, they are labeled KB1, KB2, KB3, KB4, ….

Write each unifier as { var1/val1, var2/val2, …}, i.e., a list of variable/value substitutions.

“Sue is a parent of Mary.” is KB1: Parent(Sue, Mary)

“Mary is a parent of Jill.” is KB2: Parent(Mary, Jill)

Translate this definition of Grandparent(x, y) from FOPC into CNF as KB3:

FOPC:  x  y [  z Parent(x,z) ^ Parent(z, y) ]]  Grandparent(x, y)

11a. The definition is KB3:  Parent(x, z)   Parent(z, y)  Grandparent(x, y)

11b. The negated goal is KB4:  Grandparent(Sue, Jill).

11c. The most general unifier of KB3 and KB4 is: { x / Sue, y / Jill }.

11d. The result of resolving KB3 and KB4 is KB5:  Parent(Sue, z)   Parent(z, Jill).

11e. The most general unifier of KB2 and KB5 is: { z / Mary }.

11f. The result of resolving KB2 and KB5 is KB6:  Parent(Sue, Mary).

11g. The most general unifier of KB1 and KB6 is: {}.

11h. The result of resolving KB1 and KB6 is KB7: {} (or false, or contradiction, etc.).

12. (12 pts total, 1 pt each) Logic Concepts. For each of the following terms on the left, write in the letter corresponding to the best answer or the correct definition on the right. The first one is done for you as an example. A Agent A Perceives environment by sensors, acts by actuators. C Syntax B Chain of inference rule conclusions leading to a desired sentence. I Semantics C Specifies all the sentences in a language that are well formed. L Entailment D Describes a sentence that is true in all models. J Sound E A first-order logic expression that refers to an object. K Complete F Represented as a canonical conjunction of disjunctions. E Term G Disjunction of literals, at most one of which is positive. D Valid H Describes a sentence that is false in all models. M Satisfiable I Defines truth of each sentence with respect to each possible world. H Unsatisfiable J An inference procedure that derives only entailed sentences. B Proof K An inference procedure that derives all entailed sentences. G Horn clause L The idea that a sentence follows logically from another sentence. F Conjunctive Normal Form M Describes a sentence that is true in some model.