0% found this document useful (0 votes)
13 views51 pages

Sets

Chapter 2 discusses basic structures in set theory, including definitions of sets, functions, sequences, and cardinality. It covers methods for describing sets, such as roster and set-builder notation, as well as important concepts like universal and empty sets, set equality, subsets, and operations like union and intersection. Additionally, it introduces Russell's Paradox, illustrating the limitations of naive set theory and the need for axiomatic definitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views51 pages

Sets

Chapter 2 discusses basic structures in set theory, including definitions of sets, functions, sequences, and cardinality. It covers methods for describing sets, such as roster and set-builder notation, as well as important concepts like universal and empty sets, set equality, subsets, and operations like union and intersection. Additionally, it introduces Russell's Paradox, illustrating the limitations of naive set theory and the need for axiomatic definitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Chapter 2-Part I (Sec 2.1, 2.

2)
Basic Structures:
• Sets
• Functions
• Sequences and Sums
• Cardinality of Sets
Sets
Section 2.1
Sets
● A set is an unordered collection of objects.
● the students in this class
● the chairs in this room
● The objects in a set are called the elements, or members
of the set. A set is said to contain its elements.
● The notation a ∈ A denotes that a is an element of
the set A.
● If a is not a member of A, write a ∉ A

3
Describing a Set:
Roster Method
● S = {a,b,c,d}
● Order not important
S = {a,b,c,d} = {b,c,a,d}
● Each distinct object is either a member or not; listing
more than once does not change the set.
S = {a,b,c,d} = {a,b,c,b,c,d}
● Elipses (…) may be used to describe a set without listing
all of the members when the pattern is clear.
S = {a,b,c,d,…,z }
4
Roster Method Examples
● Set of all vowels in the English alphabet:
V = {a,e,i,o,u}
● Set of all odd positive integers less than 10:
O = {1,3,5,7,9}
● Set of all positive integers less than 100:
S = {1,2,3,…,99}
● Set of all integers less than 0:
S = {…, -3,-2,-1}

5
Some Important Sets
N = natural numbers = {0,1,2,3….}
Z = integers = {…,-3,-2,-1,0,1,2,3,…}
Z⁺ = positive integers = {1,2,3,…..}
R = set of real numbers
R+ = set of positive real numbers
C = set of complex numbers.
Q = set of rational numbers

6
Set-Builder Notation
● Specify the property or properties that all members must
satisfy:
S = {x | x is a positive integer less than 100}
O = {x | x is an odd positive integer less than 10}
O = {x ∈ Z⁺ | x is odd and x < 10}
● A predicate may be used:
S = {x | P(x)}
● Example: S = {x | Prime(x)}
● Positive rational numbers:
Q+ = {x ∈ R | x = p/q, for some positive integers p,q, where q≠0}

7
Interval Notation
[a,b] = {x | a ≤ x ≤ b}
[a,b) = {x | a ≤ x < b}
(a,b] = {x | a < x ≤ b}
(a,b) = {x | a < x < b}

closed interval [a,b]


open interval (a,b)

8
Universal Set and Empty Set
● The universal set U is the set containing everything
currently under consideration.
● Contents depend on the context. Venn Diagram

U
● The empty set is the set with no V
aei
elements. ou
• Symbolized by ∅ or {}.

John Venn (1834-1923)


Cambridge, UK 9
Russell’s Paradox
the logical flaw of the naive set theory

Naive set theory (NST) (1895, George Cantor):


Using objects in the definition of sets, without specifying what an object is
This intuitive definition of a set leads to paradoxes (logical inconsistencies).
Defines a set that can not exist!

Bertrand Russell (1872-1970)


Cambridge, UK
Nobel Prize Winner
10
Russell’s Paradox Defines a set that can not exist!

● Let S be the set of all sets which are not members of


themselves.
● A paradox results from trying to answer the
question “Is S a member of itself?”
● Related Paradox:
● Henry is a barber who shaves all people who do not
shave themselves. A paradox results from trying to
answer the question “Does Henry shave himself?”
Bertrand Russell (1872-1970)
who shaves the barber? Cambridge, UK
Nobel Prize Winner
11
Russell’s Paradox Defines a set that can not exist!

● Henry is a barber who shaves all people who do not


shave themselves. A paradox results from trying to
answer the question “Does Henry shave himself?”
who shaves the barber?

The barber cannot shave himself as he only shaves those who do not shave themselves.
As such, if he shaves himself he ceases to be the barber.

12
the logical flaw of the naive set theory

Russell’s Paradox Defines a set that can not exist!

● Henry is a barber who shaves all people who do not


shave themselves. A paradox results from trying to
answer the question “Does Henry shave himself?”
who shaves the barber?
The barber cannot shave himself: he only shaves those who do not shave themselves.

If the barber does not shave himself, he needs to be shaved by a barber; so, he must shave
himself —> paradox!

This paradox depicts the need to set better definitions, a set of axioms that clarify the
case. (Shows the lacking of naive set theory.)

