A runs test based on run lengths.

A procedure is proposed for testing the hypothesis that Bernoulli trials (successes and failures) are independent with common probability of success. Equivalently, the procedure may be used to test the hypothesis that the arrangement of a fixed number of successes and failures was determined randomly. The procedure is based on a weighted linear combination of the variances of run lengths of successes and failures. It is shown to have desirable asymptotic properties and to be generally more powerful than the usual runs test, while preserving computational simplicity.