grandes-ecoles 2017 QID
Combinatorial Proof or Identity Derivation
Throughout the problem, for every pair $( n , k )$ of strictly positive integers, we denote by $S ( n , k )$ the number of partitions of the set $\llbracket 1 , n \rrbracket$ into $k$ parts. We further set $S ( 0,0 ) = 1$ and, for all $( n , k ) \in \mathbb { N } ^ { * 2 } , S ( n , 0 ) = S ( 0 , k ) = 0$. The recurrence relation $S ( n , k ) = S ( n - 1 , k - 1 ) + k S ( n - 1 , k )$ holds for all strictly positive integers $k$ and $n$.
I.D.1) Write a recursive Python function to compute the number $S ( n , k )$, by direct application of the formula established in question I.C.
I.D.2) Show that, for $n \geqslant 1$, the computation of $S ( n , k )$ by this recursive function requires at least $\binom { n } { k }$ operations (sums or products).