How randomization works in Amplitude Experiment
Amplitude Experiment uses deterministic randomization of variations. The randomization uses the bucketing key selected in the UI and the bucketing salt of the flag. In most cases, Amplitude Experiment uses the Amplitude ID as the bucketing key.
This randomization model is two-dimensional. Amplitude Experiment performs a murmur3 hash of "bucketingSalt/amplitude_id" and uses that hash to determine two things: whether to assign a specific user a variant, and which variant to assign.
In this article, / refers to the backslash character. It doesn't imply mathematical division.
For the first stage (the initial assignment), Experiment divides users into 100 buckets based on the value of mod(murmur3_x86_32("bucketingSalt/id", 100). If the bucket returned is less than the percentage rollout, Experiment buckets the user into the experiment and assigns them a variant. If Experiment doesn't bucket the user into the experiment, the user sees the fallback variant instead.
For the second stage (variation assignment), Experiment takes all users bucketed into the experiment and assigns each a variant according to the value of floor(murmur3_x86_32("bucketingSalt/id"), 100).
Amplitude associates variants with values between 0 and 42949672, based on their weights. For example, in a two-variant experiment, if Variant A has weight 1 and Variant B has weight 1 (each variant receives 50 percent of the experiment's traffic), Experiment assigns the user to Variant A if the hash value lies between 0 and 21474835. Experiment assigns the user to Variant B if that value lies between 21474836 and 42949672.
Was this helpful?