Imagine a randomly generated binary series, e.g.:
0011001111110101001.
Now imagine that it's not entirely random, but that the 1s and 0s tend to come roughly in bunches, e.g.:
0000011111000000000000011111100000110001111111100111110000010000111111111111111111000000000000011111 (100 digits).
I want to measure the ratio of 1s and 0s. In the above sequence, it happens to be 1:1. There are 50 0s an 50 1s.
But imagine I can only sample a part of the sequence, say 10 consecutive digits. If I happened to select a bunch of 10 zeros together, I would have to conclude that the sequence is 100% zeros. Conversely If I happened to select a bunch of 10 ones together, I would have to conclude that the sequence is 100% ones. Usually, my 10 consecutive digits will give me some intermediate fraction.
To take it to the extreme, if I had 50 x 0 followed by 50 x 1, and I was sampling 10 consecutive numbers, I would almost always find 100% 0 or 100% 1 and so the variance is wide.
If the numbers are more like 0010011110111101010101.... (i.e. bunches of 2 or 3) then the ratio is going to be much more like 50:50 each time you take a sample.
I'm trying to figure out how I can quantify the uncertainty in my 0s:1s ratio. I know that if the numbers were purely random, I could just use binomial statistics to calculate the standard deviation of number of successes when choosing 10 numbers (sqrt(2.5) I believe).
But I think the fact that my numbers are more likely to bunch together complicates things. Is there a way I can take into account how long my "bunches" usually are and how many numbers I am sampling, to say something about the variance of the fraction of 0s/1s I will measure.