The union of two or more sets is a new set that contains all the distinct elements from all the sets combined. It is denoted by the symbol ∪. The union operation represents the logical 'OR', meaning an element is included in the union if it belongs to set A, or to set B, or to both.
| Symbol | Meaning |
|---|---|
| A ∪ B | Union of A and B |
| x ∈ A | Element x belongs to set A |
| ∨ | Logical OR |
| |A| | Cardinality (number of elements) of set A |
| ∅ | The empty set |
A Venn diagram for the union of two sets, A and B, shows two overlapping circles. The union, A ∪ B, is represented by the entire area covered by both circles, including their overlapping region. This visually demonstrates that the union contains all elements from set A, all elements from set B, and all elements common to both.
The union operation follows several fundamental algebraic laws.
Let's prove the Principle of Inclusion-Exclusion for two sets: |A ∪ B| = |A| + |B| - |A ∩ B|.
The union A ∪ B can be expressed as the union of three disjoint sets: elements only in A (A - B), elements only in B (B - A), and elements in both (A ∩ B).
Since these three sets are disjoint, the cardinality of their union is the sum of their individual cardinalities.
We also know that |A| = |A - B| + |A ∩ B| and |B| = |B - A| + |A ∩ B|. Rearranging these gives |A - B| = |A| - |A ∩ B| and |B - A| = |B| - |A ∩ B|.
Substituting these back into the equation for |A ∪ B|:
Simplifying the expression, we arrive at the final formula:
💾 Database Operations: In database management, the SQL UNION operator combines the result sets of two or more SELECT statements into a single result set. This is crucial for integrating data from different tables to create comprehensive reports.
🔍 Search Engines: When you perform a search using the 'OR' operator (e.g., 'cats OR dogs'), the search engine finds all documents containing 'cats', all documents containing 'dogs', and combines these results. This is a direct application of the union concept to aggregate information.
📊 Market Research: Analysts combine different customer segments to understand the total market. For example, the union of 'customers who bought product X' and 'customers who visited the website' gives a complete list of all engaged or purchasing customers.
🏥 Healthcare & Medical Systems: Medical researchers might take the union of patient groups with different symptoms to identify all individuals who might have a particular disease. This helps in forming comprehensive study populations for clinical trials.
Merging Music Playlists: Imagine you and a friend want to create an ultimate road trip playlist. You combine your 'Classic Rock' playlist with their '80s Hits' playlist. The resulting master playlist is the union of the two, containing every song from both lists without duplicates.
Combining Contact Lists: When you get a new phone, you might merge the contacts from your old phone's address book with the contacts stored in your email account. The final, unified contact list on your new phone is the union of these two sets of contacts.
Aggregating Food Allergies: When planning a dinner party, you ask each guest for their dietary restrictions. To create a list of all ingredients to avoid, you take the union of each person's allergy list. The final list includes every single ingredient that at least one guest is allergic to.
Disjoint Union: This is a special case where the sets have no elements in common (their intersection is the empty set). In this case, the cardinality is simply the sum of the individual cardinalities: |A ∪ B| = |A| + |B|.
Finite vs. Infinite Union: A union can be performed on a finite number of sets (e.g., A ∪ B ∪ C) or an infinite number of sets. An infinite union, like ⋃_{n=1}^{∞} A_n, combines elements from a countably infinite sequence of sets.
Partition of a Set: A collection of non-empty subsets {A_i} forms a partition of a set S if they are mutually disjoint and their union is equal to S. This is a fundamental concept in combinatorics and probability.
Forgetting to Remove Duplicates: A common error is simply listing all elements from both sets without removing the duplicates. The union of {1, 2} and {2, 3} is {1, 2, 3}, not {1, 2, 2, 3}. A set only contains unique elements.
Confusing Union (∪) with Intersection (∩): Students often mix up the symbols. Remember, the 'U' in Union looks like a cup holding everything from both sets. Intersection's symbol (∩) looks like a bridge connecting only the common elements.
Incorrectly Calculating Cardinality: A frequent mistake is to assume |A ∪ B| = |A| + |B|. This is only true if the sets are disjoint. For overlapping sets, you must subtract the cardinality of the intersection (|A ∩ B|) to avoid double-counting.