{'fraction_non_alphanumeric': 0.028960817717206135, 'fraction_numerical': 0.0017035775127768314, 'mean_word_length': 4.394495412844036, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Detecting clustering in binary sequences

We consider the following question: given a sequence X1; … ;Xn of binary values, how likely is it that the sequence was the output of n i.i.d. Bernoulli trials? And if it was not, can we detect the presence of clustering - increased local density on smaller consecutive intervals - in a reliable way? In this paper we propose a relatively simple statistic Ȓ, the sum of the reciprocal run lengths in the sequence, as a first step towards meeting this goal, and show that it can detect a wide range of clustering with relatively high probability.