Every equation for the mid-sem, each with every symbol spelled out — bandits, returns, model dynamics, value functions, the Bellman equations, DP backups, and the Monte Carlo estimate. Pair with the slides explained.
Symbols
| Symbol | Meaning |
|---|---|
| \(S_t, A_t, R_t\) | state, action, reward at step \(t\) |
| \(\pi(a\mid s)\) | policy: probability of action \(a\) in state \(s\) |
| \(G_t\) | return (cumulative future reward) |
| \(\gamma\) | discount rate, \(0 \le \gamma \le 1\) |
| \(\alpha\) | step size / learning rate |
| \(\varepsilon\) | exploration probability |
| \(q_*(a)\) | true value of bandit action \(a\) |
| \(Q_t(a)\) | estimated value of \(a\) at step \(t\) |
| \(v_\pi(s),\, q_\pi(s,a)\) | state-/action-value under policy \(\pi\) |
| \(v_*(s),\, q_*(s,a)\) | optimal state-/action-value |
| \(p(s',r\mid s,a)\) | model dynamics |
Bandits
The expected reward when action \(a\) is chosen. If every \(q_*(a)\) were known, you would just always pick \(\arg\max_a q_*(a)\).
Average of the rewards actually received for \(a\). \(\mathbb{1}\) is the indicator (1 if true, else 0), so the numerator sums rewards on steps where \(a\) was taken and the denominator counts them.
NewEstimate \(\leftarrow\) OldEstimate \(+\) StepSize \(\cdot\) (Target \(-\) OldEstimate). With \(\alpha = \tfrac{1}{n}\) this is exactly the sample average; a constant \(\alpha\in(0,1]\) gives an exponentially-weighted (recency-biased) average for non-stationary problems.
Greedy always exploits. \(\varepsilon\)-greedy explores a uniformly-random action with probability \(\varepsilon\); the greedy action can also be the random pick, hence the \(+\tfrac{\varepsilon}{|\mathcal{A}|}\) term.
Returns
Sum of rewards to the final step \(T\) of an episode (game, maze run).
\(\gamma\) sets the present value of future rewards: \(\gamma=0\) is myopic, \(\gamma\to 1\) is far-sighted. The recursion \(G_t = R_{t+1} + \gamma G_{t+1}\) is the seed of every Bellman equation.
A constant reward of \(+1\) every step gives a finite return when \(\gamma<1\).
Model dynamics
The complete one-step model of the MDP. The Markov property: this depends only on the current \((s,a)\), not the history.
Marginalize the dynamics over reward to get the transition probability; the expected reward of a \((s,a,s')\) triple follows by conditioning.
Value functions
\(v_\pi\) is the expected return from \(s\) following \(\pi\); \(q_\pi\) commits to action \(a\) first, then follows \(\pi\). They are linked by \(v_\pi(s)=\sum_a \pi(a\mid s)\,q_\pi(s,a)\).
Bellman equations
Value of a state = average over the policy's actions of (immediate reward \(+\) discounted value of the next state). Self-consistency is what makes value computable.
The only change from the expectation form is \(\max_a\) instead of averaging over \(\pi\) — take the best action. Solving it yields the optimal policy directly.
Dynamic programming backups
Turn the Bellman expectation equation into an assignment and sweep all states until \(v\) stops changing — converges to \(v_\pi\).
Act greedily w.r.t. \(v_\pi\). The policy improvement theorem guarantees \(\pi'\) is no worse than \(\pi\).
One Bellman optimality backup per sweep — converges to \(v_*\); then read off the greedy policy.
Monte Carlo
Replace the expectation with an empirical average of the returns \(G_i\) actually observed after visiting \(s\) (or \((s,a)\)) across sampled episodes. Model-free, episodic.
Reweights returns gathered under behaviour policy \(b\) to estimate the target policy \(\pi\) — the ratio of how likely each was to produce the trajectory.
More in this vault
- Slides Explained · what each formula means
- Cheatsheet · formulas + skeletons, one card
- Book Explained · Sutton & Barto Ch 1–5