Sorry if this is silly, but this function subsamples with probability proportional to counts, right? So it can actually return a result where `result[i] > counts[i]`.