Decorated permutations - Combinatorics

Skip to content
Back to top
View this page
Edit this page

# Decorated permutations

AUTHORS:

- Martin Rubey (2020): Initial version

class sage.combinat.decorated_permutation.DecoratedPermutation(parent, pi, check=True)

  Bases: `ClonableArray`

  A decorated permutation.

  A decorated permutation is a signed permutation where all non-fixed points have positive sign.

  check()

    Check that `self` is a valid decorated permutation.

    EXAMPLES:

    Sage

        sage: S = DecoratedPermutations(3)
        sage: elt = S([2, 1, -3])
        sage: elt.check()
        sage: elt = S([2, -1, 3])
        Traceback (most recent call last):
        ...
        ValueError: invalid decorated permutation

    Python

        >>> from sage.all import *
        >>> S = DecoratedPermutations(Integer(3))
        >>> elt = S([Integer(2), Integer(1), -Integer(3)])
        >>> elt.check()
        >>> elt = S([Integer(2), -Integer(1), Integer(3)])
        Traceback (most recent call last):
        ...
        ValueError: invalid decorated permutation

  size()

    Return the size of the decorated permutation.

    EXAMPLES:

    Sage

        sage: DecoratedPermutation([2, 1, -3]).size()
        3

    Python

        >>> from sage.all import *
        >>> DecoratedPermutation([Integer(2), Integer(1), -Integer(3)]).size()
        3

  to_signed_permutation()

    Return `self` as a signed permutation.

    EXAMPLES:

    Sage

        sage: DecoratedPermutation([2, 1, -3]).to_signed_permutation()
        [2, 1, -3]

    Python

        >>> from sage.all import *
        >>> DecoratedPermutation([Integer(2), Integer(1), -Integer(3)]).to_signed_permutation()
        [2, 1, -3]

class sage.combinat.decorated_permutation.DecoratedPermutations(n)

  Bases: `UniqueRepresentation`, `Parent`

  Class of all decorated permutations of \(n\).

  A decorated permutation is a signed permutation where all non-fixed points have positive sign.

  INPUT:

  - `n` – integer; the size of the decorated permutations

  EXAMPLES:

  This will create an instance to manipulate the decorated permutations of size 3:

  Sage

      sage: S = DecoratedPermutations(3); S
      Decorated permutations of size 3
      sage: S.cardinality()
      16

  Python

      >>> from sage.all import *
      >>> S = DecoratedPermutations(Integer(3)); S
      Decorated permutations of size 3
      >>> S.cardinality()
      16

  Element

    alias of `DecoratedPermutation`

  cardinality()

    Return the cardinality of `self`.

    The number of decorated permutations of size \(n\) is equal to

    \[\sum_{k=0^n} \frac{n!}{k!}\]

    EXAMPLES:

    Sage

        sage: [DecoratedPermutations(n).cardinality() for n in range(11)]
        [1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101]

    Python

        >>> from sage.all import *
        >>> [DecoratedPermutations(n).cardinality() for n in range(Integer(11))]
        [1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101]