5.1.6 · D3Reinforcement Learning Foundations

Worked examples — Discount factor and returns

2,296 words10 min readBack to topic

This is the "roll-up-your-sleeves" companion to the parent note on returns and $\gamma$. Over there we built the machinery: the return , the discount factor , the bound , and the recursion . Here we do only one thing: hit every kind of scenario the topic can throw at you, one worked example at a time.

Before line one: a quick reminder of the three symbols we will use constantly.

Recall The three symbols, in plain words
  • ::: the reward you receive one step after being at time (the action at pays out at ).
  • ::: the "trust dial on the future", a number between and ; every extra step into the future multiplies its reward by another .
  • ::: the return — add up all future rewards, each shrunk by its own power of .

The scenario matrix

Every problem about returns is really one of the cells below. If you can do one example per row, you can do them all. (Prereq threads: Geometric series, Episodic vs continuing tasks, and the recursion feeds Value functions and Bellman equations.)

# Cell class What makes it different Covered by
A Constant reward, continuing task pure geometric series, infinite sum Ex 1
B Constant reward, negative sign tests "bigger ≠ bigger return" Ex 2
C Finite episode, mixed signs terminates → sum stops Ex 3
D Same episode via the recursion needs terminal condition Ex 4
E Degenerate (myopic) only survives Ex 5
F Limiting (episodic OK) undiscounted finite sum Ex 6
G Effective horizon / mean step vs Ex 7
H Delayed lump sum (word problem) one reward far in the future Ex 8
I Periodic reward (exam twist) reward every steps → geometric in Ex 9
J Shifting changes the decision two paths, which wins depends on Ex 10

The figures below carry the geometry: how the discounted weights stack up (Ex 1), and how the choice between two paths flips as you turn the dial (Ex 10).


The worked examples

Figure — Discount factor and returns
Figure — Discount factor and returns

Recap

Recall One-line summary of every cell

Constant reward → (Ex 1–2); finite episode → truncated term-by-term sum, matched by the backward recursion with (Ex 3–4); myopic keeps only (Ex 5); is safe only when episodic (Ex 6); horizon scale vs mean step differ by one (Ex 7); a single delayed reward is worth (Ex 8); periodic reward → geometric in (Ex 9); and can flip which policy is optimal (Ex 10).

Return to the parent note · related: Reward hypothesis, Markov Decision Process.