Decorated permutations¶
AUTHORS:
Martin Rubey (2020): Initial version
- class sage.combinat.decorated_permutation.DecoratedPermutation(parent, pi, check=True)[source]¶
Bases:
ClonableArrayA decorated permutation.
A decorated permutation is a signed permutation where all non-fixed points have positive sign.
- check()[source]¶
Check that
selfis a valid decorated permutation.EXAMPLES:
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
>>> 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
- class sage.combinat.decorated_permutation.DecoratedPermutations(n)[source]¶
Bases:
UniqueRepresentation,ParentClass 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: S = DecoratedPermutations(3); S Decorated permutations of size 3 sage: S.cardinality() 16
>>> from sage.all import * >>> S = DecoratedPermutations(Integer(3)); S Decorated permutations of size 3 >>> S.cardinality() 16
- Element[source]¶
alias of
DecoratedPermutation
- cardinality()[source]¶
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: [DecoratedPermutations(n).cardinality() for n in range(11)] [1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101]
>>> from sage.all import * >>> [DecoratedPermutations(n).cardinality() for n in range(Integer(11))] [1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101]