use lower_bound to sample discrete distribution