← Back to context

Comment by medo-bear

4 years ago

how do you sample from an arbitrary probability distribution? it is not a trivial problem at all

Why do you need an arbitrary distribution? We are talking about breaking ties, just use uniform. You can probably just use RDRAND.

  • They are equivalent. Generating an arbitrary distribution from a uniform one is trivial.

    • If you are willing to accept lookup tables or approximations, then yeah, arbitrary distributions are trivial. However for certain domains, you may want a more closed form solution for mapping uniform to your distribution, which may not be obvious. E.g. I would say generating pink noise is not "trivial" because there is no closed form solution (c.f. generating gaussian distribution via Box-Muller, that is trivial), so you need to pick a method which may have tradeoffs.

I guess I assumed the operative word was "good". The term "random number generator" almost always refers to a generator that intends to produce a uniform distribution.

If you can sample from a uniform distribution, it is trivial to turn that into any arbitrary distribution.