Hacker News new | ask | show | jobs
by patio11 5833 days ago
The way A/Bingo handles this is to assign every user a unique ID, and for each test take the MD5 hash of their ID concatenated with the test name. That gives you some big ol' integer. Modulo the number of choices gives you the number of the choice to show them. This is extremely fast, durable, and has very little state, which are nice things to have in an A/B testing algorithm.
1 comments

So that means, that all you need is their UID, and for each subsequent page hit, for a particular test, the test choice to show them is deterministic. But, where does the even distribution of test choices come from? The hash or UID or the combo of the two?
MD5 hashes mod a small number can be assumed to be randomly distributed. Hypothetically assuming I had evidence to the contrary, I would shortly be very famous in some circles. Practical results bears the expectation out.