Derivation of number of ordered partition
Each ordered partition $(m_1,m_2,\ldots,m_n)$ can be represented uniquely using $n-1$ bars and $m$ stars: $$ \ub{\texttt{*****}}_{m_1}\texttt{|}\ub{\texttt{***}}_{m_2}\texttt|\ldots\texttt|\ub{\texttt{********}}_{m_n}$$
The ordered partition is uniquely determined by the subset of $m$ stars in the set of $m+n-1$ symbols and we obtain all $m$-element subsets this way.
So the number of such partitions is $\pmat{m+n-1\\m}$.