Probability that the smallest and the largest elements in the array are compared during a run of the randomized quicksort algorithm.
After the first split, first subpart of array will contain the minimum element and second subpart contains the maximum element. (Why?)
Choose any element say $x$, greater than or equal to smallest element. After partition, smallest element will be present in the left of it. The largest element will be present on the right sub array.
After the first split, there will be no more comparison between the largest and smallest element.
To have comparison between largest and smallest element we must choose anyone of the as the pivot element in the first split itself.
Among the $N$ elements we have to choose either the smallest element or the largest element. Selection will be uniform.
Probability $= 2 / n.$