Package sage :: Package combinat :: Module composition_signed
[hide private]
[frames] | no frames]

Module composition_signed

source code


Signed Compositions



Classes [hide private]
  SignedCompositions_n
Functions [hide private]
 
SignedCompositions(n)
Returns the combinatorial class of signed compositions of n.
source code
Function Details [hide private]

SignedCompositions(n)

source code 

Returns the combinatorial class of signed compositions of
n.

EXAMPLES:
    sage: SC3 = SignedCompositions(3); SC3
    Signed compositions of 3
    sage: SC3.count()
    18
    sage: len(SC3.list())
    18
    sage: SC3.first()
    [1, 1, 1]
    sage: SC3.last()
    [-3]
    sage: SC3.random_element()
    [1, -1, 1]
    sage: SC3.list()
    [[1, 1, 1],
     [1, 1, -1],
     [1, -1, 1],
     [1, -1, -1],
     [-1, 1, 1],
     [-1, 1, -1],
     [-1, -1, 1],
     [-1, -1, -1],
     [1, 2],
     [1, -2],
     [-1, 2],
     [-1, -2],
     [2, 1],
     [2, -1],
     [-2, 1],
     [-2, -1],
     [3],
     [-3]]