apply some random permutation