This is an example solution to the next problem in python/django:
Given an a/b testing ratio for n variants, and given access to the amount of users that are already assigned to each variant. Write code that determines to which variant should it assign the next new user so that the actually distribution of users would match the given ratio as close as possible.