Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Chapter 2 - Sets
Definitions
- A set is a collection of objects
- An element/member is an object in a set
Examples of sets
- The collection of whole numbers
- The collection of people who have been in a movie with Kevin Bacon
- The collection of people who wrote a whole book on a Thursday, speak multiple languages, and have a last name starting with ‘A’.
There are two common ways to list sets:
- Roster Notation lists every element in the set
- Set Builder provides a rule to find all elements in a set
Both notations are placed within braces { }
Roster Notation (lists every element)
Examples: { 1, 2, 3, 4, 5 }
{ Cincinnati, Cleveland, Columbus }
Ellipsis “…” can be used to show that elements continue in the same manner.
Examples:
{ 1, 2, 3, 4, 5, … , 10 }
{ 0, 1, 2, 3, 4, 5, 6, … }
{ … , -3, -2, -1, 0, 1, 2, 3, … }
{ Washington, Adams, … , Bush, Obama }
© 2010 Pearson Education, Inc. All rights reserved. Section 2.1, Slide 7
Representing Sets
• Set-builder notation:
•
Examples of sets in Set Builder Notation
A = { x : x is a whole number and 1 <= x and x <= 10 }
B = { x : x was in a movie with Kevin Bacon }
C = { x : x is a complete graph }
© 2010 Pearson Education, Inc. All rights reserved. Section 2.1, Slide 9
Representing Sets
• A set is well-defined if we are able to tell whether any particular object is an element of the set.
• Example: Which sets are well-defined?(a) (b)
{ }: is a winner of an Academy AwardA x x=
{ }: is tallT x x=
Pop Quiz!!!!!
How many elements are in the set
A) { x : x is a day of the week }
B) { 4, 6, 8, … 14 }
C) { x : x is a student at UT and x is a space alien }
How do we represent the following set in Roster Form?
{ x : x is a student at UT and x is a space alien }
{ }
A set with no entries is known as the empty set. It can also be written as
∅
© 2010 Pearson Education, Inc. All rights reserved. Section 2.1, Slide 12
Representing Sets
• Do ∅ and {∅} mean the same thing?
– ∅ is the empty set – a set with no members– {∅} is a set with a member object, namely, the
empty set
The previous example shows that is possible to have a set of sets. (And sets of sets of sets, and … )
Examples:
{ 1, { 1 } }
{ { 1, 2, 3, 4, 5, … } , {-1, -2, -3, -4, -5, … } }
{ { { 3, 5 }, { 1 } } , { Kevin Bacon } }
© 2010 Pearson Education, Inc. All rights reserved. Section 2.1, Slide 14
The Element Symbol
• Example:
means "is an element of" means "is an element of"not
∈∉
{ }{ }2,3,4,53
6 2,3,4,5∈∉
K4 { x : x is a complete graph }
© 2010 Pearson Education, Inc. All rights reserved. Section 2.1, Slide 15
Representing Sets
• Example: Consider female consumers living in the U.S. The universal set is
{ }: is a female cosumer living in the U.S.U x x=
© 2010 Pearson Education, Inc. All rights reserved. Section 2.1, Slide 16
Cardinal Number
• Example: State the cardinal number of the set.
{ } { } { }{ }1,2,3 , 1,4,5 , 3X =
( ) 3
(the set contains 3 objects, each of which is also a set)
n XX
=
Examples:
{ x : x is an odd whole number } { 1, 3, 5, … }
{ x : x is an Euler path} { x : x is a Ham. path}
{ 1, 2, 3 } { 3, 2, 1 }
Section 2.2 Comparing two sets.
{ 1, 2, 3 } { x : x is a whole number }
{ 2, 4, 6, 8 } { … , -4, -2, 0, 2, 4, … }
{ 1, 2, 3, 4, 5, ... } { 1, 2, 3, … , 10}
∅ { 1, 2, 3 }
© 2010 Pearson Education, Inc. All rights reserved. Section 2.2, Slide 19
Venn Diagrams and Proper Subsets
• A Venn diagram is used to visualize relationships among sets.
• Here is the Venn diagram for A B.
The Venn Diagram of the different types of numbers
Real Numbers
Rational Numbers
Integers
Whole Numbers
Natural Numbers
What are all of the subsets of { a, b, c} ?
How many are there?
© 2010 Pearson Education, Inc. All rights reserved. Section 2.2, Slide 22
Venn Diagrams and Proper Subsets
• How many subsets exist for the given set?
{ }Bill, Gill, Jill, Will
42 2 16
A
k
=
= =
© 2010 Pearson Education, Inc. All rights reserved. Section 2.2, Slide 23
Equivalent Sets
• The sets {1, 2, 3} and {A, B, C} are equivalent because they both have 3 members.
• The sets { x : x is a pancreas in a UT student } and{ x : x is a medulla oblongata in a UT student } are
equivalent. Why?
Section 2.3 Operations on Sets
For numbers we have operations like: +, -, x, etc.
Sets also have operations on them.
First, we will look at Venn Diagrams for the 4 ways that two sets A and B can be related.
A and B could have no elements in common.
A B is a subset
U
A B
U
BA
A = B
A and B overlap, not equal but contain some of the same elements
U
A = B
U
A B
U
A B
The last Venn Diagram can be used to represent the others, so use it from now on.
U
A B
Different regions represent different types of elements.
I II III
IV
I = elements in A, not B III = elements in B, not A II = elements in A and B IV = elements not in A nor B
U
A B
Find the sets U, A, B.
1
2
3
45
6
U =A =B =
U
A B
Find the sets U, A, B.
1
2
3
45
6
U =A =B =
U
A B
Fill in the Venn diagram knowing U, A, B.
U = { 1, 2, 3, 4, 5, 6, 7 }A = { 1, 2, 3, 4 }B = { 1, 3, 5, 7 }
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 32
Union of Sets
• Example: Find the union of the two sets.
{ }{ }{ }
1, 3, 5, 6, 8
2, 3, 6, 7, 8
1, 2, 3, 5, 6, 7, 8
A
B
A B
=
=
=U
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 33
Intersection of Sets
• Example: Find the intersection of the two sets.
{ }{ }
{ }
1, 3, 5, 6, 8
2, 3, 6, 7, 8
3, 6, 8
A
B
A B
=
=
=∩
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 34
Set Complement
• Example: Given U, find the complement of A.
{ }{ }{ }
1, 2, 3, , 10
1, 3, 5, 7, 9
2, 4, 6, 8, 10
U
A
A
=
=
′ =
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 35
Set Difference
• Example: Find the difference.
{ } { }3, 6, 9, 12 : is an odd integer x x−
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 36
Order of Set Operations• Example: Let { } { }1,2,3, ,10 , : is even ,U E x x= =
{ } { }( ) ( )1,3,4,5,8 , and 1,2,4,7,8 .
Find .
B A
A B E A
= =
′ ′∩U U
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 37
Order of Set Operations
• Intersection distributes over union.
( ) ( ) ( ) A B C A B A C=∩ ∩ ∩U U
© 2010 Pearson Education, Inc. All rights reserved. Section 2.3, Slide 38
Order of Set Operations