public int RandomIndex(MyRandom random) { var p = random.Next(Sum); return(RandomIndex(Distribution, p)); }