Markov Decision Processes and Bellman Equations
The Bellman equations turn a sequential decision problem into a self-consistent system of linear or nonlinear equations: a state's value is the expected immediate reward plus the discounted value of the next state, and the optimality equations add a max over actions. Their contraction property gives value iteration, policy iteration, and the theoretical foundation of all reinforcement learning.
1. Concept overview
A Markov decision process (MDP) is a tuple : a set of states, a set of actions, transition probabilities , expected rewards , and a discount factor . The objective is to choose a policy maximizing the expected discounted return
The state value and action value obey the Bellman expectation equations
Replacing the average over actions by a maximum gives the Bellman optimality equations
These are fixed-point equations, not definitions to be solved by substitution. Because the Bellman operator is a -contraction in sup norm, the fixed point is unique and simple iteration converges to it.
2. Why this concept exists
A policy is a function from states to actions, so there are deterministic policies: only for a 10-state game, and for a modest 100-state one. Exhaustive search is impossible.
Bellman's insight is bootstrap decomposition: the value of a state can be written in terms of values of successor states. This replaces combinatorial search with a system of coupled equations, solvable by dynamic programming in polynomial time. It also decouples what happens next (model ) from what we choose (policy ), which later made it possible to learn values from sampled transitions without knowing at all (temporal difference learning, Q-learning).
Earlier alternatives — full look-ahead search through the game tree, manual case analysis, or brute-force policy enumeration — either blow up with horizon or require a complete model of every contingency. Bellman equations give a compact recursive representation whose depth is unbounded (infinite horizon) but whose size is linear in the state count.
3. Historical background
Richard Bellman introduced dynamic programming in the late 1940s and formalized Markovian decision processes in his 1956 paper "A Markovian Decision Process" and the 1957 book Dynamic Programming. He coined "dynamic programming" partly to avoid a negative connotation of "research" in the defense-contracting environment of the RAND Corporation.
Ronald Howard (1960) developed policy iteration in Dynamic Programming and Markov Processes — the first algorithm that alternates exact policy evaluation with greedy improvement. Blackwell, Derman, and others established robustness and optimality criteria for discounted and average-reward MDPs in the 1960s. Puterman's 1994 monograph Markov Decision Processes is the definitive reference, including the contraction proofs and average-reward subtleties.
In AI, the equations became operational through Sutton's (1988) temporal-difference learning and Watkins & Dayan's (1992) Q-learning, which replace the known model by samples. Sutton & Barto's textbook (1989/2018) unified the planning and learning viewpoints. Modern deep RL (DQN, AlphaGo, PPO) retains the Bellman backup as its target-defining primitive.
4. Fundamental problem
Given the model , compute
for every state, and extract an optimal policy .
Three structural difficulties:
- Circularity: depends on , which may depend back on (loops in the state graph). This is a coupled system, not a recurrence with a base case.
- Nonlinearity: the max in the optimality equation makes the system nonlinear; linear-algebra solvers for do not directly apply.
- Horizon: the return is an infinite sum. Discounting guarantees convergence and makes the operator contractive; without it, one needs total-reward or average-reward assumptions (proper/Communicating MDPs).
5. First-principles explanation
Three elementary facts generate all Bellman equations.
Fact 1 — Markov property. . The future is conditionally independent of the past given the current state and action, so a value function indexed only by (or ) is sufficient.
Fact 2 — Additivity of the return.
This algebraic identity is the entire content of "bootstrapping".
Fact 3 — Law of total expectation. Condition on the first action and next state:
By Facts 1–2 the inner expectation equals , giving the Bellman expectation equation. For optimality, Bellman's principle of optimality says an optimal policy's tail must itself be optimal from every reachable state, so can be replaced by , and the choice of the first action becomes .
6. Prerequisite concepts
Required: probability spaces and conditional expectation (to justify taking expectations over trajectories); Markov chains and transition matrices (to read ); discrete-time discounting and geometric series (to guarantee ); basic linear algebra (matrix inverses, spectral radius) for policy evaluation; the contraction mapping theorem / fixed-point iteration for convergence; and dynamic programming as an algorithmic mindset. Familiarity with expectation–maximization style alternating updates helps for policy iteration, and with supervised regression for the learning variants.
7. Complete mathematical formulation
Model. Finite MDP with , ; for each action, is row-stochastic and is the expected-reward vector.
Value of a fixed policy. With and ,
The inverse exists because the eigenvalues of have modulus at most .
Bellman expectation operator. ; is its unique fixed point.
Bellman optimality operator. ; is its unique fixed point.
Action values. , and .
Optimal policy. Any with only for is optimal.
Assumptions. Finite state/action spaces and give the clean theory; uncountable spaces require measurability and sup-norm analogues, and requires extra structure (absorbing states, communicating MDPs).
8. Notation dictionary
| Symbol | Meaning | Type / shape | |---|---|---| | | state and action sets | finite sets, , | | | current and next state | elements of | | | current and next action | elements of | | | transition probability | in , | | | random reward after step | random scalar | | | expected immediate reward | scalar, vector | | | discount factor | scalar in | | | discounted return from time | random scalar | | | policy (stochastic or deterministic) | distribution / map | | | state value under / optimal | vector in | | | action value under / optimal | matrix in | | | expectation and optimality Bellman operators | maps | | | max norm, | norm on | | | policy-induced transition matrix | | | | convergence tolerance | positive scalar |
9. Step-by-step derivation
Step 1 — decompose the return. .
Step 2 — condition on the first action and successor state. For a fixed policy,
The last expectation is by the Markov property, giving the first Bellman equation.
Step 3 — action-value form. Conditioning instead on and averaging only over gives
Step 4 — optimality. If the agent may choose the first action, Bellman's principle of optimality lets the tail be optimal: replace the inner expectation by and maximize over :
Step 5 — value iteration. Because is a -contraction (section 10), the iteration converges. After steps,
Step 6 — policy iteration. Given , solve the linear system , then set . The policy-improvement theorem guarantees pointwise, so the algorithm terminates at in at most steps (far fewer in practice).
Step 7 — extracting the policy. Once is within of , the greedy policy is -optimal; the bound follows from the contraction error amplification by .
10. Proofs and proof intuition
Theorem 1 (contraction). For any , . Proof. For each , let attain the max in . Then . Swapping and gives the reverse inequality; take the max over . The same argument works for without the max.
Theorem 2 (Banach fixed point). and have unique fixed points and , and converges. Proof. is complete and ; apply the contraction mapping theorem.
Corollary (error bound). . Proof. , so successive differences shrink geometrically; sum the tail .
Theorem 3 (policy improvement). If is greedy w.r.t. , i.e. , then pointwise. Proof. would hold if the greedy action were -greedy everywhere, but in general . Iterating and using monotonicity of (nonnegative matrix ) gives .
Proof intuition. The max can move values by at most times the previous perturbation because rewards and transitions are fixed; each backup compresses differences by the discount factor, like a repeated average. That is why the solution is unique and iteration cannot cycle.
11. Geometric interpretation
The unknown lives in , one coordinate per state. A backup is an affine function of (plus a max), so maps the value space into itself while shrinking all sup-norm distances by : the image of any set is times smaller. Repeated application spirals/contracts every starting point toward the single fixed point , like a map of the plane scaled toward one distinguished point.
For a fixed policy the geometry is exactly linear: is the intersection of hyperplanes , i.e. the solution of . Different policies give different points; the Bellman optimality equation says is the point where the upper envelope of affine functions (one per action) touches the vector itself. The max introduces a kink: value space is partitioned into regions where each action is greedy, and is a fixed point lying on the boundary of several such regions.
The optimal policy's value vector dominates all others: iff componentwise. Policy iteration walks monotonically upward through the finite set of policy values.
12. Visual explanation
Draw a backup diagram: at the root, a state node (filled circle); below it, one branch per action (open action nodes), each leading to chance nodes (small circles) for successors with edge labels and ; each node carries the backed-up quantity . The expectation equation averages over both levels; the optimality equation takes the max at the action level and the expectation at the chance level.
A second visual is a plot of versus on log scale: a straight line of slope (for the two-state example, slope per iteration for ). Policy iteration instead shows a staircase in , rising monotonically and flattening at .
Use the interactive MDP Value Iteration Playground in Practical Labs: edit and , start from random , and watch the value bars and greedy arrows stabilize. Increase toward 1 and observe the contraction slow down (the discount factor is literally the contraction modulus).
13. Numerical worked example
Consider a deterministic two-state MDP: states , actions , . From : walk with reward ; stay with reward . From : walk with reward ; stay with reward .
Start . Value iteration:
- , .
- , .
- , then , .
- Converges to (sup-norm residual reached at iteration 22; the bound gives at ).
Action values:
So walk is optimal in both states. Policy evaluation for that deterministic policy uses , :
14. Real-world analogy
Think of a warehouse manager who must decide each week whether to order stock. The "value" of the current inventory level is the expected total future profit, discounted because money next month is worth less. Bellman's equation says this value equals this week's expected profit plus the discounted value of next week's inventory — a recursive accounting identity. The manager does not need to enumerate every possible sequence of future orders: if they know the value of each possible next inventory level, one local decision suffices (the principle of optimality). Policy iteration is the managerial routine of first estimating how good the current ordering rule is, then switching any week's decision to the rule that looks best given those estimates.
15. Algorithm pseudocode
algorithm ValueIteration(P, r, gamma, epsilon):
V[s] <- 0 for all s # arbitrary initialisation
repeat:
delta <- 0
for each state s:
v_old <- V[s]
V[s] <- max_a [ r(s,a) + gamma * sum_s' P(s'|s,a) * V[s'] ]
delta <- max(delta, |V[s] - v_old|) # in-place (Gauss-Seidel) OK
until delta < epsilon*(1-gamma)/(2*gamma) # near-optimal policy guarantee
pi[s] <- argmax_a [ r(s,a) + gamma * sum_s' P(s'|s,a) * V[s'] ]
return V, pi
algorithm PolicyIteration(P, r, gamma):
pi <- arbitrary deterministic policy
repeat:
# exact policy evaluation: solve (I - gamma P_pi) V = r_pi
V <- solve(I - gamma*P[pi], r[pi])
pi_old <- pi
for each s: pi[s] <- argmax_a [ r(s,a) + gamma*sum_s' P(s'|s,a) V[s'] ]
if pi == pi_old: break # policy improvement terminates
return V, pi
16. Implementation from scratch
import numpy as np
gamma = 0.5
n_states, n_actions = 2, 2
P = np.zeros((n_actions, n_states, n_states)) # [a, s, s']
r = np.zeros((n_actions, n_states, n_states))
P[0, 0, 1] = 1.0; r[0, 0, 1] = 1.0 # A: walk -> B, reward 1
P[1, 0, 0] = 1.0 # A: stay -> A, reward 0
P[0, 1, 0] = 1.0; r[0, 1, 0] = 2.0 # B: walk -> A, reward 2
P[1, 1, 1] = 1.0 # B: stay -> B, reward 0
rbar = (r * P).sum(axis=2) # expected reward (A, S): [[1,2],[0,0]]
def backup(V):
"""One Bellman optimality backup; shapes (S,) -> (A,S)."""
return rbar + gamma * np.tensordot(P, V, axes=([2], [0]))
def value_iteration(P, rbar, gamma, tol=1e-9, max_iter=1000):
V = np.zeros(P.shape[1])
for k in range(1, max_iter + 1):
V_next = backup(V).max(axis=0)
if np.max(np.abs(V_next - V)) < tol:
return V_next, k
V = V_next
raise RuntimeError("value iteration did not converge")
def policy_evaluation(P, rbar, gamma, pi):
n = P.shape[1]
P_pi = P[pi, np.arange(n)] # (S,S) rows chosen by pi[s]
r_pi = rbar[pi, np.arange(n)] # (S,)
return np.linalg.solve(np.eye(n) - gamma*P_pi, r_pi)
V, steps = value_iteration(P, rbar, gamma)
pi = backup(V).argmax(axis=0)
print(V, steps, pi) # [2.6667, 3.3333] 23 [0 0]
assert np.allclose(V, [8/3, 10/3], atol=1e-6)
assert np.all(pi == 0) # walk in both states
assert np.allclose(policy_evaluation(P, rbar, gamma, pi), V)
17. Professional library implementation
import torch
Pt = torch.tensor(P, dtype=torch.float32) # (A,S,S)
rt = torch.tensor(rbar, dtype=torch.float32) # (A,S)
# Bellman optimality backup with an explicit tensor contraction.
V = torch.zeros(n_states)
for k in range(1, 101):
Q = rt + gamma * torch.tensordot(Pt, V, dims=([2], [0])) # (A,S)
V_next = Q.max(dim=0).values # (S,)
if torch.max(torch.abs(V_next - V)).item() < 1e-7:
break
V = V_next
print(k, V) # tensor([2.6667, 3.3333])
# Exact policy evaluation via a linear solve (works with torch >= 1.9).
policy = torch.tensor([0, 0])
P_pi = Pt[policy, torch.arange(n_states)] # (S,S)
r_pi = rt[policy, torch.arange(n_states)] # (S,)
V_pi = torch.linalg.solve(torch.eye(n_states) - gamma*P_pi, r_pi)
assert torch.allclose(V_pi, V, atol=1e-5)
# Vectorised Bellman expectation backup for a stochastic policy pi(a|s).
pi_probs = torch.eye(n_actions)[policy] # (S,A) one-hot here
P_s = torch.einsum('sa,ast->st', pi_probs, Pt) # (S,S)
r_s = torch.einsum('sa,as->s', pi_probs, rt) # (S,)
V_s = torch.linalg.solve(torch.eye(n_states) - gamma*P_s, r_s)
For large tabular MDPs use sparse matrices (scipy.sparse) for and iterative solvers (GMRES) instead of forming . For continuous or huge state spaces, replace the table by a neural network and minimize the Bellman residual — that is the bridge to deep RL.
18. Code walkthrough
Model construction. P[a,s,s2] and r[a,s,s2] use action-first indexing so a single tensordot over axis 2 (the successor index) produces the matrix . Multiplying r * P and summing over successors first gives rbar, the expected immediate reward used by all backups. Had we added the full tensor r to the backup, broadcasting would silently create a wrong array — a classic shape bug.
Value iteration. V_next = backup(V).max(axis=0) takes the max over the action axis, leaving one value per state. Stopping on tracks the successor difference whose geometric tail bounds the true error by .
Policy evaluation. P[pi, arange(n)] performs advanced indexing: row of the resulting matrix is under the action chosen in state . Solving np.eye(n) - gamma*P_pi implements without ever forming a matrix inverse (numerically stabler).
PyTorch version. torch.tensordot is the differentiable analogue; the einsum lines show how a stochastic policy is folded into the transition matrix. Note that the policy is one-hot here, so P_s matches P_pi; with real probabilities the same code handles stochastic policies.
19. Tensor and memory analysis
For a tabular MDP with states and actions:
- transition tensor : floats; rewards : floats (or if reward depends only on );
- value vector : floats; action values : floats;
- policy : floats for a stochastic policy, integers for deterministic.
With , in fp32: needs MB, another 16 MB (8 MB if only), 4 KB, 16 KB. The model dominates; value storage is negligible. With sparse transitions ( nonzero successors per state-action) store in CSR/COO with entries instead of — for that is 48 KB, a saving.
For function approximation with a network of parameters, the "value tensor" is floats (e.g. M for a small Atari CNN = 6.8 MB fp32); deep RL additionally needs a target network (another ), optimizer state ( for Adam), and a replay buffer of transitions. Atari frames stored as uint8 are 28,224 bytes each, so costs GB for observations alone (two frames per transition) — the reason modern systems store compressed frames or use frame stacking at sample time.
20. Time complexity
A single full backup over all states costs arithmetic operations (sum over actions and successors for each of states); with sparse transitions ( successors per pair) it is . Value iteration with iterations costs , and to reach accuracy because the error shrinks by per step.
Policy evaluation via the linear system costs dense (or with iterative solver sweeps). One policy-improvement pass costs ; policy iteration therefore takes for outer iterations, with typically small (< 20) but theoretically up to the number of deterministic policies.
For deep approximations, one backup evaluated on a batch of samples costs ; the contraction guarantee no longer applies exactly, which is why deep value methods need target networks and regularization.
21. Space complexity
Tabular storage is for the full model, sparse, plus for and for . Value iteration needs only two -vectors if backups are done in place (or one vector with Gauss–Seidel updates), i.e. working memory beyond the model. Policy iteration needs the matrix during the solve: working memory, reducible to plus matrix–vector products with iterative solvers.
In the function-approximation case, memory is for each network copy plus replay/storage; gradient-based Bellman-residual minimization needs backpropagation activations , which can be cut by checkpointing.
22. Experimental demonstration
Run the scratch code and log for the two-state MDP. Observed: , , , then a clean factor-2 decay each iteration, crossing at — exactly the corollary's bound . Recompute with : contraction factor 0.9, so the same tolerance needs roughly 130 iterations; plotting shows slopes vs. per step.
Second experiment: initialize at and and confirm both trajectories converge to the same (uniqueness). Third: run policy iteration starting from "stay in both states"; policy evaluation gives , one improvement step switches both states to walk, evaluation returns , and the next improvement is unchanged — termination in 2 iterations.
Finally, perturb by 1% and measure ; the sensitivity bound is roughly times the transition perturbation, illustrating why values become fragile as .
23. Benchmark results
On the two-state example above, value iteration needs 22 backups for sup-norm accuracy at , while policy iteration converges in 2 evaluation/improvement cycles; both return . On the classic FrozenLake grid (16 states, 4 actions, ), tabular value iteration typically converges in 60–100 full sweeps, and exact policy evaluation of a deterministic policy is a solve taking microseconds. These numbers are illustrative toy benchmarks, not universal constants: convergence is governed by and the mixing structure of .
For larger MDPs, sparse value iteration scales roughly linearly in the number of nonzero transitions, whereas dense policy iteration pays per cycle; this is why value iteration is the default in grid worlds and policy iteration wins when the model is small and exact evaluation is cheap. Always report the state count, , tolerance, and whether the reported error is the Bellman residual or the true error — the former is an upper bound on the latter divided by .
24. Limitations
- Requires knowledge of and (planning). Learning variants (TD, Q-learning) relax this but introduce sampling noise and function-approximation issues.
- Tabular storage is impossible for large or continuous state spaces; function approximation loses exact contraction guarantees.
- Discounting biases the agent toward the near future; modeling long-horizon tasks with slows convergence by .
- Exact policy evaluation is expensive for large .
- The max operator is non-smooth, complicating gradient-based analysis; ties require consistent tie-breaking for reproducible policies.
- With the operator is not a contraction; total- and average-reward MDPs need separate theory (unichain, communicating classes).
- Partial observability breaks the Markov property of observed states; one must plan in belief space (POMDPs).
25. Failure scenarios
- with recurrent states: the return diverges, is singular, and value iteration never converges. Use discounting or verify the MDP is proper.
- No terminal absorption in an episodic task: values grow without bound if rewards are positive and the episode never ends; add absorbing states with zero reward.
- too close to 1: error bound degrades as ; a residual of can hide a value error at .
- Wrong tensor axes: adding a reward tensor of shape to a backup of shape broadcasts to ; assert shapes explicitly.
- In-place update with a stochastic approximation: Gauss–Seidel value iteration is valid for exact backups but can interact badly with asynchronous sampled updates; use separate buffers when in doubt.
- Policy iteration cycling: only possible with floating-point equality checks or an inaccurate policy evaluation; compare values rather than raw policy arrays and solve to tight tolerance.
- Unreachable states: their values are arbitrary under a given policy but still appear in the linear system; the matrix remains nonsingular, so results are well-defined but interpretation requires care.
26. Common misconceptions
- "The Bellman equation is a recurrence with a base case." It is a self-consistent fixed-point system; loops make substitution circular.
- " is the reward you get immediately." It is the discounted total expected return, not a one-step quantity.
- "." Correct only if the transition is deterministic; the general form averages over .
- "Value iteration requires knowing the optimal policy first." It computes values directly from the model, then extracts the policy by taking a max.
- "Policy iteration can cycle forever." Under exact evaluation with and finite MDPs it strictly improves until optimal; cycling signals numerical error.
- "The discount factor merely saves computation." It also encodes preferences over time and changes the optimal policy, not just the convergence rate.
- "A small Bellman residual proves near-optimality." Only via ; the residual can be tiny while the true error is large.
27. Alternative approaches
- Policy iteration / modified policy iteration: exact or partially iterated evaluation plus greedy improvement; faster when the model is small.
- Linear programming: is the solution of s.t. — useful for constrained MDPs.
- Real-time dynamic programming (RTDP): asynchronous, trajectory-focused backups for huge state spaces.
- Temporal difference learning: replace by samples: .
- Q-learning / SARSA: learn action values directly; off-policy vs. on-policy control.
- Monte Carlo methods: estimate returns by complete episodes; no bootstrapping, higher variance.
- Model-based planning (Dyna, MCTS): learn then plan, or sample-forward with a learned simulator.
29. Research applications
- Deep RL: DQN minimizes the squared Bellman residual with a target network; double Q-learning corrects the max's overestimation bias; distributional RL generalizes from expected returns to return distributions (Bellman's equation becomes a distributional projector).
- Robotics and control: Model Predictive Control and approximate DP use Bellman backups over learned dynamics; constrained MDPs add Lagrangian multipliers.
- Recommendation / operations research: Markovian customer models, inventory control, maintenance scheduling.
- Language model alignment: RLHF value models are trained with Bellman-style TD regressions on preference-derived rewards; DPO bypasses explicit value functions.
- Multi-agent RL: Bellman equations generalize to Markov games (minimax/Nash equilibria rather than a single max).
- Theoretical RL: sample complexity, PAC-MDP, and regret bounds all start from Bellman-operator contraction.
30. Important research papers
- Bellman R. E. (1956), A Markovian Decision Process, Journal of Mathematics and Mechanics 6(5):679–684 — the original MDP formulation.
- Bellman R. E. (1957), Dynamic Programming, Princeton University Press — principle of optimality and the contraction viewpoint.
- Howard R. A. (1960), Dynamic Programming and Markov Processes, MIT Press — policy iteration.
- Blackwell D. (1962), Discrete Dynamic Programming, Annals of Mathematical Statistics — discounted optimality and optimality equations.
- Puterman M. L. (1994), Markov Decision Processes: Discrete Stochastic Dynamic Programming, Wiley — definitive reference.
- Sutton R. S. (1988), Learning to Predict by the Methods of Temporal Differences, Machine Learning 3:9–44 — sample-based Bellman backups.
- Watkins C. J. C. H., Dayan P. (1992), Q-learning, Machine Learning 8:279–292 — convergence of sampled optimality backups.
31. Further reading
- Sutton & Barto, Reinforcement Learning: An Introduction (2nd ed., 2018), chapters 3–4 — free PDF at incompleteideas.net.
- Puterman (1994), chapters 6–7 for discounted MDPs and contraction proofs.
- Bertsekas & Tsitsiklis, Neuro-Dynamic Programming (1996) — approximate DP and TD convergence.
- Csaba Szepesvári, Algorithms for Reinforcement Learning (2010), chapters 2–5 — concise theory with proofs.
- Stanford CS234 lecture notes on MDPs and dynamic programming.
- OpenAI Spinning Up: "Part 1: Key Concepts in RL" — spinningup.openai.com.
32. Practical exercises
- Reproduce the two-state example by hand: three value-iteration sweeps, then solve and verify agreement.
- Implement
value_iterationandpolicy_evaluationfrom memory; assert and that the greedy policy walks. - Derive the Bellman equation for a deterministic shortest-path MDP with terminal reward 1 and all other rewards 0; show it reduces to for undiscounted shortest paths.
- Run value iteration with ; record iterations to residual and compare with .
- Change the example so "stay" yields reward 0.4 in ; compute the new and the action gap. At what reward does the optimal policy switch?
- Implement the LP formulation with
scipy.optimize.linprogand confirm it matches value iteration on a random 5-state MDP.
33. Debugging challenges
- Values diverge to infinity: check , rewards are finite, and every row of sums to 1.
- Value iteration converges to a policy that is not greedy: the stopping tolerance is probably too loose; enforce .
- Policy evaluation gives negative/huge values: is ill-conditioned as ; use an iterative solver or smaller .
- Shape mismatch
(2,2,2) vs (2,2): you added the full reward tensor instead ofrbar=(r*P).sum(axis=2). - Two runs with different give different policies but identical values: expected — action ties can be broken differently; fix a deterministic tie-break.
- Residual decreases but the extracted policy is poor: verify you are taking
argmaxover the action axis, not the state axis.
34. Advanced exercises
- Prove the LP duality between form and the Bellman optimality inequalities; implement both and compare.
- Derive and implement modified policy iteration with partial evaluation backups; show the spectrum between value () and policy () iteration.
- Prove that for deterministic the optimality equation reduces to a shortest/longest path problem and solve it by value iteration on a 100-node graph.
- Derive the sensitivity bound and verify numerically on a perturbed MDP.
- Extend the equations to average-reward MDPs: show (the Bellman average-reward equation) and discuss when is state-independent.
35. Interview questions
- State the Bellman expectation and optimality equations and explain where each expectation comes from.
- Prove that the Bellman optimality operator is a -contraction in sup norm. Where is the max handled?
- Why is invertible for ? Give a spectral-radius argument.
- Compare value iteration and policy iteration in cost per iteration, total iterations, and memory.
- How do you extract an optimal policy from an approximately optimal ? What accuracy is needed for an -optimal policy?
- Explain why is computationally painful and what it does to the value estimates.
- Show that but in general.
36. Research questions
- How can we obtain tight error certificates for deep when the contraction property is lost by function approximation?
- What is the sample complexity of model-free Bellman backup estimation under heavy-tailed or correlated rewards?
- Can learned representations preserve Bellman-consistency while minimizing residual objectives beyond squared loss (e.g. Huber, quantile, distributional)?
- How do Bellman equations change in mean-field multi-agent systems with thousands of interacting agents?
- What role does the discount factor play in implicit bias toward robust vs. myopic policies in overparameterized deep RL?
37. Mastery assessment
To pass: (1) derive both Bellman expectation and optimality equations from and conditional expectation without notes; (2) prove the -contraction and the error bound ; (3) reproduce the two-state numerical example including the linear-system evaluation; (4) implement value iteration and policy iteration from scratch and verify against the closed-form solution; (5) explain policy improvement and termination; (6) answer the interview questions. Complete the linked assessment in Assessments; self-reporting a read is not mastery.
38. Implementation submission
Push a repository containing bellman.py (numpy implementation with value_iteration, policy_evaluation, policy_improvement), experiments.ipynb (the two-state convergence table for , the LP comparison, and a random 5-state MDP), a README.md with the derivations and observed vs. theoretical slopes, and tests asserting , greedy policy walk, and policy-iteration termination. Include a log-scale plot of . Submit the repository URL and the exact command to reproduce the numbers.
39. Completion criteria
All of: every section read and the derivation reproduced on paper; scratch implementations passing tests on the two-state MDP and one random MDP; three recorded experiments with plots and observed convergence rates; assessment score at least 80%; one failure case (e.g. or shape bug) reproduced and explained; one research question answered in a one-page note citing at least one paper. Only then mark the concept mastered.`