probability of sorted array with duplicate numbers

I'll assume that you intended to imply that all permutations of the $n$ numbers are equiprobable.

If number $x_j$ is present $n_j$ times, with $1\le j\le k$ and $\sum_jn_j=n$, there are

$$ \binom n{n_1,\ldots,n_k}=\frac{n!}{\prod_jn_j!} $$

distinguishable arrangements. They are equiprobable and exactly one of them is ordered, so the probability for this to happen is

$$ \frac{\prod_jn_j!}{n!}\;. $$


Usually, if the numbers were not repeated the probability would be 1/n! where n! is the number of possible sorted combination while just one is the correct one. As the number can be repeated, the number of each repeated numbers (for example {2,2,...,2}) can be between 1 to n and the number of different repeated numbers can be between 2 and n/2 (for example {1,1,2,2,3,3,4,4, ... ,n/2,n/2}). So the probability will be {C(n, 1) + C(n, 2) + ... + C(n, n)} / n!.{C(n/2, 2) + C(n/2, 3) + C(n/2, n/2)}