Subset Calculator — Power Set & C(n, k)
Given a set of n elements, find the total number of subsets (2ⁿ), the subsets of any size k (C(n, k)), and see the full row of Pascal's triangle.
2ⁿ — every possible selection from the set
- 1
Each element has 2 choices (in or out)
2^5 = 32Each of the n elements is independently included or excluded, giving 2 options per element. - 2
Total subsets (power set size)
2^5 = 32
Como esta calculadora funciona?
A set of n elements has exactly 2ⁿ subsets (including the empty set). The number of subsets of size k is C(n, k) = n!/(k!·(n−k)!). Proper subsets (excluding the full set) number 2ⁿ − 1. For n = 5: 32 subsets, 10 of size 2.
Fórmula
How this is calculated
For a set with n distinct elements, each element can independently be either included or excluded from a subset. That binary choice for each of n elements gives 2 × 2 × … × 2 = 2ⁿ possible selections, including the empty set ∅ and the full set itself. This total is called the power set. Proper subsets exclude one or both endpoints depending on convention; the most common definition excludes the full set itself, giving 2ⁿ − 1 proper subsets. Non-empty subsets exclude only the empty set, also giving 2ⁿ − 1.
The number of subsets of exactly k elements is the binomial coefficient C(n, k) = n! / (k! × (n−k)!), computed here with the multiplicative formula (n × (n−1) × … × (n−k+1)) / k! to avoid large intermediate factorials. These values form the n-th row of Pascal's triangle — the bar chart shows C(n, 0), C(n, 1), …, C(n, n), which follows a bell shape peaking at the middle and sums to 2ⁿ.
The input is capped at n = 30 to keep results within JavaScript's exact 53-bit integer range (2³⁰ ≈ 10⁹). For larger n the total subset count exceeds what can be shown exactly; the C(n, k) formula still works but large values are shown in scientific notation.
Perguntas frequentes
A subset includes every element of the original set, even the full set itself and the empty set ∅. A proper subset is any subset that is not equal to the full set — so a set with n elements has 2ⁿ subsets but only 2ⁿ − 1 proper subsets.
Summing C(n, k) for k = 0, 1, 2, …, n gives the total number of subsets: C(n,0)+C(n,1)+…+C(n,n) = 2ⁿ. Each term counts how many subsets have exactly that many elements, so they partition the 2ⁿ total by size.
With n = 30 the total subset count is 2³⁰ ≈ 1.07 × 10⁹, still representable as a whole number in JavaScript. Above n ≈ 53 the count exceeds the 53-bit integer precision of IEEE 754 floating point and cannot be stored exactly.
TG we-Calculate Editorial Team. (2026). Subset Calculator — Power Set & C(n, k) [Online calculator]. TG we-Calculate. https://we-calculate.com/pt/calculator/subset-calculator
TG we-Calculate Editorial Team. "Subset Calculator — Power Set & C(n, k)." TG we-Calculate. 2026. https://we-calculate.com/pt/calculator/subset-calculator.
TG we-Calculate Editorial Team, "Subset Calculator — Power Set & C(n, k)," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/pt/calculator/subset-calculator
@misc{wecalculate_subset_calculator, title = {Subset Calculator — Power Set & C(n, k)}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/pt/calculator/subset-calculator}}, year = {2026}, note = {TG we-Calculate} }
Esta calculadora ajudou você?
