Counting word occurrences with overlaps
Take word “gaga”; denote by Ij the indicator that the end-point of “gaga” is located at position j in the sequence. So, number of occurrences is equal to
Expected value of the indicator Ij is equal to 1/24, so independently of the word