This question already has an answer here:
Suppose a source produces an indefinite sequence of positive integers. How can you check whether the numbers are generated truly randomly?
|show 2 more comments|
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
There are two answers.
In classical probability theory, the question doesn't even make sense. From the usual perspective of probability theory, if I roll a fair die, I get a "random number" from 1 to 6, but none of those numbers is "random" on its own. "Randomness" here corresponds to the process of obtaining a measurement; it's a property of a random variable, not the property of a particular value I measure from the random variable. So I roll the die over and over and get "1,1,1,1,1,...", that's still the outcome of a random variable, and in this sense that sequence was still "generated randomly". Individual measurements are not random on their own, and so any sequence of numbers from 1-6 could be generated randomly by rolling a fair die.
There is a separate theory, called "Kolmogorov complexity" or "algorithmic randomness", which can be used to measure "how random" certain objects are, but the meaning of "random" here is not the same. Instead, a sequence of numbers is called "algorithmically random" if it satisfies a large collection of randomness properties (more formally, the sequence is random if it does not lie in any effective $G_\delta$ set of measure 0). This area is also well studied, and a lot is known about the sequences that are random in this sense. But a "random process", such as repeatedly rolling a fair die, is perfectly capable of generating a sequence that is not algorithmically random.
Given some time dependent data-set, autocorrelation can be used to detect randomness and lack thereof. Take a look at for example http://en.wikipedia.org/wiki/Correlogram