What is the number of favorable case of this problem? Here is the problem.

There are balls numbered $1, 2, 3, \dots, N$ in the box. You should take out a ball, write down the ball's number, then it is returned to the box. This action will be repeated $n$ times, so $n$ numbers will be written down. Ask the probability of these number arranged in the ascending order.

I know the number of all possible cases is ${ N }^{ n }$, but I’m no idea about the favorable cases. I find an answer in the net.
$$P=\frac { \frac { N\cdot \left( N-1 \right) \cdot \cdot \cdot \cdot \cdot n }{ n! }  }{ { N }^{ n } } $$
If the answer is correct,why?
 A: As in the birthday problem $\frac{N(n-1) \cdots (N-n+1)}{N^n}$ is the probability
that all integers are different. Then, assuming all arrangements to be equally
likely, one can divide by $n!$ to count as favorable only cases in which the different integers are in
ascending order. 
It is feasible to simulate this for choices of $N$ and $n$ that lead
to probabilities above 0.01 or so. Then several different simulations I tried match the result $\frac{N(n-1) \cdots (N-n+1)}{N^n}/n!.$

In case it is of interest, here is the code for simulation in R statistical
software. With a million iterations, it is reasonable to expect
two or three place accuracy. [The function diff takes $r-1$ differences of the $r$-vector
returned by sample. The result is 'favorable' precisely when all
differences are positive.]
set.seed(2017)
N= 100;  r = 3
(prod(N:(N-r+1))/factorial(r))/N^r
## 0.1617

x = replicate( 10^6,  sum(diff(sample(1:N, r, repl=T))>0)  )
mean(x==r-1)
##  0.162211   # 95% margin of simulation error 0.0007

