generalization of the runs principle comes out if instead of focusing strictly
on fixed-length sequences with all their positions occupied by successes, we
allow the occurrence of a prespecified (usually small) number of failures.
Consequently, our study searches out subsequences of consecutive trials which
embraces a prespecified proportion (usually large) of successes. Such a
configuration, is traditionally called scan or almost perfect run.
In the present article, we study the waiting time until the first appearance of
a scan of type r/k in a sequence of n Bernoulli trials,
while several recurrence relations for the calculation of probabilities
relative to it are deduced. For illustration purposes, we provide numerical
results and applications that shed light on interesting aspects of scan