Lecture 4 Sets
Lecture 4 Sets
Lecture 4 Sets
What is a Set?
{x | x ∈ N and x > 7 }
b. 4, 2, 7 , 3, 4, 7, 9
Solution:
a. The sets are not equal. However, each set has exactly
five elements, so the sets are equivalent.
b. The first set has three elements and the second set has
four elements, so the sets are not equal and are not
equivalent.
Q and A
QUESTION:
If two sets are equal, must they also be
equivalent?
ANSWER:
Yes. If the sets are equal, then they
have exactly the same elements;
therefore, they also have the same
number of elements.
Specifying a Set
U U
A B
A B
A B
The Membership Relation
Solutions:
An organized list shows the following subsets.
{} Subsets with 0 elements
{mustard}, {ketchup}, {onions}, {relish} Subsets with 1 element
{mustard, ketchup}, {mustard, onions}, {mustard, relish},
{ketchup,onions},{ketchup, relish}, {onions, relish} Subsets with 2
elements
{mustard, ketchup, onions}, {mustard, ketchup, relish},
{mustard, onions, relish}, {ketchup, onions, relish} Subsets with 3
elements
{mustard, ketchup, onion, relish} Subsets with 4 elements
The Intersection of Two Sets
A B
Intersections
A B x x A and x B
A B Ø
Examples:
Find Intersections
Let A {1, 4, 5, 7 }, B {2, 3, 4, 5, 6 }, and C {3,
6, 9} . Find
a. A B
b. A C
Solution:
a.The elements common to A and B are 4 and 5.
b. Sets A and C have no common elements. Thus
A C Ø
The Union of Two Sets
A∪B
U
A B
Unions
The union of two sets A and B is
A B x x A or x B
Find Unions
Let A {1, 4, 5, 7 }, B {2, 3, 4, 5, 6 }, and C {3,
6, 9} . Find
a. A B
b. A C
Solution:
a. A B = {1, 2, 3, 4, 5, 6, 7}
b. A C = {1, 3, 4, 5, 6, 7, 9}
The Complement of a Set
Ac
A
Ac x U x A
o Note: A A ;
c
A A c
U
The Complement of a Set
The complement of a set A, denoted by
A , is the set of all elements of the
universal set U that are not elements of
A.
Example:
R2 A B
U
A B
R1
R2
R3 R3 Ac B
R4
R4 Ac Bc
Venn Diagrams and Equality of
Sets
The Venn diagram in figure below shows the four
regions formed by two intersecting sets in a
universal set U. It shows the four possible
relationships that can exist between an element of
a universal set U and two sets A and B.
An element of U:
U
A B
o may be an element of both A and B. Region i
iii o may be an element of A, but not B. Region ii
i o may be an element of B, but not A. Region iii
ii
iv o may not be an element of either A or B.
Region iv
An Application of Sets
Example:
A movie company is making plans for future movies
it wishes to produce. The company
has done a random survey of 1000 people. The
results of the survey are shown below.
695 people like action adventures.
340 people like comedies.
180 people like both action adventures and comedies.
iii
i 515 180
160
ii
iv 145
a. Regions i and ii have a total of 695 people. So far we have accounted for 180
of these people in region i. Thus the number of people in region ii, which is the
set of people who like action adventures but do not like comedies, is 695 180
515.
b. Regions i and iii have a total of 340 people. Thus the number of people in
region iii, which is the set of people who like comedies but do not like action
adventures, is 340 180 160.
c. The number of people who do not like action adventure movies or comedies is
represented by region iv. The number of people in region iv must be the total
number of people, which is 1000, less the number of people accounted for in
regions i, ii, and iii, which is 855. Thus the number of people who do not like
either type of movie is 1000 855 145.
U
ROCK RAP
v ii vii
i
iv iii
vii
viii HEAVY
METAL
A music teacher has surveyed 495 students. The results of the survey are listed
below.
320 students like rap music.
395 students like rock music.
295 students like heavy metal music.
280 students like both rap music and rock music.
190 students like both rap music and heavy metal music.
245 students like both rock music and heavy metal music.
160 students like all three.
How many students
a. like exactly two of the three types of music?
b. like only rock music?
c. like only one of the three types of music?
U
ROCK RAP
30 10
120
160
85 30
20
40 HEAVY
METAL
a. The survey shows that 245 students like rock and heavy metal music, so the
numbers we place in regions i and iv must have a sum of 245. Since region i has
160 students, we see that region iv must have 245 160 85 students. In a similar
manner, we can determine that region ii has 120 students and region iii has 30
students. Thus 85 120 30 235 students like exactly two of the three types of
music.
b. The sum of the students represented by regions i, ii, iv, and v must be 395.
The number of students in region v must be the difference between this total and
the sum of the numbers of students in region i, ii, and iv. Thus the number of
students who like only rock music is 395160 120 8530.
c. Using the same reasoning as in part b, we find that region vi has 10 students
and region vii has 20 students. To find the number of students who like only one
type of music, find the sum of the numbers of students in regions v, vi, and vii,
which is 30 10 20 60.
Two Basic Counting Rules
The Inclusion-Exclusion Principles
If A and B are finite sets,
1. n( A B) n( A) n( B) n( A B)
2. n( A B c ) n( A) n( A B)
The Inclusion-Exclusion Principles
Example:
A school finds that 430 of its students are registered in
chemistry, 560 are registered in mathematics, and 225 are
registered in both chemistry and mathematics. How many
students are registered in chemistry or mathematics?
Solution: