A corridor has three non-terminal cells 1, 2, 3 in a row, with a terminal cell L to the left of cell 1 and a terminal cell R to the right of cell 3. The policy moves left or right with probability each. Moving into R gives reward , and every other move gives reward . With and , compute (synchronous sweeps) for cells 1, 2, 3. What do the values converge to?
Reinforcement learning, Dynamic programming
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can run iterative policy evaluation by hand using the Bellman expectation backup.
Key idea
Each sweep applies to every state, using only the values from the previous sweep. The sweeps converge to , the solution of the Bellman expectation equations.
Steps
- Terminal cells have value . Write the three backups: , , and .
- Sweep 1 (from all zeros): . Only cell 3 sees the reward.
- Sweep 2: , , .
- Sweep 3: , , .
- Find the limit by solving the fixed-point equations. Substituting and into gives , so . Then and .
- Interpret: is the probability that a random walk started at reaches R before L.
Common mistakes
- Using updated values within the same sweep when the question asks for synchronous sweeps. In-place sweeps give different intermediate numbers.
- Forgetting the reward on the move into R, so cell 3 never gets a non-zero value.
- Stopping after a few sweeps and calling the values converged. After three sweeps cell 1 is , still half of its limit.
How long your answer should be
A short table of three sweeps, then the limit; about 5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Reinforcement learning: In state the agent takes action with , gets reward and lands in , where and . The -greedy policy then picks the exploratory action . With and , compute the new under SARSA and under Q-learning. Why do they differ?
Next in Reinforcement learning: After total pulls, a three-armed bandit with rewards in has pull counts and sample means . Which arm does UCB1 pull next, using the index ? What would a greedy agent do?