Expected value for number of occurences

233 Views Asked by At

Let $W$ be a random word made from letters which are in set $K$ (letters are uniformly distributed in $W$) . Suppose also that $W$ has finite length ($\geq 2$) and size of $K$ is finite ($\geq 2$).

Let $W'$ be a word such that it has at least two letters and its last letter is not same as the first one. What is expected value for number of occurrences of $W'$ in $W$?

Bonus: What if the first letter is same as the last letter?