Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

5 Solved Problems in Midterm Exam on Propositional Logic and Search | COMPSCI 188, Exams of Computer Science

Material Type: Exam; Class: Introduction to Artificial Intelligence; Subject: Computer Science; University: University of California - Berkeley; Term: Spring 2005;

Typology: Exams

2010/2011

Uploaded on 05/09/2011

koofers-user-gni-1
koofers-user-gni-1 🇺🇸

4.5

(4)

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NAME: SID#: Section: 1
CS 188 Introduction to AI
Spring 2005 Stuart Russell Midterm
You have 80 minutes. The exam is open-book, open-notes. 100 points total. Panic not.
ALL QUESTIONS IN THIS EXAM ARE TRUE/FALSE, MULTIPLE-CHOICE, OR SHORT-ANSWER.
Mark your answers ON THE EXAM ITSELF. Write your name, SID, and section number at the top of each page.
For true/false questions, CIRCLE True OR False.
For multiple-choice questions, CIRCLE ALL CORRECT CHOICES (in some cases, there may be more than one).
If you are not sure of your answer you may wish to provide a brief explanation.
For official use only
Q. 1 Q. 2 Q. 3 Q. 4 Q. 5 Total
/12 /24 /18 /22 /24 /100
1. (12 pts.) True/False
(a) (2) True/False: There exists a task environment (PEAS) in which every agent is rational.
(b) (2) True/False: Suppose agent Aselects its action uniformly at random from the set of possible actions.
There exists a deterministic, fully observable task environment in which Ais rational.
(c) (2) True/False: No logical agent can behave rationally in partially observable environment.
(d) (2) True/False:x, y x =yis satisfiable.
(e) (2) True/False: If θunifies the atomic sentences αand β, then α|=Subst(θ,β ).
(f) (2) True/False: In any finite state space, random-restart hillclimbing is an optimal algorithm.
2. (24 pts.) Search
Suppose there are two friends living in different cities on a map, such as the Romania map shown in Figure
3.2 of AIMA2e. On every turn, we can move each friend simultaneously to a neighboring city on the map.
The amount of time needed to move from city ito neighbor jis equal to the road distance d(i, j) between the
cities, but on each turn the friend that arrives first must wait until the other one arrives (and calls the first on
his/her cell phone) before the next turn can begin. We want the two friends to meet as quickly as possible.
Let us formulate this as a search problem.
(a) (4) What is the state space? (You will find it helpful to define some formal notation here.)
pf3
pf4

Partial preview of the text

Download 5 Solved Problems in Midterm Exam on Propositional Logic and Search | COMPSCI 188 and more Exams Computer Science in PDF only on Docsity!

NAME: SID#: Section: 1

CS 188 Introduction to AI

Spring 2005 Stuart Russell Midterm

You have 80 minutes. The exam is open-book, open-notes. 100 points total. Panic not.

ALL QUESTIONS IN THIS EXAM ARE TRUE/FALSE, MULTIPLE-CHOICE, OR SHORT-ANSWER. Mark your answers ON THE EXAM ITSELF. Write your name, SID, and section number at the top of each page. For true/false questions, CIRCLE True OR False. For multiple-choice questions, CIRCLE ALL CORRECT CHOICES (in some cases, there may be more than one).

If you are not sure of your answer you may wish to provide a brief explanation.

For official use only

Q. 1 Q. 2 Q. 3 Q. 4 Q. 5 Total

  1. (12 pts.) True/False

(a) (2) True/False: There exists a task environment (PEAS) in which every agent is rational.

(b) (2) True/False: Suppose agent A selects its action uniformly at random from the set of possible actions. There exists a deterministic, fully observable task environment in which A is rational.

(c) (2) True/False: No logical agent can behave rationally in partially observable environment.

(d) (2) True/False: ∀ x, y x = y is satisfiable.

(e) (2) True/False: If θ unifies the atomic sentences α and β, then α |= Subst(θ, β).

(f) (2) True/False: In any finite state space, random-restart hillclimbing is an optimal algorithm.

  1. (24 pts.) Search Suppose there are two friends living in different cities on a map, such as the Romania map shown in Figure 3.2 of AIMA2e. On every turn, we can move each friend simultaneously to a neighboring city on the map. The amount of time needed to move from city i to neighbor j is equal to the road distance d(i, j) between the cities, but on each turn the friend that arrives first must wait until the other one arrives (and calls the first on his/her cell phone) before the next turn can begin. We want the two friends to meet as quickly as possible. Let us formulate this as a search problem.

(a) (4) What is the state space? (You will find it helpful to define some formal notation here.)

(b) (4) What is the successor function?

(c) (2) What is the goal?

(d) (4) What is the step cost function?

(e) (6) Let SLD(i, j) be the straight-line distance between any two cities i and j. Which, if any, of the following heuristic functions are admissible? (If none, write NONE.) (i) SLD(i, j) (ii) 2 · SLD(i, j) (iii) SLD(i, j)/ 2

(f) (4) True/False: There are completely connected maps for which no solution exists.

  1. (18 pts.) Propositional logic

(a) (9) Which of the following are entailed by the sentence (A ∨ B) ∧ (¬C ∨ ¬D ∨ E)? i. (A ∨ B)

ii. (A ∨ B ∨ C) ∧ (B ∧ C ∧ D ⇒ E)

iii. (A ∨ B) ∧ (¬D ∨ E)

(b) (3) True/False: Every nonempty propositional clause, by itself, is satisfiable.

(c) (6) True/False: Every set of five 3SAT clauses is satisfiable, provided that each clause mentions exactly three distinct variables.

  1. (22 pts.) Logical knowledge representation

(a) (12) Which of the following are semantically and syntactically correct translations of “Everyone’s zipcode within a state has the same first digit”? i. ∀ x, s, z 1 [State(s) ∧ LivesIn(x, s) ∧ Zip(x) = z 1 ] ⇒ [∀ y, z 2 LivesIn(y, s) ∧ Zip(y) = z 2 ⇒ Digit(1, z 1 ) = Digit(1, z 2 )].

ii. ∀ x, s [State(s) ∧ LivesIn(x, s) ∧ ∃ z 1 Zip(x) = z 1 ] ⇒ [∀ y, z 2 LivesIn(y, s) ∧ Zip(y) = z 2 ∧ Digit(1, z 1 ) = Digit(1, z 2 )].

iii. ∀ x, y, s State(s) ∧ LivesIn(x, s) ∧ LivesIn(y, s) ⇒ Digit(1, Zip(x) = Zip(y)).

iv. ∀ x, y, s State(s) ∧ LivesIn(x, s) ∧ LivesIn(y, s) ⇒ Digit(1, Zip(x)) = Digit(1, Zip(y)).

(a) (3) Mark the values of the terminal nodes.

(b) (6) Inside each internal node, write the strongest fact you can infer about its value (either a number, one or more inequalities such as “≥ 14”, or a “?”).

(c) (6) Can shortest-path lengths on the map be used to bound the values of the “?” leaves. If so, why and how? If not, why not?

(d) (3) Mark inequalities on all the “?” leaves according to the method in (c). Remember the cost to get to each leaf as well as the cost to solve it.

(e) (6) Now suppose the tree as given, with the leaf bounds from (d), was evaluated left-to-right. CIRCLE those nodes “?” nodes that would not need to be expanded further, given the bounds from part (d), and CROSS OUT those that need not be considered at all.

(f) (10 extra credit) Can you say anything precise about who wins the game on a map that is a tree?