Expected number of trials until k more successes than failures

114 Views Asked by At

If I have a coin with uneven probability p to get heads(wins), what is the expected number of throws until I get k more heads than tails? I stop on the throw that I get k more heads in total.

If p<=0.5 can it be ever expected to get more k heads(wins) than losses in n throws?

I'm interested in the formula in terms of p and k to calculate the expected number of throws for this problem and how it was derived.

1

There are 1 best solutions below

2
On BEST ANSWER

This is a typical generalized random walk problem as referred to as in some textbook. Define a random variable $c_m$, where $c_m=1$ if the $m$-th throw yields a head, or $c_m=-1$ otherwise. Then the the summation defined as $x(n)=\sum_{m=1}^n c_m$ gives the number of heads more than tails on the $n$-th throw (where $n\ge m$). It can be shown, as well as verified by simulation, that for a given value of $k>0$, the expectation of $n$ for $x(n)=k$ is

$E[n]=k/(2p-1)$.

This means that

(1) for $p=1$, $E[n]=k$;

(2) for $p=0.5$, $E[n]=\infty$;

(3) for $p<0.5$, $E[n] < 0$, indicating that it is impossible to get $x(n)=k$.