Calculate probability that landing the second heads requires at least $n$ tosses of a $p$-biased coin.
I'm having trouble calculating this possibility, since the variables are tripping me up.
Calculate probability that landing the second heads requires at least $n$ tosses of a $p$-biased coin.
I'm having trouble calculating this possibility, since the variables are tripping me up.
Copyright © 2021 JogjaFile Inc.
You know that last event should be heads, besides you can order the possible sequences by the number of events needed to arrive to second heads.
So, if you have $2$ coin tosses then the only possible sequence is $HH$.
For $3$ coin tosses you can have $THH,HTH$ .
For $n$ coin tosses you can place a $H$ at the end and then choose where to put the first heads on the other $n-1$ positions, so there are $n-1$ possible sequences.
Because the coin is p-biased, you can write the probability of the required outcome as :
$$p^2+2(1-p)p^2+3(1-p)^2p^2+...+n(1-p)^{n-1}p^2$$
which can be expressed as :
$$\sum_{k=1}^{n} k(1-p)^{k-1}p^2 = \frac{p^2}{1-p} \sum_{k=1}^{n} k(1-p)^{k}$$
Using the result from here about closed form of the summation you obtain :
$$\frac{p^2}{1-p} \sum_{k=1}^{n} k(1-p)^{k}=\frac{p^2}{1-p}\frac{(1-p)(1-(1-p)^n) - np(1-p)^{n+1}}{p^2} = 1-(1-p)^n(1+np) $$
EDIT : I realized that I made all my reasoning about the event $tosses \leq n+1$ !
But since the right one is $tosses \geq n$ you can use substitution $n=k-2$ and property $ \mathbb{P}(tosses \geq k) = 1 - \mathbb{P}(tosses \leq k-1)$ to obtain :
$$\fbox {$\mathbb{P}(tosses \geq k) = (1-p)^{k-2}(1+(k-2)p)$} $$