Behavioral Experimentation & Strategy
When the Coin Landed Wrong: Sample Ratio Mismatch, Twyman's Law, and the Silent Corruption of A/B Testing
An A/B test reports an astonishing 14% lift in checkout conversion with a p-value well below 0.001. Before engineering ships the variant, one statistical check reveals the truth: instead of the intended 50/50 split, traffic allocated at 50.8% Control and 49.2% Variation. In the presence of Sample Ratio Mismatch, that headline victory is not a breakthrough—it is an artifact of algorithmic corruption.

The headline victory that was not real
Consider a common scenario in high-velocity digital product development: A growth team redesigns a mobile checkout flow, replacing a multi-step accordion with a streamlined single-page layout. After running for two weeks across half a million users, the experimental dashboard flashes bright green:
- Control Conversion Rate: 3.20%
- Variation Conversion Rate: 3.65%
- Relative Lift: +14.06%
- Statistical Significance: p < 0.0001
The team prepares an executive presentation, calculates an estimated $4.2 million in annualized incremental revenue, and queues the pull request for production deployment.
Then, an engineer inspects the raw traffic volume. The experiment was configured as a 50/50 randomized split. The actual counts show:
- Control Visitors (N_A): 254,120 (50.82%)
- Variation Visitors (N_B): 245,880 (49.18%)
To the untrained eye, a difference of 0.82% appears negligible—a harmless rounding artifact of real-world internet traffic. But running a simple Pearson's chi-square test on these sample counts yields a χ² value of 135.8, corresponding to a p-value of p ≈ 2 × 10⁻³¹. The odds of an unbiased fair coin landing with this degree of imbalance across half a million tosses are less than one in a billion billion.
This imbalance is a Sample Ratio Mismatch (SRM). And in the discipline of scientific experimentation, it invalidates everything.
The 14% conversion lift was not driven by superior UI design. It occurred because the single-page variation contained an asynchronous tracking library that added 450 milliseconds of script execution latency on budget Android devices. Users on slower devices and cellular connections bounced before the variation's tracking pixel could fire. The users who remained in the variation sample were disproportionately equipped with high-end devices, fiber connections, and higher disposable incomes. The test was not comparing Design A against Design B; it was comparing average consumers against an artificially affluent subset.
Shipping that variation to 100% of production traffic would not produce a $4.2 million gain; it would introduce latency that depressed total revenue across the entire user base.
The statistical foundation of Sample Ratio Mismatch
In randomized controlled trials (RCTs), the entire mathematical validity of inferential statistics rests on the random assignment assumption: that every eligible user has a known, non-zero, independent probability of being assigned to each experimental variant. Randomization ensures that all confounding variables—both observed (browser, location, device) and unobserved (user intent, purchasing power, cognitive state)—are distributed identically across groups in expectation.
When the observed allocation counts (O_A, O_B) deviate from the expected theoretical allocation (E_A, E_B), the random assignment assumption has failed. The population has been filtered through an asymmetric survival sieve.
To detect SRM objectively, experimentation platforms use Pearson's Chi-Square Goodness-of-Fit Test with 1 degree of freedom:
Formula
χ² = Σ (Oᵢ − Eᵢ)² / Eᵢ = (O_A − E_A)² / E_A + (O_B − E_B)² / E_B
For a standard two-variant 50/50 split where total traffic is N = O_A + O_B, the expected count for each variant is E_A = E_B = N / 2. The equation simplifies directly to:
Formula
For a 50/50 split: χ² = (O_A − O_B)² / N
Because large digital experiments routinely evaluate hundreds of thousands of users, minor statistical fluctuations can yield low p-values. Therefore, the established industry standard, widely used in large experimentation programs, sets the significance threshold for SRM detection at α = 0.001 (p < 0.001), corresponding to a critical χ² value of 10.828.
If χ² > 10.828, the hypothesis that traffic was allocated as designed is rejected at the 0.001 level. Treat the test as compromised until the cause is found.
Practitioners can verify these exact calculations using our interactive A/B Test Significance and Sample Size Calculator, which features an automated Chi-Square SRM diagnostic engine that flags traffic routing imbalances before calculating lift metrics.
Twyman's Law and the taxonomy of experimental failure
In quantitative analysis, Twyman's Law states: "Any figure that looks interesting or different is usually wrong." Nowhere is this law more vindicated than in digital experimentation. When a variant produces an outsized conversion jump, practitioners often celebrate innovation when they should be diagnosing an engineering bug.
In their landmark paper presented at ACM SIGKDD, “Diagnosing Sample Ratio Mismatch in Online Controlled Experiments: A Taxonomy and Rules of Thumb for Practitioners”, Aleksander Fabijan and colleagues at Microsoft drew on experimentation programs across products such as Bing, MSN, and Office. They reported that roughly 6% of analyzed experiments exhibited a Sample Ratio Mismatch—frequent enough that SRM checks belong in every analysis.
Building on their taxonomy, the root causes can be grouped categorizing the root causes of SRM across three distinct stages of the experimentation lifecycle:
- 01Assignment & delivery
Asymmetric redirects, CDN caching of variant cookies, faulty hash bucketing.
- 02Execution & rendering
Script errors before telemetry fires, slow rendering that drives early bounces, extension interference.
- 03Processing & telemetry
Uneven bot filtering, cookie persistence differences, pixel firing order.
Where in the experiment lifecycle sample ratio mismatches usually originate.
1. Asymmetric redirect latency (The "Flicker" problem). The single most prevalent cause of SRM in web experimentation occurs when Control is rendered on the primary URL, but Variation redirects to a secondary URL via client-side JavaScript. The redirect introduces 200–600ms of blank-screen latency. Mobile users on high-latency 4G networks bounce during the redirect before the variation URL loads and logs their assignment. The variation loses thousands of slow-connection users, creating both an SRM and an artificial lift among the survivors.
2. Bot filtering and crawler discrepancies. Search engine web crawlers and scraping bots behave differently when encountering dynamic variants. If Variation contains a novel meta tag, an unrendered React hydration boundary, or an external script that automated headless browsers block, security firewalls (Cloudflare, Akamai) may filter bots from Control at higher rates than Variation. Because bots generate thousands of page views without ever completing a purchase, unequal bot infiltration severely distorts conversion denominator math.
3. Edge caching and CDN cookie staleness. In modern cloud architectures, Content Delivery Networks (CDNs) cache HTML pages at edge nodes. If the experimental assignment cookie is not properly configured in the CDN's cache-key hierarchy, the edge server may serve a cached version of Control to a user who was randomly assigned to Variation by the central routing tier. The user experiences Control, but their analytics events are logged under Variation, contaminating both samples.
The diagnostic tree: what to do when SRM strikes
When your experimental dashboard or sample size planning model detects an SRM with p < 0.001, product leadership must enforce a strict procedural rule: Halt analysis immediately. Do not interpret conversion lift, do not calculate revenue impact, and do not ship the variant. To triage the anomaly, follow this five-step diagnostic protocol:
- 011. Confirm
Run the chi-square test; p < 0.001 halts analysis.
- 022. Segment
Recompute by device, browser, and OS to localize the imbalance.
- 033. Performance
Compare load and interaction timing between arms.
- 044. Filtering
Inspect bot and fraud filtering logs for uneven exclusion.
- 055. Trigger timing
Check whether assignment is logged before or after the variant renders.
The order in which to investigate a mismatch before reading any lift.
- Segment by Device and Browser: Calculate the chi-square metric across major categorical segments (Desktop vs. Mobile; Chrome vs. Safari vs. Edge; iOS vs. Android). If the SRM is isolated entirely to Safari, the issue is almost certainly linked to Apple's Intelligent Tracking Prevention (ITP) deleting 7-day client-side cookies, causing returning Safari users to be re-randomized into Control.
- Audit Telemetry Firing Order: Ensure that assignment logging occurs server-side at the moment of request routing, rather than client-side after DOMContentLoaded. If logging is delayed until front-end components render, any crash or render delay in Variation will cause an artificial deficit in logged variation visitors.
- Compare Network Performance Metrics: Inspect synthetic monitoring and Real User Monitoring (RUM) data for Time to First Byte (TTFB), First Contentful Paint (FCP), and Cumulative Layout Shift (CLS). If Variation degrades FCP by more than 150ms, survivor bias is almost certainly corrupting the sample.
- Inspect Unbalanced Downstream Events: Check top-of-funnel engagement actions. If Variation shows 5% fewer visitors on the landing page, but identical traffic on Step 2 of the funnel, the attrition occurred exclusively during initial asset download.
Organizational discipline: institutionalizing the SRM check
In their authoritative reference work, “Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing” (2020), Ronny Kohavi, Diane Tang, and Ya Xu argue that data quality checks must be automated, mandatory, and enforced by platform guardrails rather than individual analyst diligence.
Left to their own devices, product teams under pressure to deliver quarterly growth targets face intense cognitive bias. When an experiment shows a +12% lift with an SRM, the team will invent post-hoc rationalizations: "The imbalance is tiny," or "The lift is so huge it must be real regardless of the sample count." This is an illusion. As our analysis of cognitive dissonance and confirmation bias demonstrates, decision-makers systematically interpret ambiguous data to confirm their desired conclusions.
To build an experimentation program with genuine scientific authority:
- Automate the Pearson's chi-square test for every running experiment at daily batch intervals.
- Hardcode dashboard alerts that automatically mask conversion metrics and replace them with a prominent warning whenever SRM reaches p < 0.001.
- Never attempt to "reweight" or mathematically correct an SRM-corrupted experiment using post-stratification unless the exact mechanism of attrition is known, fully measured, and verified by data engineering.
- Celebrate the detection of an SRM as a victory. Finding a corrupted test before deployment protects the enterprise from shipping damaging regressions masquerading as breakthrough innovations.
Notes & Sources
- 1.Fabijan, A., Gupchup, J., Gupta, S., Omhover, J., Qin, W., Vermeer, L., & Dmitriev, P. (2019). Diagnosing sample ratio mismatch in online controlled experiments: A taxonomy and rules of thumb for practitioners. Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2156–2164.
- 2.Kohavi, R., Tang, D., & Xu, Y. (2020). Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. Cambridge University Press. https://doi.org/10.1017/9781108653244
- 3.Kohavi, R., Deng, A., Frasca, B., Longbotham, R., Walker, T., & Xu, Y. (2014). Seven rules of thumb for web sites experimenting with the user experience. Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1857–1866. https://doi.org/10.1145/2623330.2623341
- 4.Johari, R., Koomen, P., Pekelis, L., & Walsh, D. (2017). Peeking at A/B tests: Why it matters, and what to do about it. Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1517–1525.
- 5.Pearson, K. (1900). On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. Philosophical Magazine Series 5, 50(302), 157–175. https://doi.org/10.1080/14786440009463897
Margaret Lin
Executive Editor, Experimentation
Oversees the publication's coverage of controlled experiments and causal inference in product and policy settings.
See our fact-checking policy.





