Problems are worth 20 points unless otherwise specified; there are 80 points in all.
NEW-RANDOMIZE-IN-PLACE(A)
n <- length[A]
for i <- 1 to n
do R[i] = RANDOM(i,n)
for i <- 1 to n
do swap A[i] <-> A[R[i]]
Assuming without loss of generality that A[i] has the initial value i for all i, show by performing each of the steps below that NEW-RANDOMIZE-IN-PLACE produces a uniform random permutation.
Show that (the decision problem version of) this problem is NP-complete. You may assume membership in NP. You may assume the NP-completeness of any problem asserted in class to be NP-complete.
Hint: reduce from the partition problem.