5.1.2 · D1Reinforcement Learning Foundations

Foundations — Markov Decision Processes (MDP)

2,895 words13 min readBack to topic

Before you touch value functions or Bellman equations, you must be able to read every squiggle the parent note writes without pausing. This page builds each one from nothing, in an order where every symbol is earned before it is used. Nothing here contradicts the parent — it is the ground floor under it.


0. The world as dots and arrows

Everything in an MDP can be drawn as dots connected by labelled arrows. Keep this picture in your head for the whole page.

Figure — Markov Decision Processes (MDP)
  • A dot = a situation the agent can be in.
  • An arrow = "if you do this action, you might end up over there."
  • Each arrow carries a chance (how likely) and a payoff (how much reward).

That is the entire object. The rest is naming the parts. Once we have named all five parts, we bundle them together and call the bundle an MDP:

Recall One assumption we make throughout

This page assumes and are discrete (finite bags of dots and choices), so that writing over next states makes sense. If states were continuous (e.g. a real-valued position), every would become an integral and would be a probability density instead of a probability. Same idea, heavier machinery — we stay discrete here.


1. The set — states

Plain words. A state is "the current screen of the video game."

The picture. Each dot in the figure above is one state. is the whole bag of dots.

Why the topic needs it. Without a fixed idea of "where am I," there is nothing to attach a decision to. States are the nouns of the problem.

Notation you'll meet:

  • — a generic state (a single dot).
  • (read "s-prime") — the next state, the dot an arrow points to. The little tick mark just means "the new one."
  • — the state at time step (see §7). So is the agent's actual trip through the dots.

2. The set — actions

Plain words. In a maze: move up, down, left, right. Those four choices are .

The picture. From one dot, each action is a bundle of arrows leaving that dot. In our line-world, action right is one arrow group, left is another.

Why the topic needs it. Actions are the only thing the agent controls. They are the verbs. The whole point of the topic is to choose them well.

Notation: = a generic action; = the action taken at time .


3. Probability, and the symbol

Before we can read the transition symbol, we must be sure about the word probability and the bar .

Now the transition symbol reads itself:

Figure — Markov Decision Processes (MDP)

Why not just one arrow per action? Because the world can be random. In the figure, taking right from has an arrow to and a arrow back to . This is exactly the stochastic Example 2 in the parent. is the tool that encodes "acting doesn't guarantee an outcome."

Sanity check on : for any fixed and , adding the chances of all next states gives — from every dot, something must happen.


4. The reward function

The picture. The reward is the label on the arrow — the little "+10" or "0" written on it in the figure.

Why the topic needs it. Rewards are how a goal becomes math. "Reach the exit" turns into "give on the arrow into the exit dot." The agent has no idea what you want except through these numbers.


5. The Greek letter — discount factor

The picture. Think of every future reward as a coin that fades a little each step. A reward steps away is worth only of its face value.

Figure — Markov Decision Processes (MDP)

Why the topic needs it. Three reasons (all in the parent):

  1. The far future is uncertain, so it should count less.
  2. Impatience — a reward now beats the same reward later.
  3. Convergence — an endless sum of rewards would blow up; multiplying by tames it.

Why makes infinite sums finite. This is the one bit of algebra you must own. A geometric series is a sum where each term is the previous one times a fixed ratio:

That is why the parent's Example 1 gets : an infinite stream of each shrunk by sums to a finite . Whenever you see later, this is the picture it came from.


6. Summation and expectation

Two symbols do the heavy lifting in every Bellman equation. Meet them now.

Why the topic needs both. Because transitions are random (), the return is a random quantity. We cannot report a single guaranteed number, so we report the average over all possible futures — that is , and it is computed by summing over next states. Every Bellman equation is literally an expectation written out as a sum.

Tiny concrete example (matches parent Example 3's risky action): Half a chance of , half of , average .

with a little underneath just means "the average, assuming actions are chosen by policy " (next section).


7. Time steps and the return

The picture. A row of stopwatch ticks. The convention that reward for the step from has subscript is just bookkeeping: "the payoff arrives with the next state."

Now we can name the quantity the whole topic is trying to maximise — the return.

Why the topic needs it. is the score the agent chases. It is random (the rewards depend on random transitions), which is exactly why the value functions in 5.1.03-Policy-and-Value-Functions take its expectation . Every symbol on this page exists to make this single sum well-defined and finite: says where to start counting, supplies the terms, and guarantees it converges.


8. The Markov property (the reason it's an MDP)

Figure — Markov Decision Processes (MDP)

The picture. Cross out the whole tail of past dots — the branching probabilities from the current dot don't change one bit.

Why the topic needs it. This is the assumption that makes everything solvable. Because the next step depends only on now, we can talk about "the value of a state" as a single well-defined quantity, instead of "the value of this entire 4000-step history." It shrinks an infinite bookkeeping problem to one number per dot. This idea is the same one behind Markov-Chains; an MDP is a Markov chain with choices and rewards bolted on.


9. Policy — the strategy

The picture. Paint one chosen out-arrow at every dot; that colouring is a deterministic policy. Follow the paint and you get a path.

Why the topic needs it. The policy is the answer the whole topic is searching for. Actions () are what's possible; the policy is what's decided. Value functions (built in 5.1.03-Policy-and-Value-Functions) always measure "how good is this policy." The best one is (§10). Details live in 5.1.03-Policy-and-Value-Functions.


10. The star and

Two final marks close the alphabet.

Why the topic needs them. Optimal control = "pick the action that leads to the best future." That sentence is exactly . The inside the Bellman optimality equation is where "just averaging" becomes "actively choosing the best." These power 5.1.04-Bellman-Equations and the algorithms in 5.2.01-Dynamic-Programming-inRL, 5.4.01-Q-Learning.


How the foundations feed the topic

States S dots

MDP tuple S A P R gamma

Actions A choices

Probability and bar given

Transitions P

Reward R arrow labels

Discount gamma geometric shrink

Return G total discounted reward

Sum and Expectation

Bellman equations

Time steps t

Markov property memoryless

Value functions V and Q

Policy pi strategy

Star and argmax best

Optimal policy pi star

Everything on the left is a symbol built on this page; everything on the right is what the parent note does with them.


Equipment checklist

Cover the right side and try to answer aloud.

What is a state , in one plain sentence?
A complete snapshot of the current situation — the only thing you need to decide your next move.
What does the prime in mean?
It marks the next state, the dot an arrow points to.
Write out the five parts of an MDP tuple.
— states, actions, transition probabilities, reward function, discount factor.
Read in words.
The probability of reaching given you are in and take action .
For a fixed , what must equal, and why?
It equals , because from any state some next state must occur.
What does the vertical bar always mean?
"Given that" — everything on its right is assumed already true.
Where does the reward live in the dots-and-arrows picture?
On the arrow — it is the label/payoff for that transition.
State the range of and when is allowed.
; is only allowed for episodic tasks guaranteed to end in finitely many steps.
What does sum to, and where does it show up?
; it produces in the parent's Example 1.
Write the formula for the return .
.
What does compute?
The probability-weighted average of the random quantity .
State the Markov property in plain words.
The next state depends only on the current state and action, not on any earlier history.
Difference between deterministic and stochastic ?
names one fixed action; gives a probability for each action.
For a stochastic policy, what must equal?
Exactly in every state — it is a probability distribution over actions.
What assumption lets us write instead of an integral?
That the state set is discrete; continuous states would need .
Difference between and ?
returns the biggest value; returns the action that achieves it.
What does the star in or signify?
The best possible value / policy over all policies.