% $Date: 2003/09/15 16:37:45 $ $Author: nthiery $ $Revision: 1.1.1.1 $

\begin{Mhelppage}{Perm2ListInv}
  {V. Prosper}%
  \begin{MInfo}
    \eng{calculates the set of inversions of a permutation}
  \end{MInfo}
  

\begin{MCalls}
  \Mcall{perm}
\end{MCalls}

\begin{MParameters}
  \param{perm}
  \eng{any list denoting a permutation} 
\end{MParameters}

\begin{MIntro}
  \eng{
The  {\Mthis} function calculates the list of all  inversions  of  a
permutation. The result is in lexicographic ordering.

The set of inversions is a set of pairs of positions \Mmath{(i,j)}{(i,j)} such
that \Mmath{i<j}{i<j} and
\Mmath{\Mex{perm}[j]<\Mex{perm}[i]}{\mathtt{perm}_i>\mathtt{perm}_j}.
 
}
\end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SG::Perm2ListInv( [4,1,3,2] );
\end{Mexin}
\begin{Mexout}
               [{1, 2}, {1, 3}, {1, 4}, {3, 4}]
\end{Mexout}
\end{MExample}

\MRelatedFunctions{Perm2Length}
\end{Mhelppage}
