At 12/23/15 10:28 PM, MSGhero wrote:
I don't see what other theoretical noise generators could be used. In order for a RNG to give me a single result 40% of the time, I could have "Math.random() < .4" but that's not smoothly random. I'm directly telling it that "-1 to -0.04" is equal to 40% of the time.
Cryptography most often relies on (something that resembles) PRNGs that give uniform distributions in one way or another. An uneven distribution results in successful frequency analysis and eventual breakage(eg. given: Ceaser Cipher, even with a one-time pad provided the padding isn't long enough to cover the message causing the padding to repeat)
AS3's Math.random is a variant of the Mersenne Twister algorithm - or so is claimed (Mersenne primes where various transforms are applied to each number and then bitwise operations are applied to the output)
Either way, although the MT algorithm defined in 1997 (MT19937) isn't equidistributed (doesn't have a uniform distribution) maybe the AS3 implementation does. Worth a shot, there.
If that fails your test, there's still plenty of options. Most PRNGs are uniform in distribution, and you can find plenty with Google. There's AS3 Park-Miller implementations here, here, and here if you'd like.
<shamelessPlug>
You can also try to use my Pi algorithm, though I'm not sure if it's uniform or not. Judging by the results, I'd hazard a guess at "yes" but you can give it a go anyway. You should. I'm curious.
</shamelessPlug>
There is no function that does any of this math, besides the ones I used in MATLAB anyway (histogram, ecdf). It's not like any of this math is being done at compile time or runtime. Tbh, there's no math at all, the ranges are experimentally determined and counted. There's not really a concept of an equation relevant to any of this, besides some arcane calculus that I'm pretty sure isn't possible to solve or even write down.
Basically what you're doing is taking your distribution data and running it through an EDF and taking a look at whatever y-value you want and grabbing the x-value from it. I'm terrible at math and can't write any functions that will do that for you automagically, but it seems pretty programmable.
I suppose what you're saying is you want a normalized distribution, but you also want to give percentage assignments to each possible value.
Basically you want to know "how likely is it that x or lower (or higher) will be hit on a normalized distribution?" or more accurately (since that's the reverse of what you want) "what must x be in order to at least qualify as y percentage?" and any value between the different x values are your answers.
You might want to take a look at this YouTube video. It seems like it holds the key to your problem, but I never could figure out z-tables.