1. Home
  2. Explore
  3. Computer Science
  4. AI Course Announcements

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

AI Course Announcements

  • 54Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Agents and Planning

What distinguishes a reflex agent from a planning agent?

54 questions

  1. 1

    What distinguishes a reflex agent from a planning agent?

    Model answer

    A reflex agent chooses an action from its current percept, perhaps using memory, without reasoning through the action’s consequences. A planning agent considers possible sequences of actions and their consequences.

    Explanation

    Reflex agents respond directly to situations, while planning agents ask what would happen if they took particular actions.

  2. 2

    Why can a reflex agent be rational even though it does not plan ahead?

    Model answer

    Rationality concerns whether an agent’s behavior optimizes expected utility, not whether it uses planning. A rapid reflex can be optimal when reasoning would take too long.

    Explanation

    For example, pulling a hand away from a fire immediately can be better than deliberating about the consequences first.

  3. 3

    Why can a reflex agent repeatedly fail in a situation where it always tries to move toward the nearest dot?

    Model answer

    If a wall blocks the direction toward the nearest dot, the agent may encounter the same situation repeatedly and repeat the same blocked action.

    Explanation

    The agent does not consider the consequence of its move or plan a route around the obstacle, so it can waste time and lose points.

  4. 4

    What does a planning agent need in order to reason about the consequences of possible actions?

    Model answer

    It needs a model of how the world works and a goal or goal condition against which it can evaluate possible action sequences.

    Explanation

    Without a world model, the agent cannot predict what its actions will do; without a goal, it has no criterion for evaluating plans.

  5. 5

    How can a planning goal be specified?

    Model answer

    A goal can specify one particular outcome or a condition that can be satisfied in multiple ways.

    Explanation

    The agent need only find a sequence of actions that reaches a state satisfying the goal condition.

  6. 6

    What is the difference between a complete search algorithm and an optimal search algorithm?

    Model answer

    A complete algorithm finds a solution whenever one exists. An optimal algorithm finds a solution with minimum cost.

    Explanation

    Completeness concerns whether a solution is found; optimality concerns whether the returned solution is the least-cost one.

  7. 7

    What is replanning, and why might an agent use it instead of planning a full solution in advance?

    Model answer

    Replanning means repeatedly planning a shorter segment, executing it, and then forming a new planning problem. It lets the agent begin acting sooner than an agent that calculates a complete plan first.

    Explanation

    For example, an agent can plan a route to the nearest dot, follow it, and then plan a route to the next dot.

  8. 8

    What four components define a search problem?

    Model answer

    A search problem has a state space, a successor function, a start state, and a goal test.

    Explanation

    Together, these components describe the possible configurations, available transitions, initial situation, and condition to be achieved.

  9. 9

    What does the successor function specify?

    Model answer

    For a given state, it specifies the available actions and the states that result from those actions.

    Explanation

    It encodes how the modeled world changes when an action is taken.

  10. 10

    What is a solution to a search problem?

    Model answer

    A solution is a sequence of actions, or plan, that transforms the start state into a state satisfying the goal test.

    Explanation

    The plan is defined by its effects on the modeled states and whether it reaches a goal.

  11. 11

    How could a route-finding problem on a map be modeled as a search problem?

    Model answer

    Use cities as states, neighboring cities as successors, the departure city as the start state, and the destination as the goal. Edge costs can represent travel distance.

    Explanation

    This model treats the map as a graph whose transitions are roads between neighboring cities.

  12. 12

    How could a route model account for considerations other than distance?

    Model answer

    The transition cost could include factors such as traffic or potholes, rather than representing distance alone.

    Explanation

    The cost definition can be adjusted to reflect which aspects of travel matter for the problem.

  13. 13

    Why must a state-space choice and its successor function be compatible?

    Model answer

    The successor function must correctly describe transitions using the information represented in the state. Changing the state representation can therefore require changing the successor function.

    Explanation

    If the state representation omits information needed to predict an outcome, the transition model may not describe the problem correctly.

  14. 14

    For a Pac-Man pathing problem, what information can the state space contain, and what does the successor function need to account for?

    Model answer

    A state can contain Pac-Man’s location. The successor function describes directional moves and must account for walls, which can prevent movement.

    Explanation

    For pathing, the locations of dots need not be represented if they do not affect the paths being sought.

  15. 15

    Why does a Pac-Man problem that requires eating every dot need a richer state representation than a simple pathing problem?

    Model answer

    It must represent Pac-Man’s location and which dots remain, because the goal depends on eating all dots and future transitions can change dot availability.

    Explanation

    A pathing problem can track only position when dots do not matter to its goal or transitions.

  16. 16

    How can the state space represent the remaining dots in a fixed Pac-Man map?

    Model answer

    It can assign each possible dot location a Boolean value indicating whether food is still present there.

    Explanation

    For each location, the value records whether the dot remains or has been eaten.

  17. 17

    What is the goal test for a Pac-Man problem whose goal is to eat all the dots?

    Model answer

    The goal test checks whether all dot-presence values are false.

    Explanation

    The goal is defined by the absence of remaining food, not by Pac-Man being at a particular location.

  18. 18

    Why is tracking only the number of remaining dots insufficient for planning a route to eat them all?

    Model answer

    The count does not reveal where the remaining dots are, so it is insufficient to determine the consequences of movement and plan a route.

    Explanation

    The state must contain enough information for the successor function to model where food is encountered and eaten.

  19. 19

    What information is needed to model Pac-Man eating all dots while keeping ghosts scared?

    Model answer

    The state needs Pac-Man’s location, the remaining regular-food and power-pellet locations, and the ghosts’ scared timer. Ghost locations are also needed if encountering a scared ghost can make it respawn unscared.

    Explanation

    These details support the goal test and the successor function’s predictions about food collection and whether the ghosts remain scared.

  20. 20

    Why must a scared-ghost timer be represented when the goal requires the ghosts to stay scared?

    Model answer

    The timer is needed to determine when the scared period ends and whether a transition would leave the ghosts unscared.

    Explanation

    The successor function can treat the game as over if the ghosts are no longer scared, but it needs the timer to predict that event.

  21. 21

    When can ghost locations be omitted from a search state in the scared-ghost problem?

    Model answer

    They can be omitted if the model assumes that ghost locations do not affect relevant transitions, such as when ghosts do not respawn unscared after being encountered.

    Explanation

    If ghost locations affect how the world changes, they must instead be included so the successor function can simulate those changes.

  22. 22

    How can the size of a state space be estimated from its variables?

    Model answer

    Count the possible values of each variable and multiply those counts, using a ballpark estimate when some combinations are impossible.

    Explanation

    A state combines values for all variables that vary in the representation, so their possible-value counts determine the approximate total.

  23. 23

    A Pac-Man world has 120120120 agent positions, 303030 possible food locations, two ghosts with 121212 positions each, and four agent orientations. What is the estimated number of world states?

    Model answer

    The estimate is 120×230×122×4120 \times 2^{30} \times 12^2 \times 4120×230×122×4.

    Explanation

    Each food location has two possibilities—present or absent—so the food configurations number 2302^{30}230. The other variable counts are multiplied by that number.

  24. 24

    Why does the state space for eating all dots differ in size from the full Pac-Man world state space?

    Model answer

    The search problem only needs Pac-Man’s position and the food configuration, so it can omit ghost positions and agent orientation. Its estimated size is 120×230120 \times 2^{30}120×230.

    Explanation

    A search state includes information relevant to the particular problem, not necessarily every detail of the world.

  25. 25

    What is the state-space size for a Pac-Man pathing problem if there are 120120120 possible agent positions?

    Model answer

    It is 120120120, because pathing only needs to track the agent’s position.

    Explanation

    Food, ghosts, and orientation can be omitted when they are irrelevant to the pathing goal and transitions.

  26. 26

    Why can a state-space count such as 120×230120 \times 2^{30}120×230 be an overestimate?

    Model answer

    Some combinations counted by the product may be impossible, such as a state where Pac-Man occupies a location that still contains uneaten food.

    Explanation

    The count is often intended as a rough estimate of scale rather than an exact enumeration of reachable states.

  27. 27

    What is a state-space graph, and how are its nodes and arcs interpreted?

    Model answer

    It is a mathematical representation of a search problem. Nodes represent abstract world configurations, and arcs represent transitions described by the successor function.

    Explanation

    Some nodes satisfy the goal condition and others do not; the graph captures the problem’s possible state transitions.

  28. 28

    How does a state-space graph differ from a search tree?

    Model answer

    A state-space graph represents each state once, whereas a search tree represents action sequences and can contain multiple occurrences of the same state.

    Explanation

    Different paths can reach the same state, so the corresponding search tree can be much larger than the state-space graph.

  29. 29

    What does a node in a search tree represent?

    Model answer

    It represents a sequence of states reached by a sequence of actions from the start state.

    Explanation

    For example, a node may represent starting at SSS, taking an action, and arriving at another state.

  30. 30

    Why can a search tree be much larger than its state-space graph?

    Model answer

    The same state can occur in the tree through many different action sequences, creating multiple tree nodes for one graph state.

    Explanation

    A small graph can therefore generate a large, or even infinite, tree of possible plans.

  31. 31

    Why can a search tree be infinite even when its state-space graph is finite?

    Model answer

    Cycles in the state-space graph can allow action sequences to continue indefinitely, generating an unbounded tree.

    Explanation

    For example, if states can transition back and forth between one another, the search tree can keep extending those paths.

  32. 32

    What are the fringe and expansion in tree search?

    Model answer

    The fringe is the set of leaf nodes waiting to be expanded. Expansion selects a fringe node and generates its successors.

    Explanation

    After selecting a node, tree search checks whether it meets the goal and, if not, uses the successor function to extend the tree.

  33. 33

    What does a basic tree-search algorithm do when no fringe nodes remain?

    Model answer

    It stops and reports that it did not find a solution.

    Explanation

    With no leaves available for expansion, there are no remaining candidate paths to explore.

  34. 34

    When does tree search return a solution?

    Model answer

    It returns the corresponding action sequence when a selected node satisfies the goal test.

    Explanation

    A path may be generated before it is selected; the described algorithm checks for success when it selects a node for expansion.

  35. 35

    Which parts of a tree-search algorithm can vary while retaining the same basic procedure?

    Model answer

    The strategy for choosing which node to expand next from the fringe can vary.

    Explanation

    Depth-first, breadth-first, and uniform-cost search use the same basic tree-search procedure but prioritize fringe nodes differently.

  36. 36

    What four properties can be used to evaluate search algorithms?

    Model answer

    Completeness, optimality, time complexity, and space complexity.

    Explanation

    These measure whether a solution is found, whether it is least-cost, how much computation is needed, and how much memory is needed.

  37. 37

    What do the branching factor BBB and maximum depth MMM describe in a search-tree analysis?

    Model answer

    BBB is the number of successors per node, and MMM is the maximum depth of the tree.

    Explanation

    Under the simplified assumption of a constant branching factor, the last layer contains BMB^MBM nodes.

  38. 38

    How does depth-first search choose which fringe node to expand?

    Model answer

    It expands a deepest node first.

    Explanation

    When multiple nodes are equally deep, a tie-breaking rule can determine which one is selected.

  39. 39

    What are the time and space complexities of depth-first search in a tree with branching factor BBB and maximum depth MMM?

    Model answer

    In the worst case, time is O(BM)O(B^M)O(BM) and space is O(BM)O(BM)O(BM).

    Explanation

    The search may traverse the whole tree, but its fringe contains roughly the unexpanded successors along a path of depth at most MMM.

  40. 40

    Under what condition is depth-first search complete, and why is it not generally optimal?

    Model answer

    It is complete when the search tree is finite. It is not generally optimal because it can find a more expensive solution before a less expensive one.

    Explanation

    Depth-first search follows its depth and tie-breaking strategy rather than ordering plans by solution cost.

  41. 41

    How does breadth-first search choose which fringe node to expand?

    Model answer

    It expands a shallowest node first, exploring the tree layer by layer.

    Explanation

    This allows it to reach shallow solutions before exploring deeper parts of the tree.

  42. 42

    If the shallowest solution is at depth sss, what are the approximate time and space complexities of breadth-first search?

    Model answer

    Both time and space are approximately O(Bs)O(B^s)O(Bs).

    Explanation

    Breadth-first search may need to generate and store the nodes across the layers up to the solution depth.

  43. 43

    When is breadth-first search optimal, and when is it not guaranteed to be optimal?

    Model answer

    It is optimal when every action has equal cost, because it finds a solution with the fewest actions. With different action costs, it is not guaranteed to find the least-cost solution.

    Explanation

    Breadth-first search orders paths by depth rather than by cumulative cost.

  44. 44

    How does iterative deepening combine features of depth-first and breadth-first search?

    Model answer

    It repeatedly runs depth-first search with an increasing depth limit. This keeps memory use low while finding solutions in order of increasing depth.

    Explanation

    The first search stops at depth 111, then the limit increases until a solution is found.

  45. 45

    Why can the repeated work in iterative deepening be relatively small?

    Model answer

    The deepest layer is typically as large as all the previous layers combined, so the repeated exploration of shallower layers is small relative to the final search.

    Explanation

    Although earlier depths are revisited, the exponentially larger last layer dominates the total work.

  46. 46

    How does uniform-cost search choose which fringe node to expand?

    Model answer

    It expands the node whose path has the lowest cumulative cost so far.

    Explanation

    Unlike breadth-first search, it orders paths by accumulated cost rather than by the number of actions.

  47. 47

    Why does uniform-cost search not stop as soon as it generates a goal node?

    Model answer

    A cheaper path to a goal may still be found by expanding a lower-cost fringe node.

    Explanation

    A generated goal path may not be the least-cost one, so uniform-cost search continues until it selects the lowest-cost goal for expansion.

  48. 48

    Why is the solution found by uniform-cost search optimal when action costs are positive?

    Model answer

    When the goal is selected at cost CCC, every remaining fringe path has cost at least CCC, and positive future costs cannot reduce those paths’ costs below CCC.

    Explanation

    Thus no unexpanded path can lead to a cheaper goal than the one selected.

  49. 49

    What assumptions support uniform-cost search’s completeness?

    Model answer

    It is complete under suitable cost conditions, including positive step costs bounded below by some epsilon and the absence of problematic negative-cost cycles.

    Explanation

    A positive lower bound on step costs prevents endlessly expanding paths with bounded cumulative cost.

  50. 50

    If the optimal solution cost is C∗C^*C∗ and every action costs at least epsilon, what effective depth is relevant to uniform-cost search?

    Model answer

    The effective depth is approximately C^*/epsilon, since no path of cost below C∗C^*C∗ can contain more than that many minimum-cost actions.

    Explanation

    The time and space requirements can grow exponentially with this effective depth, at roughly O(B^{C^*/ ext{epsilon}}) under the stated analysis.

  51. 51

    How can one tree-search implementation support depth-first, breadth-first, and uniform-cost search?

    Model answer

    Use a priority queue for the fringe and assign priorities according to the desired strategy: deepest first, shallowest first, or lowest cumulative cost first.

    Explanation

    The basic algorithm remains the same; changing the priority rule changes which fringe node is selected.

  52. 52

    Why might uniform-cost search explore many unpromising directions?

    Model answer

    It prioritizes paths that have been cheap so far, but does not use information about how close they are to the goal.

    Explanation

    A search strategy that also estimates promise relative to the goal can focus exploration more effectively.

  53. 53

    What can cause a search-based route planner to recommend a physically impossible route even if its search algorithm works correctly?

    Model answer

    The search problem may use an inaccurate or mismatched model of the real world, such as a map that does not represent the actual road layout.

    Explanation

    The algorithm can correctly solve its modeled problem while that model fails to describe the route that can actually be traveled.

  54. 54

    Why might a route planner include a boat trip in a route that is otherwise intended to reach a destination by road?

    Model answer

    The map may be incomplete and omit a road connection near the destination, so the available modeled transitions lead the planner to a boat route.

    Explanation

    If the needed path is absent from the state-space graph, search cannot select it and may return an unsuitable alternative.

1 of 54
Question 1 of 54

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent