Docsity

6.825 Midterm Exam Fall 2002: Solutions and Exercises, Exams of Artificial Intelligence

Toggle sidebar
bg1
6.825 Midterm Exam Fall 2002
October 29, 2002
1. (8 points) Convert the following four sentences to clausal form:
(a) ∀x.∃y.p(x)∧r(x, y)
Solution:
p(x1)
r(x2, F (x2))
(b) ∃x.∀y.p(x)→r(x, y)
Solution:
¬p(A) ∨r(A, y1)
(c) ∀x.(∃y.r(x, y )) ↔p(x)
Solution:
¬r(x1, y1)∨p(x1)
¬p(x2)∨r(x2, F (x2))
(d) ¬∀x.∃y.p(x)∧r(x, y)
Solution:
¬p(A) ∨ ¬r(A, y1)
1
pf3
pf4
pf5

Partial preview of the text

Download 6.825 Midterm Exam Fall 2002: Solutions and Exercises and more Exams Artificial Intelligence in PDF only on Docsity!

6.825 Midterm Exam Fall 2002

October 29, 2002

  1. (8 points) Convert the following four sentences to clausal form:

(a) ∀x.∃y.p(x) ∧ r(x, y) Solution:

p(x 1 )

r(x 2 , F (x 2 ))

(b) ∃x.∀y.p(x) → r(x, y) Solution:

¬p(A) ∨ r(A, y 1 )

(c) ∀x.(∃y.r(x, y)) ↔ p(x) Solution:

¬r(x 1 , y 1 ) ∨ p(x 1 )

¬p(x 2 ) ∨ r(x 2 , F (x 2 ))

(d) ¬∀x.∃y.p(x) ∧ r(x, y) Solution:

¬p(A) ∨ ¬r(A, y 1 )

  1. (8 points) For each group of sentences below, give an interpretation that makes the first sentence(s) true and the last sentence false. Use {A, B, C} as your universe.

(a)

∃x.p(x) ∧ q(x) ∧ r(x, x) ∀x.p(x) → ∃y.¬r(x, y) ∀x.p(x) → ∃y.¬x = y ∧ r(x, y)

∀x.p(x) ∨ ¬q(x)

Solution:

p = {< A >} q = {< A, C >} r = {< A, A >, < A, B >}

(b)

∀x.p(x) ↔ ∃y.r(y, x) ∀x.∃y.r(x, y)

∀x.¬p(x)

Solution:

p = {< A >} r = {< A, A >, < B, A >, < C, A >}

Alternately: (there are others, too)

p = {< A, B, C >} r = {< A, A >, < B, B >, < C, C >}

Common Mistakes:

  • Including only the number of packages in the state space: this is insufficient be- cause, if we know we are holding 2 packages, we don’t know if, for example, we’ve already been to A, or if we should try to go there next.
  • Specifying a goal test that couldn’t be derived from the state space that was de- scribed.

(b) (3 points) Give a non-trivial, polynomial-time, admissible heuristic for this domain, or argue that there isn’t one. Solution: There were many acceptable solutions. Some examples:

  • Straight line or manhattan distance to furthest unvisited drop-off location.
  • Straight line or manhattan distance to nearest unvisited drop-off location. (slightly looser underestimate than the previous one)
  • Number of packages left to deliver. (Not as “good” as the above two, but still acceptable.) Common Mistakes:
  • Trying to solve the Travelling Salesman Problem: In the general case, not poly in the number of drop-off locations.
  • Summing the distances between current robot location and all unvisited drop-off locations: Can overestimate the distance.
  • Summing up the perimeter of the convex hull of robot location and drop-off loca- tions: Can overestimate the distance.

(c) (3 points) Package A has to be delivered to the boss, and it’s important that it be done quickly. But we should deliver the other packages promptly as well. How could we encode this in the problem? Solution: The idea of putting “pressure” on the delivering to the boss is correctly handled in the cost function. We want to emphasize delivery to A, but we don’t want to ignore B if we happen to pass by it. Please note that to encode something into the “problem,” it must be encoded into one of the problem components: the state space, action space, goal test, or cost function. For example: while we haven’t delivered to A, actions cost 2; after that, actions cost 1. Common Mistakes:

  • Decreasing the cost instead of increasing the cost.
  • Constraining the order of the problem; requiring delivery to A before considering the other two locations at all.
  • Modifying the search heuristic instead of the cost function.

(d) (3 points) Now, consider the case where the robot doesn’t start with the packages, but it has to pick up a package from location 1 to deliver to location A, a package from location 2 to deliver to B, and from 3 to deliver to C. What is an appropriate state space for this problem? Solution: Again, multiple solutions were possible. One example:

  • State: { (x,y), deliveredA, deliveredB deliveredC, holdingA, holdingB, holdingC } Common Mistakes:
  • Again, just the number of packages and the number of visited locations are insuffi- cient.

(e) (3 points) What is a good admissible heuristic? Solution:

  • The same heuristic as before. (Not so “good,” but acceptable.)
  • The maximum (distance from my location to unvisited pickup location si plus the distance from si to unvisited delivery location).

(f) (4 points) This problem can also be treated as a planning problem. Describe the effects of the action of moving north using situation calculus axioms. As- sume that we are representing the location of the robot using integer coordinates for its x, y location in the grid, and that we can name the next integer coordinate greater than x as x + 1. Additionally, assume that we have a predicate occupied that applies to x, y pairs, indicating whether the robot may pass through the indicated locations. Solution:

∀x, y, s.atrobot(x, y, s) ∧ ¬occupied (x, y + 1) → atrobot(x, y + 1, result(moveNorth, s))

A little variability in this answer was acceptable, but the idea of result as a function from actions and situations to actions was crucial.

(g) (3 points) Describe what frame axioms would be necessary for this domain (but don’t write them down). Solution:

  • When the robot moves, the positions of the (non-held) packages and the delivery locations don’t change; which packages are held doesn’t change.
  • When the robot picks up or drops off a package, the robot’s location doesn’t change; the locations of packages and delivery locations don’t change.
  • There is not a big concern with minimizing cost (because planning methods usually seek any path to the goal). Saying “when the state space is too big” was not sufficient.

(j) (2 points) Should this problem be treated as a planning problem? Explain why or why not. Solution: I accepted a lot of answers here, mostly dependent on how cogently they were argued in the context of the answer to the previous problem. I actually think that treating this as a planning problem won’t be much help because: the initial state is known exactly, the subgoals aren’t particularly separable (you can’t solve the problem of going to location A without knowing where you’re going to be when you start), and we have a strong desire for minimizing path cost.