Math Fundamentals18 sections · 814 units
Open in Course

Vocabulary - Union

Combine both sets

The union of sets AA and BB is the set of all elements in either AA or BB or both. You write ABA \cup B.

For example, if A={1,2}A = \{1, 2\} and B={2,3}B = \{2, 3\}, then AB={1,2,3}A \cup B = \{1, 2, 3\}. Notice that 22 appears in both sets, but the union lists it once because sets have no duplicates.

Union merges sets together. In code, this is like adding all items from two lists into one set, removing duplicates automatically.