2

This question is a continuation the one asked here, and which already received good answers. Here I am asking for a solution using rational series of formal languages as suggested by the user J. E. Pin in the other thread.

Denote by $A = \{a, b, c \}$ a ternary alphabet, also denote by $|u|_{ac}$ and $|u|_{ca}$ the number of occurrences of the factor $ac$ and $ca$ in $u$. Define $\delta : A^* \to \mathbb N$ by $\delta(u) = |u|_{ac} + |u|_{ca}$. How could the cardinality of the set of all length $n$ strings such that $\delta(u) \ge m$, i.e. $$ | \{ u \in A^n : \delta(u) \ge m \}| $$ for some fixed $n$ and $m$ determined by using the Theory of Algebraic Combinatorics on Words, i.e. using rational series of languages?

StefanH
  • 18,086

1 Answers1

1

The most natural rational series approach I know of (the Goulden-Jackson cluster method) gives a rational function $f(s,t)$ such that the coefficient of $s^n t^m$ is the number of ternary sequences of length $n$ having exactly $m$ occurrences of $ac$ or $ca$. Essentially verbatim from Noonan and Zeilberger's paper, pp. 10ff, we get $$\begin{align} f(s,t)&=\frac{1}{1-3s +\frac{2 s^2 (1-t)}{1+s - s t}}\\ &= 1+3 s+s^2 (2 t+7)+s^3 \left(2 t^2+8 t+17\right)+s^4 \left(2 t^3+10 t^2+28 t+41\right)\\ &\phantom{=\ }+s^5 \left(2 t^4+12 t^3+42 t^2+88 t+99\right)+\cdots \end{align}$$

Tad
  • 6,679