2
$\begingroup$

While doing estimates on the complexity of an algorithm I have run into a word-combinatorial problem with both a local and a global constraint.

This seems to be a rather general situation and I'm sure there must be useful literature on the subject, though I haven't found anything that quite applies.

The local constraint in my case is simply a set of bad words to be avoided, and the global constraint is that no letter must repeated.

Consider an alphabet of $N$ letters divided in $p$ families. The $i$-th family contains $n_i$ letters ($i=1,...,p$), and $\sum_{i=1}^p n_i = N$.

We want to compute the number of words of $q$ letters ($q \leq N$) such that: (1) they all start with the same letter; (2) no letter appears more than once; (3) there are exactly $s$ pairs of adjacent letters from different families.

So the set of "bad" words consists of all two-letter words made with letters from two different families.

We are counting the self-avoiding words of length $q$ that begin with a given letter and contain exactly $s$ bad words as factors.

I can solve the local and global constraint separately. I solve the local one with the Goulden-Jackson method, the global one by just counting.

The problem is that Goulden-Jackson doesn't really apply to global constraints. If you apply it, the equation for the clusters is unyieldy. There must be a better way to handle these situations.

$\endgroup$
4
  • 2
    $\begingroup$ Linear or circular? $\endgroup$ Commented Aug 10, 2015 at 22:54
  • $\begingroup$ A linear string. $\endgroup$ Commented Aug 11, 2015 at 7:02
  • 1
    $\begingroup$ Now crossposted to math.SE: math.stackexchange.com/q/1428618/264 In the future, please provide links to your other posts - as you can imagine, it would be frustrating for someone to put time into answering your question here, only to find out that you'd already gotten an answer elsewhere. $\endgroup$ Commented Sep 9, 2015 at 20:58
  • $\begingroup$ I mean regular words. $\endgroup$ Commented Sep 11, 2015 at 8:02

0

You must log in to answer this question.

Browse other questions tagged .