An MDP has two states X and Y and . In X, action gives reward and moves to Y, while action gives reward and stays in X. In Y, action gives reward and moves to X, while action gives reward and stays in Y. Run policy iteration from the policy " in X, in Y". What are the evaluation and improvement steps, and what are the optimal policy and values?
Reinforcement learning, Dynamic programming
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can alternate full policy evaluation (solving the Bellman expectation equations) with greedy improvement, and know when to stop.
Key idea
Policy iteration repeats two steps. Evaluate: solve . Improve: set . It stops when the policy no longer changes, and that policy is optimal.
Steps
- Evaluate ( in X, in Y). gives . .
- Improve in X: and . Choose .
- Improve in Y: and . Choose . So is ( in X, in Y).
- Evaluate . gives . .
- Improve again. In X: and . In Y: and . Nothing changes, so the policy is stable.
- Conclude: with . Policy iteration needed two improvement rounds, which is typical, because each round is a full evaluation.
Common mistakes
- Doing only one backup in the evaluation step. That is value iteration (or modified policy iteration), not full policy iteration.
- Using over actions inside the evaluation. Evaluation uses the current policy's action only.
- Not checking stability. Stop only when an improvement step leaves every action unchanged, and watch for ties that can make the policy flip forever.
How long your answer should be
About one page: two evaluations and two improvements; 6–8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Reinforcement learning: Write PPO's clipped surrogate objective. With , evaluate the per-sample objective, and say whether it has a non-zero gradient, when (a) , ; (b) , ; (c) , . What is the clipping for?
Next in Reinforcement learning: An MDP has non-terminal states A and B, and . In A, action gives reward and ends the episode. Action gives reward , and moves to B with probability or stays in A with probability . In B, action gives reward and ends the episode. Action gives reward and moves to A. Starting from , what are the results of three sweeps of value iteration, and then what are exactly and the optimal policy?