0% found this document useful (0 votes)
5 views

Search Sample Qa

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Search Sample Qa

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

D EPARTMENT OF C OMPUTER S CIENCE & E NGINEERING

CSCE625: Artificial Intelligence


Sample Midterm Exam Questions (Solutions)

Question 1: Heuristics (15 points)

Consider heuristics where h(n) = 0 for all n for which G OAL(n) = True, i.e., functions that have the value
zero for states that are goals. Then the following statements are either true or false

Statement 1: Every admissible heuristic is consistent.


Statement 2: Every consistent heuristic is admissible.

For each statement: (1) identify whether it is true or false. (2) If it is true prove that it is so; otherwise,
if it is false, provide a counterexample.

Reminder: Using the notation from the textbook, with n0 a successor of state n and a an action, a
consistent heuristic is required to have h(n) ≤ c(n, a, n0 ) + h(n0 ).

Statement 1 is false. Here is a counter-example. Assume a linear graph between these cities, with the
10 10 10 10
numbers appearing above as true costs A −→ B −→ C −→ D −→ Goal.
Now consider the heuristic defined thusly:
h(D) = 9 < 10
h(C) = 19 < 20
h(B) = 2 < 30

Statement 2 is true. Here is a proof by contradiction (though, induction would work as well):
Assume the contrary and consider node n, the one of least distance from goal that violates admissibility.
Thus,
true cost to goal(n) < h(n).
Now, n can’t be a goal itself, since h(n) = 0 is admissible. So n must be connected, on its least cost path,
to some other node en route the goal. Call that node n0 . Then, since step costs are positive, we see

true cost to goal(n0 ) < true cost to goal(n).

Also, h(n0 ) ≤ true cost to goal(n), and accordingly,

h(n) ≤ c(n, a, n0 ) + h(n0 )


≤ c(n, a, n0 ) + true cost to goal(n0 ) = true cost to goal(n),

1 of 2
but that means h(n) < h(n), which is contradiction.
Question 2: Search costs (6 points)
You are approached by a client who arranges cycling tour holidays of Romania; they are interested in a
specialized routing problem on their map, which they want to treat via search on a graph. Usually when one
looks for a route to drive from one place (say Arad) to another (say Bucharest), the quantity being minimized
is the total distance. If the route goes from A to S, on to F , then arrives at B, the total distance is the sum of
distances on the roads along the path (i.e., dist(A, S) + dist(S, F ) + dist(F, B)). But your client is thinking
about how grueling a route will be, so they have boiled their problem down to minimizing of either:
1. the mean distance between stops (e.g., 13 [dist(A, S) + dist(S, F ) + dist(F, B)]) or,
2. the maximal leg distance (e.g., max[dist(A, S), dist(S, F ), dist(F, B)]).
Assuming that you want to use uniform cost search, what do you advise them? Why? Argue about the
metrics w.r.t. the algorithm, not which is a better model of bicycling route difficulty.

Tell them to use the maximal leg distance measure.

• The mean distance measure is a bad idea because it is not monotonic. If the first leg has distance 10
then the second has distance 5 and the third 2, moving along the path gives scores of 10, 12 (10 + 5) =
7 12 , and 13 (10 + 5 + 2) = 5 32 . Attempting to use UCS will cause problems, as this is akin to using the
normal item with negative weights. Going round and round cycles in the graph can decrease the mean
distance.

• Using the maximal leg distance is very easy to do with minimal modification: replace the summation
with a max(·) in your program. This can be done incrementally the way the algorithm already treats
it since, for example,

max[{v0 , v1 , v2 , v3 }] = max (max (max (v0 , v1 ) , v2 ) , v3 ) .

2 of 2

You might also like