Problem
An online store launches a product and does not know which price brings the most revenue. Showing every candidate price equally often wastes sales on bad prices, while sticking to the first good-looking price may miss a better one. The goal is revenue (price times purchase probability), so the price with the highest purchase rate is not the target. The choice and configuration of the bandit algorithm decide how much revenue is lost while learning.
Example from the article: a simulated store with five candidate prices (20, 30, 40, 50, 60), where the best price is 30 and four bandit strategies compete to find it.
Solution in brief
Treat each candidate price as a bandit arm and its sale revenue as the reward. Before going live, simulate a demand curve with a known optimum and compare strategies on cumulative regret, speed of reaching the target, and how often each price is shown. UCB1 with a tuned, normalized exploration weight wins; Thompson Sampling needs a price multiplier.
Questions this case answers
- How to pick the revenue-maximizing option among a few discrete candidates when each option pays a binary outcome times a known value and the response curve is unknown
- How to choose and tune an exploration strategy for a bandit when a poor setting silently turns it into a greedy policy
- How to choose a selling price for a new product when the demand curve is unknown?
- How to compare bandit algorithms for price selection when the goal is revenue, not purchase rate?
Tools and methods
- Multi-armed bandit — each price is an arm, revenue is the reward.
- Greedy and epsilon-greedy — baseline and a random-exploration variant.
- UCB1 — average reward plus an uncertainty bonus weighted by C.
- Thompson sampling — Beta posteriors per price, samples multiplied by price.
- Monte Carlo simulation — 1000 runs of 10000 steps against a known demand curve.
- NumPy — implementation in the author's repository.
Google or a one-time email code. No password.