Throwing an N-sided die M times, probability of a unique number What is the probability of at least one number being rolled exactly once when throwing an N-sided die M times?
I have simulated this and it seems to be a strange function in M which starts at 1, drops, increases and drops off.
When N = 6:
M   Probability
1   1.000
2   0.833
3   0.972
4   0.926
 A: You can do this using inclusion–exclusion.
The probability for $k$ particular numbers to be rolled exactly once in $M$ rolls is
\begin{eqnarray*}
p_{M,k}
&=&
\frac{M!}{(M-k)!}\left(\frac1N\right)^k\left(1-\frac kN\right)^{M-k}
\\
&=&
N^{-M}\frac{M!}{(M-k)!}(N-k)^{M-k}\;.
\end{eqnarray*}
Then by inclusion–exclusion, the probability for at least one number to be rolled exactly once is
\begin{eqnarray*}
p_M
&=&
\sum_{k=1}^{\min(N,M)}(-1)^{k-1}\binom Nkp_{M,k}
\\
&=&
\sum_{k=1}^{\min(N,M)}(-1)^{k-1}\binom NkN^{-M}\frac{M!}{(M-k)!}(N-k)^{M-k}
\\
&=&N^{-M}M!
\sum_{k=1}^{\min(N,M)}(-1)^{k-1}\binom Nk\frac{(N-k)^{M-k}}{(M-k)!}\;.
\end{eqnarray*}
For $N=6$, we get
\begin{eqnarray*}
p_1
&=&
6^{-1}\cdot6=1\;,\\
p_2
&=&
6^{-2}\cdot2!\left(6\cdot\frac{(6-1)^{2-1}}{(2-1)!}-\binom62\right)
\\
&=&\frac56\;,
\\
p_3
&=&
6^{-3}\cdot3!\left(6\cdot\frac{(6-1)^{3-1}}{(3-1)!}-\binom62\cdot\frac{(6-2)^{3-2}}{(3-2)!}+\binom63\right)
\\
&=&
\frac{35}{36}\;,
\\
p_4
&=&
6^{-4}\cdot4!\left(6\cdot\frac{(6-1)^{4-1}}{(4-1)!}-\binom62\cdot\frac{(6-2)^{4-2}}{(4-2)!}+\binom63\cdot\frac{(6-3)^{4-3}}{(4-3)!}-\binom64\right)
\\
&=&
\frac{75}{81}\;,
\end{eqnarray*}
and so on.
A: We  get for  the complementary  probability of  no unique  number from
first principles that it is
$$\frac{1}{N^M} M! [z^M] (\exp(z)-z)^N
\\= \frac{1}{N^M} M! [z^M]
\sum_{q=0}^N {N\choose q} (-1)^q z^q \exp((N-q)z)
\\= \frac{1}{N^M} M!
\sum_{q=0}^{\min(M,N)} {N\choose q} (-1)^q [z^{M-q}] \exp((N-q)z)
\\= \frac{1}{N^M} M!
\sum_{q=0}^{\min(M,N)} 
{N\choose q} (-1)^q \frac{(N-q)^{M-q}}{(M-q)!}.$$
This gives for the desired probability the value
$$1- \frac{1}{N^M} M!
\sum_{q=0}^{\min(M,N)}
{N\choose q} (-1)^q \frac{(N-q)^{M-q}}{(M-q)!}
\\ = \frac{M!}{N^M} \sum_{q=1}^{\min(M,N)}
{N\choose q} (-1)^{q+1} \frac{(N-q)^{M-q}}{(M-q)!}.$$
Here we have used the labeled combinatorial class 
$$\def\textsc#1{\dosc#1\csod}
\def\dosc#1#2\csod{{\rm #1{\small #2}}}
\textsc{SEQ}_{=N}(\textsc{SET}_{\ne 1}(\mathcal{Z}))
\quad \text{with EGF}\quad (\exp(z)-z)^N.$$
This matches the answer that was first to appear.
