final-search-games

pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

188

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

2

Uploaded by SargentPencilManatee29

Report
CS 188 Spring 2023 Final Review: Search/Logic Q1. Power Pellets Consider a Pacman game where Pacman can eat 3 types of pellets: Normal pellets (n-pellets), which are worth one point. Decaying pellets (d-pellets), which are worth max (0 , 5 t ) points, where t is time. Growing pellets (g-pellets), which are worth t points, where t is time. The location and type of each pellet is fixed. The pellet’s point value stops changing once eaten. For example, if Pacman eats one g-pellet at t = 1 and one d-pellet at t = 2, Pacman will have won 1 + 3 = 4 points. Pacman needs to find a path to win at least 10 points but he wants to minimize distance travelled. The cost between states is equal to distance travelled. (a) Which of the following must be including for a minimum, sufficient state space? Pacman’s location Location and type of each pellet How far Pacman has travelled Current time How many pellets Pacman has eaten and the point value of each eaten pellet Total points Pacman has won Which pellets Pacman has eaten (b) Which of the following are admissible heuristics? Let x be the number of points won so far. Distance to closest pellet, except if in the goal state, in which case the heuristic value is 0. Distance needed to win 10 x points, determining the value of all pellets as if they were n-pellets. Distance needed to win 10 x points, determining the value of all pellets as if they were g-pellets (i.e. all pellet values will be t .) Distance needed to win 10 x points, determining the value of all pellets as if they were d-pellets (i.e. all pellet values will be max (0 , 5 t ). Distance needed to win 10 x points assuming all pellets maintain current point value (g-pellets stop increasing in value and d-pellets stop decreasing in value) None of the above (c) Instead of finding a path which minimizes distance, Pacman would like to find a path which minimizes the following: C new = a t + b d where t is the amount of time elapsed, d is the distance travelled, and a and b are non-negative constants such that a + b = 1. Pacman knows an admissible heuristic when he is trying to minimize time (i.e. when a = 1 , b = 0), h t , and when he is trying to minimize distance, h d (i.e. when a = 0 , b = 1). Which of the following heuristics is guaranteed to be admissible when minimizing C new ? mean ( h t , h d ) min ( h t , h d ) max ( h t , h d ) a h t + b h d None of the above 1
Q2. Coin Stars In a new online game called Coin Stars, all players are walking around an M x N grid to collect hidden coins, which only appear when you’re on top of them . There are also power pellets scattered across the board, which are visible to all players. If you walk onto a square with a power pellet, your power level goes up by 1, and the power pellet disappears. Players will also attack each other if one player enters a square occupied by another player. In an attack, the player with a higher power level will steal all the coins from the other player. If they have equal power levels, nothing happens. Each turn, players go in order to move in one of the following directions: { N, S, E, W } . In this problem, you and your friend Amy are playing Coin Stars against each other. You are player 1, and your opponent Amy is player 2. Our state space representation includes the locations of the power pellets ( x p j , y p j ) and the following player information: (1) Each player’s location ( x i , y i ); (2) Each player’s power level l i ; (3) Each player’s coin count c i . (a) Suppose a player wins by collecting more coins at the end of a number of rounds, so we can formulate this as a minimax problem with the value of the node being c 1 c 2 . Consider the following game tree where you are the maximizing player (maximizing the your net advantage, as seen above) and the opponent is the minimizer. Assuming both players act optimally, if a branch can be pruned, fill in its square completely, otherwise leave the square unmarked. *$ None of the above can be pruned (b) Suppose that instead of the player with more coins winning, every player receives payout equal to the number of coins they’ve collected. Can we still use a multi-layer minimax tree (like the one above) to find the optimal action? *$ Yes, because the update in payout policy does not affect the minimax structure of the game. *$ Yes, but not for the reason above *$ No, because we can no longer model the game under the updated payout policy with a game tree. *$ No, but not for the reason above 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help