Learning goals
Describe a set by listing its elements or by a property, and use ∈ \in ∈ , ∉ \notin ∈ / , ⊂ \subset ⊂ , ∅ \emptyset ∅ .
Recognise the number sets N \mathbb{N} N , N ∗ \mathbb{N}^* N ∗ , Z \mathbb{Z} Z , Q \mathbb{Q} Q , R \mathbb{R} R and write intervals, half-intervals and rays.
Find the union, intersection, difference and complement of sets, and draw Venn diagrams.
Count elements with n ( A ∪ B ) = n ( A ) + n ( B ) − n ( A ∩ B ) n(A\cup B)=n(A)+n(B)-n(A\cap B) n ( A ∪ B ) = n ( A ) + n ( B ) − n ( A ∩ B ) .
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 ∈ A a \in A a ∈ A if a a a is an element of A A A and a ∉ A a \notin A a ∈ / A if it is not.
There are two ways to describe a set.
Listing : A = { 2 , 4 , 6 , 8 } 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\} A = { x ∈ N ∣ x is even and x ≤ 8 , x > 0 } . Read "the set of all x x x in N \mathbb{N} N such that ...".
The number of elements of a finite set A A A is written n ( A ) n(A) n ( A ) . The empty set ∅ \emptyset ∅ has no element, so n ( ∅ ) = 0 n(\emptyset)=0 n ( ∅ ) = 0 .
Example Describing sets
Write each set by listing its elements.
(a) A = { x ∈ N ∣ 2 < x ≤ 7 } A=\{x \in \mathbb{N} \mid 2<x\le 7\} A = { x ∈ N ∣ 2 < x ≤ 7 } . (b) B = { x ∈ R ∣ x 2 − 5 x + 6 = 0 } B=\{x \in \mathbb{R} \mid x^2-5x+6=0\} B = { x ∈ R ∣ x 2 − 5 x + 6 = 0 } . (c) C = { x ∈ Z ∣ x 2 < 2 } C=\{x \in \mathbb{Z} \mid x^2<2\} C = { x ∈ Z ∣ x 2 < 2 } .
Solution.
(a) The natural numbers greater than 2 2 2 and at most 7 7 7 are 3 , 4 , 5 , 6 , 7 3,4,5,6,7 3 , 4 , 5 , 6 , 7 . So A = { 3 , 4 , 5 , 6 , 7 } A=\{3,4,5,6,7\} A = { 3 , 4 , 5 , 6 , 7 } .
(b) x 2 − 5 x + 6 = ( x − 2 ) ( x − 3 ) = 0 x^2-5x+6=(x-2)(x-3)=0 x 2 − 5 x + 6 = ( x − 2 ) ( x − 3 ) = 0 gives x = 2 x=2 x = 2 or x = 3 x=3 x = 3 . So B = { 2 , 3 } B=\{2,3\} B = { 2 , 3 } .
(c) The integers whose square is less than 2 2 2 are − 1 , 0 , 1 -1,0,1 − 1 , 0 , 1 . So C = { − 1 , 0 , 1 } C=\{-1,0,1\} C = { − 1 , 0 , 1 } .
Subsets and equal sets
Definition Subset and equality
A A A is a subset of B B B , written A ⊂ B A \subset B A ⊂ B , if every element of A A A is also an element of B B B . Two sets are equal , A = B A=B A = B , if A ⊂ B A\subset B A ⊂ B and B ⊂ A B\subset A B ⊂ A . The empty set is a subset of every set.
For example { 1 , 2 } ⊂ { 1 , 2 , 3 } \{1,2\}\subset\{1,2,3\} { 1 , 2 } ⊂ { 1 , 2 , 3 } . The set { 1 , 2 , 3 } \{1,2,3\} { 1 , 2 , 3 } has 8 8 8 subsets: ∅ \emptyset ∅ , { 1 } \{1\} { 1 } , { 2 } \{2\} { 2 } , { 3 } \{3\} { 3 } , { 1 , 2 } \{1,2\} { 1 , 2 } , { 1 , 3 } \{1,3\} { 1 , 3 } , { 2 , 3 } \{2,3\} { 2 , 3 } , { 1 , 2 , 3 } \{1,2,3\} { 1 , 2 , 3 } .
Number sets
N = { 0 , 1 , 2 , 3 , … } \mathbb{N}=\{0,1,2,3,\dots\} N = { 0 , 1 , 2 , 3 , … } natural numbers, and N ∗ = { 1 , 2 , 3 , … } \mathbb{N}^*=\{1,2,3,\dots\} N ∗ = { 1 , 2 , 3 , … } positive integers.
Z \mathbb{Z} Z : integers … , − 2 , − 1 , 0 , 1 , 2 , … \dots,-2,-1,0,1,2,\dots … , − 2 , − 1 , 0 , 1 , 2 , …
Q \mathbb{Q} Q : rational numbers, those of the form p q \dfrac{p}{q} q p with p , q ∈ Z p,q\in\mathbb{Z} p , q ∈ Z , q ≠ 0 q\neq 0 q = 0 .
R \mathbb{R} 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} N ∗ ⊂ N ⊂ Z ⊂ Q ⊂ R . The number 2 \sqrt{2} 2 belongs to R \mathbb{R} R but not to Q \mathbb{Q} Q .
Intervals
Many subsets of R \mathbb{R} R are pieces of the number line. Let a < b a<b a < b .
Set
Name
Notation
{ x ∣ a < x < b } \{x \mid a<x<b\} { x ∣ a < x < b }
open interval
( a , b ) (a, b) ( a , b )
{ x ∣ a ≤ x ≤ b } \{x \mid a\le x\le b\} { x ∣ a ≤ x ≤ b }
closed interval (segment)
[ a , b ] [a, b] [ a , b ]
{ x ∣ a ≤ x < b } \{x \mid a\le x<b\} { x ∣ a ≤ x < b }
half-open interval
[ a , b ) [a, b) [ a , b )
{ x ∣ a < x ≤ b } \{x \mid a<x\le b\} { x ∣ a < x ≤ b }
half-open interval
( a , b ] (a, b] ( a , b ]
{ x ∣ x > a } \{x \mid x>a\} { x ∣ x > a } and { x ∣ x ≥ a } \{x\mid x\ge a\} { x ∣ x ≥ a }
rays
( a , + ∞ ) (a, +\infty) ( a , + ∞ ) and [ a , + ∞ ) [a, +\infty) [ a , + ∞ )
{ x ∣ x < b } \{x \mid x<b\} { x ∣ x < b } and { x ∣ x ≤ b } \{x\mid x\le b\} { x ∣ x ≤ b }
rays
( − ∞ , b ) (-\infty, b) ( − ∞ , b ) and ( − ∞ , b ] (-\infty, b] ( − ∞ , 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 -1 1 2 3 4 5 -1 -0.8 -0.6 -0.4 -0.2 0.2 0.4 0.6 0.8 1 x y O -1 3 The interval [ − 1 , 3 ) [-1, 3) [ − 1 , 3 ) -3 -2 -1 1 2 3 4 5 -1 -0.8 -0.6 -0.4 -0.2 0.2 0.4 0.6 0.8 1 x y O 2 -∞ The ray ( − ∞ , 2 ] (-\infty, 2] ( − ∞ , 2 ] Operations on sets
Definition Union, intersection, difference, complement
Union A ∪ B A\cup B A ∪ B : elements belonging to A A A or B B B (or both).
Intersection A ∩ B A\cap B A ∩ B : elements belonging to both A A A and B B B .
Difference A ∖ B A\setminus B A ∖ B : elements of A A A that are not in B B B .
Complement : if A ⊂ E A\subset E A ⊂ E , the complement of A A A in E E E is A c = E ∖ A A^c=E\setminus A A c = E ∖ A .
Example Operations on finite sets
Let E = { 1 , 2 , … , 8 } E=\{1,2,\dots,8\} E = { 1 , 2 , … , 8 } , A = { 1 , 2 , 3 , 4 } A=\{1,2,3,4\} A = { 1 , 2 , 3 , 4 } , B = { 3 , 4 , 5 , 6 } B=\{3,4,5,6\} B = { 3 , 4 , 5 , 6 } . Find A ∪ B A\cup B A ∪ B , A ∩ B A\cap B A ∩ B , A ∖ B A\setminus B A ∖ B , B ∖ A B\setminus A B ∖ A and the complement of A A A in E E E .
Solution.
A ∪ B A\cup B A ∪ B : put everything together without repeats: { 1 , 2 , 3 , 4 , 5 , 6 } \{1,2,3,4,5,6\} { 1 , 2 , 3 , 4 , 5 , 6 } .
A ∩ B A\cap B A ∩ B : elements in both lists: { 3 , 4 } \{3,4\} { 3 , 4 } .
A ∖ B A\setminus B A ∖ B : elements of A A A not in B B B : { 1 , 2 } \{1,2\} { 1 , 2 } . Similarly B ∖ A = { 5 , 6 } B\setminus A=\{5,6\} B ∖ A = { 5 , 6 } .
The complement of A A A in E E E : elements of E E E not in A A A : { 5 , 6 , 7 , 8 } \{5,6,7,8\} { 5 , 6 , 7 , 8 } .
A B 1, 2 3, 4 5, 6 Venn diagram of A A A and B B B Operations on intervals
Example Operations on intervals
Let A = [ − 2 , 3 ] A=[-2, 3] A = [ − 2 , 3 ] and B = ( 1 , 5 ) B=(1, 5) B = ( 1 , 5 ) . Find A ∩ B A\cap B A ∩ B , A ∪ B A\cup B A ∪ B , A ∖ B A\setminus B A ∖ B and the complement of A A A in R \mathbb{R} R .
Solution. Draw both on the number line and read off.
A ∩ B A\cap B A ∩ B : numbers that are ≥ − 2 \ge -2 ≥ − 2 , ≤ 3 \le 3 ≤ 3 and > 1 >1 > 1 , < 5 <5 < 5 . So 1 < x ≤ 3 1<x\le 3 1 < x ≤ 3 : A ∩ B = ( 1 , 3 ] A\cap B=(1, 3] A ∩ B = ( 1 , 3 ] .
A ∪ B A\cup B A ∪ B : from − 2 -2 − 2 (included) up to 5 5 5 (excluded), with no gap since B B B starts inside A A A : A ∪ B = [ − 2 , 5 ) A\cup B=[-2, 5) A ∪ B = [ − 2 , 5 ) .
A ∖ B A\setminus B A ∖ B : points of A A A that are not in ( 1 , 5 ) (1,5) ( 1 , 5 ) . That leaves − 2 ≤ x ≤ 1 -2\le x\le 1 − 2 ≤ x ≤ 1 , and 1 1 1 is not in B B B , so it stays: A ∖ B = [ − 2 , 1 ] A\setminus B=[-2, 1] A ∖ B = [ − 2 , 1 ] .
Complement of A A A : x < − 2 x<-2 x < − 2 or x > 3 x>3 x > 3 , so ( − ∞ , − 2 ) ∪ ( 3 , + ∞ ) (-\infty, -2)\cup(3, +\infty) ( − ∞ , − 2 ) ∪ ( 3 , + ∞ ) .
Counting elements
For finite sets, adding n ( A ) + n ( B ) n(A)+n(B) n ( A ) + n ( B ) counts the elements of A ∩ B A\cap B A ∩ B twice, so we subtract them once:
Watch out Common mistake
Writing [ a , + ∞ ] [a, +\infty] [ a , + ∞ ] or ( a , + ∞ ] (a, +\infty] ( a , + ∞ ] is wrong: ∞ \infty ∞ is not a number, so the bracket next to it is always round. Also, A ∪ B A\cup B A ∪ B is not "n ( A ) + n ( B ) n(A)+n(B) n ( A ) + n ( B ) " elements when the sets overlap.
Key terms
Key terms
English Tiếng Việt set tập hợp element phần tử empty set tập rỗng subset tập hợp con equal sets hai tập hợp bằng nhau interval khoảng segment (closed interval) đoạn half-open interval nửa khoảng union hợp intersection giao difference hiệu complement phần bù
Summary
A set is described by listing its elements or by a property; ∅ \emptyset ∅ is the empty set; A ⊂ B A\subset B A ⊂ B means every element of A A A is in B B B .
N ∗ ⊂ N ⊂ Z ⊂ Q ⊂ R \mathbb{N}^*\subset\mathbb{N}\subset\mathbb{Z}\subset\mathbb{Q}\subset\mathbb{R} N ∗ ⊂ N ⊂ Z ⊂ Q ⊂ 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 ∖ B A\setminus B A ∖ B means "in A A A but not in B B B ", complement is E ∖ A E\setminus A E ∖ A .
n ( A ∪ B ) = n ( A ) + n ( B ) − n ( A ∩ B ) n(A\cup B)=n(A)+n(B)-n(A\cap B) n ( A ∪ B ) = n ( A ) + n ( B ) − n ( A ∩ B ) .
Practice
Practice
List the elements: (a) { x ∈ N ∣ 1 < x ≤ 6 } \{x\in\mathbb{N}\mid 1<x\le 6\} { x ∈ N ∣ 1 < x ≤ 6 } , (b) { x ∈ Z ∣ − 2 ≤ x < 3 } \{x\in\mathbb{Z}\mid -2\le x<3\} { x ∈ Z ∣ − 2 ≤ x < 3 } , (c) { x ∈ R ∣ x 2 = 9 } \{x\in\mathbb{R}\mid x^2=9\} { x ∈ R ∣ x 2 = 9 } .
Write by a property: (a) { 1 , 3 , 5 , 7 , 9 , 11 } \{1,3,5,7,9,11\} { 1 , 3 , 5 , 7 , 9 , 11 } , (b) { 3 , 6 , 9 , 12 , 15 , 18 } \{3,6,9,12,15,18\} { 3 , 6 , 9 , 12 , 15 , 18 } .
True or false: (a) 5 ∈ N ∗ 5\in\mathbb{N}^* 5 ∈ N ∗ , (b) − 3 ∈ N -3\in\mathbb{N} − 3 ∈ N , (c) 1 2 ∈ Q \tfrac12\in\mathbb{Q} 2 1 ∈ Q , (d) 2 ∈ Q \sqrt{2}\in\mathbb{Q} 2 ∈ Q , (e) Z ⊂ Q \mathbb{Z}\subset\mathbb{Q} Z ⊂ Q , (f) 0 ∈ N ∗ 0\in\mathbb{N}^* 0 ∈ N ∗ .
List all subsets of { 1 , 2 , 3 } \{1,2,3\} { 1 , 2 , 3 } that contain the element 1 1 1 . How many are there?
Write as an interval: (a) { x ∈ R ∣ − 1 < x ≤ 4 } \{x\in\mathbb{R}\mid -1<x\le 4\} { x ∈ R ∣ − 1 < x ≤ 4 } , (b) { x ∈ R ∣ x ≥ 2 } \{x\in\mathbb{R}\mid x\ge 2\} { x ∈ R ∣ x ≥ 2 } , (c) { x ∈ R ∣ x < 0 } \{x\in\mathbb{R}\mid x<0\} { x ∈ R ∣ x < 0 } .
Let A = [ − 3 , 2 ] A=[-3, 2] A = [ − 3 , 2 ] and B = ( 0 , 6 ) B=(0, 6) B = ( 0 , 6 ) . Find A ∩ B A\cap B A ∩ B , A ∪ B A\cup B A ∪ B , A ∖ B A\setminus B A ∖ B , B ∖ A B\setminus A B ∖ A .
Let A = { x ∈ N ∣ x ≤ 6 } A=\{x\in\mathbb{N}\mid x\le 6\} A = { x ∈ N ∣ x ≤ 6 } and B = { x ∈ N ∣ x even , x ≤ 10 } B=\{x\in\mathbb{N}\mid x\text{ even},\ x\le 10\} B = { x ∈ N ∣ x even , x ≤ 10 } . Find A ∩ B A\cap B A ∩ B , A ∪ B A\cup B A ∪ B , A ∖ B A\setminus B A ∖ B and check the counting formula.
In a class of 45 45 45 students, 30 30 30 like maths, 22 22 22 like literature and every student likes at least one of them. How many like both?
Let A = ( − ∞ , 1 ] ∪ ( 4 , + ∞ ) A=(-\infty, 1]\cup(4, +\infty) A = ( − ∞ , 1 ] ∪ ( 4 , + ∞ ) . Find the complement of A A A in R \mathbb{R} R .
Challenge. (a) Among 100 100 100 students, 60 60 60 speak English, 45 45 45 speak French and 20 20 20 speak both. How many speak exactly one of the two languages, and how many speak neither? (b) Find all real m m m with [ m , m + 2 ] ⊂ [ 0 , 5 ] [m, m+2]\subset[0, 5] [ m , m + 2 ] ⊂ [ 0 , 5 ] .
Show solutions
(a) { 2 , 3 , 4 , 5 , 6 } \{2,3,4,5,6\} { 2 , 3 , 4 , 5 , 6 } . (b) { − 2 , − 1 , 0 , 1 , 2 } \{-2,-1,0,1,2\} { − 2 , − 1 , 0 , 1 , 2 } . (c) x 2 = 9 x^2=9 x 2 = 9 gives x = ± 3 x=\pm 3 x = ± 3 : { − 3 , 3 } \{-3,3\} { − 3 , 3 } .
(a) The odd natural numbers less than 12 12 12 : { x ∈ N ∣ x odd , x < 12 } \{x\in\mathbb{N}\mid x\text{ odd},\ x<12\} { x ∈ N ∣ x odd , x < 12 } . (b) The positive multiples of 3 3 3 that are at most 18 18 18 : { x ∈ N ∗ ∣ x = 3 k , k ∈ N ∗ , x ≤ 18 } \{x\in\mathbb{N}^*\mid x=3k,\ k\in\mathbb{N}^*,\ x\le 18\} { x ∈ N ∗ ∣ x = 3 k , k ∈ N ∗ , x ≤ 18 } .
(a) True. (b) False, − 3 -3 − 3 is negative. (c) True. (d) False, 2 \sqrt2 2 is irrational. (e) True, every integer k k k equals k 1 \frac{k}{1} 1 k . (f) False, 0 0 0 is not positive.
A subset containing 1 1 1 is { 1 } \{1\} { 1 } together with a subset of { 2 , 3 } \{2,3\} { 2 , 3 } : { 1 } \{1\} { 1 } , { 1 , 2 } \{1,2\} { 1 , 2 } , { 1 , 3 } \{1,3\} { 1 , 3 } , { 1 , 2 , 3 } \{1,2,3\} { 1 , 2 , 3 } . There are 4 4 4 (half of the 8 8 8 subsets).
(a) ( − 1 , 4 ] (-1, 4] ( − 1 , 4 ] . (b) [ 2 , + ∞ ) [2, +\infty) [ 2 , + ∞ ) . (c) ( − ∞ , 0 ) (-\infty, 0) ( − ∞ , 0 ) .
A ∩ B = ( 0 , 2 ] A\cap B=(0, 2] A ∩ B = ( 0 , 2 ] . A ∪ B = [ − 3 , 6 ) A\cup B=[-3, 6) A ∪ B = [ − 3 , 6 ) . A ∖ B = [ − 3 , 0 ] A\setminus B=[-3, 0] A ∖ B = [ − 3 , 0 ] (0 0 0 is not in B B B ). B ∖ A = ( 2 , 6 ) B\setminus A=(2, 6) B ∖ A = ( 2 , 6 ) (2 2 2 is in A A A , so it is removed).
A = { 0 , 1 , 2 , 3 , 4 , 5 , 6 } 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\} B = { 0 , 2 , 4 , 6 , 8 , 10 } . A ∩ B = { 0 , 2 , 4 , 6 } A\cap B=\{0,2,4,6\} A ∩ 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 = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 8 , 10 } . A ∖ B = { 1 , 3 , 5 } A\setminus B=\{1,3,5\} A ∖ B = { 1 , 3 , 5 } . Check: n ( A ∪ B ) = 9 n(A\cup B)=9 n ( A ∪ B ) = 9 and 7 + 6 − 4 = 9 7+6-4=9 7 + 6 − 4 = 9 .
n ( A ∪ B ) = 45 n(A\cup B)=45 n ( A ∪ B ) = 45 , so 45 = 30 + 22 − n ( A ∩ B ) 45=30+22-n(A\cap B) 45 = 30 + 22 − n ( A ∩ B ) , hence n ( A ∩ B ) = 52 − 45 = 7 n(A\cap B)=52-45=7 n ( A ∩ B ) = 52 − 45 = 7 .
The numbers not in A A A are those with x > 1 x>1 x > 1 and x ≤ 4 x\le 4 x ≤ 4 : the complement is ( 1 , 4 ] (1, 4] ( 1 , 4 ] .
(a) At least one language: 60 + 45 − 20 = 85 60+45-20=85 60 + 45 − 20 = 85 . Exactly one: 85 − 20 = 65 85-20=65 85 − 20 = 65 (or 40 + 25 40+25 40 + 25 ). Neither: 100 − 85 = 15 100-85=15 100 − 85 = 15 . (b) We need m ≥ 0 m\ge 0 m ≥ 0 and m + 2 ≤ 5 m+2\le 5 m + 2 ≤ 5 , i.e. 0 ≤ m ≤ 3 0\le m\le 3 0 ≤ m ≤ 3 .