Search in AI
- 28Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the key characteristic of a reflex agent?
What is the key characteristic of a reflex agent?
28 questions
- 1
What is the key characteristic of a reflex agent?
- A
It chooses actions based on current percept and memory, without considering future consequences.
- B
It uses a model of the world to simulate long-term outcomes.
- C
It replans its actions after every step based on new information.
- D
It always considers the future consequences of its actions before deciding.
Correct answer
AIt chooses actions based on current percept and memory, without considering future consequences.
Explanation
A reflex agent selects actions based on its current percept and possibly memory, but it does not consider the future consequences of its actions. Planning agents do consider future consequences.
- A
- 2
Can a reflex agent be rational?
- A
Yes, because it always follows a precomputed optimal policy.
- B
Yes, in specific circumstances where the reflex happens to produce the optimal action.
- C
No, because it never considers future consequences, so it cannot be rational.
- D
No, because rationality requires considering all possible future states.
Correct answer
BYes, in specific circumstances where the reflex happens to produce the optimal action.
Explanation
A reflex agent can be rational in specific circumstances if the reflex action matches the rational action, but in general it cannot be rational because it cannot handle every possible state.
- A
- 3
What must a planning agent have to make decisions based on consequences?
- A
A large table mapping every state to the best action.
- B
A model of how the world evolves in response to actions and a goal test.
- C
A reflex that always works in all environments.
- D
A random action selector to explore all possibilities.
Correct answer
BA model of how the world evolves in response to actions and a goal test.
Explanation
A planning agent needs a model of the world's dynamics (successor function) and a goal test to evaluate possible future states. It cannot rely solely on reflexes or precomputed tables.
- A
- 4
Which of the following is NOT a component of a search problem?
- A
A set of states
- B
A successor function with actions and costs
- C
A start state and a goal test
- D
A heuristic function to estimate distance to the goal
Correct answer
DA heuristic function to estimate distance to the goal
Explanation
A search problem consists of states, a successor function (actions and costs), a start state, and a goal test. A heuristic function is used in informed search, not in the definition of the search problem itself.
- A
- 5
What is a solution to a search problem?
- A
A sequence of actions that transforms the start state into a goal state.
- B
A set of all possible paths from start to goal.
- C
A state that satisfies the goal test.
- D
A single action that immediately achieves the goal.
Correct answer
AA sequence of actions that transforms the start state into a goal state.
Explanation
A solution is a plan (sequence of actions) that, when executed from the start state, leads to a goal state. It is not just a single action or a set of paths.
- A
- 6
Why is abstraction used in search problems?
- A
To ignore irrelevant details of the real world, making the problem feasible.
- B
To increase the state space size for better planning.
- C
To ensure the search algorithm is complete.
- D
To include every possible detail for accurate modeling.
Correct answer
ATo ignore irrelevant details of the real world, making the problem feasible.
Explanation
Abstraction simplifies the real world by keeping only details relevant to the problem, reducing the state space and making search feasible. Including all details would make the problem intractable.
- A
- 7
In the Pac-Man pathing problem, what constitutes the search state?
- A
Pac-Man's coordinates and the positions of all walls.
- B
Pac-Man's coordinates, dot positions, ghost positions, and direction facing.
- C
Pac-Man's coordinates and the positions of all dots.
- D
Pac-Man's coordinates only.
Correct answer
DPac-Man's coordinates only.
Explanation
For pathing, the goal is to reach a specific location, so only the current coordinates are needed. Dot positions, ghosts, etc., are irrelevant for that goal.
- A
- 8
In the eat-all-the-dots problem, what additional information must the search state include compared to the pathing problem?
- A
The positions of all ghosts.
- B
A Boolean for each possible dot location indicating whether the dot is still present.
- C
The total score accumulated so far.
- D
The direction Pac-Man is facing.
Correct answer
BA Boolean for each possible dot location indicating whether the dot is still present.
Explanation
To know if all dots are eaten, the state must track which dots remain. Ghost positions and direction are not needed for the basic eat-all-dots goal.
- A
- 9
If the goal is to eat all dots and keep ghosts perma-scared, what extra element must the search state track?
- A
The current score.
- B
The number of ghosts still alive.
- C
The remaining time of the scared effect.
- D
The positions of power pellets only.
Correct answer
CThe remaining time of the scared effect.
Explanation
To keep ghosts scared, the agent must know how much time is left before they become dangerous again. This timing affects future actions and must be part of the state.
- A
- 10
What is the difference between a world state and a search state?
- A
A world state is a subset of the search state.
- B
They are the same thing; the terms are interchangeable.
- C
A search state includes future predictions, while a world state is only the present.
- D
A search state includes only details needed for planning, while a world state includes every detail of the environment.
Correct answer
DA search state includes only details needed for planning, while a world state includes every detail of the environment.
Explanation
The world state is the complete configuration of the environment, while the search state is an abstraction that contains only the information relevant to planning.
- A
- 11
In the state space graph of a search problem, how is each state represented?
- A
Each state can appear multiple times depending on the path taken.
- B
States are connected by actions, but some states may be repeated.
- C
The graph is a tree with no cycles.
- D
Each state occurs only once.
Correct answer
DEach state occurs only once.
Explanation
A state space graph is a mathematical representation where each distinct state is a node, and arcs represent transitions. Each state appears exactly once, unlike a search tree where paths can lead to the same state multiple times.
- A
- 12
Why can the search tree be infinite even if the state space graph is finite?
- A
Because cycles in the graph produce infinite paths in the tree.
- B
Because the branching factor is infinite.
- C
Because the goal test is never satisfied.
- D
Because the search tree includes all possible worlds.
Correct answer
ABecause cycles in the graph produce infinite paths in the tree.
Explanation
If the state space graph contains cycles, the search tree can have infinitely many nodes corresponding to repeated states via different paths. Each cycle can be repeated indefinitely.
- A
- 13
In the general tree search algorithm, what is the fringe?
- A
The set of all nodes that have been expanded.
- B
The set of goal states.
- C
The set of partial plans (paths) under consideration for expansion.
- D
The set of actions available from the current state.
Correct answer
CThe set of partial plans (paths) under consideration for expansion.
Explanation
The fringe (or frontier) contains the leaf nodes of the search tree that have not yet been expanded. These represent partial plans that will be considered for further exploration.
- A
- 14
What data structure does depth-first search (DFS) use to manage the fringe?
- A
A priority queue ordered by path cost.
- B
A queue (first-in, first-out).
- C
A set of visited states.
- D
A stack (last-in, first-out).
Correct answer
DA stack (last-in, first-out).
Explanation
DFS uses a stack, so the most recently added node is expanded first, leading to deep exploration before breadth.
- A
- 15
Under what condition is depth-first search complete?
- A
If the branching factor is at least 2.
- B
If the state space is finite and cycles are avoided.
- C
If the search tree has a finite maximum depth.
- D
If all actions have uniform cost.
Correct answer
CIf the search tree has a finite maximum depth.
Explanation
DFS can get stuck in infinite loops if there are cycles. It is complete only if the search tree depth is bounded (e.g., by a depth limit) or if cycles are explicitly prevented.
- A
- 16
What is the time complexity of depth-first search in the worst case, assuming a maximum depth m and branching factor b?
- A
O(mb)
- B
O(bm)
- C
O(b+m)
- D
O(bm)
Correct answer
DO(bm)
Explanation
In the worst case, DFS may explore the entire tree, which has 1+b+b2+...+bm=O(bm) nodes.
- A
- 17
What is the space complexity of depth-first search in the worst case?
- A
O(bm)
- B
O(bm)
- C
O(m)
- D
O(b)
Correct answer
BO(bm)
Explanation
DFS only stores nodes along the current path and their siblings. At maximum depth m, it stores up to b nodes at each of the m levels, so O(bm) space.
- A
- 18
Which of the following is a property of breadth-first search (BFS)?
- A
It is optimal only if all actions have the same cost.
- B
It uses a stack and expands the deepest node first.
- C
It has space complexity O(bm).
- D
It uses a queue and expands nodes in order of depth.
Correct answer
DIt uses a queue and expands nodes in order of depth.
Explanation
BFS uses a FIFO queue, expanding nodes level by level. It is optimal when all step costs are identical, and its space complexity is O(bs) where s is the depth of the shallowest solution, not O(bm).
- A
- 19
What is the space complexity of breadth-first search in the worst case?
- A
O(bs) where s is the depth of the shallowest solution.
- B
O(s)
- C
O(b)
- D
O(bm) where m is the maximum depth.
Correct answer
AO(bs) where s is the depth of the shallowest solution.
Explanation
BFS stores the entire fringe, which at the deepest level before finding the solution can be up to bs nodes (the number of nodes at depth s).
- A
- 20
When would you prefer depth-first search over breadth-first search?
- A
When all step costs are different.
- B
When memory is limited and a solution exists at a reasonable depth.
- C
When the branching factor is very high.
- D
When you need the optimal solution.
Correct answer
BWhen memory is limited and a solution exists at a reasonable depth.
Explanation
DFS uses much less memory than BFS (O(bm) vs O(bs)). It can be useful when memory is constrained, though it may not find the optimal solution and may not be complete.
- A
- 21
What is the main advantage of iterative deepening search over BFS?
- A
It does not require a goal test.
- B
It always finds the cheapest solution regardless of costs.
- C
It is faster than BFS in all cases.
- D
It has the same space complexity as DFS (O(bd)) while being complete and optimal (for unit costs).
Correct answer
DIt has the same space complexity as DFS (O(bd)) while being complete and optimal (for unit costs).
Explanation
Iterative deepening runs DFS with increasing depth limits. It combines DFS's space advantage (O(bd)) with BFS's completeness and optimality (for unit costs), at the cost of some time overhead.
- A
- 22
How does iterative deepening search avoid the huge time overhead of repeatedly expanding nodes at shallow depths?
- A
It uses a heuristic to prune branches.
- B
It remembers previously expanded nodes across iterations.
- C
Most of the work is at the deepest level, so shallow levels are visited relatively few times.
- D
It only expands nodes that are on the path to the goal.
Correct answer
CMost of the work is at the deepest level, so shallow levels are visited relatively few times.
Explanation
In a tree with branching factor b, the deepest level contains about bd nodes, while shallow levels have exponentially fewer. The overhead of re-expanding shallow levels is small compared to the deepest level.
- A
- 23
What data structure does uniform cost search use to manage the fringe?
- A
A queue (FIFO).
- B
A stack (LIFO).
- C
A set of visited states.
- D
A priority queue ordered by the cumulative path cost.
Correct answer
DA priority queue ordered by the cumulative path cost.
Explanation
Uniform cost search (UCS) uses a priority queue where the node with the smallest total path cost is expanded next. This ensures it explores in order of increasing cost.
- A
- 24
When does uniform cost search return the goal node?
- A
When the goal node has the smallest heuristic value.
- B
As soon as the goal node is added to the fringe.
- C
After all nodes have been expanded.
- D
When the goal node is popped from the priority queue (i.e., when it is about to be expanded).
Correct answer
DWhen the goal node is popped from the priority queue (i.e., when it is about to be expanded).
Explanation
UCS waits until the goal node is the minimum-cost node in the fringe (i.e., when it would be expanded). This ensures that no cheaper path to the goal exists, guaranteeing optimality.
- A
- 25
What condition is necessary for uniform cost search to be complete?
- A
The goal must be reachable from the start.
- B
The branching factor must be finite.
- C
The state space must be finite.
- D
All action costs must be positive and bounded below by some epsilon>0.
Correct answer
DAll action costs must be positive and bounded below by some epsilon>0.
Explanation
If action costs can approach zero (e.g., 1/2, 1/4, ...), UCS could expand infinitely many nodes with decreasing costs. A positive minimum cost ensures it will eventually expand all nodes with cost less than the optimal solution cost.
- A
- 26
What is the time complexity of uniform cost search in the worst case?
- A
O(bC∗/epsilon) where C∗ is the optimal cost and epsilon is the minimum action cost.
- B
O(nlogn) where n is the number of states.
- C
O(bs) where s is the shallowest solution depth.
- D
O(bm) where m is the maximum depth.
Correct answer
AO(bC∗/epsilon) where C∗ is the optimal cost and epsilon is the minimum action cost.
Explanation
UCS explores all nodes with cost less than or equal to C∗. The maximum depth explored can be up to C∗/epsilon, leading to worst-case exponential time in that depth with branching factor b.
- A
- 27
In the videos comparing DFS, BFS, and UCS on a maze with varying water depth (cost), which algorithm explored more area in shallow water first?
- A
Breadth-first search.
- B
Depth-first search.
- C
They all explored in the same pattern.
- D
Uniform cost search.
Correct answer
DUniform cost search.
Explanation
UCS prioritizes low-cost regions, so it explored shallow (low-cost) water first, avoiding deep water until necessary. DFS and BFS do not consider cost.
- A
- 28
If all action costs are equal, how does uniform cost search compare to breadth-first search?
- A
They are essentially the same, both exploring in order of depth.
- B
BFS expands fewer nodes than UCS.
- C
UCS is slower because it uses a priority queue.
- D
UCS is optimal while BFS is not.
Correct answer
AThey are essentially the same, both exploring in order of depth.
Explanation
When all step costs are equal, the cumulative path cost is equivalent to depth. Both algorithms expand nodes in non-decreasing depth order, so they behave identically.
- A

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