Suppose that n$n$ people are each randomly assigned a number from 1$1$ to m$m$ with replacement. What is the probability that exactly one number is assigned to more than one person?
What I have tried:
Defining the event A$A$ to be 'exactly one number is assigned to more than one person', I can see that the probability of A$A$ is 0$0$ when m=n$m=n$ and 1$1$ when m<n$m<n$. For m>n$m>n$, the sample space would be m^n$m^n$. I have written out the sample space for n=3$n=3$ and m=4$m=4$. In this case, P(A)=40/64=5/8$P(A)=40/64=5/8$. However, I cannot see how to compute the number of sample points in the general case.