Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quantifying randomness

Tags:

python

random

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.

like image 305
tMC Avatar asked May 01 '13 14:05

tMC


People also ask

How is randomness used in statistics?

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.

What is randomness in data?

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.

How do you prove something is random?

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.


1 Answers

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.

like image 159
ely Avatar answered Oct 02 '22 13:10

ely