Multi-Armed Bandit Calculator

Explore, simulate, and compare bandit algorithms using configurable rewards, detailed regret metrics, visual charts, reproducible trials, and exportable machine learning results for smarter decisions.

Simulation Results

Algorithm comparison

Rank Algorithm Total reward Average reward Cumulative regret Average regret Best-arm rate Exploration Exploitation Reward SD 95% CI

Cumulative reward

Cumulative regret

Average reward

Arm selection frequency

Estimated-value convergence

Exploration versus exploitation

Arm statistics

Algorithm Arm Selections Selection % Estimated value True expected reward Total observed reward

Trial-by-trial decision log

The table shows the first 500 logged decisions from the leading simulation run.

Trial Algorithm Selected arm Reward Cumulative reward Cumulative regret Mode Selection explanation

Export and utility tools

Experiment setup

Arm and reward configuration

Add arms dynamically and choose a reward distribution for each action.

# Arm name Distribution Parameter 1 Parameter 2 Initial estimate Reward sequence Notes
Columns: name, distribution, parameter1, parameter2, initial, sequence.

Bandit algorithms

Select one or more strategies. Comparison mode ranks them automatically.

Algorithm parameters

Use zero for sample-average updates.

Manual reward tracking

Request an arm recommendation, enter the observed reward, and update the selected policy one step at a time.

No manual recommendation yet.

Formula used

Sample-average value update:
Qt+1(a) = Qt(a) + [Rt − Qt(a)] / Nt(a)
Epsilon-greedy:
Choose a random arm with probability ε. Otherwise choose argmax Q(a).
UCB1 score:
UCB(a) = Q(a) + c × √(ln t / N(a))
Cumulative regret:
Regret(T) = Σt=1T[μ*(t) − μAₜ(t)]
Softmax probability:
P(a) = exp(Q(a)/τ) / Σ exp(Q(b)/τ)
Thompson Sampling:
Draw θa ~ Beta(αa, βa) and select the largest draw.

How to use this calculator

  1. Choose a stationary, changing, or adversarial environment.
  2. Configure every arm and its reward distribution.
  3. Select one or more bandit algorithms.
  4. Adjust exploration, confidence, prior, and update parameters.
  5. Run simulations and compare rewards, regret, and convergence.
  6. Export tables, charts, settings, or a printable report.

Example data

ArmDistributionParameter 1Parameter 2Interpretation
Arm ABernoulli0.300Thirty percent success probability.
Arm BBernoulli0.500Fifty percent success probability.
Arm CBernoulli0.700Seventy percent success probability.

Algorithm guidance

Epsilon-greedy is simple and dependable. It explores randomly at a controlled rate. Decay helps reduce unnecessary exploration later.

UCB methods favor uncertain arms systematically. They work well with stationary rewards. Their confidence coefficient controls optimism.

Thompson Sampling uses probability distributions over arm quality. It often balances exploration efficiently. Binary rewards fit Beta priors naturally.

EXP3 targets adversarial or highly unstable rewards. It updates action weights using importance-weighted feedback. Gamma controls its exploration intensity.

Frequently asked questions

What is a multi-armed bandit problem?

It models repeated choices among uncertain actions. Each action provides an unknown reward. The goal is maximizing long-term reward.

What is exploration versus exploitation?

Exploration tests less-known arms. Exploitation chooses the strongest current estimate. Effective policies balance both behaviors.

What does cumulative regret measure?

Regret compares chosen rewards with optimal expected rewards. Lower regret indicates better decisions. It is central for policy comparison.

When should epsilon decay?

Decay is useful when rewards remain stable. It reduces random choices over time. Non-stationary problems may need continued exploration.

How does UCB choose an arm?

UCB combines estimated reward with uncertainty. Rarely selected arms receive larger bonuses. This encourages structured exploration.

Why use Thompson Sampling?

It samples plausible arm qualities from posteriors. Uncertain promising arms get natural opportunities. Performance is often strong.

Can rewards be continuous?

Yes, normal, uniform, and Poisson rewards are supported. Estimates update using observed numerical rewards. Thompson values are normalized internally.

What is a non-stationary bandit?

Its reward behavior changes over time. Older observations may become less relevant. Constant learning rates can adapt faster.

Why run multiple simulations?

Single runs contain random variation. Repeated runs produce more stable averages. Confidence intervals become more meaningful.

Which strategy is always best?

No strategy wins in every environment. Reward stability and noise matter greatly. Compare several algorithms using identical seeds.

Related Calculators

Gradient Descent CalculatorStochastic Gradient Descent CalculatorMomentum Optimiser CalculatorAdam Optimiser CalculatorLearning Rate Decay CalculatorK-Nearest Neighbours CalculatorKNN Majority Vote CalculatorQ-Learning Update CalculatorModel Calibration CalculatorBrier Score Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.