4 ms·
Out of curiosity, why do you think having a good random number generator is problematic? It seems like it's easy enough to access one in most situations.
by asxd 5y ago
Out of curiosity, why do you think having a good random number generator is problematic? It seems like it's easy enough to access one in most situations.
- medo-bear 5y agohow do you sample from an arbitrary probability distribution? it is not a trivial problem at all
- kortex 5y agoWhy do you need an arbitrary distribution? We are talking about breaking ties, just use uniform. You can probably just use RDRAND.
- medo-bear 5y agoi agree. to break ties uniform distribution should be sufficient
- Hendrikto 5y agoThey are equivalent. Generating an arbitrary distribution from a uniform one is trivial.
- kortex 5y agoIf 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.
- Hendrikto 5y agoIf you can sample from a uniform distribution, it is trivial to turn that into any arbitrary distribution.
- asxd 5y agoI 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.
- thesz 5y agoYes, exactly. There are so many to choose from. ;) There are several discussions here in HN about PRNGs of different kinds and people still want to invent new ones. Why? Because old ones do not satisfy them in full. Returning to the problem at hand. How many consecutive ties do we expect? This would helps us to define how many bits should we extract from state - for N expected consecutive ties we should extract 2log_2(N) bits or more (birthday paradox). For 64K ties we need 32 bits, which is fair amount of state, 1/8 of typical PRNG discussed here. Most PRNGs are splittable and this also brings the question "how does splitting affect bits generated?" Will these bits be correlated between splitted generators? I definitely do not want correlation coefficient computation that produces close results for provably different sets due to correlation between tie-breaked sections filled with random numbers.
- ykonstant 5y ago> Yes, exactly. There are so many to choose from. ;) Just use a good PRNG to pick one of them :D