I am trying to use Mathematica to find the following set of permutations:

$$\sum_{\rho\in \tilde{S}_{n+2}} {\rm sgn}(\rho)\eta^{\mu_{\rho_{(1)}}\mu_{\rho_{(2)}}} $$ where $$ \tilde{S}_{n+2}:=\{\rho\in S_{n+2}: \rho_{(1)}<\rho_{(2)}\} $$ is the the reduced set of all permutations of $n+2$ numbers, and ${\rm sgn}$ is the sign function. Now I want to have it for 6 numbers, to use mathematica to find the set of all reduced permutations of {1,2,3,4,5,6}. Probably I should use DeleteCases, but I do not know how to put the condition in the reduced permutation. Any ideas?

  • 5
    $\begingroup$ You're going to have to help us with the notation a bit. (1) You say "following set of permutations" when what I see is a sum over a set of permutations. (2) What is $\eta$? What is $\mu$? What is the notation $\rho_{(1))}$? (does it mean the permutation $\rho$ applied to element $1$)? What does $\mu_{\rho_{(1)}}$ mean? I actually want to help with this problem, because my gut reaction is that it could be interesting and fun to solve, but as it stands, I have no idea what you're asking for. $\endgroup$
    – march
    Dec 7, 2015 at 4:33
  • $\begingroup$ Anyway. Maybe this: reducedPerms = Cases[Permutations@Range[6], a_ /; a[[1]] < a[[2]]]. And this: signs = Signature /@ reducedPerms. Or: reducedPerms = Select[Permutations@Range[6], #[[1]] < #[[2]]&.] $\endgroup$
    – march
    Dec 7, 2015 at 4:58
  • $\begingroup$ Sorry, you are right it is a sum over all permutations...$\eta$ is simply the Kronecker delta, $\mu$ is an index for the member of the set...and $\rho{(1)}$ is the first member of each permutation set, let say for example $\{1,2,3,4,5,6\}$ then $\rho_{(1)}=1$ etc $\endgroup$
    – Hawi
    Dec 7, 2015 at 9:22
  • $\begingroup$ we can simply forget about the first equation, the second one is related to my question, if you have a sum over a set of permutations and you have to exclude some of them, in this case I just need those which the first member is smaller than the second one, and the other four could be anything.. $\endgroup$
    – Hawi
    Dec 7, 2015 at 9:31
  • $\begingroup$ What you just suggested seems to work march, thanks $\endgroup$
    – Hawi
    Dec 7, 2015 at 9:40

1 Answer 1


We start by generating all permutations and selecting those that satisfy the condition. There are two possibilities, one using Select and one using Cases. Take your pick.

n = 6;
reducedPerms = Cases[Permutations@Range[n], a_ /; a[[1]] < a[[2]]];
reducedPerms = Select[Permutations@Range[n], #[[1]] < #[[2]] &];

We can get the Signature of a permutation by using Signature:

(* -1 *)
  • 2
    $\begingroup$ Another possibility: Select[Permutations[Range[6]], OrderedQ[Take[#, 2]] &]. $\endgroup$ Dec 9, 2015 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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