13
Russell’s Paradox
the logical flaw of the naive set theory

Naive set theory (NST) (1895, George Cantor):


Using objects in the definition of sets, without specifying what an object is
This intuitive definition of a set leads to paradoxes (logical inconsistencies).
Defines a set that can not exist!

Axiomatic set theory (AST) (1902, Bertrand Russell):


Russell’s paradox depicts the need to set better definitions, a set of axioms that
clarify the case.

All the examples we will study in this course


can be represented with Cantor’s naive set Bertrand Russell (1872-1970)
theory. Hence, we’ll study NST. Cambridge, UK
Nobel Prize Winner
14
Some things to remember
● Sets can be elements of sets.
{{1,2,3},a, {b,c}}
{N, Z, Q, R}
● The empty set is different from a set containing the
empty set.
∅ ≠{∅}

15
Set Equality
Two sets are equal if and only if they have the same elements.

● Therefore if A and B are sets, then A and B are equal iff

● We write A = B if A and B are equal sets.

{1,3,5} = {3, 5, 1}
{1,5,5,5,3,3,1} = {1,3,5}

16
Subsets
The set A is a subset of B, iff every element of A is also an element of B.

● A ⊆ B : A is a subset of the set B.


● A ⊆ B holds iff is true.
1. Because a ∈ ∅ is always false, ∅ ⊆ S ,for every set S.
2. Because a ∈ S → a ∈ S, S ⊆ S, for every set S.

17
Subset Relation
● Showing that A is a Subset of B (A ⊆ B):
● if x belongs to A, then x also belongs to B.
● Showing that A is not a Subset of B (A ⊈ B):
● find an element x ∈ A with x ∉ B.
● such an x is a counterexample to the claim that x ∈ A
implies x ∈ B.

18
Equality of Sets Revisited
● Recall that two sets A and B are equal, denoted by
A = B, iff

● Using logical equivalences we have that A = B iff

● This is equivalent to
A ⊆ B and B ⊆ A

19
Proper Subsets (A ⊂ B)
If A ⊆ B, but A ≠ B, then we say A is a proper subset of B, denoted by A ⊂ B.

U
B
A

20
Set Cardinality
• |A|: the cardinality of set A.
• The number of distinct elements in A
• If there are exactly n distinct elements in S, (|S|=n), where n is a
nonnegative integer, we say that S is finite. Otherwise it is infinite.

Examples:
1. |ø| = 0
2. Let S be the letters of the English alphabet. Then |S| = 26
3. |{1,2,3}| = 3
4. |{ø}| = 1
5. The set of integers is infinite.

21
Power Sets (P(A))
The set of all subsets of A is called Power Set of A

Example: If A = {a,b} then


P(A) = {ø, {a},{b},{a, b}}

● If a set has n elements, then the cardinality of the


power set is 2ⁿ. why?

22
Tuples
● The ordered n-tuple (a1,a2,…..,an): The ordered
collection that has a1 as its first element and a2 as its
second element and so on until an as its last element.
● Two n-tuples are equal if and only if their
corresponding elements are equal.
● 2-tuples are called ordered pairs.
● The ordered pairs (a,b) and (c,d) are equal if and only
if a = c and b = d.

23
René Descartes
(1596-1650)

Cartesian Product
The Cartesian Product of two sets A and B, denoted by A × B is the set of
ordered pairs (a,b) where a ∈ A and b ∈ B .

Example:
A = {a,b} B = {1,2,3}
A × B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}

24
René Descartes
(1596-1650)

Cartesian Product
The Cartesian Product of two sets A and B, denoted by A × B is the set of
ordered pairs (a,b) where a ∈ A and b ∈ B .

Example:
A = {a,b} B = {1,2,3}
A × B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}

A subset R of the Cartesian product A × B is called a relation


from the set A to the set B.

25
Cartesian Product

26
Cartesian Product
• The cartesian products of the sets A1,A2,……,An, denoted by
A1 × A2 × …… × An , is the set of ordered n-tuples
(a1,a2,……,an) where ai belongs to Ai for i = 1, … n.

27
Cartesian Product
• The cartesian products of the sets A1,A2,……,An, denoted by
A1 × A2 × …… × An , is the set of ordered n-tuples
(a1,a2,……,an) where ai belongs to Ai for i = 1, … n.

Example: What is A × B × C where A = {0,1}, B = {1,2} and


C = {0,1,2}

28
Cartesian Product
• The cartesian products of the sets A1,A2,……,An, denoted by
A1 × A2 × …… × An , is the set of ordered n-tuples
(a1,a2,……,an) where ai belongs to Ai for i = 1, … n.

Example: What is A × B × C where A = {0,1}, B = {1,2} and


C = {0,1,2}
Solution: A × B × C = {(0,1,0), (0,1,1), (0,1,2),(0,2,0), (0,2,1),
(0,2,2),(1,1,0), (1,1,1), (1,1,2), (1,2,0), (1,2,1), (1,2,2)}

