a
Define reinforcement learning and how it differs from another form of ML [4 marks]
4 marks
›
Model Answer
Once upon a time, there was a little robot named Pip who woke up in a strange maze. Pip wasn’t given a manual or told what to do (unlike supervised learning, where a teacher gives you the correct answers). Instead, Pip had to learn by trying things out. Every time Pip found a battery, he felt a spark of joy (a reward). If he bumped into a wall, he felt a slight drain (a negative reward). This is Reinforcement Learning: Pip (the agent) learns to make a sequence of decisions by interacting with his environment. His goal isn't just to find one battery, but to learn a habit (a policy) that leads to the most batteries over his entire journey.
The big difference? No one ever tells Pip the 'right' move; he only gets evaluative feedback (the reward) after he acts, and sometimes that reward is delayed (the credit-assignment problem). Also, Pip's own actions determine what parts of the maze he sees next, unlike supervised learning where the data is fixed.
b
Compare RL with evolutionary algorithms [2 marks]
2 marks
›
Model Answer
As Pip learned to navigate the maze, he updated his strategy step-by-step, learning from every turn he took within his own lifetime. This is how RL works: using the reward signal to incrementally update a value function or policy by exploiting the structure of states and actions within episodes.
But imagine if, instead of one Pip learning continuously, there was a whole factory of different robots. They are all released into the maze at once. At the end of the day, the ones who found the least batteries are scrapped, and the best ones are 'bred' to build a new generation of robots with slight variations. That’s an evolutionary algorithm! It maintains a population, evaluates their overall fitness only at the end of a trial, and improves through selection and mutation across generations, completely ignoring the step-by-step internal details that Pip learns from.
c
Explain the role of the reward signal in RL [2 marks]
2 marks
›
Model Answer
For Pip, the 'spark of joy' (the reward signal) is everything—it defines the goal of his problem. It tells him what he should be trying to achieve. Since no one is giving him instructions, the reward is the only feedback that drives his learning. He adjusts his policy to favor actions that lead to higher cumulative reward and avoid those leading to lower reward.
Because batteries might be hidden at the end of long corridors, Pip must learn to associate his present choices with those future consequences, shaping his value estimates and ultimately his policy.
d
Describe a real-world application of RL, including the state, actions, and reward [4 marks]
4 marks
›
Model Answer
Outside the maze, Pip’s cousin, a larger autonomous robot, was learning how to walk in the real world.
• The 'state' was the robot’s sensor readings—how its joints were bent, its velocities, and its camera input.
• Its 'actions' were the motor commands it sent to its joints.
• The 'reward' was carefully engineered by its creators: a positive reward for moving forward and staying upright, and a negative reward for falling or wasting energy.
Just like Pip, the walking robot tried actions, observed the resulting states and rewards, and gradually updated its policy. Over many trials (first in simulation to avoid damage), it figured out a stable walking gait without any human explicitly programming the joint motions. Other real-world adventures include recommendation systems, traffic-light control, and game-playing systems like AlphaGo.
e
Explain the exploration–exploitation trade-off [2 marks]
2 marks
›
Model Answer
One day, Pip found a path that consistently gave him a few small batteries. He could just keep walking down this safe path forever—this is 'exploitation', choosing the action currently believed to give the highest reward.
But what if there was a giant battery stash down an unknown, scary-looking corridor? To find out, Pip would have to take a risk and wander into the unknown—this is 'exploration'. The trade-off is critical: pure exploitation means Pip might be locked into a suboptimal path forever, while pure exploration means he’d never actually collect the batteries he’s discovered. He has to balance the two (e.g., using an ε-greedy strategy) to discover good actions while also benefiting from them.
f
Illustrate RL concepts using a simple game example [4 marks]
4 marks
›
Model Answer
To take a break from the maze, Pip decides to play a game of Tic-Tac-Toe against himself.
• The 'state' is the current board configuration.
• The 'actions' are where he places his mark in an empty cell.
• The 'reward' is +1 for a win, -1 for a loss, and 0 for a draw.
At first, Pip plays almost randomly, exploring the board. But after each game, he propagates the outcome reward back to the moves that led to it, updating his value estimates for board states. As he gathers experience, he begins to exploit this knowledge, increasingly selecting moves that he knows lead to wins. By occasionally trying new moves (exploration), he makes sure he doesn't miss better strategies. Over thousands of games, he converges on near-optimal play, setting up traps and blocking losses, all learned purely from the final rewards.
g
Describe how a grid-world agent's policy evolves under Q-learning [4 marks]
4 marks
›
Model Answer
When Pip was first dropped into a corner of the grid-world maze, he was clueless. He had equal probability of moving up, down, left, or right, and his 'Q-values' (his mental map of how good an action is) were all zero.
As he wandered randomly and finally stumbled upon a battery (the goal), Q-learning updated the value of the state-action pair that got him there using the TD update rule. On his next trips, that high value propagated backwards via the max term: the step *before* the final step started looking good, too.
Gradually, a trail of high Q-values lit up the shortest path from the start to the battery. By acting greedily (or ε-greedily) with respect to these values, Pip’s policy shifted from uniform-random wandering to confidently sprinting straight down the optimal route out of the corner.
h
Explain the concept of Q-learning and what distinguishes it from other approaches [4 marks]
4 marks
›
Model Answer
Pip’s 'Q-learning' method is like carrying a magic notebook where he tracks the action-value function Q(s,a)—the expected cumulative discounted reward of taking action a in state s, and then following the optimal policy thereafter.
What distinguishes it? First, it is 'model-free'. Pip doesn’t need a map or the rules of the maze (transition probabilities or rewards) to learn; he learns purely from sampled experience.
Second, it is 'off-policy'. This means Pip learns about the optimal (greedy) policy regardless of how he actually behaves while exploring. The max operator in his update targets the *best* possible next action, rather than the one he actually takes. Unlike supervised learning, there are no labeled examples, and he explicitly handles sequential decision-making.
i
When is Q-learning an appropriate algorithm to use? [4 marks]
4 marks
›
Model Answer
Pip’s magic notebook approach (Q-learning) is perfect for his grid-world maze. It fits problems that can be framed as a Markov decision process: sequential decision-making where outcomes depend on the current state, actions have delayed consequences, and there is a definable reward.
It is especially suitable when the state and action spaces are discrete and reasonably small. Because Pip physically stores Q-values in a table, the number of state-action pairs must be manageable. It’s also ideal when a model of the environment is unavailable but experience can be sampled cheaply (like in a simulation or game).
If Pip were in a vast, continuous world, his notebook would explode, and he’d have to use a neural network (Deep Q-Networks) instead.