After one iteration, the largest or smallest element is sorted depending on whether we sort in ascending or descending order. This means there are (n-1)! possible arrangements. Of these, only 1 arrangement represents the sorted array. So the probability of the array being sorted is 1/(n-1)!