Subset Calculator
Check if one set is a subset of another, compute union, intersection, difference, and symmetric difference of two sets.
Subset Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: A is a subset of B iff every x in A is also in B
Worked example โ A is a subset of B (proper subset) | A has 2^3 = 8 subsets
Formula
A is a subset of B iff every x in A is also in B
A set A is a subset of B if all elements of A belong to B. Related operations include union (elements in A or B), intersection (elements in both), difference (elements in A but not B), and symmetric difference (elements in exactly one set).
Worked Examples
Example 1: Checking Subset Relationships
Problem:Is A = {1, 2, 3} a subset of B = {1, 2, 3, 4, 5}?
Solution:Check each element of A: 1 is in B? Yes 2 is in B? Yes 3 is in B? Yes All elements of A are in B, so A is a subset of B. A has 3 elements, B has 5 elements, so A is not equal to B. Therefore A is also a proper subset of B. B is NOT a subset of A (4 and 5 are in B but not A).
Result:A is a subset of B (proper subset) | A has 2^3 = 8 subsets
Example 2: Set Operations
Problem:Find union, intersection, and differences of A = {a, b, c, d} and B = {c, d, e, f}.
Solution:Union: A union B = {a, b, c, d, e, f} (6 elements) Intersection: A intersection B = {c, d} (2 elements) A minus B = {a, b} (elements in A but not B) B minus A = {e, f} (elements in B but not A) Symmetric difference = {a, b, e, f} (in either but not both) Verify: |A union B| = |A| + |B| - |A intersection B| = 4 + 4 - 2 = 6
Result:Union: 6 elements | Intersection: 2 elements | A-B: {a,b} | B-A: {e,f}
Frequently Asked Questions
What is a subset in set theory?
A subset is a set where every element also belongs to another set. Formally, set A is a subset of set B (written A is a subset of B) if every element of A is also an element of B. For example, {1, 2} is a subset of {1, 2, 3, 4}. The empty set is a subset of every set, and every set is a subset of itself. Subsets are one of the most fundamental concepts in mathematics, forming the basis for set operations, logical reasoning, and the construction of mathematical structures. Understanding subsets is essential for studying functions, relations, probability, and abstract algebra.
What is the difference between a subset and a proper subset?
A subset allows equality with the original set, while a proper subset must be strictly smaller. Set A is a subset of B if every element of A is in B (A could equal B). Set A is a proper subset of B if every element of A is in B AND A is not equal to B (B must have at least one element not in A). For example, {1, 2, 3} is a subset of {1, 2, 3} but NOT a proper subset. However, {1, 2} is both a subset and a proper subset of {1, 2, 3}. The notation for subset is the rounded U symbol, while proper subset uses the same symbol with a line underneath, similar to less-than-or-equal versus strict less-than.
How do you determine if one set is a subset of another?
To verify if A is a subset of B, check whether every element of A appears in B. If you find even one element of A that is not in B, then A is NOT a subset of B. For small sets, simply compare elements one by one. For larger sets or formal proofs, assume x is an arbitrary element of A and show that x must also be in B. This proof technique is called element chasing. For computational applications, convert both sets to sorted arrays or hash sets, then iterate through A checking membership in B. The time complexity is O(|A| + |B|) with hash sets or O(|A| * log|B|) with sorted arrays and binary search.
What is the union of two sets?
The union of sets A and B, written A union B, is the set of all elements that belong to A, to B, or to both. It combines all distinct elements from both sets into a single set. For example, if A = {1, 2, 3} and B = {3, 4, 5}, then A union B = {1, 2, 3, 4, 5}. Note that the element 3 appears only once in the union because sets contain no duplicates. The cardinality formula is |A union B| = |A| + |B| - |A intersection B|, which accounts for double-counting of shared elements. Union is commutative (A union B = B union A), associative, and has the empty set as its identity element.
What is the intersection of two sets?
The intersection of sets A and B, written A intersection B, is the set of all elements that belong to both A and B simultaneously. For example, if A = {1, 2, 3, 4} and B = {3, 4, 5, 6}, then A intersection B = {3, 4}. If two sets have no common elements, their intersection is the empty set, and the sets are called disjoint. Intersection is commutative, associative, and distributes over union. The cardinality of the intersection is related to the union by |A intersection B| = |A| + |B| - |A union B|. In probability, the intersection of events corresponds to the joint probability of both events occurring.
What is set difference and symmetric difference?
The set difference A minus B (also written A \ B) contains all elements that are in A but NOT in B. For example, if A = {1, 2, 3, 4} and B = {3, 4, 5}, then A minus B = {1, 2}. Note that set difference is NOT commutative: B minus A = {5}. The symmetric difference contains elements that are in either set but NOT in both, equivalent to (A minus B) union (B minus A) = (A union B) minus (A intersection B). Using the same example, the symmetric difference is {1, 2, 5}. Symmetric difference is commutative, associative, and has the empty set as identity. It measures how different two sets are.
How many subsets does a set with n elements have?
A set with n elements has exactly 2^n subsets, including the empty set and the set itself. The number of proper subsets is 2^n - 1 (excluding the set itself), and the number of non-empty subsets is also 2^n - 1 (excluding the empty set). The number of subsets with exactly k elements is the binomial coefficient C(n,k) = n!/(k!(n-k)!). The total count 2^n follows from each element having two independent choices: include or exclude. For example, a set with 5 elements has 2^5 = 32 subsets, of which C(5,0)=1 has size 0, C(5,1)=5 have size 1, C(5,2)=10 have size 2, and so on.
What is the complement of a set?
The complement of set A (relative to a universal set U) is the set of all elements in U that are NOT in A, written as A complement or A-bar. For example, if U = {1, 2, 3, 4, 5} and A = {1, 3, 5}, then the complement of A is {2, 4}. De Morgan laws connect complement with union and intersection: the complement of (A union B) equals (complement of A) intersection (complement of B), and the complement of (A intersection B) equals (complement of A) union (complement of B). The complement depends on the chosen universal set, so it must always be specified or understood from context. The complement of the complement returns the original set.
How are subsets used in probability theory?
In probability, the sample space S is the set of all possible outcomes, and events are subsets of S. The probability of an event A is a measure assigned to the subset A. The probability of A or B is P(A union B), and the probability of A and B is P(A intersection B). The complement rule states P(not A) = 1 - P(A). If A is a subset of B, then P(A) is less than or equal to P(B), which makes intuitive sense since A contains fewer or equal outcomes. Conditional probability P(A|B) = P(A intersection B)/P(B) uses set intersection. The entire framework of probability is built on set theory and subset relationships.
What are Venn diagrams and how do they represent subset relationships?
Venn diagrams are visual representations of sets using overlapping circles or closed curves within a rectangle (representing the universal set). Each circle represents a set, and the overlapping regions represent intersections. If A is a subset of B, circle A is drawn entirely within circle B. Disjoint sets are shown as non-overlapping circles. The four regions in a two-set Venn diagram represent: A only (A minus B), B only (B minus A), both (A intersection B), and neither (complement of A union B). Venn diagrams become impractical for more than three sets because the regions become hard to distinguish, though Edwards-Venn diagrams can handle up to about six sets.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎAnnulus Area Calculator
Calculate annulus area with inputs, formulas, and instant results.
๐งฎArea Calculator
Calculate area with inputs, formulas, and instant results.
๐งฎArea of a Rectangle Calculator
Calculate the area, perimeter, and diagonal of a rectangle. Find missing sides from known area. Convert between metric and imperial area units.
๐งฎArea of Crescent Calculator
Calculate area of crescent with inputs, formulas, and instant results.
๐งฎCenter of Mass Calculator
Calculate center of mass with inputs, formulas, and instant results.
๐งฎCentroid Calculator
Calculate centroid with inputs, formulas, and instant results.
๐งฎChord Length Calculator
Calculate chord length with inputs, formulas, and instant results.
๐งฎConic Sections Calculator
Calculate conic sections with inputs, formulas, and instant results.