C1: one action fixes the next state
C2: one action, several possible states
Outcome probabilities guide decisions
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | ||||
| 2 | ||||
| 1 | ●Agent |
State (x, y)
Agent at (1, 1)
x increases right; y increases up
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | ||||
| 2 | ||||
| 1 | ●Agent |
Regular states
Available actions: North, East, South, West
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | ||||
| 2 | ||||
| 1 | ●Agent |
Wall at (2, 2)
A move into the wall leaves the agent in place
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | +1Exit | |||
| 2 | −1Exit | |||
| 1 | ●Agent |
Exit states
Only available action: Exit
Exit pays +1 or −1, then the episode ends
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | +1Exit | |||
| 2 | −1Exit | |||
| 1 | ●Agent |
Movement reward
Every compass action pays
Including blocked moves and moves into exit squares
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | +1Exit | |||
| 2 | −1Exit | |||
| 1 | ●Agent |
Noisy movement
Intended direction: 0.8
Each sideways direction: 0.1
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | +1Exit | |||
| 2 | -1Exit | |||
| 1 | ●Agent |
Choose a move
Last reward: 0.0
Total reward: 0.0
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | +1Exit | |||
| 2 | -1Exit | |||
| 1 | ●Agent |
Click an available action
Intended direction: 0.8
Each sideways direction: 0.1
Start at (1, 1)
Choose North twice
What is the probability of
ending at (1, 2)?
Same state: (3, 1)
Same action: North
Different histories
Same next-state probabilities
Current state, action, next state
The current state and action suffice
Earlier history adds nothing
Also specify the initial state or distribution and any terminal states
Start at (1, 1)
Follow a fixed list of actions
First action: North
We intend to move up
Dashed arrow: intended direction
Chosen action: North
Actual move: East
The agent lands at (2, 1)
A sideways slip, probability 0.1
Next on the list: North
North now points into the wall
This move leaves the agent in place
The plan still says North
But we are in a different square
We need an action for
where we are now
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | → | → | → | +1Exit |
| 2 | ↑ | ↑ | −1Exit | |
| 1 | ↑ | → | ↑ | ← |
A policy determines
what to do for each state
After the slip, we are at (2, 1)
Observe the state, then use its action
Policy A
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | → | → | → | +1Exit |
| 2 | ↑ | ↑ | −1Exit | |
| 1 | ↑ | → | ↑ | ← |
Policy B
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | → | → | → | +1Exit |
| 2 | ↑ | ↑ | −1Exit | |
| 1 | → | → | ↑ | ← |
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | → | → | → | +1Exit |
| 2 | ↑ | ← | −1Exit | |
| 1 | ↑ | ← | ← | ↓ |
Living reward
Reward received on every move
Intended direction: 0.8
Each sideways direction: 0.1
Exit rewards: +1 and −1
The car wants to travel quickly
Actions: Slow or Fast
Temperature changes what happens next
At a state: choose
Take the action with the
highest expected return
After an action: average
Weight each possible
outcome by its probability
Fast: equal weights, 0.5 and 0.5
is the current state
is the chosen action
is a Q-state
is the next state
Probability of reaching after taking in
: probability of next state after action in current state
Choose East from c
| Transition | Probability |
|---|---|
| Any other state |
At a, compare East with Exit
| State | Action | Next State | Probability |
Reward |
|---|---|---|---|---|
| a | East | |||
| a | East | |||
| a | Exit |
West toward +10
Three successful moves, then Exit
East toward +1
One successful move, then Exit
A larger reward later, or a smaller reward sooner?
How much should waiting reduce a reward’s value?
More reward?
Earlier reward?
How should we compare whole reward sequences?
Prefer rewards now to the same rewards later
Now
One step later
Two steps later
Each extra step multiplies the reward’s value by
Return from the start:
| Without Discounting () | With | |
|---|---|---|
| A | ||
| B |
A smaller gives less weight to later rewards
Start at d · Movement reward 0 · 0.8 move, 0.2 stay
| Discount | West to +10 | East to +1 | Preferred |
|---|---|---|---|
| 0.1 | 0.005 | 0.082 | East |
| 0.9 | 6.769 | 0.878 | West |
Expected discounted returns include failed-move delays and a separate Exit action
At : Fast when Cool, Slow when Warm
The optimal policy keeps driving without overheating
Slow earns +1; Fast from Cool earns +2
The agent earns +1 on every move, forever
No discount
With
An endless reward sequence can have a finite discounted return
Every reward has magnitude at most ;
Best expected return
starting in
Take in , then act optimally
Includes the reward from the first action
Choose Fast at Cool
Reward from This Action
Average Future Value
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | 0.31 | 0.51 | 0.72 | +11.00 |
| 2 | 0.15 | 0.36 | -1-1.00 | |
| 1 | 0.01 | 0.01 | 0.15 | -0.09 |
Choose East at (3, 3)
| Next State | Probability | Value |
|---|---|---|
| (4, 3) | 0.80 | 1.00 |
| (3, 3) | 0.10 | 0.72 |
| (3, 2) | 0.10 | 0.36 |
Each term: probability × (transition reward + discounted next-state value)
is the best expected return with actions remaining
One action now, then actions remain; Exit also counts as an action
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | 0.00 | 0.00 | 0.72 | +11.00 |
| 2 | 0.00 | 0.00 | -1-1.00 | |
| 1 | 0.00 | 0.00 | 0.00 | 0.00 |
One action: Exit gives +1 or −1
Two actions: move, then Exit
Every update reads the previous sweep
is the best expected return with actions remaining
Take action first, then act optimally
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | 0.00 | 0.00 | 0.72 | +11.00 |
| 2 | 0.00 | 0.00 | -1-1.00 | |
| 1 | 0.00 | 0.00 | 0.00 | 0.00 |
Two actions remaining at (3, 3)
| First Action | |
|---|---|
| North | 0.09 |
| East | 0.72 |
| South | 0.09 |
| West | 0.00 |
Each row keeps one action value; the maximum gives the state value
Stop when the largest change is below a tolerance
| Round | Cool | Warm | Overheated |
|---|---|---|---|
Given this policy, how do we determine its values?
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | →0.31 | →0.39 | ↑0.45 | Exit1.00 |
| 2 | →0.00 | →-0.72 | Exit-1.00 | |
| 1 | →-0.31 | →-0.39 | →-0.45 | →-0.47 |
Given these optimal values , which actions should we choose?
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 3 | →0.64 | →0.74 | →0.85 | Exit1.00 |
| 2 | ↑0.57 | ↑0.57 | Exit-1.00 | |
| 1 | ↑0.49 | ←0.43 | ↑0.48 | ←0.28 |
Which machine would you choose for the next 100 plays?
Blue: $1 every play
Red: $2 with probability 0.75
$0 with probability 0.25
Always Blue or always Red, starting from either state
→ Choose Red
We can no longer solve this MDP
from the given information alone
We must act, observe rewards,
and learn the missing probabilities
Choose a machine on each of 10 turns
Blue: $1 every play
Red: $2 or $0, odds unknown
Illustrative 10-play record
| Machine | Observed rewards | Sample average |
|---|---|---|
| Blue | 1, 1, 1, 1 | $1.00 |
| Red | 0, 0, 0, 0, 0, 2 | $0.33 |
Each action earns a reward and may teach us something
We needed to act to learn about the machines
| Idea | What It Means |
|---|---|
| Exploration | Try uncertain actions to gain information |
| Exploitation | Use the best action according to current estimates |
| Regret | Expected reward lost compared with choosing the best action |
| Sampling | Repeat observations because outcomes vary by chance |
Learning can be harder than solving a known MDP