📜  写出 {1,2,3} 的幂集. - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:37.444000             🧑  作者: Mango

代码示例1
Power set of a set is the set of all possible sets formed by elements of the given set.
Given set B = { 1 , 2 , 3 }
Power set P(B) = { 1 , 2 , 3 , ( 1 , 2 ) , ( 2 , 3 ) , ( 3 , 1 ) , ( 1 , 2 , 3 ) , Ø }
Number of elements in set = n(B) = 3 .
Therefore, Number of elements in power set = 2^n(B) = 2^3 = 8 .