Skip to content
Road to Intelligence

Concept · Chapter 5: Vision, Speech & Reinforcement Learning

MDPs, Policies and Value

Must knowUnderstand14 minDifficulty

A Markov decision process formalises an RL problem as states, actions, transitions, rewards and a discount; a policy says what to do, and a value function says how good a situation is under it.

The problem

To design and compare RL algorithms, we need a precise description of what the agent can observe, what it can do and what it is optimising.

The solution

Model the world as an MDP and define value functions that satisfy a recursive (Bellman) relationship between a state and its successors.

The consequence

Most RL algorithms become ways of estimating value functions, improving policies, or both.

The ingredients

A Markov decision process has a set of states SS, actions AA, transition probabilities P(s′∣s,a)P(s' \mid s, a), a reward for each transition, and a discount γ\gamma. Markov means the current state contains everything relevant: where you go next depends on where you are and what you do, not on how you got here. In the gridworld lab the state is the square, the actions are four moves, the transitions are deterministic, and rewards arrive only at the coin, the goal and the pit.

A policy π(a∣s)\pi(a \mid s) is the agent's behaviour: a probability for each action in each state (or a single fixed choice). Value functions score policies:

  • Vπ(s)V^\pi(s): the expected return starting in ss and following π\pi.
  • Qπ(s,a)Q^\pi(s,a): the expected return after taking action aa in ss, then following π\pi.

The Bellman equation

Values are recursive: what a state is worth equals what you get now plus what the next state is worth, discounted. For the best possible behaviour:

Q∗(s,a)  =  E[ r+γmax⁡a′Q∗(s′,a′) ]Q^*(s,a) \;=\; \mathbb{E}\big[\, r + \gamma \max_{a'} Q^*(s', a') \,\big]

Tiny numeric example (gridworld, γ = 0.9): a square next to the +10 goal is worth 10, because you can step in now. One square further back is worth 0 + 0.9 × 10 = 9, the next 8.1, and so on back to the start, five moves away: 10×0.94≈6.5610 \times 0.9^4 \approx 6.56. Heading for the coin instead, three moves away, is worth only 0.92×1=0.810.9^2 \times 1 = 0.81 from the start, so the optimal policy walks to the goal.

What to remember

  • MDP = (states, actions, transition probabilities, rewards, discount γ).
  • Markov: the next state depends only on the current state and action, not on the full history.
  • Policy π(a | s): what the agent does. Value V(s): expected return from s. Q(s, a): expected return after taking a in s.
  • Bellman: value here = reward now + γ × value of where you land.

Key papers

Essential

Reinforcement Learning: An Introduction (2nd edition)

Richard S. Sutton, Andrew G. Barto · 2018 · MIT Press

The standard textbook, free online from the authors. Everything in this chapter's RL half (MDPs, value functions, Q-learning, exploration, policy gradients, actor–critic) is developed carefully there.

How to read it: Chapters 1, 3 and 6 cover the core: the problem, MDPs, and temporal-difference learning including Q-learning. Chapter 13 is policy gradients.

~10 h read✓ verified 2026-09-26

Watch