| Homework #4 Solutions 1. [17] State Based Search (again). I was dissapointed with the class's performance on simple state-based search (everything in AI is a search problem!). Let's practice one more time [this, from the 2006 Google Puzzle Challenge]: "Full House" puzzle: for each puzzle, find the starting square and draw a path moving horizontally and vertically that passes through each open square exactly once. For each straight segment in the path, you must go as far as possible, changing direction only when you are blocked by the grid's edge, a black square, or a square already visited. (a) [10 points] Represent this as a state-based search problem. What is a state? What is the initial state? What is the successor-state function? What are the path costs? What is the goal test? A state represents the path taken so far, and the current square. The initial state is a blank diagram with and empty "current square". The successor-states from the initial state are probably easiest to think of as simply all the possible "start squares", although that makes the successor state fn different for the first move. After that, the successor state fn creates all the next states resulting from moving from the current square in any of the 4 possible directions until an obstacle is reached (there may only be one successor if there is only ne leal move). Here path cost is just 1 per move. Goal test is that path covers all squares.
It is also possible to realize a state as path so far, current square, and current direction, and the successor state only moves one square in current direction if possible, and branches to all possible directions otherwise. This makes for a much larger number of states, many or which have no branches at all. Still, a heuristic like "the number of squares not yet covered" is obviously admisible and maybe even somewhat useful. Somewhat better is to use a non-1 path cost and charge 1 pt/square, using the whole move successor state. This is a smaller search space, and the "number of squares" left heuristic is reasonable and admissable. Without simulating the actual problems I dont know if my initial solution is better or not, although I suspect it is (given that it is based on how hard the remaing problem is, and not how far you already came). Some people wanted to run the path for as long as possible without making a choice (since often there is no choice when an obstacle is reache about which way to turn). This will only work with the "1-per-square" path cost and associated "# of squares remaining" hueristic, as otherwise it is very hard to estimate how many of these "multi-moves" are left without actually solving the remaining problem (not reasonable).
For the initial statement above, consider that at best you must cover every remaining row or column, so MIN(# rows with blanks, # columns with blanks). For the path cost = 3 of squares traveled, the # of remaining squares is reasonable and admissible. 2. [26] Commonsense knowledge representation: Consider the following argument:
In this problem, you will axiomatize the commonsense knowledge used in this argument and provide a formal first-order logic derivation of this argument. Note: In this problem, you will use a continuous notion of time rather than the notion of discrete time steps.
3. [17] The following logic circuit has four wires, W1, W2, W3, and W4. It has an "AND gate", A, and an "inverter", B. The input wires, W1 and W2, can be either "on" or not. If the AND gate A is functioning properly (OK), wire W3 is "on" if and only if wires W1 and W2 are both "on". If the inverter B is functioning properly (OK), wire W4 is "on" if and only if wire W3 is not "on".
4. [6] Using situation calculus, write sentences to describe the logical effects of a "SHOOT" action in the Wumpus World. Remember that in situation calculus that sentences are oriented around descriptions of fluents, not actions. Assume that the agent has only one arrow with which to shoot. Remember that the situation calculus oriented towards describing the fluents, not the actions that change them. Shooting a Wumpus makes it dead, but there is no 'resurrection' action that makes it come alive, so our sucessor state axiom for Alive will only have one clause. Similarly, we lose the arrow when we shoot it, and there's no way to get it back (obviously it's perfectly OK if you assumed that you could GRAB the arrow if you were in the same square, etc., but you didn't have to for this problem): Has(AGENT,ARROW,s)
=> Poss(Shoot,s)
Alive(WUMPUS,Result(a,s)) <=> [Alive(WUMPUS,s)
^ Has(AGENT,ARROW,Result(a,s)) <=> [Has(AGENT,ARROW,s) ^ ~(a=shoot)] 5. [24] STRIPS-style Planning.
Problem 11.4 in the book (Monkey & Bananas).
6. [10] Problem 11.11 from the textbook (Sussman's Anomaly).
|
||