I've come up with 2 methods to generate relatively short random strings- one is much faster and simpler and the other much slower but I think more random. Is there a not-super-complicated method or way to measure how random the data from each method might be?
I've tried compressing the output strings (via zlib) figuring the more truly random the data, the less it will compress but that hasn't proved much.
A numeric sequence is said to be statistically random when it contains no recognizable patterns or regularities; sequences such as the results of an ideal dice roll or the digits of π exhibit statistical randomness.
data is random if. the outcome is not predictable in ad- vance; there is a predictable long-term pat- tern that can be described by the dis- tribution of the outcomes of very many trials. A random outcome is the result of a random phenomenon or procedure.
No, there is no such prove - if you have perfectly random numbers, the probability of each sequence of length n is equal. However, there are statistical tests to asses the quality of a random number generator, which is probably what you are looking for. See Diehard tests.
You are using standard compression as a proxy for the uncomputable Kolmogorov Complexity, which is the "right" mathematical framework for quantifying randomness (but, unfortunately, is not computable).
You might also try some measure of entropy if you are willing to assume some kind of distribution over strings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With