Non-FictionInformativeEducational
Frequentist Bandit Operator eBook
A Coursebook on Frequentist Bandit Operator
A Coursebook on Frequentist Bandit Operator
Formats
Free sample
Chapter 1: The Peeking Curse--–- The email arrived at 11:47 PM on a Friday. Sarah, a senior data scientist at a mid-sized travel booking platform, had been babysitting an A/B test for six weeks. The test compared two variants of the checkout button: green (control) versus gold (treatment). At week two, the gold button was winning by a statistically significant margin—a p-value of 0.03, well below the conventional 0.05 threshold. She showed the early results to her product manager, who immediately asked, "Can we roll this out before the holiday weekend?" Sarah hesitated.
The test was designed for a fixed sample size of 100,000 users per variant. They were only at 32,000. But the numbers looked so promising. The team was excited. The pressure was real.
She decided to "just peek" and call it early.By week six, when the test finally reached its planned sample size, the gold button's lift had evaporated. Worse, it was now underperforming the green control by 0.7 percent—not statistically significant, but directionally negative. The product manager was confused. Sarah was embarrassed. The engineering lead was annoyed about the wasted implementation effort.
And worst of all, the company had lost four weeks of potential revenue from the green button, revenue they could have captured if they had simply trusted the original design and launched nothing at all.Sarah had just experienced the peeking curse, a statistical trap so subtle and so pervasive that it has cost companies billions of dollars in foregone revenue, yet most data scientists learn about it only after getting burned. This chapter reveals why peeking destroys the validity of classical A/B tests, why static experimentation fails in dynamic environments, and how a different framework—the multi-armed bandit—escapes these traps entirely. But, because this book is committed to intellectual honesty, we will also be explicit about what basic bandits cannot do, setting the stage for the advanced solutions in later chapters.The Three Failures of Static Experimentation Before we can appreciate the bandit solution, we must understand exactly how traditional A/B testing breaks in practice. The problems fall into three categories, each more insidious than the last, and each capable of invalidating months of careful work.Failure One: The Peeking Illusion Statistical hypothesis testing, as developed by Jerzy Neyman and Egon Pearson in the 1930s, assumes a fixed sample size. You decide in advance how many observations you will collect, you run the experiment without looking at the data, and only at the end do you compute a p-value and a confidence interval.
This procedure guarantees that if the null hypothesis is true, you will falsely reject it at most α percent of the time, typically 5 percent.But in modern data-driven organizations, no one actually waits. Product managers check dashboards daily, sometimes hourly. Data scientists peek after a few thousand users to see if there is "something interesting." Engineering teams want to "fail fast" and kill underperforming variants early. Executives demand updates every Monday morning. Each time you peek, you inflate the probability of a false positive.
The mathematics are brutal and unforgiving.Consider a simple simulation. You run an A/B test with no true effect—both variants are identical. You plan to collect 100,000 observations per variant. You peek at the data at five equally spaced intervals: 20,000, 40,000, 60,000, 80,000, and 100,000 observations. You decide to stop early if the p-value dips below 0.025 at any peek.
What is the actual false positive rate? Approximately 14 percent—nearly triple the nominal 5 percent. With ten peeks, it exceeds 25 percent. With twenty peeks, it approaches 40 percent. You are effectively flipping a coin.Why does this happen?
Because p-values are not designed for optional stopping. A p-value of 0.03 after 10,000 observations does not mean "there is a 3 percent chance this result is due to random variation." It means: if the null hypothesis were true, and if you had fixed your sample size at 10,000 in advance, the probability of observing a test statistic at least this extreme would be 3 percent. When you peek, you violate the "fixed in advance" condition. The entire mathematical foundation crumbles.The practical consequence is staggering: Most published A/B test results in industry are likely invalid due to peeking, even when practitioners believe they are following best practices. The "peeking-adjusted" p-value for Sarah's week-two peek at 32,000 users would have been approximately 0.21, using standard sequential testing corrections—not significant at all.
She never had a real result. She had a statistical mirage.Failure Two: Time Decay and Vanishing Effects Even if you possess the iron discipline to resist the urge to peek, static A/B tests suffer from a second, more subtle problem: time decay. Imagine you are testing a new recommendation algorithm for a news website. The treatment variant shows personalized article suggestions based on reading history. The control shows generic popular articles from an editorial desk.In the first week, the treatment wins decisively.
Users click more because the personalized recommendations are novel and engaging. The novelty effect is real and measurable. By week three, personalization fatigue begins to set in. Users have seen enough recommendations that the novelty has worn off. The treatment's advantage shrinks.
By week six, the control actually outperforms the treatment because users have returned to familiar reading patterns and the generic articles have built their own momentum.A fixed-horizon A/B test that ends at week three would declare the treatment a winner. A test that ends at week six would declare no difference or, worse, a loser. The same treatment, the same users, the same software system—but the result depends entirely on when you stop the experiment. This is not a flaw in your execution. This is not a bug.
This is a fundamental property of time-varying effects in complex adaptive systems.The assumption of constant treatment effects over the experiment duration is baked into every power calculation, every confidence interval, and every sample size determination. Yet this assumption is almost always false in practice, especially in recommendation systems, pricing algorithms, user interfaces, and any environment where users learn, adapt, or experience fatigue.The practical consequence is deeply unsettling: You cannot trust that a winner in a two-week test will remain a winner in permanent production. The very act of measuring changes the system being measured. Time decay is not an exception; it is the rule.Failure Three: Non-Stationary Populations The third failure is the most profound and the most philosophically challenging. Non-stationarity means that the population on which you are experimenting is not the same at the end of the test as it was at the beginning.
User demographics shift. Competitors launch new features. Seasonality changes behavior. External events reshape preferences. The world does not pause for your experiment.Consider a ride-sharing company testing a surge pricing algorithm.
The experiment runs for four weeks. In week one, heavy rain increases demand dramatically. The algorithm performs well because it responds aggressively to demand spikes. In week two, a competitor launches a deep discount campaign. Users defect en masse, and the algorithm appears terrible because it cannot compete on price.
In week three, a holiday increases the supply of drivers, changing the balance of supply and demand. The algorithm adapts differently in these conditions. In week four, everything returns to baseline…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Willingham Libbie
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, Informative, Educational
- Released
- 2026-05-11
- Pages (approx.)
- 149
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Willingham Libbie
Franchise Builder's Family Business LegacyWillingham Libbie$11.99
Contemplating Dispassion With BreathWillingham Libbie$11.99
Step Nine Living AmendsWillingham Libbie$11.99
Values And Mission Alignment Product DevelopmentWillingham Libbie$11.99
The Opium King of Hong Kong: How One Man Smuggled a Million Pounds of DrugsWillingham Libbie$11.99
The Silent March That Shook the World: The 1963 March on Washington Through the Eyes of a Teenage PhotographerWillingham Libbie$11.99
Robot Assisted Surgery OutlookWillingham Libbie$12.99
Meta Content Moderation HandbookWillingham Libbie$12.99
Understanding Hypertonic GingivitusWillingham Libbie$17.99
How to Start a Casting of Steel Products (finished or Semi-finished) Business (Beginners Guide)Willingham Libbie$11.99You may also like
Hong Kong Handover 1997Dunn Johnnie$11.99
Zumba For Postnatal Recovery CourseNeal Christian$11.99
Zumba for BeginnersLadner Nikia$11.99
YouTube Comment Mining GuideHumes Pandora$12.99
Worry Box MeditationCarlin Rudy$11.99
Workplace Stress MeditationNguyen Lynn$11.99
Workplace Stress and Sleep RepairHawley Ivory$11.99
Workplace Perfectionism CureDelaney Jeffry$11.99
Workplace Injustice Anger GuideWallen Isabelle$11.99
Work Addiction and Burnout LinkGreenwood Ester$11.99
Women in Yoga and WellnessBeattie Galina$11.99
Women in Stand Up ComedyChun Evangeline$11.99