Can someone recommend a method to answer the following type of question:

Suppose I have a coin with a probability hhh of coming up heads (and 1-hhh
of coming up tails)
I plan on flipping the coin nnn times (for example, nnn = 500)
What is the expected probability or frequency of a run of rrr heads* during
the nnn=500 coin flips?
Moreover, I would probably (excuse the pun) want the answer for a range of
rrr values, for example rrr = 0:50

Of course I am more interested in an analytical solution than a monte carlo
simulation solution.

Thanks in advance,

Harvey

* OR "a run of rrr heads or more ..."

	[[alternative HTML version deleted]]

