This Reinforcement Learning concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Reinforcement Learning
Markov Decision Process Formalism
An MDP is the RL contract for one-step prediction: current state plus action gives a next-state and reward law, while a policy mixes action kernels into behavior.
Concept Structure
Markov Decision Process Formalism
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.
Reinforcement learning begins with a promise:
If the agent tells us where it is and what it does, then the environment has a well-defined probability law for what happens next.
That promise is the Markov decision process, or MDP. It is not an algorithm. It does not say how to find a good policy. It is the formal contract that makes later ideas such as Bellman equations, value iteration, Q-learning, policy gradients, and RLHF-as-RL possible.
A state is useful only if it carries the information needed for prediction. If two histories look like the same state but have different next-state probabilities, the state description is incomplete. The fix is not to hope the Bellman equation saves us later. The fix is to add the missing variable, or explicitly treat the problem as partially observable.
Keep three objects separate:
- is the environment's transition kernel for one chosen action.
- is the agent's policy, a distribution over actions.
- is the next-state law after the policy mixes the action kernels.
Many RL confusions come from collapsing those three objects into one vague "what happens next" table.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
For a finite discounted MDP, define
Here:
- is a finite set of states;
- is a finite set of actions;
- is the probability of moving to next state after taking action in state ;
- is the immediate reward received on that transition;
- is the discount factor;
- is the start-state distribution.
For every state-action pair, the transition kernel is a probability distribution:
The Markov property says the next step depends on the current state and action, not on the whole past history once those are known:
A stochastic policy is another conditional distribution:
If the agent follows , the one-step next-state law from state marginalizes over actions:
The expected immediate reward under one action is
The discounted return from time is
Later, value functions will ask for expectations of this return. This page stops one step earlier: it makes sure the objects inside that expectation are not blurry.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
states = ["Start", "Practice", "Confused", "Mastered"]
kernel = {
"drill": [
("Practice", 0.62, 1.0),
("Confused", 0.23, -0.5),
("Mastered", 0.15, 3.0),
],
"skim": [
("Start", 0.30, 0.1),
("Practice", 0.45, 0.5),
("Confused", 0.25, -0.2),
],
}
policy = {"drill": 0.70, "skim": 0.30}
def action_law(action):
law = {s: 0.0 for s in states}
reward = 0.0
for next_state, prob, r in kernel[action]:
law[next_state] += prob
reward += prob * r
return law, reward
def policy_law(policy):
law = {s: 0.0 for s in states}
reward = 0.0
for action, weight in policy.items():
action_next, action_reward = action_law(action)
reward += weight * action_reward
for state, prob in action_next.items():
law[state] += weight * prob
return law, reward
drill_law, drill_reward = action_law("drill")
mix_law, mix_reward = policy_law(policy)
print("row sum:", round(sum(drill_law.values()), 3))
print("P(. | Start, drill):", drill_law)
print("E[R | Start, drill]:", round(drill_reward, 3))
print("P_pi(. | Start):", {k: round(v, 3) for k, v in mix_law.items()})
print("E_pi[R | Start]:", round(mix_reward, 3))
The code mirrors the math. First it reads one action-conditioned row . Then it builds the policy-conditioned law by averaging rows with policy weights.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the MDP Transition Lab as a state-action prediction check.
Pick a case, then decide which formal object explains the next step:
- one action-conditioned transition kernel,
- a policy mixture over action kernels,
- or an incomplete state description.
Before reveal, the next-state probabilities and reward ledgers stay locked. After reveal, inspect the transition row, the policy mixture, or the hidden variable that the visible state forgot to include.
Live Concept Demo
Explore Markov Decision Process Formalism
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 Markov Decision Process Formalism 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
An MDP is the RL contract for one-step prediction: current state plus action gives a next-state and reward law, while a policy mixes action kernels into behavior.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Markov Decision Process Formalism should make visible.
Visual Inquiry
Make the image answer a mathematical question
An MDP is the RL contract for one-step prediction: current state plus action gives a next-state and reward law, while a policy mixes action kernels into behavior.
Which visible object should carry the first intuition?
Pick the cue that should make Markov Decision Process Formalism easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Canonical source for agent-environment interaction, finite MDPs, one-step transition dynamics over next state and reward, policy, and return notation.
Open sourceGraduate course context for MDP problem formulation, tabular planning, model-free control, and policy-gradient prerequisites.
Open sourceCourse-note source for state/action/reward/transition/discount framing and the Markov property in small decision processes.
Open sourceClaim Review
An MDP is the RL contract for one-step prediction: current state plus action gives a next-state and reward law, while a policy mixes action kernels into behavior.
Claims without a substantive review badge still need exact source-support review.
sutton-barto-2018-rl, stanford-cs234-2026, berkeley-cs188-mdp
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support the finite MDP tuple, the action-conditioned transition kernel, immediate reward framing, discounted return notation, and the Markov assumption that state must carry the information needed for one-step prediction. The policy-mixture equation follows by marginalizing over actions under a stochastic policy.
Sources: Reinforcement Learning: An Introduction, Second Edition, Stanford CS234: Reinforcement Learning, UC Berkeley CS188: Markov Decision ProcessesFinite tabular teaching MDP only; excludes continuous state/action spaces, partial observability beyond the state-completeness warning, Bellman equations, function approximation, off-policy data, exploration, and policy-gradient derivations.A bounded review summary is present; still check caveats and exact reference scope.Checked Sutton and Barto for finite MDP interaction, one-step dynamics, policy and return notation; Stanford CS234 for graduate RL topic inclusion and MDP formulation; and Berkeley CS188 for the state/action/transition/reward/discount framing plus Markov-property explanation. 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 agent-environment interaction, finite MDPs, one-step transition dynamics over next state and reward, policy, and return notation.
course-notes 2026Stanford CS234: Reinforcement LearningGraduate course context for MDP problem formulation, tabular planning, model-free control, and policy-gradient prerequisites.
course-notes 2026UC Berkeley CS188: Markov Decision ProcessesCourse-note source for state/action/reward/transition/discount framing and the Markov property in small decision processes.
Practice Loop
Try the idea before it explains itself
An MDP is the RL contract for one-step prediction: current state plus action gives a next-state and reward law, while a policy mixes action kernels into behavior.
Before touching the demo, predict one visible change that should happen in Markov Decision Process Formalism.
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.
Markov Decision Process Formalism
What is the smallest example that makes Markov Decision Process Formalism 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 - Markov Decision Process Formalism Selected item key: recorded for copy. Context: Reinforcement Learning Page anchor: recorded for copy. Open question: What is the smallest example that makes Markov Decision Process Formalism 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/mdp-formalism
concept:reinforcement-learning/mdp-formalism