Subset & Power Set Calculator

Generate all subsets (power set) of a set, count by size with C(n,k), view binary encodings, and solve subset-sum problems interactively.

Subset & Power Set Calculator

e.g. 1,2,3 or a,b,c,d
Find subsets that sum to this value
Set
{ 1, 2, 3 }
3 unique elements
Power Set Size |๐’ซ(S)|
8
2^3 = 8 subsets (including โˆ… and S)
Proper Subsets
7
2^3 โˆ’ 1 = 7 (excludes S itself)
Non-Empty Subsets
7
Excludes only the empty set โˆ…
Binary Encoding Bits
3
Each subset maps to an 3-bit binary string
Middle Size C(n, โŒŠn/2โŒ‹)
3
Subsets of size 1 โ€” the largest group

Combinations by Size

Size kC(3, k)% of TotalVisual
0112.5%
1337.5%
2337.5%
3112.5%

All Subsets (8)

#SubsetSizeBinary
0โˆ…0000
1{ 1 }1100
2{ 2 }1010
3{ 3 }1001
4{ 1, 2 }2110
5{ 1, 3 }2101
6{ 2, 3 }2011
7{ 1, 2, 3 }3111

Subset Relationships

ConceptNotationDefinition
SubsetA โІ BEvery element of A is in B (A may equal B)
Proper SubsetA โŠ‚ BA โІ B and A โ‰  B
Power Set๐’ซ(S)Set of all subsets of S, including โˆ… and S
Empty Setโˆ… or { }Subset of every set; |โˆ…| = 0
Cardinality|๐’ซ(S)|2^|S| for finite S
Planning notes, formulas, and examples

About the Subset & Power Set Calculator

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, the page keeps the counts, binary encodings, and subset listings in one visual workflow.

When This Page Helps

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 gets unwieldy quickly, especially for n > 4.

This page provides the C(n,k) breakdown, maps each subset to its binary encoding, and optionally solves subset-sum problems. It is useful for students working through discrete math homework and for programmers debugging bit-mask logic.

How to Use the Inputs

  1. Enter set elements separated by commas (numbers or names).
  2. Use presets for common examples.
  3. Read the output cards for power set size, proper subsets, and binary encoding bits.
  4. Examine the Combinations by Size table to see how many subsets exist at each cardinality.
  5. For sets โ‰ค 10 elements, scroll through the full enumeration table with binary strings.
  6. For numeric sets, enter a target sum to find all subsets summing to that value.
  7. Use the reference table for subset notation and definitions.
Formula used
|๐’ซ(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.

Example Calculation

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.

Tips & Best Practices

  • For {1,2,3,4,5}, there are 2^5 = 32 subsets โ€” small enough to scan manually.
  • The binary encoding column maps directly to bit-mask operations in code.
  • C(n, โŒŠn/2โŒ‹) is always the largest group โ€” most subsets are "medium-sized."
  • Keep sets โ‰ค 8 elements for fast full enumeration; use the combinations table for larger sets.
  • The subset-sum feature checks up to 2^20 combinations โ€” keep numeric sets โ‰ค 20 elements.
  • Remember: โˆ… is a subset of every set, and every set is a subset of itself.

Power Sets in Mathematics

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.

Binary Subsets and Bit Masks

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.

Subset Sum and Computational Complexity

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.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • 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}}.