Shuffle product of words

class sage.combinat.words.shuffle_product.ShuffleProduct_overlapping(w1, w2)
Bases: sage.combinat.combinat.CombinatorialClass
class sage.combinat.words.shuffle_product.ShuffleProduct_overlapping_r(w1, w2, r)
Bases: sage.combinat.combinat.CombinatorialClass
class sage.combinat.words.shuffle_product.ShuffleProduct_shifted(w1, w2)
Bases: sage.combinat.words.shuffle_product.ShuffleProduct_w1w2
class sage.combinat.words.shuffle_product.ShuffleProduct_w1w2(w1, w2)

Bases: sage.combinat.combinat.CombinatorialClass

cardinality()

Returns the number of words in the shuffle product of w1 and w2.

It is given by binomial(len(w1)+len(w2), len(w1)).

EXAMPLES:

sage: from sage.combinat.words.shuffle_product import ShuffleProduct_w1w2
sage: w, u = map(Words("abcd"), ["ab", "cd"])
sage: S = ShuffleProduct_w1w2(w,u)
sage: S.cardinality()
6

Previous topic

Combinatorial classes of words.

Next topic

Suffix Tries and Suffix Trees

This Page