Skip to content
BIASED

Markov decision processes

MDPs, returns, Bellman equations, value and policy iteration, beliefs in POMDPs.

From plan to policy

Search returned a fixed action sequence. When a step can slip — as in the Russell–Norvig 4times34\\times 3 grid, where each move succeeds with probability 0.80.8 and slips sideways with 0.10.1 — a blind plan fails. The plan N,N,E,E,E reaches the goal with probability only 0.327760.32776 and expected return about 0.0510.051; a reactive policy is worth 0.3740.374 from the same start.

MDP, return and values

An MDP is (mathcalS,mathcalA,P,R,gamma)(\\mathcal S,\\mathcal A,P,R,\\gamma) with the Markov property: the next state depends only on the current state and action. The return is

Gt=Rt+1+gammaRt+2+gamma2Rt+3+cdots.G_t = R_{t+1} + \\gamma R_{t+2} + \\gamma^2 R_{t+3} + \\cdots .

Discount gamma<1\\gamma<1 keeps the sum finite, prefers sooner reward, and reads as a 1−gamma1-\\gamma chance the process stops. Values: V^\\pi(s)=\\mathbb E_\\pi[G_t\\mid S_t=s], Q^\\pi(s,a)=\\mathbb E_\\pi[G_t\\mid S_t=s,A_t=a]; optima V^\\star, Q^\\star.

Bellman expectation equation

From Gt=Rt+1+gammaGt+1G_t=R_{t+1}+\\gamma G_{t+1}, linearity and the Markov property:

V^\\pi(s)=\\sum_a \\pi(a\\mid s)\\sum_{s'} P(s'\\mid s,a)\\big(R(s,a,s')+\\gamma V^\\pi(s')\\big).

In matrix form V^\\pi = R_\\pi + \\gamma P_\\pi V^\\pi, so V^\\pi=(I-\\gamma P_\\pi)^{-1}R_\\pi: evaluating a known policy is a linear solve.

Optimality and value iteration

Key idea. The best action maximizes immediate expected reward plus discounted best continuation:

V^\\star(s)=\\max_a \\sum_{s'} P(s'\\mid s,a)\\big(R(s,a,s')+\\gamma V^\\star(s')\\big).

Value iteration iterates the backup VleftarrowTVV\\leftarrow T V. TT is a gamma\\gamma-contraction in \\|\\cdot\\|_\\infty, so it converges geometrically to the unique fixed point V^\\star from any start. In the grid, Q^\\star((3,3),\\mathrm{E})\\approx 0.928=V^\\star(3,3).

Policy iteration

Policy iteration alternates exact evaluation of V^\\pi with greedy improvement \\pi'(s)=\\arg\\max_a Q^\\pi(s,a). The policy-improvement theorem gives V^{\\pi'}\\ge V^\\pi; with finitely many deterministic policies the loop stops at an optimum. From “always north” (−0.319-0.319 at the start) three rounds reach 0.3740.374.

POMDPs and next

If the state is hidden, act on a belief updated by Bayes’ rule. A dirt sensor with prior 0.30.3 and accuracy 0.90.9 that reports “dirty” yields posterior 0.7940.794. The belief MDP is exact but continuous and hard; agents approximate it (filters, recurrent state, or an LM context).

Value iteration needs known P,RP,R and a sweep over all states. When part of the environment is an adversary and the state space is too large to list, search forward from the current position — next: games and Monte Carlo tree search.

Check your understanding

The same questions as in Pulse. Answers are shared between modes.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • One Bellman backup for an MDPoptional

    Compute V'(s) = max_a Σ p(s'|s,a)[r + γV(s')] on a tiny MDP; match the table.

    ~25 min · easier on a computer · The matching course topic has been read.

    Self-check in the notebook — not part of mastery or the certificate.

Full notes

Answers are saved on the server and tied to this browser until you sign in.