permutations function

Permutation sampling