Macaulay2 » Documentation
Packages » PathSignatures :: lyndonWords
next | previous | forward | backward | up | index | toc

lyndonWords -- compute all Lyndon words of at most a given length on a given number of letters

Description

A word $l$ on the alphabet $\{1,\dots, d\}$ is a Lyndon word if it is strictly smaller, in lexicographic order, than all of its rotations.

This method generates a list containing all Lyndon words of length at most $k$ on $d$ letters. The Lyndon words are given as Array in the same convention of wordFormat.

i1 : words = lyndonWords (2,3)

o1 = {[1], [1, 1, 2], [1, 2], [1, 2, 2], [2]}

o1 : List
i2 : R = wordAlgebra(2);
i3 : apply(words, i-> i_R)

              2                   2
o3 = {Lt , Lt  Lt , Lt Lt , Lt Lt  , Lt }
        1    1   2    1  2    1  2     2

o3 : List

Ways to use lyndonWords:

  • lyndonWords(ZZ,ZZ)

For the programmer

The object lyndonWords is a method function.


The source of this document is in PathSignatures/documentation.m2:918:0.