A Markov reward process has two states with transition matrix P=(010.50.5), expected rewards R=(0,1)⊤ and γ=0.5. What is the Bellman equation in matrix form, what is its solution for V, and why does a unique solution exist for any γ<1?

Reinforcement learning, Bellman equations
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can turn the Bellman expectation equation into the linear system V=R+γPV and solve it.

Key idea

For a fixed policy, V=R+γPV, so V=(I−γP)−1R. The matrix I−γP is invertible for γ<1 because P is a stochastic matrix with eigenvalues of size at most 1.

Steps

  1. Write the Bellman equation for each state: V(s)=R(s)+γ∑s′P(s,s′)V(s′). In matrix form V=R+γPV.
  2. Rearrange: (I−γP)V=R. Here I−0.5P=(1−0.5−0.250.75).
  3. Solve by substitution. Row 1 gives V1=0.5 V2. Row 2 gives −0.25 V1+0.75 V2=1, so −0.125 V2+0.75 V2=1 and V2=1/0.625=1.6. Then V1=0.8.
  4. Check state 2 directly: V2=1+0.5 (0.5×0.8+0.5×1.6)=1+0.5×1.2=1.6. It matches.
  5. Why a unique solution exists: every eigenvalue λ of γP has ∣λ∣≤γ<1, so 1 is never an eigenvalue and I−γP is invertible. Equally, V↦R+γPV is a γ-contraction.
  6. Mention the cost: solving directly takes O(∣S∣3), so for large state spaces we use iterative methods (dynamic programming, TD or Monte Carlo) instead.

Common mistakes

How long your answer should be

Half a page; 4–5 minutes.

Last checked on 4 December 2026.

Read this

Previous in Reinforcement learning: An MDP has non-terminal states A and B, and γ=0.9. In A, action a1 gives reward 2 and ends the episode. Action a2 gives reward 0, and moves to B with probability 0.8 or stays in A with probability 0.2. In B, action b1 gives reward 4 and ends the episode. Action b2 gives reward 0 and moves to A. Starting from V0=0, what are the results of three sweeps of value iteration, and then what are V∗ exactly and the optimal policy?
Next in Reinforcement learning: Four episodes are generated by a behaviour policy b. For a target policy π, the importance ratios ρ=∏tπ(at∣st)/b(at∣st) and the returns G are (ρ,G)=(4,8), (0,5), (2,3) and (4,2). Compute the ordinary and weighted importance-sampling estimates of Vπ at the start state. Which is biased, and which has higher variance?