How to solve this coin toss problem using recursive methods?

376 Views Asked by At

I toss a biased coin n times and record the sequence of heads and tails. Assume P(H) = p (where 0< p <1). Let a_n be the probability that the number of heads is divisible by 3. Write a set of recursive equations to compute a_n

1

There are 1 best solutions below

0
On BEST ANSWER

$a_n=(1-p)a_{n-1}+p\cdot c_{n-1}$

$b_n=(1-p)b_{n-1}+p\cdot a_{n-1}$

$c_n=(1-p)c_{n-1}+p\cdot b_{n-1}$

where $b_n$ is the probability that the number of heads in $n$ flips is one more than a multiple of 3 and $c_n$ is the probability that the number of heads in $n$ flips is two more than a multiple of 3. Initial values are $a_0=1, b_0=0, c_0=0$.