Back to questions
JuniorTheoryCommon
What does this program print?
import numpy as np
probs = np.array([0.3, 0.5, 0.8])
pulls = np.array([2, 0, 2, 1, 2])
regret = (probs.max() - probs[pulls]).sum()
print(round(regret, 2))0.8
- Expecting
3.2, the summed probabilities of the arms pulled: regret sums the gaps to the best arm,0.8minus each pulled arm's probability, so the three pulls of arm 2 add nothing. - Expecting
0.16, the average gap: regret adds the losses over all steps,0.5 + 0.3 = 0.8, and it keeps growing while a weaker arm is still being pulled.
- How does regret grow over time for a fixed 50/50 split, and for a strategy that stops pulling weak arms?
- Why can regret be computed in a simulation but not in a live test?