What is the number of all set permutations in a power set?

*爱你&永不变心* 提交于 2019-12-08 09:58:47

问题


For a set of size n, the size of its power set is 2^n. Generate all permutations for each element of the power set. The power set for set {a, b} is {{}, {a}, {b}, {a,b}}. Generate all permutations on each set, we can get {(),(a),(b),(a,b),(b,a)}. So the number of all subset permutation for a power set generated from a 2-element set is 5. And such a number for a 3-item set is 16. Is there a formula for this number defined in terms of n?


回答1:


First of all, consider the power set. The number of sets of size k (for some 0 <= k <= n) in the power set is

n choose k = n! / (k! * (n - k)!)

Indeed, if we sum the number of sets for all k, we get 2^n, see Wolfram Alpha.

How many permutations does a set of size k have? Well, k!. So, if we plug that in, we loose the k! from the denominator and sum n! / (n-k)! for all k, which is

n! * Sum(1/k!, 0 <= k <= n)

Again, see the result by Wolfram Alpha.



来源:https://stackoverflow.com/questions/19079038/what-is-the-number-of-all-set-permutations-in-a-power-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!