Reinforcement Learning Foundations
Time limit: 30 minutes Total marks: 40 Instructions: Answer all questions. Use notation for mathematics. Show working where derivations are required.
Q1. Define the following components of a reinforcement learning problem in one sentence each: (a) agent, (b) environment, (c) state, (d) action, (e) reward. (5 marks)
Q2. A Markov Decision Process (MDP) is defined as a tuple . State what each of the five elements represents, and write down the Markov property for the state transition. (6 marks)
Q3. Write the definition of the discounted return in terms of future rewards. Given a reward sequence (and zero thereafter) with discount factor , compute . (4 marks)
Q4. State the Bellman expectation equation for the state-value function . Briefly explain the difference between the state-value function and the action-value function . (5 marks)
Q5. Explain the exploration vs exploitation trade-off in one or two sentences. Then, for an -greedy policy with over available actions, compute the probability of selecting (a) the current greedy action and (b) a specific non-greedy action. (4 marks)
Q6. State two key differences between Monte Carlo (MC) methods and Temporal Difference (TD) methods for value estimation. (4 marks)
Q7. Write down the TD(0) update rule for , clearly labelling the TD target and the TD error. (3 marks)
Q8. Both SARSA and Q-learning update action-values. Write the update rule for each and state which one is on-policy and which is off-policy. (5 marks)
Q9. Briefly distinguish between policy iteration and value iteration in dynamic programming. (4 marks)
End of paper
Answer keyMark scheme & solutions
Q1. (5 marks) — 1 mark each.
- (a) Agent: the decision-maker/learner that selects actions to maximise cumulative reward.
- (b) Environment: everything outside the agent; it responds to actions with new states and rewards.
- (c) State: a representation of the situation of the environment at a given time step, .
- (d) Action: a choice available to the agent, , that influences the environment.
- (e) Reward: a scalar feedback signal indicating the immediate value of the agent's action.
Why: these are the standard five primitives defining the agent–environment interaction loop.
Q2. (6 marks) — 1 mark per element (5) + 1 mark for Markov property.
- : set of states (state space).
- : set of actions (action space).
- : transition probability, .
- : reward function, expected reward (or ).
- : discount factor, .
- Markov property: i.e. the next state depends only on the current state and action, not the full history.
Q3. (4 marks) Definition (1 mark): Computation (3 marks): Why: each future reward is weighted by an increasing power of , reflecting reduced value of delayed rewards. Answer: .
Q4. (5 marks) Bellman expectation equation (3 marks): Difference (2 marks):
- : expected return starting from state and following policy .
- : expected return starting from state , taking action , then following . Relation: .
Q5. (4 marks) Trade-off (2 marks): Exploitation uses current knowledge to pick the best-known action for immediate reward; exploration tries other actions to gain information that may yield higher long-term reward. The agent must balance the two.
Computation (2 marks): With , :
- (a) Greedy action: .
- (b) A specific non-greedy action: .
Check: . ✓
Q6. (4 marks) — 2 marks per valid difference.
- MC updates only at the end of an episode using the full observed return ; TD updates every step using bootstrapping (an estimate of future value).
- MC requires complete episodes (episodic tasks); TD works online and in continuing tasks.
- (Alt.) MC has higher variance/no bias; TD has lower variance but introduces bias from bootstrapping.
Q7. (3 marks)
- TD error: (1 mark)
- Correct update form with (1 mark), correct target labelled (1 mark).
Q8. (5 marks) SARSA (2 marks): Q-learning (2 marks): Classification (1 mark): SARSA is on-policy (uses the action actually taken); Q-learning is off-policy (uses the greedy regardless of behaviour policy).
Q9. (4 marks) — 2 marks each.
- Policy iteration: alternates full policy evaluation (solve for ) and policy improvement (greedy update) until the policy is stable.
- Value iteration: applies the Bellman optimality update directly, effectively truncating evaluation to a single sweep per iteration; converges to , then extracts the greedy policy.
[
{"claim":"Q3 discounted return equals 6","code":"g=0.5; G=2+g*4+g**2*8; result=(G==6)"},
{"claim":"Q5a epsilon-greedy greedy action prob equals 0.925","code":"eps=0.1; A=4; p=(1-eps)+eps/A; result=(abs(p-0.925)<1e-9)"},
{"claim":"Q5b non-greedy action prob equals 0.025","code":"eps=0.1; A=4; p=eps/A; result=(abs(p-0.025)<1e-9)"},
{"claim":"Q5 probabilities sum to 1","code":"eps=0.1; A=4; pg=(1-eps)+eps/A; pn=eps/A; total=pg+(A-1)*pn; result=(abs(total-1)<1e-9)"}
]