A coin having probability p of coming up heads is continually flipped. Let P_{j} (n) denote the probability that a run of j successive heads occurs within the first n flips.
(a) Argue that
P_{j} (n) = P_{j} (n− 1)+ p^{j} (1 −p)[1 −P_{j} (n −j −1)](b) By conditioning on the first non-head to appear, derive another equation relating P_{j} (n) to the quantities P_{j} (n −k), k = 1, . . . , j .
Part (a) is proven by noting that a run of j successive heads can occur within the first n flips in two mutually exclusive ways. Either there is a run of j successive heads within the first n – 1 flips; or there is no run of j successive heads within the first n–j –1 flips, flip n–j is not a head, and flips n–j +1 through n are all heads.
Let A be the event that a run of j successive heads occurs within the first n,(n≥ j), flips. Conditioning on X, the trial number of the first non-head, gives the following