Reinforcement Learning Questions with Answers

8 practice questions on Reinforcement Learning (Machine Learning) with answers and step-by-step solutions. Try 8 samples below, then practise all 8 free in the AptiNest app.

Sample questions

Question 1Easy

Why is a discount factor gamma below 1 used in infinite-horizon reinforcement learning?

  1. It makes the agent learn faster on every single step
  2. So that the discounted sum of rewards stays finite
  3. It removes the need to define any reward function at all
  4. It sets the learning rate used by the neural network

Answer: B. So that the discounted sum of rewards stays finite

Explanation

With gamma below 1 and bounded rewards, the sum of gamma to the power t times the reward is bounded, even when the episode never ends. It also makes near-term rewards count more than distant ones.

Step-by-step solution

  1. An infinite episode would sum an unlimited number of rewards.
  2. Each later reward is multiplied by a further power of gamma, so it shrinks.
  3. With bounded rewards and gamma below 1, the total stays finite.

Why the other options are wrong

  • A. Gamma changes how future rewards are weighted, not the learning speed on each step.
  • C. A reward function is still needed; gamma does not replace it.
  • D. The learning rate is a separate setting from the discount factor.

Tip: Gamma near 0 looks only at the next reward; gamma near 1 looks far ahead.

Question 2Easy

With gamma = 0.9, the rewards at steps 0, 1 and 2 are 0, 0 and 10. What is the discounted return from step 0?

(Return = sum of gamma^t × reward at step t.)

  1. 8.1
  2. 10
  3. 9
  4. 7.29

Answer: A. 8.1

Explanation

Only step 2 pays a reward, so the return is 0.9^2 × 10 = 0.81 × 10 = 8.1. Using 0.9^3 would be wrong because step 2 has exponent 2.

Step-by-step solution

  1. Step 0 has weight 0.9^0 = 1 and reward 0.
  2. Step 1 has weight 0.9^1 = 0.9 and reward 0.
  3. Step 2 has weight 0.9^2 = 0.81 and reward 10, so the return is 8.1.

Why the other options are wrong

  • B. That ignores the discount; a reward at step 2 is worth less than 10 from step 0.
  • C. 0.9 × 10 applies the discount for only one step, but the reward is at step 2.
  • D. 0.9^3 × 10 counts the step as the third step, but the first step is step 0.

Tip: The first step gets no discount; the reward at step t gets gamma to the power t.

Question 3Easy

In reinforcement learning, an agent learns by

  1. Studying labelled input-output pairs
  2. Interacting with an environment and receiving rewards
  3. Grouping unlabelled data
  4. Compressing the dataset into fewer features

Answer: B. Interacting with an environment and receiving rewards

Explanation

The agent takes actions, observes states and rewards, and improves its policy to maximise total reward.

Step-by-step solution

  1. Observe state.
  2. Take action, get reward.
  3. Improve the policy.

Why the other options are wrong

  • A. That is supervised learning.
  • C. That is clustering.
  • D. That is dimensionality reduction.

Question 4Easy

What is the exploration versus exploitation trade-off in reinforcement learning?

  1. Choosing between trying new actions and repeating the best known one
  2. Choosing between two network layers, to balance speed against accuracy
  3. Balancing the size of the state space against the total reward
  4. Deciding how many training episodes to skip before any updates

Answer: A. Choosing between trying new actions and repeating the best known one

Explanation

An agent that only exploits repeats the best action it knows and may miss better ones. An agent that only explores tries actions it knows little about and earns less reward. Good agents balance the two.

Step-by-step solution

  1. Exploration means trying actions to learn their value.
  2. Exploitation means taking the action that looks best so far.
  3. Too much of either hurts: the agent needs both.

Why the other options are wrong

  • B. Network layers are a model design choice; they are not the exploration trade-off.
  • C. The state space size is a separate issue from how the agent chooses actions.
  • D. Episode skipping is not part of the trade-off.

Tip: Explore to learn, exploit to earn.

Question 5Medium

The discount factor gamma in reinforcement learning controls

  1. The size of the dataset
  2. The number of actions
  3. The learning rate of the network's optimiser
  4. How much future rewards are valued compared with immediate rewards

Answer: D. How much future rewards are valued compared with immediate rewards

Explanation

A gamma close to 0 makes the agent short-sighted; close to 1 values long-term returns.

Step-by-step solution

  1. Return = r0 + gamma r1 + gamma^2 r2 ...
  2. Small gamma shrinks later terms.
  3. Large gamma keeps them.

Why the other options are wrong

  • A. There is no fixed dataset.
  • B. That is the action space.
  • C. Learning rate is separate.

Question 6Medium

In the Q-learning update, what does max over a' of Q(s', a') represent?

  1. The reward received right now for the chosen action a
  2. The best value the agent expects from the next state s'
  3. The average reward collected over all past episodes so far
  4. The chance that the agent picks the greedy action next time

Answer: B. The best value the agent expects from the next state s'

Explanation

The target in Q-learning adds the reward to the discounted maximum Q-value over the actions available in the next state s'. That maximum is the agent's best estimate of the future value from s'.

Step-by-step solution

  1. The Q-learning target is r + gamma * max over a' of Q(s', a').
  2. max over a' looks at every action a' in the next state s'.
  3. It picks the largest estimated value, which is the best expected future value from s'.

Why the other options are wrong

  • A. The immediate reward is r, which is added separately, not the max term.
  • C. No average over past episodes appears in the update.
  • D. Choosing actions is the policy; the max term is a value, not a probability.

Tip: The max term is a value estimate of the next state, not a probability.

Question 7Hard

With gamma = 0.5 and rewards 4, 8, 16 at steps 0, 1, 2, the discounted return from step 0 is

  1. 12
  2. 28
  3. 14
  4. 7

Answer: A. 12

Explanation

Return = 4 + 0.5*8 + 0.25*16 = 4 + 4 + 4 = 12.

Step-by-step solution

  1. Step 0: 4 x 1 = 4.
  2. Step 1: 8 x 0.5 = 4.
  3. Step 2: 16 x 0.25 = 4; total 12.

Why the other options are wrong

  • B. That is the plain sum, with no discounting.
  • C. Discounts only the last reward, giving 4 + 8 + 16 x 0.125 = 14.
  • D. Halves the plain sum 28 to 14 and then halves again.

Question 8Hard

Why is Q-learning called off-policy?

  1. It never updates the value table, only the policy, during each training step
  2. It learns only from episodes that end with a positive reward total
  3. It needs a full model of the transition probabilities to work
  4. Its update target uses the max over next actions, not the action taken

Answer: D. Its update target uses the max over next actions, not the action taken

Explanation

Q-learning learns the values of the greedy policy while the agent may act with a different, exploring policy. Its target uses the max over next actions, not the action the agent actually takes next, so the learned policy can differ from the one that produced the data.

Step-by-step solution

  1. The agent acts with an exploring policy, such as epsilon-greedy.
  2. The Q-learning target uses max over next actions, which is the greedy policy's choice.
  3. The learned values describe the greedy policy, so the learning policy and target policy differ: off-policy.

Why the other options are wrong

  • A. Q-learning updates a value table every step; the policy is derived from it.
  • B. Q-learning updates on every step, not only at the end of a winning episode.
  • C. Q-learning is model-free; it learns from sampled transitions.

Tip: On-policy methods like SARSA use the action the agent takes next; Q-learning uses the best one.

Practise all 8 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Machine Learning topics · All topics