Finite automata, probabilistic method, and occurrence enumeration of a pattern in words and permutations - Toufik Mansour; Reza Rastegar; Alexander Roitershtein (2019)