On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Sets & Logic · Grade 6-8

Union

The union A∪B is the set of everything that is in A, in B, or in both, with duplicates removed.

A∪B={x:x∈A or x∈B}

Quick Answer

The union A∪B is the set of everything that is in A, in B, or in both, with duplicates removed. Use it when an item counts as long as it meets at least one condition: students who play soccer or basketball, numbers that are even or bigger than 10. To build it, take all of A, then add any members of B not already listed. To count it, use ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣, because members of both sets would otherwise be counted twice.

Why This Matters

Union answers every 'either' question: how many people can come to at least one of two practices, which die rolls win if an even number or a 5 wins. It is the set version of the logical OR, and the overlap rule ∣A∣+∣B∣−∣A∩B∣ is the first counting formula that guards against double-counting. Without it, combined totals come out too large.

Intuitive Explanation

Two friends merge their sticker collections into one album. Maya has {cat, star, rocket}; Jon has {rocket, moon, sun}. The album gets one of each design: {cat, star, rocket, moon, sun}. The rocket was in both collections but takes only one slot. That album is the union: everything that is in at least one of the sets, each listed once.

Because shared members are listed once, the size of a union is usually less than the two sizes added. Maya has 3 designs and Jon has 3, but the album has 5, not 6: 3+3−1=5, where the 1 is the shared rocket. A union is never smaller than either set it came from, and it equals the bigger set exactly when the smaller set fits inside it.

Everyday 'and' can mean union. 'Invite the soccer team and the band' means anyone on either list, so the guest list is S∪B. But 'students in soccer and band' means students in both, which is the intersection S∩B. Ask whether being on one list is enough to qualify (union) or whether both lists are needed (intersection).

Think of it like this. Forming a union is like merging two playlists into one library with duplicates removed: every song from either playlist is in, and a song on both appears once. The picture predicts the count too: two 10-song playlists that share 3 songs merge into 17 songs, not 20.

Core idea. The union gathers all elements in A, in B, or in both, into one set.


When to Use

Use a union when one condition is enough to qualify: 'or', 'either', 'at least one of', 'combined list', everyone who signed up for any session. To count it, add the two sizes and subtract the overlap. If an item must meet both conditions, use intersection instead. If the problem keeps order and repeats, like joining two lists of daily scores end to end, you are joining lists, not taking a union.

Tip. Ask: Does an item belong as long as it is in at least one of the sets?

How to Recognize It

Before joining two sets, look at how many conditions an item must pass to be counted and whether the two groups share any members.

  1. Is passing just one of the two conditions enough for an item to count?

    If yes, take the union. If no, because an item must pass both, you want the intersection, which is never larger than either set.

  2. Could some items belong to both groups, like a student who plays soccer and basketball?

    If yes, list each shared item once and count with ∣A∣+∣B∣−∣A∩B∣. If no, the sets are disjoint, and plain addition, ∣A∣+∣B∣, gives the size of the union.

  3. Does the answer need to keep repeats or an order, like two weeks of daily scores placed end to end?

    If yes, you are joining lists (concatenation), which keeps every copy. If no, a union fits, and each item appears once however many groups it is in.

  4. Is the question about items outside both groups, such as students who play neither sport?

    If yes, find the union first, then take its complement: the total minus ∣A∪B∣. If no, the union itself is the answer.

Union compared with Intersection, Sum of cardinalities, and Concatenation of lists

Union, intersection, adding the counts and joining lists all combine two groups, so their answers get confused. Ask whether one condition is enough, whether shared items are counted once, and whether order and repeats must be kept.

Union

Meaning
Use this when an item qualifies by belonging to at least one of the sets (the OR condition).
Key test
Does an item belong as long as it is in at least one of the sets?
Formula
A∪B={x:x∈A or x∈B}
Example
Let A={1,2,3} and B={3,4,5}. Find A∪B.

Intersection

Meaning
Keeps only elements in BOTH sets, not either.
Key test
Use when an item must satisfy both conditions at once (AND).
Formula
A∩B={x:x∈A and x∈B}
Example
{1,2}∩{2,3}={2}

Sum of cardinalities

Meaning
Adds the counts and double-counts shared members.
Key test
Use only when the sets are disjoint, or correct it with inclusion-exclusion.
Formula
∣A∣+∣B∣−∣A∩B∣
Example
∣A∪B∣≠∣A∣+∣B∣ when they overlap

Concatenation of lists

Meaning
Joins lists keeping order and duplicates.
Key test
Use when order and repeats matter, not for sets.
Example
[1,2]+[2,3]=[1,2,2,3]

Formula & Notation

A∪B={x:x∈A or x∈B}
A∪B={x:x∈A∨x∈B}

How to read it: A∪B

Worked Examples

Example 1 — Combine two sets

Easy

Let A={1,2,3} and B={3,4,5}. Find A∪B.
Show the steps and the answer
  1. Start with all of A: 1,2,3.

    Every member of A belongs to the union, since being in A alone is enough.

  2. Go through B: 3 is already listed, so skip it; add 4 and 5.

    A set lists each member once, so the shared 3 is not written twice.

  3. Write A∪B={1,2,3,4,5}.

    These are exactly the numbers in at least one of the two sets.

  4. Check the count: ∣A∣+∣B∣−∣A∩B∣=3+3−1=5.

    The union has 5 members, one fewer than 3+3, because of the shared 3.

Answer: A∪B={1,2,3,4,5}

Takeaway: Take one set whole, then add only the new members of the other; the overlap is what keeps the union smaller than the sum of the sizes.

