6  A Two-armed Bandit Warm-up

Play this game before reading Multi-armed Bandits. In front of you are two slot machines, A and B. Each pull of a machine pays a random reward: sometimes more, sometimes less, sometimes negative. One machine pays more on average than the other, but you do not know which. You have a fixed number of pulls, and your goal is to collect as much reward as possible.

6.1 How to play

Click a machine to pull it. Under each machine, you see every reward it has paid you so far; use them however you like to decide which machine to pull next. When your pulls run out, the average payout of each machine is revealed.

6.2 The game

6.3 Your results

6.4 Things to think about

  1. How did you decide which machine to pull next? Try to write your rule in one sentence.
  2. Which numbers did you use to compare the machines: the last reward, the largest one, the average, or something else?
  3. When did you stop trying the other machine? Could you have been wrong about which machine was better?
  4. Would you play differently with 10 pulls than with 50? Why?

The chapter Multi-armed Bandits turns these questions into an algorithm. After reading it, play A Two-armed Bandit Game, which shows the numbers that the algorithm keeps and compares your choices with it.

TipPlaying together in class

Every game has a number. Everyone who enters the same game number plays the same two machines, and the first, second, third, … pull of each machine pays the same reward for everyone. With the same number of pulls as well, the results can be compared directly: differences in total reward come only from the choices made. Game numbers are shared with A Two-armed Bandit Game, so after the chapter, the class can replay the same game there.