Explore Library
Code QuizIntermediate

Epsilon-Greedy Selection

Find why this epsilon-greedy policy explores at the wrong rate.

Codejavascript
function selectAction(Q, s, epsilon) {
  if (Math.random() > epsilon) {
    return Math.floor(Math.random() * Q[s].length); // explore
  }
  return argmax(Q[s]); // exploit
}

What is the bug in this epsilon-greedy action selection?