Each curve averages 200 independent runs on freshly sampled testbeds. ε-greedy explores at a fixed rate; optimistic initialization forces early exploration then coasts; UCB steers exploration toward uncertain arms; the gradient bandit learns action preferences by stochastic gradient ascent.
Average reward over the first 1000 steps as a function of each method's single hyperparameter (100 runs per point), swept over powers of two. This is the Sutton & Barto Figure 2.6 summary — every algorithm has a sweet spot.
Here the arm values drift by a random walk every step. The sample-average estimator gives every reward equal weight and lags the moving target; a constant step size (α = 0.1) keeps chasing it. Averaged over 200 runs.
The 4×4 gridworld (corners are terminal, −1 reward per step, γ = 0.9). Policy iteration and value iteration converge to the same optimal value function and greedy policy. Each cell shows the optimal move and its state value.
Value iteration on the capital-betting MDP for three coin biases. The value function is the probability of reaching the $100 goal; the policy is the optimal stake at each capital level — producing the famous jagged staircase when the coin is unfavorable.
Build a seeded bandit testbed, implement incremental sample-average updates and epsilon-greedy selection, then average reward and optimal-action curves over many runs.
Add random-walk nonstationarity, constant step-size updates, optimistic initialization, UCB action selection and gradient bandits, then run a parameter study comparing all methods.
Encode the book gridworld as an MDP, perform iterative policy evaluation and greedy improvement, run full policy iteration, and solve the same MDP directly with value iteration.
Model the capital-betting MDP, compute optimal state values with value iteration, and extract the optimal stake for every capital level.