Lemonmath
Tiếng Việt

Sets and set operations

Lesson 1.2 · 18 min read · Updated

Your class, the songs on your phone, the even numbers: we group things all the time. Mathematics gives such a group a name, a set, and a few simple tools for working with it. Almost every later topic, from equations to probability, is written in this language.

Sets and elements

A set is a collection of distinct objects, called its elements. We write a∈Aa \in A if aa is an element of AA and a∉Aa \notin A if it is not.

There are two ways to describe a set.

  • Listing: A={2,4,6,8}A=\{2,4,6,8\}. The order does not matter and repeating an element changes nothing.
  • By a property: A={x∈N∣x is even and x≤8, x>0}A=\{x \in \mathbb{N} \mid x \text{ is even and } x \le 8,\ x>0\}. Read "the set of all xx in N\mathbb{N} such that ...".

The number of elements of a finite set AA is written n(A)n(A). The empty set ∅\emptyset has no element, so n(∅)=0n(\emptyset)=0.

Subsets and equal sets

For example {1,2}⊂{1,2,3}\{1,2\}\subset\{1,2,3\}. The set {1,2,3}\{1,2,3\} has 88 subsets: ∅\emptyset, {1}\{1\}, {2}\{2\}, {3}\{3\}, {1,2}\{1,2\}, {1,3}\{1,3\}, {2,3}\{2,3\}, {1,2,3}\{1,2,3\}.

Number sets

  • N={0,1,2,3,… }\mathbb{N}=\{0,1,2,3,\dots\} natural numbers, and N∗={1,2,3,… }\mathbb{N}^*=\{1,2,3,\dots\} positive integers.
  • Z\mathbb{Z}: integers …,−2,−1,0,1,2,…\dots,-2,-1,0,1,2,\dots
  • Q\mathbb{Q}: rational numbers, those of the form pq\dfrac{p}{q} with p,q∈Zp,q\in\mathbb{Z}, q≠0q\neq 0.
  • R\mathbb{R}: real numbers, all points of the number line.

They are nested: N∗⊂N⊂Z⊂Q⊂R\mathbb{N}^*\subset\mathbb{N}\subset\mathbb{Z}\subset\mathbb{Q}\subset\mathbb{R}. The number 2\sqrt{2} belongs to R\mathbb{R} but not to Q\mathbb{Q}.

Intervals

Many subsets of R\mathbb{R} are pieces of the number line. Let a<ba<b.

Set Name Notation
{x∣a<x<b}\{x \mid a<x<b\} open interval (a,b)(a, b)
{x∣a≤x≤b}\{x \mid a\le x\le b\} closed interval (segment) [a,b][a, b]
{x∣a≤x<b}\{x \mid a\le x<b\} half-open interval [a,b)[a, b)
{x∣a<x≤b}\{x \mid a<x\le b\} half-open interval (a,b](a, b]
{x∣x>a}\{x \mid x>a\} and {x∣x≥a}\{x\mid x\ge a\} rays (a,+∞)(a, +\infty) and [a,+∞)[a, +\infty)
{x∣x<b}\{x \mid x<b\} and {x∣x≤b}\{x\mid x\le b\} rays (−∞,b)(-\infty, b) and (−∞,b](-\infty, b]

A square bracket means the end is included (filled dot), a round bracket means it is excluded (hollow dot). Infinity is never included.

-3-2-112345-1-0.8-0.6-0.4-0.20.20.40.60.81xyO-13
The interval [−1,3)[-1, 3)
-3-2-112345-1-0.8-0.6-0.4-0.20.20.40.60.81xyO2-∞
The ray (−∞,2](-\infty, 2]

Operations on sets

AB1, 23, 45, 6
Venn diagram of AA and BB

Operations on intervals

Counting elements

For finite sets, adding n(A)+n(B)n(A)+n(B) counts the elements of A∩BA\cap B twice, so we subtract them once:

Key terms

Summary

  • A set is described by listing its elements or by a property; ∅\emptyset is the empty set; A⊂BA\subset B means every element of AA is in BB.
  • N∗⊂N⊂Z⊂Q⊂R\mathbb{N}^*\subset\mathbb{N}\subset\mathbb{Z}\subset\mathbb{Q}\subset\mathbb{R}.
  • Intervals use square brackets for included ends and round brackets for excluded ends; infinity always gets a round bracket.
  • Union means "or", intersection means "and", difference A∖BA\setminus B means "in AA but not in BB", complement is E∖AE\setminus A.
  • n(A∪B)=n(A)+n(B)−n(A∩B)n(A\cup B)=n(A)+n(B)-n(A\cap B).

Practice

Show solutions
  1. (a) {2,3,4,5,6}\{2,3,4,5,6\}. (b) {−2,−1,0,1,2}\{-2,-1,0,1,2\}. (c) x2=9x^2=9 gives x=±3x=\pm 3: {−3,3}\{-3,3\}.
  2. (a) The odd natural numbers less than 1212: {x∈N∣x odd, x<12}\{x\in\mathbb{N}\mid x\text{ odd},\ x<12\}. (b) The positive multiples of 33 that are at most 1818: {x∈N∗∣x=3k, k∈N∗, x≤18}\{x\in\mathbb{N}^*\mid x=3k,\ k\in\mathbb{N}^*,\ x\le 18\}.
  3. (a) True. (b) False, −3-3 is negative. (c) True. (d) False, 2\sqrt2 is irrational. (e) True, every integer kk equals k1\frac{k}{1}. (f) False, 00 is not positive.
  4. A subset containing 11 is {1}\{1\} together with a subset of {2,3}\{2,3\}: {1}\{1\}, {1,2}\{1,2\}, {1,3}\{1,3\}, {1,2,3}\{1,2,3\}. There are 44 (half of the 88 subsets).
  5. (a) (−1,4](-1, 4]. (b) [2,+∞)[2, +\infty). (c) (−∞,0)(-\infty, 0).
  6. A∩B=(0,2]A\cap B=(0, 2]. A∪B=[−3,6)A\cup B=[-3, 6). A∖B=[−3,0]A\setminus B=[-3, 0] (00 is not in BB). B∖A=(2,6)B\setminus A=(2, 6) (22 is in AA, so it is removed).
  7. A={0,1,2,3,4,5,6}A=\{0,1,2,3,4,5,6\}, B={0,2,4,6,8,10}B=\{0,2,4,6,8,10\}. A∩B={0,2,4,6}A\cap B=\{0,2,4,6\}. A∪B={0,1,2,3,4,5,6,8,10}A\cup B=\{0,1,2,3,4,5,6,8,10\}. A∖B={1,3,5}A\setminus B=\{1,3,5\}. Check: n(A∪B)=9n(A\cup B)=9 and 7+6−4=97+6-4=9.
  8. n(A∪B)=45n(A\cup B)=45, so 45=30+22−n(A∩B)45=30+22-n(A\cap B), hence n(A∩B)=52−45=7n(A\cap B)=52-45=7.
  9. The numbers not in AA are those with x>1x>1 and x≤4x\le 4: the complement is (1,4](1, 4].
  10. (a) At least one language: 60+45−20=8560+45-20=85. Exactly one: 85−20=6585-20=65 (or 40+2540+25). Neither: 100−85=15100-85=15. (b) We need m≥0m\ge 0 and m+2≤5m+2\le 5, i.e. 0≤m≤30\le m\le 3.