Question: Professor Marceau objects to the loop invariant used in the proof of Lemma 5.5. He questions whether it is true prior to the first iteration.
Professor Marceau objects to the loop invariant used in the proof of Lemma 5.5. He questions whether it is true prior to the first iteration. His reasoning is that one could just as easily declare that an empty subarray contains no 0-permutations. Therefore, the probability that an empty subarray contains a 0-permutation should be 0, thus invalidating the loop invariant prior to the first iteration. Rewrite the procedure RANDOMIZE-IN-PLACE so that it’s associated loop invariant applies to a nonempty subarray prior to the first iteration, and modify the proof of Lemma 5.5 for your procedure.
Step by Step Solution
3.35 Rating (167 Votes )
There are 3 Steps involved in it
Heres the rewritten procedure RANDOMIZEINPLACEA n length A swap A1 ARANDOM1 n for i 2 to n do swa... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
C-S-A (21).docx
120 KBs Word File
