Low-level permutations

class sage.combinat.permutation_nk.PermutationsNK(n, k)

Bases: sage.combinat.combinat.CombinatorialClass

TESTS:

sage: from sage.combinat.permutation_nk import PermutationsNK
sage: a = PermutationsNK(3,2)
sage: a == loads(dumps(a))
True
cardinality()

Returns the number of permutations of k things from a list of n things.

EXAMPLES:

sage: from sage.combinat.permutation_nk import PermutationsNK
sage: PermutationsNK(3,2).cardinality()
6
sage: PermutationsNK(5,4).cardinality()
120
random_element()

Returns a random permutation of k things from range(n).

EXAMPLES:

sage: from sage.combinat.permutation_nk import PermutationsNK
sage: PermutationsNK(3,2).random_element()
[0, 1]

Previous topic

Output functions

Next topic

Low-level splits

This Page