A deterministic MDP has two states, A and B, and . In A you can "stay" (reward 1, remain in A) or "go" (reward 0, move to B). In B the only action is "stay" (reward 2, remain in B). Starting from , what are the values after three iterations of value iteration, and what are and the optimal policy?
Reinforcement learning, Dynamic programming
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can apply the Bellman optimality backup mechanically and read the greedy policy off the values.
Key idea
Each sweep applies . The values converge to , and the greedy action can change along the way as the value of distant rewards propagates back.
Steps
- Write the two backups: and .
- Iteration 1: (stay), .
- Iteration 2: (stay); .
- Iteration 3: (go); .
- Solve the fixed point. . Staying in A forever is worth ; going is worth . So and go.
- Comment: the greedy action in A switched from stay to go at iteration 3, and the max-norm error shrinks by at least a factor per sweep.
Common mistakes
- Reading the optimal policy off early iterates. The second sweep still picks "stay" in A, the wrong action; the choice switches to "go" only in the third sweep.
- Forgetting on the next-state value, or applying it to the immediate reward.
- Using a value updated earlier in the same sweep without saying so. That is in-place (Gauss–Seidel) value iteration: valid, but the intermediate numbers differ.
How long your answer should be
A small table of and for , plus three lines for ; about 3 minutes.
Last checked on 4 December 2026.
Read this
- Sutton and Barto, Reinforcement Learning: An Introduction (2nd ed.), Section 4.4: Free PDF. Section 4.4, Value Iteration (pp. 82–84): the backup V(s) ← max_a Σ p(s′, r | s, a)[r + γV(s′)], with pseudocode and the stopping test.
- David Silver, UCL RL Course, Lecture 3: Planning by Dynamic Programming: Slides 20–26: value iteration with a worked shortest-path example showing values propagating back sweep by sweep.
- NPTEL: Reinforcement Learning (IIT Madras, Prof. Balaraman Ravindran): Week 5, Value Iteration, which covers the update rule and its convergence.
Previous in Reinforcement learning: What is the difference between the state-value and the action-value , and how are they related? If , , and , what is ?
Next in Reinforcement learning: Write the Q-learning update. With , , , reward and , compute the new . Why is Q-learning called off-policy?