State-Based Models: MDPs & Games
- 25Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What distinguishes a search-based model from a reflex-based model in terms of output?
25 questions
- 1
What distinguishes a search-based model from a reflex-based model in terms of output?
Model answer
A reflex-based model outputs a single action per input, while a search-based model outputs a sequence of actions, considering future consequences.
Explanation
In reflex-based models, the output does not influence future inputs, whereas in search problems, an action affects subsequent states, so planning over a sequence is necessary.
- 2
Give two examples of real-world problems that can be modeled as search problems.
Model answer
Route finding (shortest path from A to B) and robot motion planning (moving from start to goal with constraints).
Explanation
Search problems involve finding a sequence of actions to achieve a goal, common in navigation and robotics.
- 3
In the farmer, cabbage, goat, and wolf puzzle, why is taking the cabbage across first not a valid first move?
Model answer
Because if the farmer takes the cabbage first, the wolf is left with the goat, and the wolf will eat the goat.
Explanation
The constraint prohibits leaving wolf and goat together unattended.
- 4
How many crossings are required to solve the farmer, cabbage, goat, and wolf puzzle (with the boat carrying the farmer plus one item)?
Model answer
Seven crossings.
Explanation
The optimal solution requires seven crossings: take goat, come back, take wolf, bring goat back, take cabbage, come back, take goat.
- 5
List the five essential components needed to formally define a search problem.
Model answer
Start state, actions function, cost function, successor function, and IsEnd function.
Explanation
These components specify the initial state, available actions, cost of each action, resulting state after an action, and termination condition.
- 6
What does the actions function return given a state?
Model answer
The actions function returns all possible actions that can be taken from that state.
Explanation
It enumerates the set of legal moves from a given state.
- 7
What is the purpose of the successor function in a search problem?
Model answer
The successor function takes a state and an action and returns the resulting state.
Explanation
It defines the transition from one state to another after executing an action.
- 8
In the tram problem, what are the two possible actions from any state S?
Model answer
Walk to S+1 costing 1 minute, or take the magic tram to 2S costing 2 minutes.
Explanation
Both actions move forward; walking increments by 1 and tram doubles the state.
- 9
What does the IsEnd function check?
Model answer
It checks whether the current state is a goal state (no further actions needed or desired).
Explanation
IsEnd returns true if the state satisfies the termination condition of the search problem.
- 10
Define branching factor b and depth d in the context of a search tree.
Model answer
Branching factor b is the average number of actions from each state; depth d is the number of steps in a path from start to a leaf.
Explanation
These parameters determine the size of the search tree and the complexity of search algorithms.
- 11
What is the time complexity of backtracking search, expressed in terms of b and d?
Model answer
O(b^d) time.
Explanation
Backtracking search explores the entire tree in worst case, visiting all nodes.
- 12
What is the space complexity of backtracking search?
Model answer
O(d).
Explanation
It only needs to store the current path from root to the current node.
- 13
Under what condition can depth-first search (DFS) stop as soon as it finds a solution?
Model answer
When all action costs are zero.
Explanation
If costs are zero, every solution has the same cost, so the first found solution is optimal.
- 14
What is the space complexity of breadth-first search (BFS)?
Model answer
O(b^d), where d is the depth of the shallowest goal.
Explanation
BFS must store all nodes at the current frontier, which grows exponentially with depth.
- 15
How does DFS iterative deepening combine the benefits of BFS and DFS?
Model answer
It uses BFS-style level-by-level search but runs a full DFS within each level, achieving space O(d) and time similar to BFS.
Explanation
It avoids the large memory of BFS while still guaranteeing to find the shallowest goal first.
- 16
What is the key assumption required for dynamic programming to be applicable to a search problem?
Model answer
The state space must be acyclic (no cycles).
Explanation
Dynamic programming relies on an ordering of states to compute future costs recursively; cycles break that ordering.
- 17
Write the Bellman optimality equation for the future cost of a state S in a search problem.
Model answer
future(S) = 0 if IsEnd(S) else min_{a in actions(S)} [cost(S,a) + future(succ(S,a))].
Explanation
This recurrence defines the minimum cost from S to a goal state.
- 18
How does memoization (caching) improve the performance of dynamic programming?
Model answer
It stores computed future costs for states so that they are not recomputed, reducing time from exponential to polynomial.
Explanation
By reusing results for repeated states, dynamic programming avoids redundant work.
- 19
What is the time complexity of dynamic programming on a state space with n states?
Model answer
O(n) (linear in the number of states).
Explanation
Each state’s future cost is computed once (with caching), and each computation examines its outgoing actions, leading to total time proportional to number of states.
- 20
Why must the state in dynamic programming be a summary of past actions sufficient for optimal future decisions?
Model answer
Because dynamic programming assumes the future cost depends only on the current state, not the entire history; otherwise, the recurrence would be invalid.
Explanation
The state must capture all relevant information to make optimal decisions without needing the full sequence of past actions.
- 21
In the 'cannot visit three odd cities in a row' problem, what is the minimal state space that suffices?
Model answer
A tuple (previous city was odd, current city), giving 2n states.
Explanation
Knowing whether the previous city was odd is enough to enforce the constraint; storing the exact previous city is unnecessary.
- 22
In the 'visit at least three odd cities' problem, what is the minimal state representation?
Model answer
A tuple (min(number of odd cities visited, 3), current city), giving 3n states.
Explanation
Only need to track up to three odd cities; more than three is the same as three for the constraint.
- 23
What is the assumption about costs in uniform cost search?
Model answer
All action costs must be non-negative.
Explanation
Non-negative costs ensure that the algorithm can safely pop the lowest-cost state from the frontier as optimal.
- 24
What are the three sets maintained by uniform cost search?
Model answer
Explored (states with optimal cost known), frontier (states seen but not yet confirmed optimal), and unexplored (states not yet seen).
Explanation
These sets organize the search process: explored states are finalized, frontier states are candidates for expansion, and unexplored are unknown.
- 25
In the uniform cost search example (A -> B (1), B -> C (1), C -> D (1), A -> C (100), B -> D (100)), what is the optimal cost from A to D and the path?
Model answer
Cost 3, path A -> B -> C -> D.
Explanation
The direct edge A->C is expensive; the path through B and C is cheaper overall.

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