Consider the following algorithm for finding the smallest element in an unsorted array:
RANDOMMIN(A[1 .. n]):
min ← ∞
for i ← 1 to n in random order
if A[i] < min
min ← A[i] ( )
return min
(a) In the worst case, how many times does RANDOMMIN execute line ?
(b) What is the probability that line is executed during the nth iteration of the for loop?
(c) What is the exact expected number of executions of line ?