I stumbled upon this post and I'm thinking if the problem can be generalized to continuous case.
In short, we generate $n$ random numbers, $X_1, X_2, ..., X_n$, which are uniformly distributed over the interval $[0, 1]$. The random numbers are i.i.d. What is $P(X_1 \le X_2 \le ... \le X_n)$?
From the comments, it is clear that this problem is easily solved by combinatorial methods, so no simulation is needed to get the solution. You do not discuss your reason for wanting a simulation. But it is easy to show a relevant simulation in R statistical software, as below:
Table entries divided by $5!$ are probabilities of various counts of 'fixed points'. For example, 1/5! is the probability that all five $X_i$ are in sort order, and $44/5!$ is the probability that none of the $X_i$ are in sort order. That is $X_1 \ne X_{(i)},$ for all $i$. Perhaps you can find combinatorial solutions for those values.
There are more elegant ways to write such a program in R, using special features of the R language, but this method with an explicit 'for-loop' should be accessible to people who do not use R.