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.
Asked
Active
Viewed 138 times
1
-
this is 'how many distinct sets from the elements of $A$ can be formed of length $n-k$?' – JMP May 28 '16 at 07:28
-
@JonMarkPerry The problem also states that the sets are ordered. – I. Stefan May 28 '16 at 07:40
-
so ${1,2,3}$ is considered to be a different set to ${1,3,2}$? – JMP May 28 '16 at 07:43
-
1If my interpretation is okay then you are asking for the number of surjections ${1,\dots,n}\to{1,\dots,k}$. Have a look here. – drhab May 28 '16 at 08:04
-
YEs, you are right. – I. Stefan May 28 '16 at 08:11
1 Answers
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