a
Define reinforcement learning and how it differs from another form of ML [4 marks]
4 marks
›
Model Answer
Think about how you train a puppy. You don't hand it a textbook of correct behaviours; you let it try things, and when it does something good it gets a treat, when it doesn't, nothing. Over time it works out which actions earn treats. That is reinforcement learning.
Formally: in RL an agent (the puppy / a program) learns to make a sequence of decisions by interacting with an environment. At each step it observes a state (the current situation), takes an action, and receives a reward signal plus a new state. Its goal is to learn a policy — a habit that maps situations to actions — that maximises the expected cumulative reward over time, not just the treat right in front of it.
The clearest contrast is with supervised learning, which is more like revising with flashcards that have the answer on the back: every example comes with the correct label, and learning just means matching them. RL has no answer key — it only gets an evaluative reward saying how good an action was, never what the perfect action would have been. Two consequences follow: feedback is often delayed (the treat may depend on a whole chain of earlier moves — the credit-assignment problem), and the agent's own choices decide what experience it sees next, whereas in supervised learning the dataset is fixed and handed to you.
b
Compare RL with evolutionary algorithms [2 marks]
2 marks
›
Model Answer
Picture two ways a darts club could improve. RL is one player practising all evening: after each throw they see where it landed and tweak their aim — they learn within a single 'lifetime' from step-by-step feedback. An evolutionary algorithm is more like running a whole squad, keeping the few who scored best by the end of the night, and 'breeding' the next generation from them with small random changes (mutation) and mixes (crossover).
So RL updates a value function or policy incrementally using the reward at each step, exploiting the structure of states and actions inside an episode. Evolutionary methods judge each whole policy only by its final fitness, ignore the step-by-step detail, and improve across generations rather than within one trial.
c
Explain the role of the reward signal in RL [2 marks]
2 marks
›
Model Answer
The reward is the agent's version of the score in a video game, or the 'warmer… warmer… colder!' in a children's hiding game — it's the thing that tells you what you're actually trying to achieve. It defines the goal of the problem.
It is also the only feedback that drives learning: the agent nudges its policy toward actions that lead to more total reward and away from those that lead to less. And because the 'warmer' can arrive long after the move that earned it, the agent must learn to connect present actions with future payoffs — which is what shapes its value estimates and ultimately its behaviour.
d
Describe a real-world application of RL, including the state, actions, and reward [4 marks]
4 marks
›
Model Answer
A nice example is a robot learning to walk — much like a toddler. Nobody tells the toddler the exact muscle commands; they wobble, fall, adjust, and gradually figure it out from the consequences.
• State: the robot's sensor readings — joint angles, velocities, balance, camera input — everything it can sense about its current situation.
• Actions: the motor commands it can send to its joints.
• Reward: hand-designed to capture the goal — positive for distance travelled forward and for staying upright, negative for falling over or wasting energy.
The robot tries actions, watches the resulting states and rewards, and slowly updates its policy so movements that keep it balanced and moving forward become more likely. To avoid breaking real hardware, this is usually done in simulation first. Over many trials it converges on a smooth walking gait nobody hand-programmed.
Other everyday examples in the same state/action/reward mould: recommendation feeds (state = your history, action = what to show next, reward = whether you engage), traffic-light control, datacentre cooling, and game-players like AlphaGo.
e
Explain the exploration–exploitation trade-off [2 marks]
2 marks
›
Model Answer
This is the 'favourite restaurant' dilemma. Exploitation is ordering the dish you already know is great. Exploration is trying something new that might be even better — or might be a let-down.
In RL, exploitation means picking the action you currently believe gives the highest reward; exploration means trying others to gather information. The trade-off matters because pure exploitation can lock you onto a merely-okay favourite you never improve on, while pure exploration never lets you enjoy what you've learned. Strategies like ε-greedy strike a balance — usually order the favourite, but every so often roll the dice on something new.
f
Illustrate RL concepts using a simple game example [4 marks]
4 marks
›
Model Answer
Take noughts and crosses (Tic-Tac-Toe).
• State = the current board.
• Actions = placing your mark in any empty square.
• Reward = +1 for a win, −1 for a loss, 0 for a draw or an ordinary mid-game move.
An RL agent plays loads of games — often against itself — and after each game it pushes the final outcome back onto the moves that led there, updating its sense of how good each board position is. At first it plays almost at random (exploration), but as experience builds it learns which positions tend to lead to wins and increasingly picks those moves (exploitation). Using ε-greedy selection it still tries the occasional offbeat move so it doesn't miss a better strategy. After thousands of games it settles into near-perfect play: blocking the opponent's threats and setting up its own — all learned purely from the +1/−1/0 rewards, never from being told the 'right' move.
g
Describe how a grid-world agent's policy evolves under Q-learning [4 marks]
4 marks
›
Model Answer
Imagine being dropped into an unfamiliar building and told there's an exit somewhere. At first you wander pretty much at random. The moment you stumble on the exit, you remember the last turn that got you there. Next time you also remember the turn before that, and the one before that — the 'good route' knowledge spreads backwards from the exit toward the start. Q-learning in a grid-world works exactly like this.
Concretely: the agent starts in a corner choosing up/down/left/right with equal probability (0.25 each), and all its Q-values start at zero, so its behaviour is essentially random. When it reaches the goal and gets a reward, Q-learning updates the value of the state–action pair that led there using:
Q(s,a) ← Q(s,a) + α [ r + γ · max_a' Q(s',a') − Q(s,a) ]
where α is the learning rate and γ the discount factor. The goal reward first lifts the Q-value of the action that reached it; on later episodes that higher value propagates backwards to earlier squares through the max term (the 'remembering the earlier turns' part). Gradually, actions pointing along the shortest path acquire the highest Q-values. Acting greedily (or ε-greedily) with respect to them, the agent's policy shifts from random wandering to confidently walking the best route, while early exploration ensures it actually found the path rather than getting stuck. Over many episodes it converges on the optimal way out of the corner.
h
Explain the concept of Q-learning and what distinguishes it from other approaches [4 marks]
4 marks
›
Model Answer
Q-learning is like keeping a mental scorecard that says, 'from this situation, how good is each move I could make?' That scorecard is the action-value function Q(s,a): the expected total (discounted) reward of taking action a in state s and then playing optimally afterwards. The agent fills it in from experience using the temporal-difference update rule, and simply reads off the highest-scoring move to decide what to do.
What makes it distinctive:
• Model-free — it needs no rulebook or map of how the world works (no transition probabilities, no reward model). It learns purely by doing, the way you can get good at a game without knowing the maths behind it.
• Off-policy — it learns the value of the BEST play even while it's goofing around exploring. The max in the update always points at the best possible next move, regardless of the (possibly random) move actually taken. That's what lets it explore freely yet still learn optimal behaviour.
Unlike supervised learning it uses no labelled answers, only delayed evaluative rewards; and unlike most ML methods it directly tackles sequential decisions and the credit-assignment problem.
i
When is Q-learning an appropriate algorithm to use? [4 marks]
4 marks
›
Model Answer
Q-learning suits anything you can frame like a board game or a maze: a sequence of situations where your move now affects what happens later, the payoff can be delayed, and there's a clear reward — in other words, a Markov decision process.
It works best when the situations and moves are discrete and not too numerous, because plain Q-learning literally keeps a scorecard (a table) of every situation–move pair, and that table mustn't blow up. It's also ideal when you don't have a rulebook of the environment (its model-free nature) but you can practise cheaply — say in a simulation or a game.
Good fits: grid-world navigation, board games, maze-solving, and simple control tasks. It becomes impractical when the situations are vast or continuous (the scorecard explodes) — that's when you swap the table for a neural network and use Deep Q-Networks (DQN) instead.