function s=perm_sign(permutation)
a=[]; 
  for i=1:length(permutation), 
    for j=i+1:length(permutation), 
      a=[a,sign(permutation(j)-permutation(i))];
    end;
  end;
s=prod(a);