Performing a chi-squared test with overlapping observations I have a process that can be modeled by looking at the occurrence of particular patterns in a 12 digit binary string to determine if those patterns occur more or less often than they would randomly.  I am assuming that each digit has an equal chance of being 0 or 1, but throwing out the case of 00_00_00_00_00_00 since that pattern has a very high likelihood of occurring (>50%) and I'm only interested in the cases where there is a 1 somewhere in the binary string.  The total number of possibilities is then 2^12 - 1 = 4095.  The patterns I'm interested in are any of the following:
.1_1._.._.._.._..
.._.1_1._.._.._..
.._.._.1_1._.._..
.._.._.._.1_1._..
.._.._.._.._.1_1.

Where . can be any other digit.  This means that the expected probability of each of these is 2^10 / (2^12 - 1), which is approximately 25.0006%.  However, since there are 5 possible patterns simply summing the probabilities yields a value greater than 100%.
I have experimental data that I will be calculating the actual observations from to compare to, I want to know if any of those patterns is different than what random chance would suggest.  My first thought is to use a chi-squared test with the null hypothesis being that there is no difference and the alternate hypothesis being that there is a difference.  I think the degrees of freedom would be 4, but I'm not sure since a single observation can count for multiple patterns that I'm interested in.
Is chi-squared the correct method to use here?  If so, would my degrees of freedom be 4?
(Note: I organized the binary string into pairs of digits because in the physical process I'm measuring that's how they're organized.  There's a specific failure case I'm trying to analyze where two adjacent pairs might be experiencing some kind of interaction, but only on their adjacent digits.)
 A: Testing independence
After our discussion in the comment space, I think testing independancy using chi-squared is straightforward. You just want to test the indepedance of X and Y where Y follows X on the adjacent pair. First fill this table with these occurences computed accross your whole dataset.
            X
            0   1
      Y 0   a   b
        1   c   d

The columns specify the first part of your pair, and the the rows the second part. To be concrete :  


*

*$a$ is the number of times you got $0$ _ $0$   

*$b$ is the number of times you got $1$ _ $0$   

*$c$ is the number of times you got $0$ _ $1$   

*$d$ is the number of times you got $1$ _ $1$   


A chi-squared test can be done in one line of code. It has only one degree of freedom. In R :

chisq.test(cbind(c(a,b),c(c,d)))

Comparing proportions
I wrote the previous passage because you were asking about chi-squared test. I don't think this is the most relevant test here. The problem with this approach is that it does not take into account that your alternative hypothesis is $P(1|1)>P(1|0)$  Indeed, a chisq test could reject independence if the contrary was true ($P(1|1)<P(1|0)$). If your dataset is large enough I would suggest to compare proportions instead. This approach is well described here. I'll adapt it for an 1-sided test here to give the p.value needed.

z.prop = function(a,b,c,d){
  numerator = (d/(d+b))-(c/(a+c))
  p.common = (c+d) / (a+b+c+d)
  denominator = sqrt(p.common * (1-p.common) * (1/(a+c) + 1/(d+b)))
  z.prop.ris = numerator / denominator
  return(pnorm(z.prop.ris,lower.tail = FALSE))
}
z.prop(a,b,c,d)

lower.tail = FALSE allows you to look only on the "right side" of the normal distribution. 
