Notation and Conventions

The notation is Sutton and Barto’s throughout, so that a reader can move between this companion and the original without translation.Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. Adaptive Computation and Machine Learning. MIT Press, Cambridge, MA, second edition, 2018. ISBN 978-0-262-03924-6. URL http://incompleteideas.net/book/the-book-2nd.html Capital letters are random variables and lower-case letters their values or scalar functions; vectors are bold lower case, even when random, and matrices bold capitals. The symbol ≐\doteq marks an equality that holds by definition, and ←\leftarrow an assignment inside an algorithm.

0.3General Symbols

SymbolMeaning
Pr⁡{X=x}\Pr\{X = x\}probability that the random variable XX takes the value xx
X∼pX \sim pXX is drawn from the distribution pp, p(x)≐Pr⁡{X=x}p(x) \doteq \Pr\{X = x\}
𝔼[X]\mathbb{E}[X], 𝔼π[X]\mathbb{E}_\pi[X]expectation; the subscript names the policy that generates the data
argmax⁡af(a)\operatorname{argmax}_a f(a)a value of aa at which ff is maximal (ties broken arbitrarily)
𝟙predicate\mathbb{1}_{\text{predicate}}indicator: 11 if the predicate is true, else 00
ε\varepsilonprobability of a random action in an ε\varepsilon-greedy policy
α,β\alpha, \betastep-size parameters
γ\gammadiscount rate, 0≤γ≤10 \le \gamma \le 1
λ\lambdadecay rate of eligibility traces

0.4Bandits

SymbolMeaning
kknumber of actions (arms)
q∗(a)q_*(a)true value (expected reward) of action aa
Qt(a)Q_t(a)estimate at time tt of q∗(a)q_*(a)
Nt(a)N_t(a)number of times aa was selected before time tt
Ht(a)H_t(a)learned preference for aa at time tt
πt(a)\pi_t(a)probability of selecting aa at time tt
R¯t\bar R_trunning estimate of the expected reward

0.5Markov Decision Processes

SymbolMeaning
s,s′s, s'; aa; rrstates; an action; a reward
𝒮\mathcal{S}, 𝒮+\mathcal{S}^+nonterminal states; all states including the terminal one
𝒜(s)\mathcal{A}(s), ℛ\mathcal{R}actions available in ss; the finite set of possible rewards
St,At,RtS_t, A_t, R_tstate, action and reward at time tt (Rt+1R_{t+1} follows AtA_t)
TTfinal time step of an episode
p(s′,r∣s,a)p(s', r \mid s, a)probability of moving to s′s' with reward rr after taking aa in ss
p(s′∣s,a)p(s' \mid s, a), r(s,a)r(s, a)state-transition probability; expected reward
π(a∣s)\pi(a \mid s), π(s)\pi(s)stochastic policy; action of a deterministic policy
GtG_treturn following time tt
Gt:t+nG_{t:t+n}nn-step return (bootstrapped from step t+nt+n)
GtλG_t^\lambdaλ\lambda-return
vπ(s)v_\pi(s), qπ(s,a)q_\pi(s, a)state and action values under π\pi
v∗(s)v_*(s), q∗(s,a)q_*(s, a)optimal state and action values
V,VtV, V_t; Q,QtQ, Q_ttabular estimates of state and action values
δt\delta_ttemporal-difference error at time tt
ρt:h\rho_{t:h}importance-sampling ratio from time tt through hh
b(a∣s)b(a \mid s)behavior policy, when learning about a target policy π\pi
r(π)r(\pi)average reward of π\pi
μ(s)\mu(s)on-policy distribution over states
η(s)\eta(s)expected number of visits to ss per episode

0.6Function Approximation

SymbolMeaning
𝐰\mathbf{w}, ddweight vector of a value function and its dimension
v^(s,𝐰)\hat v(s, \mathbf{w}), q^(s,a,𝐰)\hat q(s, a, \mathbf{w})approximate state and action values
𝐱(s)\mathbf{x}(s), 𝐱t\mathbf{x}_tfeature vector of ss; shorthand for 𝐱(St)\mathbf{x}(S_t)
𝐰⊤𝐱\mathbf{w}^\top\mathbf{x}inner product
𝐳t\mathbf{z}_teligibility trace vector
𝜽\boldsymbol{\theta}, d′d'policy parameter vector and its dimension
π(a∣s,𝜽)\pi(a \mid s, \boldsymbol{\theta}), J(𝜽)J(\boldsymbol{\theta})parameterized policy; its performance
𝐏\mathbf{P}, 𝐃\mathbf{D}, 𝐗\mathbf{X}transition matrix under π\pi; diag⁡(μ)\operatorname{diag}(\mu); matrix whose rows are the 𝐱(s)⊤\mathbf{x}(s)^\top
𝐀\mathbf{A}, 𝐛\mathbf{b}, 𝐰TD\mathbf{w}_{\mathrm{TD}}𝔼[𝐱t(𝐱t−γ𝐱t+1)⊤]\mathbb{E}[\mathbf{x}_t(\mathbf{x}_t - \gamma\mathbf{x}_{t+1})^\top], 𝔼[Rt+1𝐱t]\mathbb{E}[R_{t+1}\mathbf{x}_t], and the TD fixed point 𝐀−1𝐛\mathbf{A}^{-1}\mathbf{b}
TπT_\pi, T∗T_*Bellman operator of π\pi and Bellman optimality operator (𝐁π\mathbf{B}_\pi in the off-policy chapters, as in the original)
Π\Piprojection onto representable value functions
∥v∥μ2\lVert v \rVert_\mu^2∑sμ(s)v(s)2\sum_s \mu(s) v(s)^2
VE̅\overline{\mathrm{VE}}, BE̅\overline{\mathrm{BE}}, PBE̅\overline{\mathrm{PBE}}, TDE̅\overline{\mathrm{TDE}}mean squared value, Bellman, projected Bellman and TD errors

0.7Conventions of This Companion

Numbered algorithms are written as compact pseudo-code: parameters, initialization, then the loop; they correspond to the boxed algorithms of the original. Theorems are stated with the hypotheses they need and proved, or their proof is sketched with a reference. A sidenote that begins with Beyond Sutton and Barto (2018) introduces material that is not in the book: later results, or classic results it leaves out, always with the primary source.

The Wolfram Language checks are code blocks in the JavaScript mode of wolfram-ws-bridge: show`…` sends Wolfram Language text to the kernel and typesets the result, which appears right below the block exactly as the kernel produced it, and ${name} inserts the value of an earlier step. No check assigns a Wolfram symbol: values live in JavaScript constants and functions are pure Functions, so each chapter’s checks are self-contained and run in order.