How can I determine the statistical randomness of a binary string? Ergo, how can I code my own test, and return a single value that corresponds to the statistical randomness, a value between 0 and 1.0 (0 being not random, 1.0 being random)? The test would need to work on binary strings of any size. When you do it with pen and paper, you might explore strings like this: 0 (arbitrary randomness, the only other choice is 1) 00 (not random, its a repeat and matches the size) 01 (better, two different values) 010 (less random, palindrome) 011 (less random, more 1's, still acceptable) 0101 (less