Randomization: Defeating Bias with Chance

Randomization uses chance to assign subjects to groups, isolating the effect you're testing from hidden variables. It's the foundation of A/B tests and clinical trials. The footgun is confusing 'haphazard' selection with true, unbiased randomization.
Why it exists
To prove that a specific change causes a specific effect, you must eliminate all other possible explanations. If you let users opt-in to a new feature, you can't know if their behavior changed because of the feature or because they're the type of user who likes new things. Randomization was developed to solve this problem of confounding variables.
The mental model
Think of a referee dividing kids into two soccer teams. If the captains pick, they'll stack their teams with friends or skilled players, creating bias. A truly random assignment, like a coin flip for each kid, ensures that on average, both teams have a similar mix of skills. Now, if one team gets a new coach (the 'treatment') and wins, you can be more confident it was the coaching, not a pre-existing skill imbalance.
How it works
In a randomized experiment, you have at least two groups: a control group (gets the standard experience) and a treatment group (gets the new experience). For each subject that enters the experiment, a purely random process—like a cryptographically secure random number generator—assigns them to a group. This breaks the connection between the subjects' pre-existing traits and the group they join, ensuring the only systematic difference between the groups is the treatment itself.
When to use it
Use randomization whenever you need to establish a cause-and-effect relationship with high confidence. It is the gold standard for A/B testing in software (does this new button cause more clicks?), clinical trials in medicine (does this drug cause a recovery?), and survey sampling for public opinion (randomly dialing numbers to get a representative sample of the population).
When not to use it
Randomization is not always possible or ethical. You cannot randomly assign people to a 'smokers' group to study cancer; you must use observational studies instead. It's also unnecessary for purely descriptive analysis where you are not comparing groups or trying to determine causality.
One canonical example
A website wants to test if a new, simpler checkout page increases completed sales. They randomly assign 50% of users who click 'checkout' to the old page (control) and 50% to the new page (treatment). Because the assignment is random, factors like what products are in the cart or the user's location are, on average, evenly distributed between both groups. If the new page has a higher completion rate, they can confidently attribute the increase to the new design.
Interview question
What is the primary benefit of using randomization to assign subjects to groups in an experiment?
- a.It guarantees that the experiment will yield statistically significant results.
- b.It distributes unknown or unmeasured confounding factors evenly across all groups.Correct
- c.It helps to keep the researchers unaware of which subjects are in which group.
- d.It ensures that every subject has an equal chance of being assigned to any group.
Why? this is the answer
The primary benefit of randomization is to ensure that, on average, all other variables (known or unknown) are evenly distributed between groups, allowing any observed differences to be attributed solely to the treatment. While randomization does ensure equal chances for group assignment (option D), this is the mechanism by which it achieves the more fundamental benefit of controlling for confounding variables.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on statistics — each one lists the topics its interview covers.
See open roles