= Solution
During phase A every item is inspected, while during phase B inspection has probability $1/r$, independently of item quality. The long-run inspected fraction is therefore the stationary reward
$$
I=\sum_{i<K}\pi_i+\frac{\pi_K}{r}=1-\left(1-\frac1r\right)\pi_K.
$$
This can be justified by the <Markov chain ergodic theorem> for state occupation and the strong law for the independent inspection coins (or the corresponding bounded martingale differences).
For the printed cumulative count this gives
$$
\boxed{I_{\rm cumulative}=\frac{Kp+q}{Kp+rq}}.
$$
It does not equal the claimed expression in general. For instance $K=2$, $p=1/2$, $r=2$ gives $I=3/4$, whereas the printed expression gives $4/5$.
For the consecutive-clearance rule, substituting $\pi_K=rq^K/D$ instead gives
$$
I_{\rm consecutive}=1-\frac{(r-1)q^K}{D}
=\boxed{\frac1{1+(r-1)(1-p)^K}}.
$$
Thus \b[the claimed formula is valid for consecutive clearance, and false for the literal cumulative count]. For $p=0$ the limiting inspected fraction is $1/r$ in either model; for $p=1$ it is 1 because phase A never clears.
Back to article page