Skip to content

🏋️ Reinforcement Learning — Exercises

Reinforcement Learning

View the live site — ijk37.com

Exercises

Home  |  Notes  |  Quiz Hub  |  Projects  |  Resources

Practice problems for every chapter of Reinforcement Learning: An Introduction (2nd ed.) by Sutton & Barto, paired with the study notes.

Each chapter file mixes conceptual/descriptive questions, math-by-hand problems, and small coding tasks. Every exercise follows the same format:

  • 💡 Hint — a visible nudge to get you unstuck. Read it after thinking, before giving up.
  • ✅ Full Answer — a collapsible <details> block with the complete, worked solution. Try the problem first, then expand to check.

How to study: attempt the question cold → peek at the hint only if stuck → write your answer → expand the full answer and compare. For coding tasks, run your version before reading the solution.


📚 Chapter index

Part 0 — Foundations

Part I — Tabular Solution Methods

Part II — Approximate Solution Methods

Part III — Looking Deeper


Work the exercises right after reading the matching notes chapter — while the ideas are fresh. The coding tasks build on each other:

bandit (ε-greedy/UCB)  →  tabular Q-learning/Sarsa  →  Dyna-Q  →
tile-coded Sarsa (Mountain Car)  →  DQN  →  REINFORCE → actor–critic

If you implement that chain end-to-end, you'll have re-derived most of modern RL by hand.


🧭 The one question to ask about every algorithm

How does it evaluate? How does it improve? Does it bootstrap? Does it need a model? On-policy or off-policy?

Most exercises are secretly checking whether you can answer these five for the method at hand.


Companion to the notes. Equations render on GitHub via LaTeX ($…$); answers are hidden in collapsible <details> blocks so you can self-test.