Generate all subsets (power set) of a set, count by size with C(n,k), view binary encodings, and solve subset-sum problems interactively.
Every set S has a power set 𝒫(S) — the set of all its subsets, including the empty set ∅ and S itself. If S has n elements, 𝒫(S) has exactly 2^n members. Understanding subsets is fundamental to combinatorics, probability, logic, and computer science, where bit-masks, database queries, and search algorithms all manipulate subsets.
This calculator takes a set of elements, computes the total number of subsets (2^n), proper subsets (2^n − 1), and the distribution by size C(n, k) with a visual bar chart. For sets with up to 10 elements, it enumerates every subset with its binary encoding (each bit represents whether an element is included or excluded). For numeric sets, it optionally solves the subset-sum problem: finding all subsets whose elements add to a target value.
Whether you are learning about power sets in a discrete math course, need to enumerate combinations for a programming problem, or want to explore the structure of 2^n subsets, this tool provides instant, visual results.
Subsets and power sets appear constantly in math and CS — from combinatorial proofs and probability calculations to database indexing and feature selection in machine learning. Enumerating them by hand is tedious and error-prone, especially for n > 4.
This tool automates the enumeration, provides the C(n,k) breakdown, maps each subset to its binary encoding, and solves subset-sum problems — all in one interactive interface. It is invaluable for students working through discrete math homework and for programmers debugging bit-mask logic.
|𝒫(S)| = 2^n. Proper subsets = 2^n − 1. C(n,k) = n! / (k!(n−k)!). Subset-sum: find T ⊆ S such that Σ(t∈T) t = target. Binary encoding: subset ↔ n-bit string where bit i = 1 iff element i is included.
Result: 8 subsets: ∅, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}
|S| = 3, so 2³ = 8 subsets. C(3,0)=1, C(3,1)=3, C(3,2)=3, C(3,3)=1.
Cantor proved that for any set S (even infinite), |𝒫(S)| > |S| — the power set is strictly larger. This is the basis of Cantor's theorem and the reason there are 'more' real numbers than natural numbers: ℝ has the same cardinality as 𝒫(ℕ). In axiomatic set theory (ZFC), the Power Set Axiom guarantees that 𝒫(S) exists for any set S, and it is one of the few axioms that increases the "size" of the set-theoretic universe.
In programming, a set of n elements can be represented as an n-bit integer. The subset {0, 2, 3} of {0, 1, 2, 3, 4} is the bitmask 01101 (bits 0, 2, and 3 set). Union is bitwise OR, intersection is bitwise AND, and complement is bitwise NOT. This representation is O(1) for set operations and is used extensively in competitive programming, dynamic programming on subsets (bitmask DP), and hardware design.
The subset-sum problem — deciding whether any subset of a given set of integers sums to a target — is one of Karp's 21 NP-complete problems (1972). Despite this worst-case hardness, practical instances with small n are easily solved by brute-force enumeration (2^n subsets) or dynamic programming (pseudo-polynomial time O(n × target)). The problem has applications in cryptography (knapsack-based cryptosystems), resource allocation, and financial portfolio optimization.
The power set 𝒫(S) of a set S is the set of all subsets of S, including the empty set and S itself. If S = {a,b}, then 𝒫(S) = {∅, {a}, {b}, {a,b}}.
Each element is either included or excluded from a subset — 2 choices per element, n elements, so 2^n total combinations. This maps to n-bit binary strings.
⊆ (subset) allows equality: A ⊆ A is true. ⊂ (proper subset) requires strict inclusion: A ⊂ A is false. A proper subset must be "smaller than" the parent.
Given a set of numbers and a target, find any (or all) subsets that sum to the target. It is NP-complete in general, but solvable for small sets by enumeration.
2^10 = 1,024 subsets is manageable. 2^20 = 1,048,576 would crash the browser. The tool still shows counts and combinations for larger sets.
Map each element to a bit position. A subset is a binary string: 1 means "include," 0 means "exclude." For {a,b,c}, 101 = {a,c}, 010 = {b}, 111 = {a,b,c}.