[Math] A coin is tossed $m+n$ times. Find the probability of getting atleast $m$ consecutive heads

combinatoricsprobability

A coin is tossed $m+n$ times. Find the probability of getting atleast $m$ consecutive heads

I already know that the exact same question has already been answered here

But I am trying to solve it using another method.

  1. The first case is when at least $m$ consecutive heads occur before getting a tail. That is
    $$HHH\cdots HH \_~\_~\_~\_~\cdots\_~\_$$
    Number of ways $=2^{n}$
  2. Second case is when Tail comes first and then $m$ consecutive heads.
    Number of ways $=2^{n-1}$
  3. Third case is:$$\_THHH\cdots HH\_~\_~\_\cdots\_~\_$$
    First position can either be $H$ or $T$.
    Number of ways $=(1/2)^{1}\cdot2^{n-2}$

There will be many cases. Last case is when $m$ consecutive heads come after $n$ trials. Number of ways is $2^{n-1}\cdot1/2^{0}$

Total number of ways $$=2^n+2^{n-1}+1/2^1\cdot2^{n-2}+1/2^2\cdot2^{n-3}+\cdots +2^{n-1}\cdot1/2^0$$
$$=2^n+(n+1)1/2^{n-1}$$

Probability is $$\frac{2^n+(n+1)1/2^{n-1}}{2^{m+n}}=\frac{n+2}{2^{m+1}}$$
This is the required answer
By (S.A.M).B-tech-N.I.T

Best Answer

There are $2^{m+n}$ outcomes in total. Now treat the string of $m$ consecutive heads as a single head with $n$ more tosses. So our string of $m$ heads can be in $n+1$ different positions relative to the other $n$ coin tosses. The outcomes of those $n$ tosses do not matter since your question asks for at least a string of $m$ heads. So the probability should be: $(n+1)2^{n}/2^{n+m}$. Is this what you got?