category: math

4dc5 Sequence

2006-05-28 by dudegalea in computers, math

When generating a pseudo-random binary sequence, it’s hard to create a series of bits that is evenly distributed for all lengths of sub-sequence; by that I mean that even if you get roughly the same number of 0s and 1s, you might get wildly different counts of 00s, 01s, 10s and 11s. And you might have different counts of 000s, 001s, 010s, 011s and so on for all sub-sequences. Any of these variances can signify a non-random sequence. It has (so I’m told) been proven that it is impossible to generate a genuine pseudo-random sequence that satisfies the requirement of having a reasonably similar distribution of all sub-sequences. But I had this idea a few years back. Why not keep a count of all the sub-sequences, and select the next bit based on the longest sub-sequence that is deficient? With a powerful scripting language like Python, it’s pretty simple to knock up an experiment.

Read the rest of this entry »