Probablity of getting sequence of K equal results while tossing coin N times I will explain question by example. I throw coin 100 times. What is the probability I get one or more series of 8 or more heads in a row?
Which theorem should I use?
Is there a equation for this kind of experiments?
I tried looking towards to Bernoulli distribution but still no clue.
There are similar questions for little different problems:
Expected number of coin tosses to get N consecutive, given M consecutive
Consecutive Coin Toss with static tosses
This one is really close: 3 heads in a sequence when a fair coin is tossed 5 times but does not give theoretical explanation I am looking for.
 A: Consider the problem as a Markov chain with states for: 0, 1, ..., 7 heads at the end of the string, and a state for 8 heads seen in a row.  Design the transition matrix such that seeing a tail with probability half sends you back to state 0, and otherwise with probability half advances you to the next state (the final state is an absorbing state).  Raise this matrix to the $n$th power.  The value in the first row, and last column is the probability of seeing 8 heads in a row.  In Python:
import numpy as np

a = np.zeros((9, 9))
for i in range(8):
    a[i, 0] = a[i, i + 1] = 0.5
a[8, 8] = 1.0

print(np.linalg.matrix_power(a, 100)[0, 8])

gives 0.170207962419.  Using the Fraction type gives an exact answer of 6742632053880245534447059849/39614081257132168796771975168.
A: This can be answered using recursion/dynamic programming. The method is given in detail in the answer to this question: Probability over multiple blocks of events . Using this method in a spreadsheet, I found the probability of achieving 8 consecutive heads in 100 tosses to be 0.170207962419
A: According to results in my research project:
https://github.com/peterdemin/k-heads-in-a-row
Probability of having a series of length 1 is 1/4. For 2 - 1/8, for 3 - 1/16 ans so on.
So the general equation for meeting a sequence of k equal results is
p(k) = 1/2^(k+1)
and having a sequence with length of 8 or more is:
sum(1/2^9 + 1/2^10 + 1/2^11 + ...) ~= 1/2^8
The probability for sequence of length 1 confuses me a little, because, intuitially it must be 1/2, so maybe all numbers must be multiplied by 2 having general equation
p(k) = 1/2^k
