% $Id: stirling1.tex,v 1.1.1.3 2004/10/04 17:25:16 nthiery Exp $
\begin{Mhelppage}{stirling1}{Torsten Metzner}
  [ImplState=stable,TestState=stable,DocState=stable]
\Mproofread{stefanw}{5.6.00}{fertig}
\Mproofread{nthiery}{10/2003}{proofread}

\begin{MInfo}
  \eng{Stirling numbers of the first kind}
  \de{}
\end{MInfo}

\begin{MIntro}
  \eng{\Mthis(n,k) computes the Stirling numbers of the first kind.}
  \de{\large !! Noch keine deutsche Doku vorhanden}
\end{MIntro}

\begin{MCalls}
  \Mcall{n,k}

\end{MCalls}

\begin{MParameters}
  \param{n,k}
    \eng{nonnegative integers}
    \de{}
\end{MParameters}

\begin{MReturnValue}
   \eng{an integer.} 
   \de{}
\end{MReturnValue}

\MKeywords{combinatorics}

\begin{MDetails}
  \eng{Let \Mmath{S(n,k)}{S(n,k)} be the number of permutations of \Mpar{n}
  symbols that have exactly \Mpar{k} cycles. Then \Mthis(n,k)
  computes \Mmath{-1^(n+k)*S(n,k)}{(-1)^{(n+k)}S(n,k)}.}
  \de{}

  \eng{Let \Mmath{S1(n,k)}{S1(n,k)} be the Stirling number of the first
    kind, then we have:
\Mdmath{sum(S1(n,k)*x\^{}k, k=0...n) = x*(x-1) ... (x-n+1)}{\sum_{k=0}^{n}S1(n,k) x^k = x(x-1)\ldots(x-n+1)}}
  \de{}
\end{MDetails}

\begin{MExample}{ex1}
\eng{Let us have a look what's the result of
  \Mmath{x*(x-1)*(x-2)*(x-3)*(x-4)*(x-5)}{x(x - 1)(x - 2)(x - 3)(x
    - 4)(x - 5)} written as a sum.}
\de{}
\begin{Mexin}
expand(x*(x-1)*(x-2)*(x-3)*(x-4)*(x-5)) 
\end{Mexin}
\begin{Mexout}
          6       5       4        3        2
         x  - 15 x  + 85 x  - 225 x  + 274 x  - 120 x
\end{Mexout}
\eng{Now let us ``prove'' the formula mentioned in the ``Details'' section
  by calculating the proper Stirling numbers:}
\de{}
\begin{Mexin}
combinat::stirling1(6,1); 
combinat::stirling1(6,2); 
combinat::stirling1(6,3); 
combinat::stirling1(6,4); 
combinat::stirling1(6,5); 
combinat::stirling1(6,6) 
\end{Mexin}
\begin{Mexout}
                             -120

                              274

                             -225

                              85

                              -15

                               1
\end{Mexout}
\end{MExample}

\begin{MExample}{ex2}
\begin{Mexin}
combinat::stirling1(3,-1) 
\end{Mexin}
\begin{Mexout}
Error:  Arguments must be nonnegative integers. [combinat::sti\
rling1]
\end{Mexout}
\end{MExample}

\begin{MFurtherDoc}
   \eng{J.J. Rotman, An Introduction to the Theory of Groups\/, 
3rd Edition, Wm. C. Brown Publishers, Dubuque, 1988}
   \de{}
\end{MFurtherDoc}

\begin{MChanges}
  \version{2.0} 
  \none
\end{MChanges}

\end{Mhelppage}
