0% found this document useful (0 votes)
23 views

Chapter 2 (_sets) 15 11 2022 Water Marked

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)
23 views

Chapter 2 (_sets) 15 11 2022 Water Marked

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/ 11

Chapter 2

1 Sets
• Definition 1: A set is an unordered collection of objects
A = {1,2 ,4 ,7}, B = {A, G, Y}, …

• Definition 2: The object in a set are also called the elements or members

• Definition 3:
Universal Sets:
N = {0,1,2,3 ...} the set of natural numbers
Z= {... , -2 , -1 , 0 , 1 ,2 , ...} the set of integers.
Z+ = {1, 2 ,3 ...} the set of positive integers
Q = {p/q , where pZ, qZ , q  0} set of rational numbers
R, the set of real numbers

• Definition 4: Two sets are equal if and only if they have the same distinct elements.
Ex: { 1,3,5} and { 5, 1,3} are equal .
{5,1,3} and {5,5,5,5,1,1,3,3} are equal

• Definition 5: Empty Set (Null set) is a set with no elements. Ex: { }, 


• Definition 6: Singleton set is the set with one element. Ex: {}, {1}, {A}, {{1,2,3}}
• Definition 7: Finite set is the set with limited number of elements. Ex: A= {1,2,3…100}, {1,2,3}
Infinite set is the set with unlimited number of elements. Ex: Integers set: Z
• Definition 8: Set cardinality ( |S| ) is the number of distinct elements in a set.
Ex: 1. S= {1, 2, 3, -5 ,0}, then |S| = 5
2. || = 0
3. |{1,2,3}| = 3
4. |{{1,2,3}}| = 1
5. |{}| = 1
❖ Set can be described by:

A. Listing all of it’s members (Roster’s Notation)


Ex: describe the set of positive odd numbers less than 10. Universe: Z
O = {1, 3, 5, 7, 9}
1  O : True
2 O : False
2 O : True

B. Set Builder Notation

Ex: describe the above set of odd numbers less than 10 using set builder notation.

O = { x | x is an odd positive number less than 10}


In more precise way → O = { x | 10>x > 0  x = 2 k +1 , where k is an integer}
1  O : True since 1>0  1 =20 + 1 → T  T → T
2 O : False since 2>0  2 ≠ 2K + 1 → T  F → F

C. Venn diagram

Definition: universal set U is the set that contains all objects under consideration.

Ex1: describe the above set of odd numbers less than 10 using Venn Diagram. U: Z
O = {1, 3, 5, 7, 9}

U: Z

O 1 3
0 -1 10 100 11
5 7
9

Ex2: V = describes the set of Vowels using Venn diagram.


V = {a, e, o, u, i}
V = { x / x is a vowel letter}

U: English Letters
a e
V b d f
o u
i
❖ Subsets ( A  B)

• The set A is a subset of the set B if and only if every element of A is also an element of B. ( A  B)
• ( A  B) is true, if and only if the quantification x( xA → xB) is true

• Theorem: for any set S


* (  S) : { } is a subset of any set.
* ( S  S) : any set is a subset of itself.

• If ( A  B) is true and ( B  A) is true, then A = B. x( xA  xB) is true

❖ Proper subset (A  B)

• The set A is a proper subset of the set B if and only if every element of A is also an element of B, but
A  B. ( A  B)
• ( A  B) is true, if and only if the quantification x( (xA → xB) ˄ A  B) is true

Ex: S= { , 1, 2, 3, 4, 5, {1} }
|S|=7
1S 6S {1}  S {1}  S
SS SS S S
{}  S {1}  S {{1}}  S {1,2,3}  S
  {{1}}  {{1}} {1,2,3}  S

❖ Power set P(S)

• Given a set S, the power set of S is the set of all subsets of the set S. the power set is denoted by P(S)

Ex: what is the power set of the set S = {0, 1, 2}


P(S)= {  , { 0 , 1, 2} , {0} , {1 } , {2 } , {0,1} , {0,2} ,{1 ,2} }

Ex: P({}) = {  , {}} , P({1}) = {  , {1}} , | P({1}) |= 2


P() = {,}={} , | P() |= 1

• If a set has n elements, then its power set has 2n elements.


Ex: S = {0, 1, 2} then number of subsets is 23 = 8 subsets

