A theory for the multiset sampler