1

Let $A=\{1,2,...,k\}$ be a set and $n \ge k$ a natural number. How many ordered sets of length $n$ formed only with elements of the set $A$ are there such that every element $1,2,..,k$ appears at least one times.

I. Stefan
  • 384

1 Answers1

2

There is an answer using inclusion/exclusion starting $k^n-k(k-1)^n+\frac{k(k-1)}{2}(k-2)^n-\cdots$, so $$\displaystyle \sum_{j=0}^k (-1)^j{k \choose j}(k-j)^n$$

Another way of writing this is $k!S_2(n,k)$ where $S_2(n,k)$ represents Stirling numbers of the second kind

For small $n$ and $k$ this gives

n\k  0 1    2     3      4       5        6        7        8        9      10
     - - ---- ----- ------ ------- -------- -------- -------- -------- -------     
0 |  1 0    0     0      0       0        0        0        0        0       0
1 |  0 1    0     0      0       0        0        0        0        0       0
2 |  0 1    2     0      0       0        0        0        0        0       0
3 |  0 1    6     6      0       0        0        0        0        0       0
4 |  0 1   14    36     24       0        0        0        0        0       0
5 |  0 1   30   150    240     120        0        0        0        0       0
6 |  0 1   62   540   1560    1800      720        0        0        0       0
7 |  0 1  126  1806   8400   16800    15120     5040        0        0       0
8 |  0 1  254  5796  40824  126000   191520   141120    40320        0       0
9 |  0 1  510 18150 186480  834120  1905120  2328480  1451520   362880       0
10|  0 1 1022 55980 818520 5103000 16435440 29635200 30240000 16329600 3628800
Henry
  • 169,616