This Reinforcement Learning concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Reinforcement Learning
Dynamic Programming and Value Iteration
Value iteration turns the Bellman optimality backup into a known-model planning algorithm: sweep old values through every state until a greedy policy stabilizes.
Concept Structure
Dynamic Programming and Value Iteration
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
1 prerequisite listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Bellman optimality told us what a perfect value function must satisfy. Value iteration asks a more procedural question:
If the model is known, can we start with rough values and repeatedly improve every state?
Yes. One sweep applies the Bellman optimality backup to each state using the old value table. Then the new table replaces the old table. Another sweep repeats the same local computation with better future estimates.
That is dynamic programming: solve bigger planning subproblems by reusing smaller value estimates. Reward does not need to be physically adjacent to the starting state. If a state can reach reward in one step, its value rises first. States that can reach that state rise on later sweeps. Value information propagates backward through the transition graph.
The known-model assumption is the hinge. Value iteration is not learning from sampled experience. It assumes you can enumerate transition probabilities and rewards, then plan by applying the model.
Policy evaluation and value iteration look similar because both are Bellman updates. The difference is the operator. Policy evaluation averages action rows under a fixed policy. Value iteration improves toward control by taking the best action row at each state on every sweep.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let be a finite discounted MDP, where . The transition model is known: for each state and action , we can enumerate and reward .
For any current value estimate , define the Bellman optimality operator
Value iteration applies this operator repeatedly:
The phrase "for every state" matters. In the standard synchronous version, the whole right-hand side uses the old table . Only after all states have been updated do we replace it with .
The largest value change in one sweep is the residual
For a finite discounted MDP, is a contraction in the max norm, so repeated sweeps converge to the unique optimal fixed point :
Once the value estimate is good enough, extract a greedy policy:
That last equation is why value iteration is a planning algorithm. It first computes good state values, then turns those values into action choices.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
states = ["Start", "Practice", "Confused", "Mastered"]
gamma = 0.90
P = {
"Start": {"drill": [("Practice", .62, 1.0), ("Confused", .23, -.5), ("Mastered", .15, 3.0)],
"skim": [("Start", .30, .1), ("Practice", .45, .5), ("Confused", .25, -.2)]},
"Practice": {"repeat": [("Mastered", .55, 2.0), ("Practice", .30, .4), ("Confused", .15, -.6)],
"reflect": [("Mastered", .35, 1.2), ("Practice", .55, .5), ("Start", .10, 0.0)]},
"Confused": {"ask": [("Practice", .65, .7), ("Confused", .25, -.4), ("Start", .10, 0.0)],
"guess": [("Mastered", .20, 1.6), ("Confused", .50, -.8), ("Start", .30, -.1)]},
"Mastered": {"done": [("Mastered", 1.0, 0.0)]},
}
def sweep(V):
new, greedy = {}, {}
for s in states:
qs = {}
for a, transitions in P[s].items():
qs[a] = sum(p * (r + gamma * V[sp]) for sp, p, r in transitions)
greedy[s] = max(qs, key=qs.get)
new[s] = qs[greedy[s]]
return new, greedy
V = dict.fromkeys(states, 0.0)
for k in range(4):
V_next, pi = sweep(V)
residual = max(abs(V_next[s] - V[s]) for s in states)
print(k, {s: round(V_next[s], 3) for s in states}, pi, round(residual, 3))
V = V_next
The code mirrors the math: every row is computed from the old table , and each new state value is the largest action row.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the Value Iteration Sweep Lab to predict how a whole value table changes.
Choose a sweep, then predict which state will change most when the old table is used to compute the next table. After reveal, inspect the residual, the greedy action chosen at each state, and the action rows behind the largest change.
Before reveal, the next values and residual stay locked. That matters because value iteration is not a notation exercise; the learning move is to anticipate how value information propagates through the model.
Live Concept Demo
Explore Dynamic Programming and Value Iteration
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Dynamic Programming and Value Iteration should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Value iteration turns the Bellman optimality backup into a known-model planning algorithm: sweep old values through every state until a greedy policy stabilizes.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Dynamic Programming and Value Iteration should make visible.
Visual Inquiry
Make the image answer a mathematical question
Value iteration turns the Bellman optimality backup into a known-model planning algorithm: sweep old values through every state until a greedy policy stabilizes.
Which visible object should carry the first intuition?
Pick the cue that should make Dynamic Programming and Value Iteration easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Canonical source for dynamic programming, value iteration, Bellman optimality backups, and finite discounted MDP assumptions.
Open sourceGraduate RL source for planning with known dynamics, Bellman equations, dynamic programming, and value-iteration context.
Open sourceCourse-note source for the synchronous value-iteration update, Bellman operator distinction, contraction framing, and policy extraction.
Open sourceOpen textbook source for turning the dynamic-programming principle into the value-iteration update in tabular reinforcement learning.
Open sourceClaim Review
Value iteration turns the Bellman optimality backup into a known-model planning algorithm: sweep old values through every state until a greedy policy stabilizes.
Claims without a substantive review badge still need exact source-support review.
sutton-barto-2018-rl, stanford-cs234-value-iteration, berkeley-cs188-value-iteration, d2l-value-iteration
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support finite discounted tabular value iteration as a dynamic-programming planning algorithm that repeatedly applies Bellman optimality backups under a known model, uses the previous sweep's values on the update's right-hand side, converges to the optimal value function under the discounted finite setting, and supports greedy policy extraction from the converged value estimate.
Sources: Reinforcement Learning: An Introduction, Second Edition, Stanford CS234: MDPs, Bellman Equations, and Planning, UC Berkeley CS188: Value Iteration, Dive into Deep Learning: Value IterationFinite tabular teaching MDP only; excludes asynchronous value iteration, function approximation, sampled TD/Q-learning, exploration, and full contraction proof details.A bounded review summary is present; still check caveats and exact reference scope.Checked Berkeley CS188 and D2L for the synchronous update rule V_{k+1}(s)=max_a sum_{s'} P(s'|s,a)[R+gamma V_k(s')], convergence/fixed-point framing, and greedy policy extraction; checked the existing Sutton/Barto and Stanford CS234 RL spine for dynamic-programming and known-model planning context. GPT Pro publication critique remains pending because 127.0.0.1:51672 is unavailable.
Reviewer: codex-local-source-review; reviewed 2026-07-03Source support candidates
book 2018Reinforcement Learning: An Introduction, Second EditionCanonical source for dynamic programming, value iteration, Bellman optimality backups, and finite discounted MDP assumptions.
course-notes 2026Stanford CS234: MDPs, Bellman Equations, and PlanningGraduate RL source for planning with known dynamics, Bellman equations, dynamic programming, and value-iteration context.
course-notes 2026UC Berkeley CS188: Value IterationCourse-note source for the synchronous value-iteration update, Bellman operator distinction, contraction framing, and policy extraction.
book 2026Dive into Deep Learning: Value IterationOpen textbook source for turning the dynamic-programming principle into the value-iteration update in tabular reinforcement learning.
Practice Loop
Try the idea before it explains itself
Value iteration turns the Bellman optimality backup into a known-model planning algorithm: sweep old values through every state until a greedy policy stabilizes.
Before touching the demo, predict one visible change that should happen in Dynamic Programming and Value Iteration.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
Dynamic Programming and Value Iteration
What is the smallest example that makes Dynamic Programming and Value Iteration click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Dynamic Programming and Value Iteration Selected item key: recorded for copy. Context: Reinforcement Learning Page anchor: recorded for copy. Open question: What is the smallest example that makes Dynamic Programming and Value Iteration click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/reinforcement-learning/dynamic-programming-value-iteration
concept:reinforcement-learning/dynamic-programming-value-iteration