Counting Subwords and Regular Languages
arXiv:1804.11175
Abstract
Let and be words. We consider the languages whose words are those for which the numbers of occurrences of and , as subwords of , are the same (resp., the number of 's is less than the number of 's, resp., is less than or equal). We give a necessary and sufficient condition on and for these languages to be regular, and we show how to check this condition efficiently.