Unit 2 of 11 · about 4 hours · explain, derive
States, observations, the Markov property, transition kernels and rewards
Values condition on state. If the state omits history the learner needs, Bellman updates average over different situations as if they were one.
You'll be able to
- Explain the Markov property with and give a non-Markov observation example.
- Write the dynamics and derive , and by marginalization.
- Distinguish state, observation and history and state what must be added to restore Markov structure.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Dynamics, Markov property and derived quantitiesReinforcement Learning: An Introduction (2nd ed.) - Chapters 3 and 4
Chapter 3, Section 3.1 dynamics (3.2) to (3.6), Markov property and state requirement, printed pp. 47 to 49. The authors post the full text free at incompleteideas.net.
- History, Markov assumption and Mars Rover modelStanford CS234 Winter 2026 - Foundations and Planning
History, Markov Assumption and Why Markov is Popular (slides 35 to 37); Mars Rover MDP Model with and definitions (slides 39 to 40)
- MDP tuple with bandit, CartPole and LLM tableHands-on Modern RL - MDPs, Values and Bellman Equations
The MDP Tuple: State, Action, and Environment with the bandit, CartPole and LLM table and the CartPole 4D state example (page read 2026-10-14)
Focus on
- Markov means the future is independent of the past given the present. History collapses to .
- The four-argument sums to 1 over and for each and . Other quantities come from summing out or .
- Observation is what the agent receives. State is what determines what happens next. If is insufficient, augment with history, velocity, time remaining or belief.
Common mistakes · 3
- Calling an observation a Markov state because it looks complete. CartPole angle without angular velocity is the standard counterexample on the Hands-on page.
- Normalizing over the wrong axis. Sum over and , not over and .
- Treating deterministic physics as a known model. Unknown is the usual case. Planning assumes known only as a baseline.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.State the Markov property in one equation.Answer
The state is Markov when . The future depends on history only through the present state and action.
2.How do you get from ?Answer
Weight each reward by its probability and sum out the next state: .
3.Why is angle-only CartPole not Markov?Answer
The same angle with different angular velocities leads to different next angles. Add velocity to restore the property.
4.How is a bandit an MDP?Answer
It has a single state. The transition always returns to that state. Actions affect only immediate reward.
Practice
- Sutton and Barto Exercise 3.4: recycling robot dynamics table
Exercise 3.4, printed p. 53; write the table analogous to Example 3.3. The authors post the full text free at incompleteideas.net.
Check that each and row sums to 1 and that your derived matches (3.4).
You're done when
You derive the three derived quantities from a new table without notes and spot one non-Markov observation with its fix.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 4 more in the section
- Stanford CS234 Winter 2026 - Foundations and PlanningStanford University · primary
Study Lecture 1 (
lecture1pre.pdfandlecture1post.pdf) and Lecture 2 on tabular MDP planning (lecture2pre.pdfandlecture2post.pdfunder https://web.stanford.edu/class/cs234/slides/). Work Assignment 1 independently: the written MDP, horizon and Bellman-operator questions and thevi_and_pi.pyplanning code on RiverSwim (NumPy only). Do not copy or publish course solutions. - Reinforcement Learning: An Introduction (2nd ed.) - Chapters 3 and 4Richard Sutton and Andrew Barto · required
The authors post the full second edition free at incompleteideas.net; cite the printed page numbers. Study Chapter 3 (Sections 3.1 to 3.7, finite MDPs, returns, Bellman equations and optimality) and Chapter 4 (Sections 4.1 to 4.7, policy evaluation, improvement, policy and value iteration, asynchronous DP and GPI). Reproduce Example 4.1 and Figure 4.1 exactly, then Example 4.3 (the gambler), and write exact tests for stochastic transitions, terminals, ties and stopping error.
- Hands-on Modern RL - MDPs, Values and Bellman EquationsWalking Labs · support
Use the value and Bellman page and the value experiment page (
code/chapter03_mdp/bellman_equation_verify.pyandgridworld_q_learning.pyrun on CPU in seconds) as a code companion. Check every equation against Sutton and Barto before adopting it. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; itscode/chapterNNfolders do not follow the site chapter numbers.
Also in this section
- Gymnasium - Time Limits and Episode SemanticsFarama Foundation · required
Read the termination, truncation and "importance in learning code" sections, then the vector autoreset note at https://farama.org/Vector-Autoreset-Mode (next-step autoreset is the default in Gymnasium 1.x). Build a wrapper test that distinguishes termination from truncation and proves which cases bootstrap before using any third-party environment.
- Deep-ML - Planning ProblemsDeep-ML · support
Use named problems as closed-book checks after your own implementation passes: 157 (Bellman equation for value iteration), 164 (the gambler's problem by value iteration) and 467 (policy iteration). Read each problem's tests before trusting its statement.
- Reinforcement Learning Control Laboratory - Planning CoreRoadmap-Final · required
Complete Milestone A planning requirements: an explicit finite MDP, exact policy evaluation, value iteration, policy iteration, simulator agreement and seeded reward, transition, terminal and tie defects.
- Reinforcement Learning: An Introduction (2nd ed.) - Chapter 2 banditsRichard Sutton and Andrew Barto · reference
Read Section 2.9, Associative Search (Contextual Bandits), printed p. 41, with Exercise 2.10 as the context versus no-context check. Use only this section from Chapter 2.