Your 50/50 A/B test split 51,200 vs 48,800. Do you ship?
Question
You run a two-week 50/50 A/B test on a redesigned checkout flow. Treatment shows a +6.0% relative lift in conversion (p = 0.004), and the team wants to ship today. Before signing off, you inspect total assigned users:
- Control:
51,200users (51.2%) - Treatment:
48,800users (48.8%) - Total:
100,000users (expected50,000per arm)
- Run a chi-squared goodness-of-fit test on the traffic split. Is this a Sample Ratio Mismatch (SRM)?
- Should you trust the
+6.0%lift? Show with numbers how a1,200-user shift can manufacture a fake lift. - What causes SRM most often, and how do you diagnose it?
Show hints (3)
- "COMPUTE CHI-SQUARED"
With
50,000expected in each arm, compute(51,200 - 50,000)^2 / 50,000 + (48,800 - 50,000)^2 / 50,000. Compare that number with10.83(p = 0.001). - "TEST ZERO-LIFT BIAS"
Suppose both arms truly have
5,000buyers (10%of50,000). What happens to each arm's rate if1,200non-buyers move from Treatment to Control? - "SLICE BY DIMENSION"
Check the split by browser, OS, device, app version, and day. SRM usually concentrates in one broken client path, redirect, or bot filter.
Show checked explanation
Do not ship. A 51,200 vs 48,800 split on a 50/50 test gives chi2 = 57.6 and p = 3.21e-14 (severe Sample Ratio Mismatch). Stop and investigate the assignment or logging bug. Even if the true lift is 0%, losing 1,200 non-buyers from Treatment to Control creates a fake +4.9% lift.
import math obs_c, obs_t = 51_200, 48_800 total = obs_c + obs_t exp = total / 2 chi2 = (obs_c - exp) ** 2 / exp + (obs_t - exp) ** 2 / exp p_val = math.erfc(math.sqrt(chi2 / 2)) # exact 1-df chi-squared tail print(f"chi2={chi2:.1f} p={p_val:.2e}") # Counterfactual: 5,000 real buyers per arm, 1,200 non-buyers shifted c_rate = 5_000 / obs_c t_rate = 5_000 / obs_t fake_lift = (t_rate - c_rate) / c_rate print(f"true 0% lift -> logged C={c_rate:.2%} T={t_rate:.2%} " f"fake_lift={fake_lift:+.2%}")
chi2=57.6 p=3.21e-14 true 0% lift -> logged C=9.77% T=10.25% fake_lift=+4.92%
Exact chi-squared statistic (57.6), 1-df p-value via math.erfc (3.21e-14), and zero-lift attrition counterfactual run on CPython 3.12.10 (Windows x64); official SciPy and Python links checked. Checked by an editor other than the author.
Walkthrough
A 51.2% vs 48.8% split sounds close to 50/50 until you check the sample size. With 100,000 users, random 50/50 coin flips have a standard deviation of only sqrt(100,000 * 0.25) = 158.1 users per arm. Being off by 1,200 users is 7.6 standard deviations away from random chance.
Compute Pearson's chi-squared goodness-of-fit statistic (1 degree of freedom):
- Expected per arm:
50,000 - Control term:
(51,200 - 50,000)^2 / 50,000 = 1,440,000 / 50,000 = 28.8 - Treatment term:
(48,800 - 50,000)^2 / 50,000 = 28.8 - Total:
chi2 = 57.6, exact p-value3.21e-14(< 1e-13).
Experimentation teams flag SRM whenever p < 0.001 (chi2 > 10.83). Once SRM fires, every metric and p-value in the experiment is untrustworthy because missing users are almost never missing at random.
How SRM manufactures a fake +4.9% lift from zero true effect:
| Scenario | Control logged | Treatment logged | Relative lift |
|---|---|---|---|
| True unbiased 50/50 | 5,000 / 50,000 (10.00%) | 5,000 / 50,000 (10.00%) | 0.00% |
1,200 non-buyers shifted to Control | 5,000 / 51,200 (9.77%) | 5,000 / 48,800 (10.25%) | +4.92% |
Suppose a slow Treatment redirect makes impatient users bounce before the exposure beacon fires, or sends older browsers back to Control. The remaining Treatment cohort then looks healthier purely from survivorship bias.
Diagnose SRM in four steps:
- Slice the split by dimension: check ratio by browser, OS, app version, country, user tenure, and day of test. A bug often shows
50/50on desktop and60/40on Safari mobile. - Check redirect and telemetry loss: compare server-side assignment logs against client-side exposure beacons to catch slow Treatment loads or ad-blocker loss.
- Audit post-exposure filters: remove filters on events the Treatment itself affects (such as page render complete or button click).
- Check bot filtering and ramp changes: verify bot rules did not drop one arm unevenly, and confirm traffic weights did not change mid-test without stratifying by day. Fix the bug and re-run the test.
Common mistakes
- Eyeballing
51.2%vs48.8%as close enough to50/50. At100,000users, that gap is7.6standard deviations (p = 3.21e-14), proving a real bug. - Re-weighting or subsampling Control down to
48,800users and shipping anyway. Dropping random Control rows cannot undo non-random attrition inside Treatment. - Checking SRM only at the end of a two-week test. Run automated SRM alerts on Day 1 so you catch broken instrumentation within hours.
- Triggering the analysis on a downstream event affected by Treatment (for example,
checkout_rendered) instead of the upstream assignment point.
Follow-up questions
- "What if the test was configured as a 90/10 split instead of 50/50?" Use the exact configured weights (
expected = [0.9 * N, 0.1 * N]) in the chi-squared formula. For100,000users, compare observed counts against90,000and10,000, and apply the samep < 0.001alarm threshold. - "Why use p < 0.001 for SRM instead of p < 0.05?" Platforms run hundreds of tests and check SRM continuously. A
0.05threshold triggers false alarms in 1 of every 20 healthy tests, whereas0.001catches genuine instrumentation bugs with very few false stops. - "Can a real Treatment crash cause SRM even if assignment hashing is bug-free?" Yes. If assignment hashes 50/50 on the server, yet Treatment crashes before firing the client exposure event, the analytics table sees fewer Treatment users. Logging assignment server-side exposes the drop immediately.
What a strong answer covers
Computes chi2 = 57.6 (p = 3.21e-14), blocks launch, and proves a 1,200-user shift creates a fake +4.92% lift. Diagnoses SRM by slicing dimensions and checking redirects, bots, and trigger filters before re-running.
Open in interactive practice deck →