❖ Cartesian Products
• A  B = { (a, b) | a  A  b  B} it is the set of all ordered pair from A to B.
Ex: Let A = {1, 2} B= {a, b, c}
A  B = { (1,a), (1,b) ,(1,c) , (2,a), (2,b) ,(2,c)}
B  A = { (a,1), (a,2), (b,1), (b,2), (c,1), (c,2)}
• A  B  B  A iff A ≠ B
• A=
• Relation from the set A to the set B is a subset from A  B
• | A  B | = |A| x |B|

2 Set Operations
1. Union (A  B): { x| x A  xB}

2. Intersection ( A  B): { x| x A  xB}

3. Difference ( A – B) : { x| x A  xB}

4. Complement A : { x| xU  x A }

5. Symmetric Difference (A Δ B) = A-B  B-A


: { x | x  A  B  x  A  B}

Example:

A = {3, 4, 5} B={1, 2, 3} U={1, 2, 3, … , 10}

A  B = {1, 2, 3, 4, 5}

A  B = {3}
A – B = {4, 5}

B – A = {1, 2}

__
A = { 1, 2, 6,7, 8, 9, 10}

__
B = { 4, 5, 6, 7, 8, 9, 10}
A Δ B = {1, 2, 4, 5}

Definitions:

a. A and B are disjoint if and only if A  B = 


Example : A={x | x is an even number  Z}
B={ x | x is an odd number  Z}
AB=

b. | A  B| = |A| + |B| - | A  B|
Example:
A = {3, 4, 5} B={1, 2, 3} A  B = { 1, 2, 3,4, 5} A  B = {3}
|AB|=3+3–1=5

c. | A  B C| = |A| + |B| + |C| - | A  B|- | A  C|- | B  C|- | A  B C |


* Computer representation of sets
U = {1, 2 ,3 ,4 ,5 ,6 ,7 ,8 , 9, 10} What is the bit string that represents the set S of odd integers in U?

Sol:
U: 1 2 3 4 5 6 7 8 9 10
S: 1 3 5 7 9

1 0 1 0 1 0 1 0 1 0

Union and intersection


Let A=1 010 1010 1 0 & B = 1 1 1 0 1 01 0 1 1
1 0 1 0 1 0 1 0 1 0  1 1 1 0 1 01 0 1 1 = 1 1 1 0 1 0 1 0 1 1 = A  B
1 0 1 0 1 0 1 0 1 0  1 1 1 0 1 01 0 1 1 = 1 0 1 0 1 0 1 0 1 0 = A  B
1 1 1 0 1 01 0 1 1  (1 0 1 0 1 0 1 0 1 0)
1 1 1 0 1 01 0 1 1  0 1 0 1 0 1 0 1 0 1 = 0 1 0 0 0 0 0 0 0 1 = B – A
(1 0 1 0 1 0 1 0 1 0) = 0 1 0 1 0 1 0 1 0 1 = A
* Proving techniques
A. Set identities
Equivalence rule Name
AA Identity
AUA
A Domination
AUU
AA A Idempotent
AAA
( A )=A Complementation
law
A B  B A Commutative
A B  B A
(A  B)  C  A  ( B  C) Associative
(A  B)  C  A  ( B  C)
A  (B  C)  (A  B)  (A  C) Distributive
A  (B  C)  (A  B)  (A  C)
̅̅̅̅̅̅
AB = A ̅B
̅ Demorgan’s
AB ̅B
̅̅̅̅̅̅ = A ̅

A  (A  B)  A Absorption
A  (A  B)  A

A A  Complement law
A  A U

Ex: prove that A (BC)  (C B)  A using set identities:

A  (B  C)  A  (B C)

 (B C)  A

 (C B)  A
B. Set builder notation
Ex: use set builder notation and logical equivalence to show that

AB AB

Sol:
A B  { x| x A  B}
 { x| (x A  B)}
= { x| (x A  xB)}
= { x| x A  xB}

= { x| x A  xB}

= { x| x (A B)} = (A  B )

C. Membership table
Ex: prove that A  (B  C)  (A  B)  (A  C) for all sets A, B, and C
Any element x in the domain has 2 possibilities:
x  the set → 1
x  the set → 0

A B C BC A  (B  C) A B A C (A  B)  (A  C)
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1

D. Venn Diagrams
B  (A  C)  (B  A)  (B  C)

You might also like