Skip to topic | Skip to bottom
Home
Substitutions
Substitutions.FactorsOfAGivenLengthr1.5 - 15 Sep 2009 - 16:28 - TWikiGuesttopic end

Start of topic | Skip to actions

Establishing a list of the factors of a given length

During the pseudo-algorithm (see PlanForAGeneralStrategy) we often need to provide a list of the factors of a given length (usually small). This can be done algorithmically :


  • Input : $\sigma$ (a non-erasing substitution), $a$ (a letter such that $\sigma(a)$ begins with $a$ and has at least 2 letters), $n$ (an integer).
  • Output : List of factors of length at most $n$ of the fixed point of $\sigma$ that begins with the letter $a$.
  1. $L \leftarrow [a]$ (liste that contains the word '$’a$' as unique element, i.e. $L[0] = a$)
  2. $i \leftarrow -1$ (pointer)
  3. while $i$ is less or equal to the length of $L$ do
  4.          $i \leftarrow i+1$
  5.          Add to $L$ the factors of length at most $n$ of $\sigma(L[i])$ that are not yet elements of $L$
  6. done
  7. Return $L$

Of course line 5 is very imprecise and there are many ways to optimize it (see the last section of http://www.lirmm.fr/~monteil/m2/Monteil-FacteursMotsSubstitutifs.pdf).

A naive implementation is available in SAGE: language of a substitution
to top


You are here: Substitutions > FactorsOfAGivenLength

to top

Copyleft 2005-2009. Tout est libre ici! Everything is free here!
This project is not supported by any grant, organisation,...
Ideas, requests, problems regarding TWiki? Send feedback.