Given:
- A discrete probability distribution over
n-bitintegers represented as a listysof floats (i.e.sum(ys) == 1) - a parameter
epssuch that0 < eps < 0.5
I want to generate a new probability distribution over n-bit integers, xs, such that the following holds:
(1) (forall) i in range(0, 2**n):
(1 - eps) <= xs[i] / ys[i] <= (1 + eps)
(2) sum(xs) == 1
My (naive) starting point is this:
for i in range(2**n):
xs[i] = uniform(ys[i] * (1 - eps), ys[i] * (1 + eps))
but obviously sum(xs) may not be 1, and normalizing xs may break condition (1).
It seems to me that there should be a way to generate such a list where both constraints are met. Am I missing something fundamental here?