The question can be described in the following way:
Suppose I have a finite language $\mathcal{L}$ over alphabet $\Sigma$.
I have a string that is composed of a concatenated series of $w_i$ chosen randomly(uniformly, independently) from $\mathcal{L}$. Its length is $n$. I want to find the number of occurrences of another word $W$ over the same alphabet, in that string.
Are there standard tools to handle this? It is a bit similar to type 2 binominal distribution, but not exactly the same.
Thanks