Sterling number of first kind sum of product of subset size k
Answers
Answered by
9
Given two numbers n and k where n represents number of elements in a set, find number of ways to partition the set into k subsets.
EXAMPLE --:
Input: n = 3, k = 2 Output: 3 Explanation: Let the set be {1, 2, 3}, we can partition it into 2 subsets in following ways {{1,2}, {3}}, {{1}, {2,3}}, {{1,3}, {2}} Input: n = 3, k = 1 Output: 1 Explanation: There is only one way {{1, 2, 3}}
i hope its help you
EXAMPLE --:
Input: n = 3, k = 2 Output: 3 Explanation: Let the set be {1, 2, 3}, we can partition it into 2 subsets in following ways {{1,2}, {3}}, {{1}, {2,3}}, {{1,3}, {2}} Input: n = 3, k = 1 Output: 1 Explanation: There is only one way {{1, 2, 3}}
i hope its help you
Similar questions
Math,
8 months ago
Math,
8 months ago
Physics,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago