Given a set of $N$ elements and a uniformly distributed random number generator, which always generates values between $0$ and $N-1$. Then the probability to get a random permutation (without re-draws) is given by:
$$p_{0, right} = \prod_{i = 1}^{N-1} \frac{N-i}{N}$$
The $0$ indicates no re-draw. For the example N = 4, this results in following:
$$p_{0, right} = \frac{3}{4} \cdot \frac{2}{4} \cdot \frac{1}{4} = 0.09375$$
If we are allowed, to re-draw once, then the probability increases. Re-drawing can happen at any position. For the given example above, we can re-draw at three different positions. If we re-draw at the first position, the probability for that is given by:
$$p_{1} = \left( \frac{3}{4} + \frac{1}{4} \cdot \frac{3}{4} \right) \cdot \frac{2}{4} \cdot \frac{1}{4}$$
This is repeated for all other re-draw positions, to get $p_{2,3}$. The probability to get a random permutation with maximum 1 re-draw is then given by
$$p_{1, right} = p_{0, right} + p_1 + p_2 + p_3$$
My question no is how to generalize this for to $k$ re-draws?