29
Truth Sets of Quantifiers
● Truth set of P to be the set of elements in D for which
P(x) is true. The truth set of P(x) is denoted by

● Example: The truth set of P(x): “|x| = 1” where the


domain is the integers :{-1,1}

30
Set Operations
Section 2.2
Boolean Algebra
● The operators in set theory are analogous to the
corresponding operators in propositional calculus.
● They are both instances of Boolean algebra.
● As always there must be a universal set U.
● All sets are assumed to be subsets of U.

32
Union
● The union of the sets A and B, denoted by A ∪ B, is
the set:

● Example: What is {1,2,3} ∪ {3, 4, 5}?


Solution: {1,2,3,4,5}
U
A B

33
Intersection
● The intersection of sets A and B, denoted by A ∩ B, is

● For A and B are disjoint sets, if their intersection is


empty
● Example: What is? {1,2,3} ∩ {3,4,5} ?
Solution: {3} U
● Example:What is? A B
{1,2,3} ∩ {4,5,6} ?
Solution: ∅
34
Complement
The complement of a set A (with respect to U),
denoted by Ā is the set U - A
Ā = {x ∈ U | x ∉ A}
(The complement of A is sometimes denoted by A c .)

Example: If U is the positive integers less than 100,


what is the complement of {x | x > 70}
Solution: {x | x ≤ 70} U
Ā
A

35
Difference
• The difference of the sets A and B, denoted by A – B, is
the set containing the elements of A that are not in B.
• The difference of A and B is also called the
complement of B with respect to A.
A – B = {x | x ∈ A ∧ x ∉ B} = A ∩ B

U
A
B

36
The Cardinality of the Union of Two
Sets
• Inclusion-Exclusion U
|A ∪ B| = |A| + | B| − |A ∩ B| A B

• Example: Let A be the math majors in your class and B be the CS majors. To
count the number of students who are either math majors or CS majors, add
the number of math majors and the number of CS majors, and subtract the
number of joint CS/math majors.

37
Review Questions
Example: U = {0,1,2,3,4,5,6,7,8,9,10} A = {1,2,3,4,5}, B ={4,5,6,7,8}
1. A∪B
Solution: ?
2. A ∩ B
Solution: ?
3. Ā
Solution: ?
4.
Solution: ?
5. A – B
Solution: ?
6. B – A
Solution: ?

38
Review Questions
Example: U = {0,1,2,3,4,5,6,7,8,9,10} A = {1,2,3,4,5}, B ={4,5,6,7,8}
1. A∪B
Solution: {1,2,3,4,5,6,7,8}
2. A ∩ B
Solution: {4,5}
3. Ā
Solution: {0,6,7,8,9,10}
4.
Solution: {0,1,2,3,9,10}
5. A – B
Solution: {1,2,3}
6. B – A
Solution: {6,7,8}

39
Symmetric Difference
The symmetric difference of A and B, denoted by
is the set

Example:
U = {0,1,2,3,4,5,6,7,8,9,10}
U
A = {1,2,3,4,5} B ={4,5,6,7,8}
A B
What is :
● Solution: ?

40
Symmetric Difference
The symmetric difference of A and B, denoted by
is the set

Example:
U = {0,1,2,3,4,5,6,7,8,9,10}
U
A = {1,2,3,4,5} B ={4,5,6,7,8}
A B
What is :
● Solution: {1,2,3,6,7,8}

41
Set Identities
● Identity laws

● Domination laws

● Idempotent laws

● Complementation law

Continued on next slide !


42
Set Identities
● Commutative laws

● Associative laws

● Distributive laws

Continued on next slide !


43
Set Identities
● De Morgan’s laws

● Absorption laws

● Complement laws

44
Proving Set Identities
● 3 Different ways to prove set identities:
1. Prove that each set (each side of the identity) is a subset of
the other.
2. Use set builder notation and propositional logic.
3. Membership Tables: Verify that elements in the same
combination of sets always either belong or do not
belong to the same side of the identity.
• Use 1 to indicate it is in the set and a 0 to indicate
that it is not.

45
Proof of Second De Morgan Law
Using Subset Relation
Example: Prove that
Solution: We prove this identity by showing that:

1) and

2)

Continued on next slide !


46
Proof of Second De Morgan Law
These steps show that:

Continued on next slide !


47
Proof of Second De Morgan Law
These steps show that:

48
Proof of Second De Morgan Law
Using Set-Builder Notation

49
Using Membership Table
Example: Construct a membership table to show that the distributive law
holds.

Solution:

A B C
1 1 1 1 1 1 1 1
1 1 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 0 0 0 1 1 1 1
0 1 1 1 1 1 1 1
0 1 0 0 0 1 0 0
0 0 1 0 0 0 1 0
0 0 0 0 0 0 0 0 50
Generalized Unions and Intersections
● Let A1, A2 ,…, An be an indexed collection of sets.
We define:

These are well defined, since union and intersection are


associative.
● For i = 1,2,…, let Ai = {i, i + 1, i + 2, ….}. Then,
=A1

51

You might also like