concept / bellman-equations
Next task →
University/Reinforcement Learning/Foundations/Markov Decision Processes and Bellman Equations
Reinforcement Learning · Foundations · Value functions

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.

39 sectionsadvanced200 minhand-authored · structural 82/100
Take assessment →
Mastery requires: derivation reproduced, from-scratch implementation committed, failure case explained, and assessment score ≥ 80%. Current state: not_started.

1. Concept overview

A Markov decision process (MDP) is a tuple M=(S,A,P,R,γ)\mathcal{M}=(\mathcal{S},\mathcal{A},P,R,\gamma): a set of states, a set of actions, transition probabilities P(s′∣s,a)P(s'|s,a), expected rewards r(s,a)=E[Rt+1∣St=s,At=a]r(s,a)=\mathbb{E}[R_{t+1}\mid S_t=s,A_t=a], and a discount factor γ∈[0,1)\gamma\in[0,1). The objective is to choose a policy π(a∣s)\pi(a|s) maximizing the expected discounted return

Gt=∑k=0∞γkRt+k+1.G_t=\sum_{k=0}^{\infty}\gamma^k R_{t+k+1}.

The state value Vπ(s)=Eπ[Gt∣St=s]V^\pi(s)=\mathbb{E}_\pi[G_t\mid S_t=s] and action value Qπ(s,a)=Eπ[Gt∣St=s,At=a]Q^\pi(s,a)=\mathbb{E}_\pi[G_t\mid S_t=s,A_t=a] obey the Bellman expectation equations

Vπ(s)=∑aπ(a∣s)∑s′P(s′∣s,a)[r(s,a)+γVπ(s′)],V^\pi(s)=\sum_a\pi(a|s)\sum_{s'}P(s'|s,a)\bigl[r(s,a)+\gamma V^\pi(s')\bigr], Qπ(s,a)=∑s′P(s′∣s,a)[r(s,a)+γ∑a′π(a′∣s′)Qπ(s′,a′)].Q^\pi(s,a)=\sum_{s'}P(s'|s,a)\bigl[r(s,a)+\gamma\sum_{a'}\pi(a'|s')Q^\pi(s',a')\bigr].

Replacing the average over actions by a maximum gives the Bellman optimality equations

V∗(s)=max⁡a∑s′P(s′∣s,a)[r(s,a)+γV∗(s′)],Q∗(s,a)=∑s′P(s′∣s,a)[r(s,a)+γmax⁡a′Q∗(s′,a′)].V^*(s)=\max_a\sum_{s'}P(s'|s,a)\bigl[r(s,a)+\gamma V^*(s')\bigr],\qquad Q^*(s,a)=\sum_{s'}P(s'|s,a)\bigl[r(s,a)+\gamma\max_{a'}Q^*(s',a')\bigr].

These are fixed-point equations, not definitions to be solved by substitution. Because the Bellman operator is a γ\gamma-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 ∣S∣|\mathcal{S}| states to ∣mathcalA∣|mathcal{A}| actions, so there are ∣mathcalA∣∣S∣|mathcal{A}|^{|\mathcal{S}|} deterministic policies: only 410≈1.1×1064^{10}\approx1.1\times10^6 for a 10-state game, and 4100≈1.6×10604^{100}\approx1.6\times10^{60} 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 ∣mathcalS∣|mathcal{S}| coupled equations, solvable by dynamic programming in polynomial time. It also decouples what happens next (model PP) from what we choose (policy π\pi), which later made it possible to learn values from sampled transitions without knowing PP 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 (P,r,γ)(P,r,\gamma), compute

V∗(s)=max⁡πEπ ⁣[∑t=0∞γtRt+1 | S0=s]V^*(s)=\max_{\pi}\mathbb{E}_\pi\!\left[\sum_{t=0}^{\infty}\gamma^t R_{t+1}\,\middle|\,S_0=s\right]

for every state, and extract an optimal policy π∗(s)∈arg⁡max⁡aQ∗(s,a)\pi^*(s)\in\arg\max_a Q^*(s,a).

Three structural difficulties:

  1. Circularity: V(s)V(s) depends on V(s′)V(s'), which may depend back on V(s)V(s) (loops in the state graph). This is a coupled system, not a recurrence with a base case.
  2. Nonlinearity: the max in the optimality equation makes the system nonlinear; linear-algebra solvers for VπV^\pi do not directly apply.
  3. Horizon: the return is an infinite sum. Discounting γ<1\gamma<1 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. P(St+1=s′,Rt+1=r∣St,At)=P(St+1=s′,Rt+1=r∣S0,A0,…,St,At)P(S_{t+1}=s',R_{t+1}=r\mid S_t,A_t)=P(S_{t+1}=s',R_{t+1}=r\mid S_0,A_0,\dots,S_t,A_t). The future is conditionally independent of the past given the current state and action, so a value function indexed only by ss (or (s,a)(s,a)) is sufficient.

Fact 2 — Additivity of the return.

Gt=Rt+1+γRt+2+γ2Rt+3+⋯=Rt+1+γGt+1.G_t=R_{t+1}+\gamma R_{t+2}+\gamma^2R_{t+3}+\dots=R_{t+1}+\gamma G_{t+1}.

This algebraic identity is the entire content of "bootstrapping".

Fact 3 — Law of total expectation. Condition on the first action and next state:

E[Gt∣St=s]=∑aπ(a∣s)∑s′P(s′∣s,a)E[Rt+1+γGt+1∣St=s,At=a,St+1=s′].\mathbb{E}[G_t\mid S_t=s]=\sum_a\pi(a|s)\sum_{s'}P(s'|s,a)\mathbb{E}[R_{t+1}+\gamma G_{t+1}\mid S_t=s,A_t=a,S_{t+1}=s'].

By Facts 1–2 the inner expectation equals r(s,a)+γVπ(s′)r(s,a)+\gamma V^\pi(s'), 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 E[Gt+1]\mathbb{E}[G_{t+1}] can be replaced by V∗(s′)V^*(s'), and the choice of the first action becomes max⁡a\max_a.

6. Prerequisite concepts

Required: probability spaces and conditional expectation (to justify taking expectations over trajectories); Markov chains and transition matrices P∈R∣S∣×∣S∣P\in\mathbb{R}^{|S|\times|S|} (to read P(s′∣s,a)P(s'|s,a)); discrete-time discounting and geometric series (to guarantee ∑tγt=1/(1−γ)\sum_t\gamma^t=1/(1-\gamma)); 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 ∣mathcalS∣=n|mathcal{S}|=n, ∣mathcalA∣=m|mathcal{A}|=m; for each action, Pa∈Rn×nP_a\in\mathbb{R}^{n\times n} is row-stochastic and ra∈Rnr_a\in\mathbb{R}^n is the expected-reward vector.

Value of a fixed policy. With Pπ(s,s′)=∑aπ(a∣s)P(s′∣s,a)P_\pi(s,s')=\sum_a\pi(a|s)P(s'|s,a) and rπ(s)=∑aπ(a∣s)r(s,a)r_\pi(s)=\sum_a\pi(a|s)r(s,a),

Vπ=rπ+γPπVπ⟺Vπ=(I−γPπ)−1rπ.V^\pi=r_\pi+\gamma P_\pi V^\pi\quad\Longleftrightarrow\quad V^\pi=(I-\gamma P_\pi)^{-1}r_\pi .

The inverse exists because the eigenvalues of γPπ\gamma P_\pi have modulus at most γ<1\gamma<1.

Bellman expectation operator. (TπV)(s)=∑aπ(a∣s)∑s′P(s′∣s,a)[r(s,a)+γV(s′)](T^\pi V)(s)=\sum_a\pi(a|s)\sum_{s'}P(s'|s,a)[r(s,a)+\gamma V(s')]; VπV^\pi is its unique fixed point.

Bellman optimality operator. (TV)(s)=max⁡a[r(s,a)+γ∑s′P(s′∣s,a)V(s′)](TV)(s)=\max_a\bigl[r(s,a)+\gamma\sum_{s'}P(s'|s,a)V(s')\bigr]; V∗V^* is its unique fixed point.

Action values. Q∗(s,a)=r(s,a)+γ∑s′P(s′∣s,a)V∗(s′)Q^*(s,a)=r(s,a)+\gamma\sum_{s'}P(s'|s,a)V^*(s'), and V∗(s)=max⁡aQ∗(s,a)V^*(s)=\max_a Q^*(s,a).

Optimal policy. Any π∗\pi^* with π∗(a∣s)>0\pi^*(a|s)>0 only for a∈arg⁡max⁡aQ∗(s,a)a\in\arg\max_a Q^*(s,a) is optimal.

Assumptions. Finite state/action spaces and γ<1\gamma<1 give the clean theory; uncountable spaces require measurability and sup-norm analogues, and γ=1\gamma=1 requires extra structure (absorbing states, communicating MDPs).

8. Notation dictionary

| Symbol | Meaning | Type / shape | |---|---|---| | S,A\mathcal{S},\mathcal{A} | state and action sets | finite sets, n=∣mathcalS∣n=|mathcal{S}|, m=∣mathcalA∣m=|mathcal{A}| | | s,s′s,s' | current and next state | elements of S\mathcal{S} | | a,a′a,a' | current and next action | elements of A\mathcal{A} | | P(s′∣s,a)P(s'|s,a) | transition probability | in [0,1][0,1], ∑s′P=1\sum_{s'}P=1 | | Rt+1R_{t+1} | random reward after step tt | random scalar | | r(s,a)r(s,a) | expected immediate reward | scalar, vector ra∈Rnr_a\in\mathbb{R}^n | | γ\gamma | discount factor | scalar in [0,1)[0,1) | | GtG_t | discounted return from time tt | random scalar | | π(a∣s)\pi(a|s) | policy (stochastic or deterministic) | distribution / map S→A\mathcal{S}\to\mathcal{A} | | Vπ(s),V∗(s)V^\pi(s),V^*(s) | state value under π\pi / optimal | vector in Rn\mathbb{R}^n | | Qπ(s,a),Q∗(s,a)Q^\pi(s,a),Q^*(s,a) | action value under π\pi / optimal | matrix in Rn×m\mathbb{R}^{n\times m} | | Tπ,TT^\pi,T | expectation and optimality Bellman operators | maps Rn→Rn\mathbb{R}^n\to\mathbb{R}^n | | ∥⋅∥∞\lVert\cdot\rVert_\infty | max norm, max⁡s∣V(s)∣\max_s|V(s)| | norm on Rn\mathbb{R}^n | | PπP_\pi | policy-induced transition matrix | Rn×n\mathbb{R}^{n\times n} | | ε\varepsilon | convergence tolerance | positive scalar |

9. Step-by-step derivation

Step 1 — decompose the return. Gt=Rt+1+γGt+1G_t=R_{t+1}+\gamma G_{t+1}.

Step 2 — condition on the first action and successor state. For a fixed policy,

Vπ(s)=∑aπ(a∣s)∑s′P(s′∣s,a)(r(s,a)+γ Eπ[Gt+1∣St+1=s′]).V^\pi(s)=\sum_a\pi(a|s)\sum_{s'}P(s'|s,a)\Bigl(r(s,a)+\gamma\,\mathbb{E}_\pi[G_{t+1}\mid S_{t+1}=s']\Bigr).

The last expectation is Vπ(s′)V^\pi(s') by the Markov property, giving the first Bellman equation.

Step 3 — action-value form. Conditioning instead on (s,a)(s,a) and averaging only over s′s' gives

Qπ(s,a)=r(s,a)+γ∑s′∈SP(s′∣s,a)∑a′π(a′∣s′)Qπ(s′,a′).Q^\pi(s,a)=r(s,a)+\gamma\sum_{s'\in\mathcal{S}}P(s'|s,a)\sum_{a'}\pi(a'|s')Q^\pi(s',a').

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 V∗(s′)V^*(s') and maximize over aa:

V∗(s)=max⁡a[r(s,a)+γ∑s′P(s′∣s,a)V∗(s′)]=(TV∗)(s).V^*(s)=\max_a\Bigl[r(s,a)+\gamma\sum_{s'}P(s'|s,a)V^*(s')\Bigr]=(TV^*)(s).

Step 5 — value iteration. Because TT is a γ\gamma-contraction (section 10), the iteration Vk+1=TVkV_{k+1}=TV_k converges. After kk steps,

∥Vk−V∗∥∞≤γk1−γ∥V1−V0∥∞.\lVert V_k-V^*\rVert_\infty\le\frac{\gamma^k}{1-\gamma}\lVert V_1-V_0\rVert_\infty .

Step 6 — policy iteration. Given πk\pi_k, solve the linear system Vπk=(I−γPπk)−1rπkV^{\pi_k}=(I-\gamma P_{\pi_k})^{-1}r_{\pi_k}, then set πk+1(s)∈arg⁡max⁡a[r(s,a)+γ(PaVπk)(s)]\pi_{k+1}(s)\in\arg\max_a[r(s,a)+\gamma(P_aV^{\pi_k})(s)]. The policy-improvement theorem guarantees Vπk+1≥VπkV^{\pi_{k+1}}\ge V^{\pi_k} pointwise, so the algorithm terminates at V∗V^* in at most ∣mathcalA∣∣S∣|mathcal{A}|^{|\mathcal{S}|} steps (far fewer in practice).

Step 7 — extracting the policy. Once VkV_k is within ε(1−γ)/(2γ)\varepsilon(1-\gamma)/(2\gamma) of V∗V^*, the greedy policy is ε\varepsilon-optimal; the bound follows from the contraction error amplification by 1/(1−γ)1/(1-\gamma).

10. Proofs and proof intuition

Theorem 1 (contraction). For any U,V∈RnU,V\in\mathbb{R}^n, ∥TV−TU∥∞≤γ∥V−U∥∞\lVert TV-TU\rVert_\infty\le\gamma\lVert V-U\rVert_\infty. Proof. For each ss, let asa_s attain the max in TV(s)TV(s). Then TV(s)−TU(s)≤[r(s,as)+γ(PasV)(s)]−[r(s,as)+γ(PasU)(s)]≤γmax⁡s′∣V(s′)−U(s′)∣TV(s)-TU(s)\le [r(s,a_s)+\gamma(P_{a_s}V)(s)]-[r(s,a_s)+\gamma(P_{a_s}U)(s)]\le\gamma\max_{s'}|V(s')-U(s')|. Swapping UU and VV gives the reverse inequality; take the max over ss. The same argument works for TπT^\pi without the max. □\square

Theorem 2 (Banach fixed point). TT and TπT^\pi have unique fixed points V∗V^* and VπV^\pi, and Vk=TkV0V_k=T^kV_0 converges. Proof. (Rn,∥⋅∥∞)(\mathcal{R}^n,\lVert\cdot\rVert_\infty) is complete and γ<1\gamma<1; apply the contraction mapping theorem. □\square

Corollary (error bound). ∥Vk−V∗∥∞≤γ1−γ∥Vk−Vk−1∥∞≤γk1−γ∥V1−V0∥∞\lVert V_k-V^*\rVert_\infty\le\frac{\gamma}{1-\gamma}\lVert V_k-V_{k-1}\rVert_\infty\le\frac{\gamma^k}{1-\gamma}\lVert V_1-V_0\rVert_\infty. Proof. Vk+1−Vk=TVk−TVk−1V_{k+1}-V_k=T V_k-T V_{k-1}, so successive differences shrink geometrically; sum the tail ∑j≥kγj−k∥Vj+1−Vj∥\sum_{j\ge k}\gamma^{j-k}\lVert V_{j+1}-V_j\rVert. □\square

Theorem 3 (policy improvement). If π′\pi' is greedy w.r.t. VπV^\pi, i.e. Tπ′Vπ=TVπT^{\pi'}V^\pi=TV^\pi, then Vπ′≥VπV^{\pi'}\ge V^\pi pointwise. Proof. Vπ=Tπ′VπV^\pi=T^{\pi'}V^\pi would hold if the greedy action were π′\pi'-greedy everywhere, but in general Vπ≤Tπ′VπV^\pi\le T^{\pi'}V^\pi. Iterating Tπ′T^{\pi'} and using monotonicity of Tπ′T^{\pi'} (nonnegative matrix Pπ′P_{\pi'}) gives Vπ≤(Tπ′)kVπ→Vπ′V^\pi\le (T^{\pi'})^kV^\pi\to V^{\pi'}. □\square

Proof intuition. The max can move values by at most γ\gamma 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 VV lives in Rn\mathbb{R}^n, one coordinate per state. A backup (TV)(s)(TV)(s) is an affine function of VV (plus a max), so TT maps the value space into itself while shrinking all sup-norm distances by γ\gamma: the image of any set is γ\gamma times smaller. Repeated application spirals/contracts every starting point toward the single fixed point V∗V^*, like a map of the plane scaled toward one distinguished point.

For a fixed policy the geometry is exactly linear: VπV^\pi is the intersection of nn hyperplanes V(s)=rπ(s)+γ(PπV)(s)V(s)=r_\pi(s)+\gamma(P_\pi V)(s), i.e. the solution of (I−γPπ)V=rπ(I-\gamma P_\pi)V=r_\pi. Different policies give different points; the Bellman optimality equation says V∗V^* 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 V∗V^* is a fixed point lying on the boundary of several such regions.

The optimal policy's value vector dominates all others: π∗⪰π′\pi^*\succeq\pi' iff V∗≥Vπ′V^*\ge V^{\pi'} 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 ss (filled circle); below it, one branch per action aa (open action nodes), each leading to chance nodes (small circles) for successors s′s' with edge labels P(s′∣s,a)P(s'|s,a) and r(s,a)r(s,a); each s′s' node carries the backed-up quantity γV(s′)\gamma V(s'). 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 ∥Vk−V∗∥∞\lVert V_k-V^*\rVert_\infty versus kk on log scale: a straight line of slope log⁡10γ\log_{10}\gamma (for the two-state example, slope ≈−0.301\approx-0.301 per iteration for γ=0.5\gamma=0.5). Policy iteration instead shows a staircase in max⁡sVπk(s)\max_s V^{\pi_k}(s), rising monotonically and flattening at V∗V^*.

Use the interactive MDP Value Iteration Playground in Practical Labs: edit PP and rr, start from random V0V_0, and watch the value bars and greedy arrows stabilize. Increase γ\gamma 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 {A,B}\{A,B\}, actions {walk,stay}\{\text{walk},\text{stay}\}, γ=0.5\gamma=0.5. From AA: walk →B\to B with reward 11; stay →A\to A with reward 00. From BB: walk →A\to A with reward 22; stay →B\to B with reward 00.

Start V0=0V_0=0. Value iteration:

  • V1(A)=max⁡(1+0,0)=1V_1(A)=\max(1+0,0)=1, V1(B)=max⁡(2+0,0)=2V_1(B)=\max(2+0,0)=2.
  • V2(A)=max⁡(1+0.5⋅2, 0.5⋅1)=2V_2(A)=\max(1+0.5\cdot2,\,0.5\cdot1)=2, V2(B)=max⁡(2+0.5⋅1, 0.5⋅2)=2.5V_2(B)=\max(2+0.5\cdot1,\,0.5\cdot2)=2.5.
  • V3=(2.25, 3.0)V_3=(2.25,\ 3.0), then (2.5,3.125)(2.5,3.125), (2.5625,3.25)(2.5625,3.25).
  • Converges to V∗=(8/3, 10/3)≈(2.6667,3.3333)V^*=(8/3,\,10/3)\approx(2.6667,3.3333) (sup-norm residual 10−610^{-6} reached at iteration 22; the bound γk/(1−γ)∥V1−V0∥∞=21−k\gamma^k/(1-\gamma)\|V_1-V_0\|_\infty=2^{1-k} gives 9.5×10−79.5\times10^{-7} at k=22k=22).

Action values:

Q∗(A,walk)=1+12⋅103=83,Q∗(A,stay)=12⋅83=43,Q^*(A,\text{walk})=1+\tfrac12\cdot\tfrac{10}{3}=\tfrac83,\quad Q^*(A,\text{stay})=\tfrac12\cdot\tfrac83=\tfrac43, Q∗(B,walk)=2+12⋅83=103,Q∗(B,stay)=12⋅103=53.Q^*(B,\text{walk})=2+\tfrac12\cdot\tfrac83=\tfrac{10}{3},\quad Q^*(B,\text{stay})=\tfrac12\cdot\tfrac{10}{3}=\tfrac53.

So walk is optimal in both states. Policy evaluation for that deterministic policy uses Pπ=(0110)P_\pi=\begin{pmatrix}0&1\\1&0\end{pmatrix}, rπ=(1,2)⊤r_\pi=(1,2)^\top:

Vπ=(I−0.5Pπ)−1rπ=10.75(10.50.51)(12)=(8/310/3)=V∗.V^\pi=(I-0.5P_\pi)^{-1}r_\pi=\frac{1}{0.75}\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}\begin{pmatrix}1\\2\end{pmatrix}=\begin{pmatrix}8/3\\10/3\end{pmatrix}=V^*.

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 PπP_\pi and iterative solvers (GMRES) instead of forming (I−γPπ)−1(I-\gamma P_\pi)^{-1}. For continuous or huge state spaces, replace the table VV by a neural network VϕV_\phi and minimize the Bellman residual ∥Vϕ−TVϕ∥2\lVert V_\phi-TV_\phi\rVert^2 — 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 A×SA\times S matrix Q(s,a)=r(s,a)+γ∑s′P(s′∣s,a)V(s′)Q(s,a)=r(s,a)+\gamma\sum_{s'}P(s'|s,a)V(s'). 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 A×SA\times S backup, broadcasting would silently create a wrong A×S×SA\times S\times S 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 max⁡s∣Vk+1(s)−Vk(s)∣<tol\max_s|V_{k+1}(s)-V_k(s)|<\text{tol} tracks the successor difference whose geometric tail bounds the true error by γ tol/(1−γ)\gamma\,\text{tol}/(1-\gamma).

Policy evaluation. P[pi, arange(n)] performs advanced indexing: row ss of the resulting matrix is P(s,⋅)P(s,\cdot) under the action chosen in state ss. Solving np.eye(n) - gamma*P_pi implements (I−γPπ)−1rπ(I-\gamma P_\pi)^{-1}r_\pi 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 nn states and mm actions:

  • transition tensor PP: mn2m n^2 floats; rewards rr: mn2m n^2 floats (or mnmn if reward depends only on (s,a)(s,a));
  • value vector VV: nn floats; action values QQ: mnmn floats;
  • policy π\pi: mnmn floats for a stochastic policy, nn integers for deterministic.

With n=1000n=1000, m=4m=4 in fp32: PP needs 4×106×4=164\times10^6\times4=16 MB, rr another 16 MB (8 MB if r(s,a)r(s,a) only), VV 4 KB, QQ 16 KB. The model dominates; value storage is negligible. With sparse transitions (kk nonzero successors per state-action) store PP in CSR/COO with O(mnk)O(mnk) entries instead of O(mn2)O(mn^2) — for k=3k=3 that is 48 KB, a 300×300\times saving.

For function approximation with a network of dd parameters, the "value tensor" is dd floats (e.g. d=1.7d=1.7 M for a small Atari CNN = 6.8 MB fp32); deep RL additionally needs a target network (another dd), optimizer state (2d2d for Adam), and a replay buffer of BB transitions. Atari frames stored as (4,84,84)(4,84,84) uint8 are 28,224 bytes each, so B=106B=10^6 costs ≈56\approx56 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 O(mn2)O(mn^2) arithmetic operations (sum over mm actions and nn successors for each of nn states); with sparse transitions (kk successors per pair) it is O(mnk)O(mnk). Value iteration with KK iterations costs O(Kmn2)O(Kmn^2), and K=O(11−γlog⁡(1/ε))K=O(\frac{1}{1-\gamma}\log(1/\varepsilon)) to reach ε\varepsilon accuracy because the error shrinks by γ\gamma per step.

Policy evaluation via the linear system costs O(n3)O(n^3) dense (or O(nnz⋅J)O(nnz\cdot J) with JJ iterative solver sweeps). One policy-improvement pass costs O(mn2)O(mn^2); policy iteration therefore takes O(J(n3+mn2))O(J(n^3+mn^2)) for JJ outer iterations, with JJ typically small (< 20) but theoretically up to the number of deterministic policies.

For deep approximations, one backup evaluated on a batch of bb samples costs O(b⋅cost(network))O(b\cdot\mathrm{cost}(\text{network})); the contraction guarantee no longer applies exactly, which is why deep value methods need target networks and regularization.

21. Space complexity

Tabular storage is O(mn2)O(mn^2) for the full model, O(mnk)O(mnk) sparse, plus O(mn)O(mn) for QQ and O(n)O(n) for VV. Value iteration needs only two nn-vectors if backups are done in place (or one vector with Gauss–Seidel updates), i.e. O(n)O(n) working memory beyond the model. Policy iteration needs the n×nn\times n matrix I−γPπI-\gamma P_\pi during the solve: O(n2)O(n^2) working memory, reducible to O(n)O(n) plus matrix–vector products with iterative solvers.

In the function-approximation case, memory is O(d)O(d) for each network copy plus replay/storage; gradient-based Bellman-residual minimization needs backpropagation activations O(b⋅activation size)O(b\cdot\text{activation size}), which can be cut by checkpointing.

22. Experimental demonstration

Run the scratch code and log Δk=∥Vk−V∗∥∞\Delta_k=\lVert V_k-V^*\rVert_\infty for the two-state MDP. Observed: Δ1=1.667\Delta_1=1.667, Δ2=0.667\Delta_2=0.667, Δ3=0.333\Delta_3=0.333, then a clean factor-2 decay each iteration, crossing 10−610^{-6} at k=22k=22 — exactly the corollary's bound 21−k2^{1-k}. Recompute with γ=0.9\gamma=0.9: contraction factor 0.9, so the same tolerance needs roughly 130 iterations; plotting log⁡Δk\log\Delta_k shows slopes −0.301-0.301 vs. −0.046-0.046 per step.

Second experiment: initialize V0V_0 at +100+100 and −100-100 and confirm both trajectories converge to the same (8/3,10/3)(8/3,10/3) (uniqueness). Third: run policy iteration starting from "stay in both states"; policy evaluation gives V=(0,0)V=(0,0), one improvement step switches both states to walk, evaluation returns (8/3,10/3)(8/3,10/3), and the next improvement is unchanged — termination in 2 iterations.

Finally, perturb PP by 1% and measure ∥V∗−V~∗∥∞\lVert V^*-\tilde V^*\rVert_\infty; the sensitivity bound is roughly γ/(1−γ)2\gamma/(1-\gamma)^2 times the transition perturbation, illustrating why values become fragile as γ→1\gamma\to1.

23. Benchmark results

On the two-state example above, value iteration needs 22 backups for 10−610^{-6} sup-norm accuracy at γ=0.5\gamma=0.5, while policy iteration converges in 2 evaluation/improvement cycles; both return (2.666667,3.333333)(2.666667,3.333333). On the classic 4×44\times4 FrozenLake grid (16 states, 4 actions, γ=0.9\gamma=0.9), tabular value iteration typically converges in 60–100 full sweeps, and exact policy evaluation of a deterministic policy is a 16×1616\times16 solve taking microseconds. These numbers are illustrative toy benchmarks, not universal constants: convergence is governed by γ/(1−γ)\gamma/(1-\gamma) and the mixing structure of PπP_\pi.

For larger MDPs, sparse value iteration scales roughly linearly in the number of nonzero transitions, whereas dense policy iteration pays O(n3)O(n^3) 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, γ\gamma, tolerance, and whether the reported error is the Bellman residual ∥TVk−Vk∥\lVert TV_k-V_k\rVert or the true error ∥Vk−V∗∥\lVert V_k-V^*\rVert — the former is an upper bound on the latter divided by (1−γ)(1-\gamma).

24. Limitations

  • Requires knowledge of PP and rr (planning). Learning variants (TD, Q-learning) relax this but introduce sampling noise and function-approximation issues.
  • Tabular storage O(mn2)O(mn^2) is impossible for large or continuous state spaces; function approximation loses exact contraction guarantees.
  • Discounting γ<1\gamma<1 biases the agent toward the near future; modeling long-horizon tasks with γ≈0.999\gamma\approx0.999 slows convergence by 1/(1−γ)1/(1-\gamma).
  • Exact policy evaluation O(n3)O(n^3) is expensive for large nn.
  • The max operator is non-smooth, complicating gradient-based analysis; ties require consistent tie-breaking for reproducible policies.
  • With γ=1\gamma=1 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

  1. γ≥1\gamma\ge1 with recurrent states: the return diverges, (I−γPπ)(I-\gamma P_\pi) is singular, and value iteration never converges. Use discounting or verify the MDP is proper.
  2. 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.
  3. γ\gamma too close to 1: error bound degrades as 1/(1−γ)1/(1-\gamma); a residual of 10−610^{-6} can hide a 10−310^{-3} value error at γ=0.999\gamma=0.999.
  4. Wrong tensor axes: adding a reward tensor of shape (A,S,S)(A,S,S) to a backup of shape (A,S)(A,S) broadcasts to (A,S,S)(A,S,S); assert shapes explicitly.
  5. 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.
  6. 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.
  7. Unreachable states: their values are arbitrary under a given policy but still appear in the linear system; the matrix (I−γPπ)(I-\gamma P_\pi) 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.
  • "V∗(s)V^*(s) is the reward you get immediately." It is the discounted total expected return, not a one-step quantity.
  • "Q∗(s,a)=r(s,a)+γV∗(s)Q^*(s,a)=r(s,a)+\gamma V^*(s)." Correct only if the transition is deterministic; the general form averages V∗(s′)V^*(s') over P(s′∣s,a)P(s'|s,a).
  • "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 γ<1\gamma<1 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 ∥V−V∗∥∞≤∥TV−V∥∞/(1−γ)\lVert V-V^*\rVert_\infty\le\lVert TV-V\rVert_\infty/(1-\gamma); 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: V∗V^* is the solution of min⁡V∑sV(s)\min_V\sum_s V(s) s.t. V(s)≥r(s,a)+γ(PaV)(s) ∀s,aV(s)\ge r(s,a)+\gamma(P_aV)(s)\ \forall s,a — useful for constrained MDPs.
  • Real-time dynamic programming (RTDP): asynchronous, trajectory-focused backups for huge state spaces.
  • Temporal difference learning: replace PP by samples: V(St)←V(St)+α[Rt+1+γV(St+1)−V(St)]V(S_t)\leftarrow V(S_t)+\alpha[R_{t+1}+\gamma V(S_{t+1})-V(S_t)].
  • 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 PP 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

  1. Reproduce the two-state example by hand: three value-iteration sweeps, then solve (I−γPπ)V=rπ(I-\gamma P_\pi)V=r_\pi and verify agreement.
  2. Implement value_iteration and policy_evaluation from memory; assert V∗=(8/3,10/3)V^*=(8/3,10/3) and that the greedy policy walks.
  3. Derive the Bellman equation for a deterministic shortest-path MDP with terminal reward 1 and all other rewards 0; show it reduces to V(s)=1+min⁡s′V(s′)V(s)=1+\min_{s'}V(s') for undiscounted shortest paths.
  4. Run value iteration with γ∈{0.5,0.9,0.99}\gamma\in\{0.5,0.9,0.99\}; record iterations to residual 10−810^{-8} and compare with log⁡(1/ε)/(1−γ)\log(1/\varepsilon)/(1-\gamma).
  5. Change the example so "stay" yields reward 0.4 in AA; compute the new V∗V^* and the action gap. At what reward does the optimal policy switch?
  6. Implement the LP formulation with scipy.optimize.linprog and confirm it matches value iteration on a random 5-state MDP.

33. Debugging challenges

  • Values diverge to infinity: check γ<1\gamma<1, rewards are finite, and every row of PP sums to 1.
  • Value iteration converges to a policy that is not greedy: the stopping tolerance is probably too loose; enforce ∥TVk−Vk∥∞<ε(1−γ)\lVert TV_k-V_k\rVert_\infty<\varepsilon(1-\gamma).
  • Policy evaluation gives negative/huge values: (I−γPπ)(I-\gamma P_\pi) is ill-conditioned as γ→1\gamma\to1; use an iterative solver or smaller γ\gamma.
  • Shape mismatch (2,2,2) vs (2,2): you added the full reward tensor instead of rbar=(r*P).sum(axis=2).
  • Two runs with different V0V_0 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 argmax over the action axis, not the state axis.

34. Advanced exercises

  1. Prove the LP duality between min⁡s\min_s form and the Bellman optimality inequalities; implement both and compare.
  2. Derive and implement modified policy iteration with mm partial evaluation backups; show the spectrum between value (m=0m=0) and policy (m=∞m=\infty) iteration.
  3. Prove that for deterministic PP the optimality equation reduces to a shortest/longest path problem and solve it by value iteration on a 100-node graph.
  4. Derive the sensitivity bound ∥V~∗−V∗∥∞≤11−γ∥T~V∗−V~∗∥∞\lVert \tilde V^*-V^*\rVert_\infty\le\frac{1}{1-\gamma}\lVert\tilde T V^*-\tilde V^*\rVert_\infty and verify numerically on a perturbed MDP.
  5. Extend the equations to average-reward MDPs: show h(s)+g=max⁡a[r(s,a)+∑s′P(s′∣s,a)h(s′)]h(s)+g=\max_a[r(s,a)+\sum_{s'}P(s'|s,a)h(s')] (the Bellman average-reward equation) and discuss when gg 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 γ\gamma-contraction in sup norm. Where is the max handled?
  • Why is (I−γPπ)(I-\gamma P_\pi) invertible for γ<1\gamma<1? 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 VV? What accuracy is needed for an ε\varepsilon-optimal policy?
  • Explain why γ→1\gamma\to1 is computationally painful and what it does to the value estimates.
  • Show that V∗(s)=max⁡aQ∗(s,a)V^*(s)=\max_aQ^*(s,a) but Q∗(s,a)≠r(s,a)+γV∗(s)Q^*(s,a)\ne r(s,a)+\gamma V^*(s) in general.

36. Research questions

  • How can we obtain tight error certificates for deep VϕV_\phi 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 Gt=Rt+1+γGt+1G_t=R_{t+1}+\gamma G_{t+1} and conditional expectation without notes; (2) prove the γ\gamma-contraction and the error bound γk/(1−γ)∥V1−V0∥∞\gamma^k/(1-\gamma)\|V_1-V_0\|_\infty; (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 γ∈{0.5,0.9,0.99}\gamma\in\{0.5,0.9,0.99\}, the LP comparison, and a random 5-state MDP), a README.md with the derivations and observed vs. theoretical slopes, and tests asserting V∗=(8/3,10/3)V^*=(8/3,10/3), greedy policy walk, and policy-iteration termination. Include a log-scale plot of ∥Vk−V∗ Vert∞\lVert V_k-V^*\ Vert_\infty. 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. γ≥1\gamma\ge1 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.`

Research papers linked to this concept

bellman1956 · citation recorded, library entry pending
Dynamic Programming 1957
howard1960 · citation recorded, library entry pending
puterman1994 · citation recorded, library entry pending