Understanding the subset calculator — concept and principle
This calculator checks whether set A is a subset or a proper subset of set B, whether B is a subset of A, and whether the sets are equal. It lists any elements of A missing from B and counts the subsets of B, its proper subsets and the subsets of a chosen size k. Use it for set theory, discrete mathematics and probability homework.
How it is calculated
- A ⊆ B (subset): every element of A is in B.
- A ⊂ B (proper subset): A ⊆ B and B has at least one element not in A.
- A = B: A ⊆ B and B ⊆ A.
- Number of subsets of B = 2ⁿ, with n = n(B); proper subsets = 2ⁿ − 1.
- Subsets with exactly k elements = C(n, k) = n! ÷ (k!(n − k)!).
Elements are compared exactly as typed, so "2" and "2.0" are different.
The principle
Being a subset is about membership only, not order or repetition. To show A ⊆ B, you check each element of A; one missing element is enough to fail. The empty set passes automatically because it has no elements to check, so ∅ is a subset of every set. Counting subsets uses the in-or-out choice for each element of B, giving 2ⁿ, and counting those of a given size is a combination problem: choosing k of the n elements.
Worked example
Default inputs: A = {2, 4}, B = {1, 2, 3, 4, 5}, k = 2.
- 2 ∈ B and 4 ∈ B, so A ⊆ B: yes.
- B has 1, 3 and 5, which A lacks, so A is a proper subset: yes.
- 1 ∉ A, so B ⊄ A, and the sets are not equal. Elements of A not in B: ∅.
- n(B) = 5, so B has 2⁵ = 32 subsets and 31 proper subsets.
- Subsets of B with 2 elements: C(5, 2) = 10. n(A) = 2, n(B) = 5.
How to read the result
"Yes" for A ⊆ B and "no" for B ⊆ A means A sits strictly inside B. If any elements of A are listed as missing from B, those are exactly why A is not a subset. The counts tell you how many different selections can be made from B, for example how many 2-person committees from 5 people.
Common mistakes
- Confusing ⊆ (subset, may be equal) with ⊂ (proper subset).
- Confusing "is an element of" (∈) with "is a subset of" (⊆): 2 ∈ B, but {2} ⊆ B.
- Forgetting that ∅ and B itself are subsets of B.
- Typing elements inconsistently, such as "a" and "A".
Frequently asked questions
Is every set a subset of itself?
Yes, A ⊆ A always. It is not a proper subset of itself.
Is the empty set a proper subset of every set?
Of every non-empty set, yes. It is not a proper subset of itself.
How many subsets does a 5-element set have?
2⁵ = 32.
Sources: OpenStax, Contemporary Mathematics (2023), §1.2 Subsets