
Learning by Trial: Tabular Reinforcement Learning
Monte Carlo, TD(0) SARSA, n-step TD, and SARSA(lambda) each learn to cross a frozen lake without falling through the ice. Every algorithm runs from first principles in NumPy on Gymnasium environments.
66%
TD(0) success, 8 by 8 slippery
24%
Monte Carlo, same lake
75%
three-step TD, 4 by 4 slippery
4
algorithms from scratch
Problem
Understanding the challenge and user needs
On a slippery lake an agent moves in its intended direction only part of the time. Methods that wait until the end of an episode to learn struggle when most episodes end in a hole.
Approach
Strategy and methods used to address the problem
Each algorithm trained on four-by-four and eight-by-eight lakes, with and without slipping, and on the Taxi environment. Heat maps of the learned value tables and greedy policies show what each agent came to believe about every square.
(opens in a new tab)Final Solution
The final design and outcome
On the eight-by-eight slippery lake, TD(0) reached the goal in 66 percent of evaluation episodes against 24 percent for Monte Carlo. On the four-by-four slippery lake, three-step TD performed best at 75 percent.
Success rate on slippery lakes
| Lake | Method | Evaluation success |
|---|---|---|
| 8 by 8 | Monte Carlo | 24% |
| 8 by 8 | TD(0) SARSA | 66% |
| 4 by 4 | n-step TD, n = 3 | 75% |
Impact & Validation
Results, learnings, and outcomes
Learning from each step rather than each finished episode nearly tripled the success rate under uncertainty, the core idea behind every deep reinforcement learning method that follows.






