Number of Subsets Calculator

Enter the number of elements to count all of its subsets.

How it is calculated

For a set with n elements the tool gives four counts. Total subsets: 2n, because each element is either in a subset or out of it. Proper subsets: 2n − 1, which leaves out only the full set itself. Non-empty subsets: also 2n − 1, leaving out only the empty set. Two-element subsets: C(n, 2) = n(n − 1) ÷ 2. Here proper means every subset except the set itself, so the empty set is counted, and the proper and non-empty figures are equal. The input must be a whole number from 0 to 60; a fraction, a negative number or a larger value gives no result. All counts are exact integers, so 60 elements print every digit of 260 = 1,152,921,504,606,846,976, with no rounding.

Worked example

A set with 5 elements, for example {a, b, c, d, e}. Total subsets: 25 = 32. Proper subsets: 32 − 1 = 31. Non-empty subsets: 32 − 1 = 31. Two-element subsets: C(5, 2) = 5 × 4 ÷ 2 = 10. Result: 32 subsets in total, 31 proper, 31 non-empty and 10 pairs. Each added element doubles the total, so a set of 6 elements has 64 subsets.

Try this example →

Common mistakes

  • Counting the empty set and the full set out of habit. The total of 2n includes both, so 5 elements give 32, not 30.
  • Expecting the proper-subset figure to differ from the non-empty one. Here they are always equal, because each leaves out exactly one subset.
  • Confusing subsets of any size with subsets of a fixed size. 32 counts every size, while only 10 of them have exactly two elements.
  • Entering the number of subsets instead of the number of elements. For a set of 3 elements enter 3, not 8.
  • Entering a set with repeated items without removing duplicates. A set counts distinct elements only, so {a, a, b} has 2 elements.

About this calculator

A set with n elements has exactly 2ⁿ subsets in total, including the empty set and the set itself — this comes from the fact that building any subset means making an independent include-or-exclude decision for each of the n elements, giving 2 choices multiplied together n times. From that total, the number of proper subsets is 2ⁿ − 1 (every subset except the full set), the number of non-empty subsets is also 2ⁿ − 1 (every subset except the empty set), and the number of two-element subsets is given by the combination formula C(n,2) = n(n−1)/2.

This counting shows up throughout combinatorics and computer science: algorithms that enumerate all subsets of a collection — for example brute-force solutions to the knapsack problem or subset-sum problem — commonly represent each subset as a binary bitmask from 0 to 2ⁿ − 1, directly using this same 2ⁿ relationship. It is also one of the standard results taught in discrete math courses to introduce the power set.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators