Probability of streaks I thought of this question lately, but I'm not satisfied with the answer I got:

If I flip a coin 100 times, what is the probability that I will get a streak of at least ten of the same side?

The way I thought of solving it was just: $\left(90 \times 0.5 ^ 9\right) = 0.0879$, but this has to be wrong because, for the probability of getting a streak of at least 4 in the same scenario, it yields: $\left(96 \times 0.5 ^ 3\right) = 12$, which obviously doesn't make sense.
According to this page, there is a closed form expression for just this problem.


  ...the probability, S, of getting K or more heads in a row in N
  independent attempts (where p is the probability of heads and q=1-p is
  the probability of tails) is:
  
  $$ 
S(N,K) = p^K\sum_{T=0}^\infty {N-(T+1)K\choose
T}(-qp^K)^T-\sum_{T=1}^\infty {N-TK\choose T}(-qp^K)^T
$$


With the unusual convention that ${A\choose B}= 0$ for $A &lt; B$.  Numerical evaluation gives me 0.0441372 for the case of $p=1/2$, $N=100$, $K=10$.

Edit 1

Reworking it a bit to get rid of that weird convention just changes the upper limit.

$$
p^k \sum _{t=0}^{\frac{n-k}{k+1}} \binom{n-k (t+1)}{t} \left(-q p^k\right)^t-\sum _{t=1}^{\frac{n}{k+1}} \binom{n-k t}{t} \left(-q p^k\right)^t
$$

The following Mathematica code gives you numbers, just plug in p, n, k in the last substitution bit.

-\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(t = 1\), 
FractionBox[\(n\), \(1 + k\)]]\(
\*SuperscriptBox[\((\(-
\*SuperscriptBox[\(p\), \(k\)]\)\ q)\), \(t\)]\ Binomial[n - k\ t, 
       t]\)\) + p^k \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(t = 0\), 
FractionBox[\(\(-k\) + n\), \(1 + k\)]]\(
\*SuperscriptBox[\((\(-
\*SuperscriptBox[\(p\), \(k\)]\)\ q)\), \(t\)]\ Binomial[
       n - k\ \((1 + t)\), t]\)\) //. {k -&gt; 10, n -&gt; 100, q -&gt; 1 - p, 
   p -&gt; 1/2} // N


Edit 2

It has recently been pointed out by Mark L. Stone that the above is for a streak of heads, but not for the case of either streak occurring. I'd recommend reading his post below.
I think it would be easier to use this formula $\sum_{i=1}^n \binom{n}{i}p^i(1-p)^{n-i} $, where $n$ is the number of times the action occurred (in this case, the coin flip), and $p$ is the probability of the chosen event happening (in this case, $\frac{1}{1024}$ for a streak of ten).
Plugging that in would give us $\sum_{i=1}^{100} \binom{100}{i} (\frac{1}{1024})^i(1-\frac{1}{1024})^{100-i} \approx .0930826...$, or about 9.9%