Skip to content

Permutations ​

Return all permutations of length k (default full length) of a collection.

WikipediaPermutationMathWorldPermutationWikidataQ161519Encyclopedia of MathematicsPermutationnLabpermutationBritannicatopic/permutationOEISA000142Wolfram LanguageQFactorialSageMathPermutations(n)SymPygenerate_bellmathlib4Equiv.Perm (Fin n)MATLABpermsRosetta CodePermutations
Permutations(xs, k)The permutations of length k (default full length) of a collection, as compute-engine declares it.
Permutations(n)The permutations of {1,…,n}\{1, \ldots, n\} as one-line words: the collection SymmetricGroup(n).
Typed signatures
TypePackageApplies
((S, integer?) -> list<string> where S: string) & ((collection, integer?) -> list<list>)compute-enginealways
((S, integer?) -> list<string> where S: string) & ((collection, integer?) -> list<list>) & ((integer<0..>) -> indexed_collection<permutation>)combinatoricsreplaces compute-enginealways

Domain: Compute engine

Examples

Basic #

Permutations(n) is the collection of permutations of {1,…,n}\{1, \ldots, n\}, the same as SymmetricGroup(n)

live ↗
InCount(Permutations(4))\mathrm{Count}(\mathrm{Permutations}(4))Out2424
About
Examples1
CrosswalkWikipediaMathWorldWikidataEncyclopedia of MathematicsnLabBritannicaOEISWolfram LanguageSageMathSymPymathlib4MATLABRosetta Code

See also: SymmetricGroup