Function Repository Resource:

Involutions

Source Notebook

List permutations comprised only of cycles of size two or less

Contributed by: Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)

ResourceFunction["Involutions"][l]

gives the list of involutions of the elements in the list l.

ResourceFunction["Involutions"][n]

gives involutions for Range[n].

ResourceFunction["Involutions"][,"Cycles"]

gives involutions in their cycle representation.

Details and Options

ResourceFunction["Involutions"] does not necessarily return the result in canonical order.
ResourceFunction["Involutions"][n,] is equivalent to ResourceFunction["Involutions"][Range[n],].

Examples

Basic Examples (3) 

All involutive permutations of a list:

In[1]:=
ResourceFunction["Involutions"][Range[3]]
Out[1]=

Get the same result by specifying the size:

In[2]:=
ResourceFunction["Involutions"][3]
Out[2]=

Cycle representations of the involutions:

In[3]:=
ResourceFunction["Involutions"][Range[3], "Cycles"]
Out[3]=
In[4]:=
Cycles /@ %
Out[4]=

Properties and Relations (4) 

Permuting involutions with themselves gives the identity permutation:

In[5]:=
ResourceFunction["Involutions"][4]
Out[5]=
In[6]:=
Map[(Permute[#, #]) &, %] // Union
Out[6]=

The result given by Involutions can be verified using the resource function PermutationInvolutionQ:

In[7]:=
ResourceFunction["Involutions"][3]
Out[7]=
In[8]:=
ResourceFunction["PermutationInvolutionQ"] /@ %
Out[8]=

Involutions can be obtained from a list of permutations:

In[9]:=
Select[Permutations[Range[3]], ResourceFunction["PermutationInvolutionQ"]]
Out[9]=
In[10]:=
ResourceFunction["Involutions"][Range[3]]
Out[10]=
In[11]:=
Sort[%] === %%
Out[11]=

The number of involutions is given by the resource function InvolutionCount:

In[12]:=
ResourceFunction["Involutions"][4]
Out[12]=
In[13]:=
Length[%]
Out[13]=
In[14]:=
ResourceFunction["InvolutionCount"][4]
Out[14]=

Version History

  • 1.0.0 – 26 June 2020

Related Resources

License Information