When estimating the mean reward of an action in a bandit problem, you can compute it incrementally as new samples arrive, without storing all historical samples.
In an n-armed bandit, the estimated value of action a is:
Q(a) = (R_1 + R_2 + ... + R_n) / n
If you've already computed Q after n samples, and receive a new reward R_{n+1}, you can update:
Q_{n+1} = Q_n + (1/(n+1)) * (R_{n+1} - Q_n)
This is the incremental mean formula. It lets you update online without storing all past rewards, using only the current estimate Q_n, the count n, and the new reward.
Implement update_incremental_mean(estimate, count, reward) which:
No results yet
Run your code to check it against the examples, or submit to run every test.