At 14:34 31-12-98 +0100, Johann Wiesenbauer wrote:
>
>Speaking of computation times, the computation of Stirling1(1000,500) takes
>Mathematica 38.56s on my Pentium 166 PC (vs. 20.1s with my routine above!)
>Taking into account that this is a built-in (!) routine in Mathematica (you
>have to use the syntax StirlingS1[1000,500] for this expression) that
>speaks volumes, doesn't it? Anyone out there who can report the
>corresponding times for other CAS?
>
>Cheers, Johann
>
I looked into the packages of Mathematica and I found the following
routine for calculating Stirling1numbers:
StirlingFirst[n_Integer,m_Integer] := StirlingFirst1[n,m]
StirlingFirst1[n_Integer,0] := If [n == 0, 1, 0]
StirlingFirst1[0,m_Integer] := If [m == 0, 1, 0]
StirlingFirst1[n_Integer,m_Integer] := StirlingFirst1[n,m] =
(n-1) StirlingFirst1[n-1,m] + StirlingFirst1[n-1, m-1]
This routine is similar to the routine I made for derive and we all know
that it's very slow!
I found this routine in the package combina2.m in the directory \discrete
My version of mathematica is a rather old dos-version 2.2.
Greetings
Peer van de sanden
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|