2

I am considering an extension of a previously posed problem, for which I have a hand-wave solution. I would like to determine whether the solution is exact and if not, need help with a rigorous approach.

The base problem is:

Suppose a biased coin (probability of heads being $p$) was flipped $n$ times. I would like to find the probability that the length of the longest run of heads, [in a particular realization of $n$ coin tosses] $\ell_n$, exceeds a given number $m$, i.e. $\mathbb{P}(\ell_n \geq m)$.

If trials are stopped when a run of length $m$ occurs, the median number of trials is $\tilde{n}_m$, with $\mathbb{P}(\ell _{\tilde{n}_m} \geq m)=1/2$. I am concerned with the median number of trials when the stopping criteria is not a fixed value, but rather a set of alternating or cyclical values.

For M conditions, let's denote the stopping criteria as $\vec{m} = \{ m_1, m_2, ..., m_M\}$. As an example, if we are looking for a run of heads with a criteria of $\{3+, 2\}$, then trial sequences in which runs of two heads start after an even number of samples (e.g. HHT, HTHHT, THTTHHT) would not satisfy the stopping point. The $+$ indicates that any run of three or more heads starting after an odd number of samples will automatically satisfy the other condition so $\{3, 2\}$ is equivalent to $\{4, 2\}$ or $\{5, 2\}$.

Returning to the original problem, we have the de Moivre solution $$\mathbb{P}(\ell_n\geq m)=\sum_{j\geq 1}^{\lfloor {n+1\over m+1}\rfloor}(-1)^{j+1}\left[p+q{n-j m +1\over j}\right] {n-j m \choose j-1}p^{jm}q^{j-1},$$ which also included an approximation (1) for $\tilde{n}_m$ without a proof $$\tilde{n}_m \approxeq {{0.7(1 - p^m)}^2\over qp^m}$$ and another approximation (2) derived by Hald, $$\tilde{n}_m \approxeq {0.7\over qp^m} - {1\over q}$$ for $n\gg m$. These two approximations are plotted over a range of $p$ for $m=\{5\}$, along with the exact solution (nearest integer) by iteratively solving for $\mathbb{P}$. Simulation based estimates for $\tilde{n} _{\{5\}}$ are also shown.

$\tilde{n} _{\{5\}} \mbox{plots}$

There is agreement between the simulation and exact solution, validating the simulation.

For the cyclical case I do not have an exact solution, but would propose without proof $$\tilde{n} _{\vec{m}} \approxeq M \left( \sum _{i = 1}^{M} {1 \over \tilde{n} _{m_i}} \right)^{-1}$$ Here is the proposed solution plotted for $\vec{m} = \{5+, 4\}$ over a range of $p$, along with simulation output

$\tilde{n} _{\{5+, 4\}}$ plots .

In addition, the exact solution and two approximations for $\tilde{n} _{4.5}$ are shown. Based on the plot, my estimate for $\tilde{n} _{\{5+, 4\}}$ looks to be a good approximation with residuals possibly dominated by quantization noise.

My questions are:

  1. Is the inverse addition equation an exact solution?
  2. If not, is there a way to derive an exact solution with generating functions that can be used to show the conditions in which the proposed solution is accurate?

References

  1. Section 22.6 A History of Probability and Statistics and Their Applications before 1750 by Hald solutions by de Moivre (1738)

0 Answers0