Is there a name for this permutation?

84 Views Asked by At

I came across this algorithm of permuting a set: successively generate a random permutation of $N$ elements starting with $j = 1$, then $j = 2$, and so on. Once one has a random permutation of the first $j − 1$ elements, the random permutation of the $j$ elements, is obtained by putting n in the final position and then interchanging the element in position n with the element in a randomly chosen position which is equally likely to be either position $1$, position $2$ or position $j$.

Is there a name for this permutation? Also, I wanted to prove that in fact this is a random permutation.

1

There are 1 best solutions below

0
On BEST ANSWER

It is a "random permutation" by definition, since it is picked by a process involving chance. I assume you mean "uniformly random", meaning that every possible permutation has the same probability of being picked.

There are $j!$ permutations of the values $1$ through $j$. If they are all equally likely, the probability that only one was picked is $\dfrac 1{j!}$. When $j = 1$, there is only one permutation, so no matter how the picking is done, the probability of it being picked is $1 = \dfrac 1{1!}$. Suppose it is known that for some $j-1$, your method is known to be uniform. Let's calculate the probability that a given permutation $S$ of $j$ elements is picked by your process.

First, create an permutation $S'$ as follows: if the last entry $k < j$, then exchange $k$ and $j$ in $S$. Otherwise do nothing. $S'$ is the first $j-1$ entries in the resulting permutation. By your process, $S$ cannot be picked unless $S'$ is picked first. Because $S'$ is a permutation of $j-1$ elements, by assumption its probability of being picked is $\dfrac 1{(j-1)!}$.

Given that $S'$ has already been picked, the next step is to uniformly choose a value from $1$ to $j$. Exactly one of these picks will lead to $S$ by your procedure. So the probability that $S$ will be picked given that $S'$ was picked is $\frac 1j$. An the complete probability that $S$ will be picked is $$P(S) = P(S')P(S|S') = \dfrac 1{(j-1)!}\dfrac 1j = \dfrac 1{j!}$$

Thus every permutation of length $j$ is equally likely to be picked. By induction this is true for all $j$. And your method is indeed uniform.