Problem #254
Small permutations
For a permutation p of size n, an index r is called ‘small’ if p(r) = \min(p(1), p(2)\dots p(r)). Calculate the number of permutations of size 4040 with exactly 2000 small indices modulo 1000000007.
For a permutation p of size n, an index r is called ‘small’ if p(r) = \min(p(1), p(2)\dots p(r)). Calculate the number of permutations of size 4040 with exactly 2000 small indices modulo 1000000007.