Example 2 — Both, not either

Standard

With A={1,2,3} and B={3,4,5}, what is the set of elements in BOTH?
Show the steps and the answer
  1. Read the condition: an element must be in A and also in B.

    The word 'both' means one set is not enough, so the answer is not the union.

  2. Test each member of A: 1∉B, 2∉B, 3∈B.

    Anything in both sets must be in A, so checking the three members of A covers every candidate.

  3. Keep only 3: A∩B={3}.

    That is the intersection, the shared part of the two sets.

  4. Compare with the union {1,2,3,4,5}: the intersection sits inside it and is much smaller.

    'Both' narrows the set; 'either' widens it.

Answer: A∩B={3}

Takeaway: 'Either' builds a union and 'both' builds an intersection; the same two sets give 5 members for one and 1 member for the other.

Example 3 — Find the mistake: adding overlapping counts

Application

In a class, 14 students have a dog and 9 have a cat; 4 of them have both. Ravi writes: "The number of students with a dog or a cat is 14+9=23." Find the mistake and correct it.
Show the steps and the answer
  1. Notice that the 4 students with both pets are inside the 14 and again inside the 9.

    Adding the two counts includes each of those 4 students twice, but each belongs to the union once.

  2. Subtract the overlap once: 14+9−4=19.

    That is ∣D∪C∣=∣D∣+∣C∣−∣D∩C∣, which counts every student exactly once.

  3. Check by regions: dog only 14−4=10, cat only 9−4=5, both 4; total 10+5+4=19.

    Three non-overlapping groups can be added directly, and they give the same 19.

Answer: 19 students have a dog or a cat.

Takeaway: When sets overlap, the size of the union is the sum of the sizes minus the overlap; plain addition works only for sets with nothing in common.

Where You'll See It

  • Party invitations from two groups

    You invite your soccer team (11 people) and your art club (8 people), and 3 friends are in both. The guest list is the union, with 11+8−3=16 people. Sending one invitation per person rather than per list keeps those 3 friends from getting two.

  • Library searches with OR

    Searching a catalogue for 'cats OR dogs' returns the union: every book tagged cats, every book tagged dogs, and a book tagged both listed once. If 40 books are about cats, 55 about dogs and 12 about both, the search shows 40+55−12=83 results.

  • Stops you can reach by bus

    From your stop, Route 5 serves {Park, Mall, School} and Route 12 serves {Mall, Library, Station}. The places you can reach without changing buses are the union {Park, Mall, School, Library, Station}: 5 stops, with the Mall counted once even though both routes serve it.

Common Mistakes

  1. The slip: Writing a shared element twice in the union

    Instead: the union, being a set, lists each element once.

  2. The slip: Confusing ∪ (or, combine) with ∩ (and, overlap)

    Instead: union grows or stays the same, intersection shrinks or stays the same.

  3. The slip: Sizing a union as ∣A∣+∣B∣ when the sets overlap

    Instead: subtract ∣A∩B∣ to avoid double-counting.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Let A={2,4,6,8} and B={1,2,3,4}. Find A∪B.

    Hint: List everything that appears in at least one set.

  2. Let A={a,e,i} and B={o,u}. Find A∪B and ∣A∪B∣.

    Hint: Do the two sets share any elements?

  3. If ∣A∣=12, ∣B∣=9 and ∣A∩B∣=4, find ∣A∪B∣.

    Hint: Adding 12 and 9 counts the shared elements twice.

  4. Let A be the set of factors of 12 and B the set of factors of 18. Find A∪B.

    Hint: List the factors of each number first.

  5. A club lets in anyone who plays chess or plays piano. Of 30 students, is the member list the union or the intersection of the two groups?

    Hint: Does a member need to do one activity, or both?

  6. With A={5,6,7} and B={6,7,8}, Jo writes A∪B={5,6,6,7,7,8} with 6 elements. Correct Jo.

    Hint: How many times can one element appear in a set?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

What is the union of a set with itself?

It is the same set: A∪A=AA \cup A = A. Joining a set to a copy of itself adds nothing new, because every member is already there and a set never records a member twice. Intersection behaves the same way, A∩A=AA \cap A = A. Compare this with numbers, where 5+55 + 5 is 10, not 5. Union looks a bit like addition, but here it does not behave like addition.

Can I take the union of three or more sets?

Yes. A∪B∪CA \cup B \cup C holds everything in at least one of the three sets, and the grouping does not matter: (A∪B)∪C=A∪(B∪C)(A \cup B) \cup C = A \cup (B \cup C). Counting takes longer: ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|. The last term adds back the centre region, which the three subtractions removed completely.

Is 'or' in everyday English the same as a union?

Not always. A menu offering 'soup or salad' usually means one but not both, which is called exclusive or. A union uses the inclusive or: an item in both sets is in the union. So 'students who take French or Spanish' includes those who take both. If a question really means one but not both, count ∣A∣+∣B∣−2∣A∩B∣|A| + |B| - 2|A \cap B|, removing the overlap from each set.

Where would I see a union outside math class?

Searching online for 'cats OR dogs' returns pages about either animal, the union of two sets of results. When two friends merge their contact lists, a phone that removes duplicates is taking a union. A school emailing families about two events takes the union of both sign-up lists, so a family on both lists gets one email instead of two.

Learning Path

← Before

Set
Union

You are here

You need Set first: a collection in which each member appears once. Union adds a way to combine two sets, keeping everything from either one. Next, Intersection keeps only what the sets share, and the Venn Diagram puts both on one picture so you can count each region without double-counting.

See Also