Implement a greedy multi-armed bandit agent that uses optimistic initial value estimates to drive exploration.
In a multi-armed bandit setting, the agent must balance exploring different arms and exploiting the best-known arm. One elegant approach is to initialize the estimated Q-values to a value much higher than the true rewards. Because the agent always selects the arm with the highest Q-value (greedy), it will naturally try different arms as each one's estimate gets pulled down after being selected.
Given:
true_rewards: a list of the true (deterministic) reward for each arm. Pulling arm i always returns true_rewards[i].initial_q: the initial Q-value estimate for all arms (set optimistically high to encourage exploration).n_steps: the number of total arm pulls to simulate.step_size: a constant step-size parameter (alpha) for updating Q-values.At each step:
Return a tuple of two lists: