Log inStart free
LESSON 15.14 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Thompson sampling

Watch each arm draw a guess from its belief; the highest guess wins the pull.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 15.14 · BANDIT BAY5 ARMS · FLAT BELIEFS
01
Stage 1 of 5 · Flat start
Each arm starts with a flat Beta curve. Every chance from 0 to 1 looks equally likely.
Explain it simply

Each column is one arm of the same 5-arm bandit as before. The blue band shows what the agent believes about the arm's hidden chance to pay. At the start the band is flat, so any chance from 0 to 1 looks the same. The dashed mark is the true chance, and the agent cannot see it.

Five arms. Each belief is a flat Beta 1, 1 curve over the chances 0 to 1. The hidden chances are 0.2, 0.5, 0.7, 0.4, 0.6. Arm 3 is best.

hidden chancebelief and drawpullmomentregret
beliefs before pull 100.51Beta0.2arm 1(1, 1)0.5arm 2(1, 1)0.7arm 3(1, 1)0.4arm 4(1, 1)0.6arm 5(1, 1)every arm: Beta(1, 1), a flat beliefbeliefs before pull 100.51Beta0.2arm 1(1, 1)0.5arm 2(1, 1)0.7arm 3(1, 1)0.4arm 4(1, 1)0.6arm 5(1, 1)every arm: Beta(1, 1), a flat belief
Toy: the 5 arms of 15.12, 1,000 pulls, 3 seeded runs
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
θa∼Beta(1, 1)\sy{theta}{out}{\theta_a} \sim \mathrm{Beta}(1,\ 1)
θ1,…,θ5∼Beta(1, 1)\theta_1, \dots, \theta_5 \sim \mathrm{Beta}(1,\ 1)

Before any pull, every chance of arm a is equally likely.

Common mix-ups

MYTHPulling the arm with the best mean is enough.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Is the curve of arm 3 wider or narrower at pull 1,000 than at pull 10?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.