4
$\begingroup$

I am working with a function of type

F[a,b,c,d,e,f]

that obeys the following symmetries:

F[a,b,c,d,e,f]=F[c,d,a,b,e,f]=F[c,d,e,f,a,b],

and

F[a,b,c,d,e,f]=F[b,a,c,d,e,f]=F[a,b,d,c,e,f]=F[a,b,d,c,f,e],

i.e. is symmetric in entries 1-2,3-4 and 5-6 and also is symmetric if I switch any couple of entries with a different one. I want to compute a list with all the possible distinct values of the function, giving different entries. To do this, I want to compute a list of lists containing all the possible distinct orderings of my entries (given the symmetries of my function). From a simple combinatorics argument, I expect

6!/2!2!2!3!=15 

different orderings of my entries. To be more specific, the different orderings I need are

{1,2,3,4,5,6},{1,2,3,5,4,6},{1,2,3,6,4,5},{1,3,2,4,5,6},{1,3,2,5,4,6},{1,3,2,6,4,5,},{1,4,2,3,5,6},{1,4,2,5,3,6},{1,4,2,6,3,5},{1,5,2,3,4,6},{1,5,2,4,3,6},{1,5,2,6,3,4},{1,6,2,3,4,5},{1,6,2,4,3,5},{1,6,2,5,3,4}

How can I compute those distinct orderings in Mathematica? Can I exploit some specific features of Permutation[] command?

$\endgroup$
4
  • $\begingroup$ Assume a,b,.. are the values you want to feed to f. Then: DeleteDuplicates[f @@@Permutations[{a, b, c, d, e, f}]] gives all the different results. $\endgroup$ Nov 30 '21 at 11:40
  • $\begingroup$ @Syed I delete all of them except the first one! All the others possibilities can be obtained by using swapping symmetry within a pair or symmetry in the swapping of pairs. Using combinatorics, among the 6! permutations, only 6!/2!2!2!3! are independent, i.e. cannot be obtained from the others using the mentioned symmetries. $\endgroup$
    – McSenegal
    Nov 30 '21 at 12:40
  • $\begingroup$ Please add the required combinations to your post. $\endgroup$
    – Syed
    Nov 30 '21 at 12:43
  • $\begingroup$ @Syed I can even list you the different combinations I need: {1,2,3,4,5,6},{1,2,3,5,4,6},{1,2,3,6,4,5},{1,3,2,4,5,6},{1,3,2,5,4,6},{1,3,2,6,4,5,},{1,4,2,3,5,6},{1,4,2,5,3,6},{1,4,2,6,3,5},{1,5,2,3,4,6},{1,5,2,4,3,6},{1,5,2,6,3,4},{1,6,2,3,4,5},{1,6,2,4,3,5},{1,6,2,5,3,4} The problem is that I need similar objects at higher points (i.e. more than six variables), so I was searching for a more algorithmic way of solving the problem $\endgroup$
    – McSenegal
    Nov 30 '21 at 12:46
2
$\begingroup$
ClearAll[partitionedOrderless]

partitionedOrderless[n_, k_: 2] := Block[{foo}, 
  SetAttributes[foo, Orderless]; 
  DeleteDuplicatesBy[foo @@ foo @@@ Partition[#, k] &] @ Permutations[Range @ n]]

Examples:

partitionedOrderless[6] 

enter image description here

partitionedOrderless[4, 2]

enter image description here

partitionedOrderless[6, 3] 

enter image description here

partitionedOrderless[8, 2] 

enter image description here

partitionedOrderless[8, 4] 

enter image description here

etc.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.