Randomize the entity whose outcome you intend to compare
Connect stable assignment, repeated requests, analysis units, and the causal question.
On this page
The question for today
What you’ll understand
- Choose a randomization unit that matches the intended intervention.
- Explain when deterministic assignment remains sticky.
- Distinguish user-weighted outcomes from request-weighted duplication.
A live model experiment begins with a unit, not a percentage. Assigning requests, devices, people, or organizations produces different experiences and different evidence. A request-level switch can expose one person to both models, while an organization-level assignment can preserve a shared workflow but leave far fewer independent assignment units. State which entity receives treatment and which outcome is being averaged. Then make its assignment reproducible so retries, devices, and later sessions do not silently redefine the comparison halfway through the outcome window.
Choose assignment and analysis units together
Suppose the goal is conversion per person over seven days. Randomizing each request independently can mix experiences within one person and produce carryover from earlier requests. Randomizing a stable user identifier better matches that intervention, provided the identifier actually links the relevant activity. Device IDs answer another question when one person uses several devices or several people share one device. Neither identifier is universally correct; the target experience and identity limitations determine the choice.
The analysis must respect dependence induced by assignment. A user with many requests does not become many independent randomized users. Aggregate the declared user outcome or use an estimator and uncertainty calculation that accounts for repeated observations within users. A request-weighted metric can be legitimate when it is the intended estimand, but copying a user-level conversion label onto every request changes the weights and can change the apparent effect without adding new information.
Deterministic does not mean immutable under configuration changes
A common implementation hashes the experiment identifier, a stable unit identifier, and a versioned salt into a bucket. A fixed allocation rule converts that bucket into an arm. Repeated checks then return the same result as long as the identifiers, salt, and rule remain unchanged. The hash implements reproducibility; approximate uniform independent bucketing across units is a design assumption that should be checked, rather than a property established by printing a few balanced examples.
Changing the threshold, targeting rule, identifier resolution, or salt can change assignments even if the hash function is unchanged. Persistent assignment can retain the first enrolled decision while enrollment rules evolve, but its behavior must be specified and logged. A ramp should record configuration epochs and distinguish newly eligible units from previously assigned units. Reclassifying an existing unit after observing its outcome damages the original randomized comparison and cannot be fixed by relabeling the chart.
Freeze the identity contract for the experiment
Store the randomization-unit type, identifier version, assignment probability, configuration epoch, and first-assignment timestamp with the experiment record. Test retries and sign-in transitions explicitly. If anonymous and signed-in IDs are joined, define whether an existing assignment wins and how conflicting histories are handled. An identity merge performed after treatment can otherwise turn one person into two counted units or selectively discard an arm’s earlier behavior.
An A/A exercise can expose integration and measurement problems before a substantive model comparison, but a passing A/A run does not prove future experiments correct. Keep assignment diagnostics separate from outcome significance. When treatment changes activity volume, a growing request log is especially easy to misread as a growing independent sample. Preserve the chosen denominator and unit-level lineage so the reported uncertainty still describes the entity that was actually randomized.
Work it through
More requests do not create more randomized people
Four users are randomized: treatment users A and B have conversion labels 1 and 0 and request counts 4 and 1; control users C and D have labels 1 and 0 and request counts 3 and 2. Compare user conversion with an incorrect request-row average formed by duplicating each user label onto every request.
Each arm contains two users. User-level conversion is (1+0)/2=0.5 in treatment and (1+0)/2=0.5 in control, so the observed user-level difference is zero. The ten requests do not change the four assignment decisions.
Duplicating treatment labels across requests gives four ones and one zero, averaging 4/5=0.8. Control duplication gives three ones and two zeros, averaging 3/5=0.6. This produces an apparent difference of 0.2 by changing weights.
The copied rows still contain only four independent randomized units. They neither establish a 0.2 user-conversion effect nor justify a ten-independent-user standard error. A genuinely request-level outcome would need its own definition and dependence-aware analysis.
The two averages answer different weighting questions. The declared user conversion comparison is 0.5 versus 0.5, not the duplicated-row comparison 0.8 versus 0.6.
The living notebook
Explore the model
Interactive lab · probability
Assignment count fluctuates around its expectation
Reset, set Success probability p to 0.5 and Trials n to 20. Predict treatment-count mean 10 and variance 5 before Step. Reset, set p to 0.25 and n to 20; predict mean 5 and variance 3.75 before Step. Playback highlights exact binomial outcomes, not fresh randomized users. This independent-count model does not hash IDs or implement sticky assignment.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA planned allocation ratio defines probabilities, not an exactly balanced realized count.
Pause & reason
Check your understanding
Your turn
Try it yourself
Under independent fixed-probability assignment, N=100 eligible users have treatment probability p=0.4. Find expected treatment count and its binomial variance. Does this require exactly 40 treated users?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use Np and Np(1−p), distinguishing expectation from a realized count.
Compare with the solution
Expected treatment count is 100×0.4=40 and variance is 100×0.4×0.6=24 users squared. A realized count can differ from 40; exact balancing would require a different allocation design such as constrained randomization. The bucket model’s independence and stable eligible-unit list are assumptions of these calculations.
Keep the idea
Take it with you
- Choose the intervention unit before choosing a traffic percentage.
- Sticky assignment requires stable identity and configuration behavior.
- Repeated requests do not increase the independent assignment-unit count.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.