Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Permutations > Permutations >

Permutations

Permutations[list]
generates a list of all possible permutations of the elements in list.
Permutations
gives all permutations containing at most n elements.
Permutations
gives all permutations containing exactly n elements.
  • There are n! permutations of a list of n distinct elements.
  • Repeated elements are treated as identical.  »
  • The object list need not have head List.
Length-3 permutations of :
Length-3 permutations of :
Length-3 permutations of :
In[1]:=
Click for copyable input
Out[1]=
 
Length-3 permutations of :
In[1]:=
Click for copyable input
Out[1]=
Repeated elements are treated as identical:
Use any expressions as elements:
Get permutations of all lengths, shortest ones first:
Get even-length permutations, longest ones first:
The list of elements can have any head:
The number of length-n permutations of a length-n list of distinct elements is n!:
The number of length-r permutations of a length-n list of distinct elements is :
If the input list is in the order given by Sort, so are its length-r permutations:
New in 1 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF