As Introduction to Algorithms (CLRS) describes, the problem is
Suppose you flip a fair coin $n$ times. What is the longest streak of consecutive heads that you expect to see?
The book claims that the expects is $\Theta(\log{}n)$, and proves that it is both $O(\log{}n)$ and $\Omega(\log{}n)$. I want generize the problem, and look into the $\Theta(\log{}n)$.
For example, we're flipping a biased coin with the probability $p$ for head and $q$ for tail, where $p+q=1$. Supposing that the length of the longest streak is $X$, we want to rewrite $EX = A\log{}n + O(1)$, or more precisely, $EX = A\log{}n + B + o(1)$, or something else. How to determine the asymptotics for $EX$?
There's something trivial. Supposing that $P_{n,m}=\textrm{ probability that }X
Any help? Thanks!