3297032



Probability of drawing a sequence of balls with at least k consecutive red balls

The generating function for binary (red-blue or 0-1) n-sequences that do not contain k-substrings of 1' is

$$ \frac {1-y^k} { 1-x-y-xy^k} $$

By using "factory diagrams" to generate sequences that do not contain k-strings of 1's, we get for $$k=2$$ (left diagram)

$$ S= 1 + Sx + Syx $$ for sequences that do not contain 11's and end in 0, then

$$T = Sy$$ for sequences that end in $$1$$.

Hence the $$S+T$$ generating function.

Generaly (right diagram),

$$ S= 1 + Sx + Syx + Sy^2x +...+ Sy^{k-1}x $$ and

$$T= S(y + y^2 +...+ y^{k-1})$$