flock of sheep with quantized speeds In answering to this post (which actually parallel this other one about the more common phenomenon in car traffic)
I came across to this interesting Sum-Product, defined for non-negative integers $n,q,g$
$$
N(n,q,g) = \left\{ {\begin{array}{*{20}c}
   0 & {\left| {\;q < g} \right.\;}  \\
   {\left[ {0 = g} \right]} & {\left| {\;0 = q} \right.}  \\
   {\sum\limits_{\left\{ \begin{subarray}{l} 
  1\, \leqslant \,k_{\,1} \, < \,k_{\,2} \, < \, \cdots \, < \,k_{\,g} \, \leqslant \,n\, \\ 
  \,j_{\,1}  + j_{\,2} \, + \,\, \cdots \, + \,j_{\,g} \, = \,q\;\;\left| {\;1\, \leqslant \,j_{\,k} \,} \right. 
\end{subarray}  \right.} {k_{\,1} ^{\,j_{\,1}  - 1} \;k_{\,2} ^{\,j_{\,2}  - 1}  \cdots k_{\,g} ^{\,j_{\,g}  - 1} } } & {\left| {\;1 \leqslant q} \right.\;}  \\
 \end{array} } \right.
$$
which gives the number of ways into which a linear flock of $q$ sheeps may finally gather 
into $g$ groups, given that each sheep is randomly assigned with one of the $n$ values for speed.
With no sheep we can form $0$ groups (the empty set), for whichever $n$ ( [X] represents the Iverson's bracket).  
The probability of having $g$ groups is therefore given by
$$
P(n,q,g) = \frac{{N(n,q,g)}}
{{n^{\,q} }} = \left\{ {\begin{array}{*{20}c}
   {\left[ {0 = g} \right]} & {\left| {\;0 = q} \right.\;}  \\
   {\frac{1}
{{n^{\,g} }}\sum\limits_{\left\{ \begin{subarray}{l} 
  1\, \leqslant \,k_{\,1} \, < \,k_{\,2} \, < \, \cdots \, < \,k_{\,g} \, \leqslant \,n\, \\ 
  \,j_{\,1}  + j_{\,2} \, + \,\, \cdots \, + \,j_{\,g} \, = \,q\;\;\left| {\;1\, \leqslant \,j_{\,k} \,} \right. 
\end{subarray}  \right.} {\left( {\frac{{k_{\,1} }}
{n}} \right)^{\,j_{\,1}  - 1} \;\left( {\frac{{k_{\,2} }}
{n}} \right)^{\,j_{\,2}  - 1}  \cdots \left( {\frac{{k_{\,g} }}
{n}} \right)^{\,j_{\,g}  - 1} } } & {\left| {\;1 \leqslant q} \right.\;}  \\
 \end{array} } \right.
$$
which when the range of speeds becomes continuous gives
$$
P(\infty ,q,g) = \frac{1}
{{q!}}\left[ \begin{gathered}
  q \\ 
  g \\ 
\end{gathered}  \right]
$$
The details on the derivation of the above formulas can be read in the answer to the referred post.
A few values of $N(n,q,g)$ are given in the Table.

Many known paths are discernible in the columns, rows and diagonals there.
However I could not yet figure out a more compact expression for that.  
Any hint or suggesting a reference (on Stirling p.m.f.) is appreciated.
 A: So, not having received hints, I proceeded in the analysis and could obtain a recurrence relation for  $N(n,q,g)$ as
$$
\left\{ \begin{gathered}
  N(n,q,g) = 0\quad \left| {\;n < 0\; \vee \;q < 0\; \vee \;g < 0} \right. \hfill \\
  N(n,q,g) - N(n - 1,q,g)\quad  =  \hfill \\
   = n\;\left( {N(n,q - 1,g) - N(n - 1,q - 1,g)} \right) + N(n - 1,q - 1,g - 1) + \left[ {0 = n} \right]\left[ {0 = q} \right]\left[ {0 = g} \right] \hfill \\ 
\end{gathered}  \right.
$$
And, applying a binomial tranform to the table obtained, to realize  that
$$ \bbox[lightyellow] {  
N(n,q,g) = \sum\limits_{\left( {0\, \leqslant } \right)\,k\,\left( { \leqslant \,\min (n,q)} \right)} {\left( \begin{gathered}
  n \\ 
  k \\ 
\end{gathered}  \right)\left\{ \begin{gathered}
  q \\ 
  k \\ 
\end{gathered}  \right\}\left[ \begin{gathered}
  k \\ 
  g \\ 
\end{gathered}  \right]} 
} \tag{1}$$
which in fact satisfies the recurrence above, and gives
$$
\begin{gathered}
  n^{\,q}  = \sum\limits_{\left( {0\, \leqslant } \right)\,g\,\left( { \leqslant \,\min (n,q)} \right)} {N(n,q,g)}  = \sum\limits_{\left( {0\, \leqslant } \right)\,k,\;j\,\left( { \leqslant \,\min (n,q)} \right)} {\left( \begin{gathered}
  n \\ 
  k \\ 
\end{gathered}  \right)\left\{ \begin{gathered}
  q \\ 
  k \\ 
\end{gathered}  \right\}\left[ \begin{gathered}
  k \\ 
  j \\ 
\end{gathered}  \right]}  =  \hfill \\
   = \sum\limits_{\left( {0\, \leqslant } \right)\,k\,\left( { \leqslant \,\min (n,q)} \right)} {\left( \begin{gathered}
  n \\ 
  k \\ 
\end{gathered}  \right)\left\{ \begin{gathered}
  q \\ 
  k \\ 
\end{gathered}  \right\}k!}  = \sum\limits_{\left( {0\, \leqslant } \right)\,k\,\left( { \leqslant \,\min (n,q)} \right)} {\left\{ \begin{gathered}
  q \\ 
  k \\ 
\end{gathered}  \right\}n^{\,\underline {\,k\,} } }  \hfill \\ 
\end{gathered} 
$$
