It's not enough to check the frequency. For instance, the sequence "1 2 3 1 2 3 1 2 3" has equal frequencies, but is unlikely to be random.
If you tried with a few thousand blocks this wouldn't show a more scientific answer rather than "I rolled a die 6x and I got 3 twice, therefore the odds of rolling a 3 on a die is 1 in 3" . It's just not how odds work.
+1
There's official government backed standards for testing randomness, and testing software called the NIST Statistical Test Suite software. However, even the official government standards say "statistical testing cannot serve as a substitute for cryptanalysis". Statistical testing by itself isn't enough, and good statistical testing can require 10^18 or more random numbers to test.
The details of the testing software are in this quote from another thread.
NIST produced some software for conducting statistical testing on data produced by random number generators. However it requires compiling, and needs huge data sets to work with.
http://csrc.nist.gov/groups/ST/toolkit/rng/documents/SP800-22rev1a.pdfThis paper discusses some aspects of selecting and testing random and pseudorandom number generators.The outputs of such generators may be used in many cryptographic applications, such as the generation of key material. Generators suitable for use in cryptographic applications may need to meet stronger requirements than for other applications. In particular, their outputs must be unpredictable in the absence of knowledge of the inputs. Some criteria for characterizing and selecting appropriate generators are discussed in this document. The subject of statistical testing and its relation to cryptanalysis is also discussed, and some recommended statistical tests are provided. These tests may be useful as a first step in determining whether or not a generator is suitable for a particular cryptographic application. However,no set of statistical tests can absolutely certify a generator as appropriate for usage in a particular application, i.e., statistical testing cannot serve as a substitute for cryptanalysis
This is the download link for the the NIST Statistical Test Suite software.
http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.htmlTesting if a sequence of numbers is random is incredibly difficult, as random.org points out.
https://www.random.org/analysis/If you flip enough coins, you will get sequences of coin flips that seen in isolation from the rest of the sequence don't look random at all. Scott Adams has drawn this as a Dilbert strip, which is funny exactly because it is true:
What Dilbert is told is correct: It is impossible to prove definitively whether a given sequence of numbers (and the generator that produced it) is random. It could happen that the creature in the comic strip has been generating perfectly random numbers for many years and that Dilbert simply happens to walk in at the moment when there's six nines in a row. It's not very likely, but if the creature sits there for long enough (and Dilbert visits enough times), then it will eventually happen.
There is more software for testing randomness called dieharder. It doesn't run all the NIST tests yet, but earlier software it's based on (called diehard) required a default input to work on of ten million random numbers in a file. Dieharder requires much more data than that to run sensitive tests.
http://www.phy.duke.edu/~rgb/General/dieharder.phpDieharder differs significantly from diehard in many ways. For example, diehard uses file based sources of random numbers exclusively and by default works with only roughly ten million random numbers in such a file. However, modern random number generators in a typical simulation application can easily need to generate 10^18 or more random numbers, generated from hundreds, thousands, millions of different seeds in independent (parallelized) simulation threads, as the application runs over a period of months to years. Those applications can easily be sensitive to rng weaknesses that might not be revealed by sequences as short as 10^7 uints in length even with excellent and sensitive tests. One of dieharder's primary design goals was to permit tests to be run on very long sequences.
*snip*
In addition to implementing all of the diehard tests it is expected that dieharder will eventually contain all of the NIST STS and a variety of tests contributed by users