luvv to helpDiscover the Best Free Online Tools
Topic 4 of 13

Randomization Basics

Learn Randomization Basics for free with explanations, exercises, and a quick test (for Data Analyst).

Published: December 20, 2025 | Updated: December 20, 2025

Who this is for

Next steps

  • Standardize your hash + seed method across teams
  • Add SRM checks to your experiment template
  • Practice with the exercises below, then take the quick test

Ready to check yourself?

Take the quick test below. It’s available to everyone; only logged-in users will have progress saved.

Practice Exercises

2 exercises to complete

Instructions

You have a table/list of 10,000 eligible users with user_id. Create a stable 50/50 assignment to variants A and B using a fixed seed. Then run an SRM check.

  1. Generate a bucket with a hash of user_id and a fixed seed (e.g., 202501). Map 0–49 to A, 50–99 to B.
  2. Count users in A and B.
  3. Run a chi-square goodness-of-fit test against the expected 50/50 split.
  4. Document the seed and assignment logic you used.
Tips (Spreadsheet)

Use a hash-like function or RAND() with a seeded surrogate if available; otherwise, simulate by hashing text via a custom formula if your tool supports it. Ensure the random value is derived from user_id so it is stable, not from volatile RAND() without a seed.

Tips (SQL sketch)
SELECT CASE WHEN MOD(ABS(HASH(CONCAT(user_id, ':', 202501))), 100) < 50 
            THEN 'A' ELSE 'B' END AS variant,
       COUNT(*) AS n
FROM users
GROUP BY 1;
Expected Output
Variant counts close to 5,000 each (± a small random fluctuation) and a chi-square p-value > 0.05 (no SRM flagged).

Randomization Basics — Quick Test

Test your knowledge with 8 questions. Pass with 70% or higher.

8 questions70% to pass

Have questions about Randomization Basics?

AI Assistant

Ask questions about this tool