Generating continuous random variables from a set of Bernoullis

54 Views Asked by At

Given a set of $Bernoulli(p_i)$ variables with each having its own arbitrary $p_i$, is there an efficient way to generate continuous random variables sampled from an arbitrary distriubution? To further specify, continuous in this context would refer to discrete N-bit numbers. For example generating a 32-bit integer from the Normal distribution.

The naive way seems to be generating a uniform() distribution using Bernoulli(.5), then using standard rv algorithms such as the Box-Muller transform. However this seems rather bloated considering only a single probability ($p_i = .5$) is used.

I was considering a solution in which each Bernoulli represents a bit of the number and $p_i = 1-CDF(x)$ where x is the bit's order of significance. This would require calculating N expensive CDF functions though.

Is there a better way to manipulate $p_i$ to generate samples more efficiently?