Abstract: We consider the problem of testing for randomness against streaky
alternatives in Bernoulli sequences. In particular, we study tests of
randomness (i.e., that trials are i.i.d.) which choose as test statistics (i)
the difference between the proportions of successes that directly follow k
consecutive successes and k consecutive failures or (ii) the difference between
the proportion of successes following k consecutive successes and the
proportion of successes. The asymptotic distributions of these test statistics
and their permutation distributions are derived under randomness and under
general models of streakiness, which allows us to evaluate their local
asymptotic power. The results are applied to revisit tests of the "hot hand
fallacy" implemented on data from a basketball shooting experiment, whose
conclusions are disputed by Gilovich, Vallone, and Tversky (1985) and Miller
and Sanjurjo (2018a). While multiple testing procedures reveal that one shooter
can be inferred to exhibit shooting significantly inconsistent with randomness,
supporting the existence of positive dependence in basketball shooting, we find
that participants in a survey of basketball players over-estimate an average
player's streakiness, corroborating the empirical support for the hot hand
fallacy.