How to calculate the "triangle" for stirling numbers as fast as possible?

935 Views Asked by At

In an exam, I had to calculate the stirling number of second kind $S_{8,6}$. We were given the hint to calculate the "triangle" for stirling numbers of second kind for n = 8 (talking about this one: https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind#Table_of_values). This seems like quite an effort though. How would I go about this if I want to calculate it as fast as possible? Some cases seem obvious of course, but most of then can't be calculated by intuition.

1

There are 1 best solutions below

0
On

Starting with the row $n=0$, which is totally null for all values of column index $m$ (including $m=-1$) , except for $m=0$ which is $1$, then the triangle canbe easily calculated with the recursion $$ \left\{ \matrix{ n \cr m \cr} \right\} = m\left\{ \matrix{ n - 1 \cr m \cr} \right\} + \left\{ \matrix{ n - 1 \cr m - 1 \cr} \right\} $$

Otherwise the Stirling Numbers of 2nd kind can be directly calculated by the sum $$ \left\{ \matrix{ n \cr m \cr} \right\}\quad = {1 \over {m!}}\sum\limits_j {\left( \matrix{ m \cr j \cr} \right)j^{\,n} \left( { - 1} \right)^{\,m - j} } = {1 \over {m!}}\sum\limits_j {\left( \matrix{ m \cr j \cr} \right)\left( {m - j} \right)^{\,n} \left( { - 1} \right)^{\,j} } $$