Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
171 views

M1 - Sets and Functions: University of San Agustin Cpe122 - Discrete Math, 2 Sem Ay2020-21

This document provides an overview of sets and operations on sets including: - Defining a set and set notation - Representing sets using Venn diagrams - Subsets and determining if one set is a subset of another - The size or cardinality of a finite set - The power set of a set - Cartesian products of sets - Set operations including union, intersection, difference, and complement - Examples are provided to illustrate each concept.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
171 views

M1 - Sets and Functions: University of San Agustin Cpe122 - Discrete Math, 2 Sem Ay2020-21

This document provides an overview of sets and operations on sets including: - Defining a set and set notation - Representing sets using Venn diagrams - Subsets and determining if one set is a subset of another - The size or cardinality of a finite set - The power set of a set - Cartesian products of sets - Set operations including union, intersection, difference, and complement - Examples are provided to illustrate each concept.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

University of San Agustin

CpE122 – Discrete Math, 2nd Sem AY2020-21


M1 – Sets and Functions

1. Sets and Operation on Sets


Venn Diagrams
Set - Introduction Sets can be represented graphically using Venn
diagrams, named after the English mathematician John
A set is an unordered collection of objects, called Venn, who introduced their use in 1881.
elements or members of the set. A set is
said to contain its elements. We write a ∈ A to denote Subsets
that a is an element of the set A. The The set A is a subset of B, and B is a superset of A, if and
notation a ∈ A denotes that a is not an element of the only if every element of A is also an element of B. We
set A. use the notation A ⊆ B to indicate that A is a subset of
the set B. If, instead, we want to stress that B is a
Examples: superset of A, we use the equivalent notation B ⊇ A.
(So, A ⊆ B and B ⊇ A are equivalent statements.)
 The set V of all vowels in the English alphabet
can be written as V = {a, e, i, o, u} Examples:
 The set O of odd positive integers less than 10 Given: A= {1, 2, 3, 4}
can be expressed by O = {1, 3, 5, 7, 9}  What are the subset of set A?
 The set of positive integers less than 100 can be
denoted by {1, 2, 3, . . . , 99} Solution:
Subsets of A: {1}, {2}, {3}, {4}, {1.2}, {1, 3}, {1, 4}, {2, 3},
Set builder notation {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {2, 3, 4}, {1, 3, 4}, {1,
O = {x | x is an odd positive integer less than 10} 2, 3, 4}, {}
O = {x ∈ Z+ | x is odd and x < 10}.
The Size of a Set
Listing Notation: Let S be a set. If there are exactly n distinct
A = {1, 3, 5, 7, 9} elements in S where n is a nonnegative integer, we say
B = {2, 4, 6, 8. 10} that S is a finite set and that n is the cardinality of S. The
cardinality of S is denoted by |S|.
Two sets are equal if and only if they have the same
elements. Remark: The term cardinality comes from the common
usage of the term cardinal number as the size of a
Empty set, or null set - a special set that has no finite set.
elements and is denoted by ∅ or { }. Often, a set of
elements with certain properties turns out to be the Examples:
null set. C = {a, b, c, d, e}  |C| = 5
N = {1, 2, 3, 4, 6, 7}  |N| = 6
These sets, each denoted using a boldface letter, play W = {“Hello!”, “Hi!”, “Welcome!”}  |W|= 3
an important role in discrete mathematics:
N = {0, 1, 2, 3, …}, the set of all natural numbers Power Set
Z = {… , -2, -1, 0, 1, 2, …}, the set of all integers Given a set S, the power set of S is the set of all subsets
Z+ = {1, 2, 3, …}, the set of all positive integers of the set S. The power set of S is
Q = {p∕q ∣ p ∈ Z, q ∈ Z, and q ≠ 0}, the set of all rational denoted by P(S).
numbers
R, the set of all real numbers Examples;
1. What is the power set of the set {0, 1, 2}?
Solution: The power set P({a, b, c}) is the set of all
subsets of {a, b, c}.

//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions

P({a, b, c}) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}. Intersection of Sets
Let A and B be sets. The intersection of the sets A
Note: The empty set and the set itself are members of and B, denoted by A ∩ B, is the set containing those
this set of subsets. elements in both A and B. An element x belongs to the
intersection of the sets A and B if and only if x belongs
Cartesian Product to A and x belongs to B. This tells us that A ∩ B = {x ∣ x ∈
The ordered n-tuple (a1, a2, … , an) is the ordered A ∧ x ∈ B}.
collection that has a1 as its first element, a2 as its
second element, … , and an as its nth element. The Examples:
ordered pairs (a, b) and (c, d) are equal if and only if a =  Given: A={1, 3, 5} and B={1, 2, 3}
c and b = d. Note that (a, b) and (b, a) are not equal Solution: A ∩ B = {1, 3}
unless a = b.
 Given: X= {a, b, c} and Y= {a, b, x}
Let A and B be sets. The Cartesian product of A and Solution: A ∩ B = {a, b}
B, denoted by A × B, is the set of all ordered pairs (a, b),
where a ∈ A and b ∈ B. Hence, A × B = {(a, b) ∣ a ∈ A ∧ b Two sets are called disjoint if their intersection is the
∈ B} empty set.

Examples: Examples:
 What is the Cartesian product of A = {1, 2} and  Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}. Because
B = {a, b, c}? A ∩ B = ∅, A and B are disjoint.
Solution: The Cartesian product A × B is
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}. Principle of inclusion–exclusion.
If the number of elements that are in both A and B is
 What is the Cartesian product of X = {x, y, z} and subtracted from |A| + |B|, elements in A ∩ B will be
Y = {1, 2}? counted only once.
Solution: The Cartesian product X × Y is Notation: |A ∪ B| = |A| + |B| - |A ∩ B|
X × Y = {(x, 1), (x, 2), (y, 1), (y, 2), (z, 1), (z, 2)}.
Difference

2. Set Operations Let A and B be sets. The difference of A and B, denoted


by A - B, is the set containing those elements that are in
Union of Sets A but not in B. The difference of A and B is also called
the complement of B with respect to A.
Let A and B be sets. The union of the sets A and B, Remark: The difference of sets A and B is sometimes
denoted by A ∪ B, is the set that contains those denoted by A∖B.
elements that are either in A or in B, or in both.
An element x belongs to the difference of A and B if and
only if x ∈ A and x ∉ B. This tells us that
Examples:
A - B = {x ∣ x ∈ A ∧ x ∉ B}
 Given: A= {1, 3, 5} and B= {3, 4, 5}
Solution: A ∪ B = {1, 3, 5} ∪ {3, 4, 5} = {1, 3, 4, 5} Examples:
 Given: A = {1, 3, 5} and B = {1, 2, 3}
 Given: X= {a, b, c} and Y= {a, b, x} Solution: A - B = {1, 3, 5} - {1, 2, 3} = {5}
Solution: A ∪ B = {a, b, c} ∪ {a, b, x} = {a, b, c, x}  Given: X = {a, b, c} and Y = {a, c, d}
Solution: X - Y = {a, b, c} - {a, c, d} ={b}

//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions

Complement  Computer Representation of Sets


 Let U be the universal set. The complement of the Assume that the universal set U is finite (and of
set A, denoted by A, is the complement of A with reasonable size so that the number of elements of U is
respect to U. Therefore, the complement of the set not larger than the memory size of the computer being
A is U - A. used). First, specify an arbitrary ordering of the
elements of U, for instance a1, a2, … , an. Represent a
Remark: The definition of the complement of A subset A of U with the bit string of length n, where the
depends on a particular universal set U. This ith bit in this string is 1 if ai belongs to A and is 0 if ai
definition makes sense for any superset U of A. If we does not belong to A.
want to identify the universal set U, we would write
“the complement of A with respect to the set U.” Examples:
An element belongs to A if and only if x ∉ A. This tells us  Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering
that A = {x ∈ U ∣ x ∉ A}. of elements of U has the elements in increasing
order; that is, ai = i. What bit strings represent the
Examples: subset of all odd integers in U, the subset of all even
 Let A = {a, e, i, o, u} (where the universal set is the integers in U, and the subset of integers not
set of letters of the English alphabet). Then exceeding 5 in U?
A = {b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z}. Solution: The bit string that represents the set of odd
 Let A be the set of positive integers greater than 10 integers in U, namely, {1, 3, 5, 7, 9}, has a one bit in the
(with universal set the set of all positive integers). first, third, fifth, seventh, and ninth positions, and a zero
Then A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. elsewhere. It is 10 1010 1010.

TABLE 1 Set Identities.  We have seen that the bit string for the set {1, 3, 5,
7, 9} (with universal set {1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
Identity Name is 10 1010 1010. What is the bit string for the
A∩U=A complement of this set?
Identity laws Solution: The bit string for the complement of this set is
A∪∅=A
A∪U=U obtained by replacing 0s with 1s and vice versa. This
Domination laws yields the string 01 0101 0101, which corresponds to
A∩∅=∅
A∪A=A the set {2, 4, 6, 8, 10}
Idempotent laws
A∩A=A
(A) = A Complementation law  The bit strings for the sets {1, 2, 3, 4, 5} and {1, 3, 5,
A∪B=B∪A 7, 9} are 11 1110 0000 and 10 1010 1010,
Commutative laws respectively. Use bit strings to find the union and
A∩B=B∩A
A ∪ (B ∪ C) = (A ∪ B) ∪ C intersection of these sets.
A ∩ (B ∩ C) = (A ∩ B) ∩ Associative laws Solution: The bit string for the union of these sets is 11
C 1110 0000 ∨ 10 1010 1010 = 11 1110 1010, which
A ∪ (B ∩ C) = (A ∪ B) ∩ corresponds to the set {1, 2, 3, 4, 5, 7, 9}. The bit string
(A ∪ C) for the intersection of these sets is 11 1110 0000 ∧ 10
Distributive laws 1010 1010 = 10 1010 0000, which corresponds to the
A ∩ (B ∪ C) = (A ∩ B) ∪
(A ∩ C) set {1, 3, 5}
A∩B=A∪B
De Morgan’s laws 2. Functions
A∪B=A∩B
A ∪ (A ∩ B) = A
Absorption laws Definition:
A ∩ (A ∪ B) = A
A∪A=U Let A and B be nonempty sets. A function f from A to B
Complement laws is an assignment of exactly one
A∩A=∅
element of B to each element of A. We write f (a) = b if
//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions

b is the unique element of B assigned the domain of f. A function is said to be injective if it is


by the function f to the element a of A. If f is a function one-to-one.
from A to B, we write f : A → B.
Examples:
Remark: Functions are sometimes also called mappings  Determine whether the function f from {a, b, c, d}
or transformations. to {1, 2, 3, 4, 5} with f (a) = 4, f (b) = 5, f (c) = 1, and f
(d) = 3 is one-to-one.
If f is a function from A to B, we say that A is the domain Solution: The function f is one-to-one because f takes on
of f and B is the codomain of f. If f (a) = b, we say that b different values at the four elements of its domain.
is the image of a and a is a preimage of b. The range, or
image, of f is the set of all images of elements of A.  Determine whether the function f (x) = x2 from the
Also, if f is a function from A to B, we say that f set of integers to the set of integers is one-to-one.
maps A to B Solution: The function f (x) = x2 is not one-to-one
because, for instance, f (1) = f (-1) = 1, but 1 ≠ -1

 Determine whether the function f (x) = x + 1 from


the set of real numbers to itself is one-to-one.

Solution: Suppose that x and y are real numbers with f


(x) = f (y), so that x + 1 = y + 1. This means that x = y.
Hence, f (x) = x + 1 is a one-to-one function from R to R.

Examples: Onto function or Surjective


1. What are the domain, codomain, and range of the A function f from A to B is called onto, or a surjection, if
function that assigns grades to students described and only if for every element b ∈ B there is an element
in the first paragraph of the introduction of this a ∈ A with f(a) = b. A function f is called surjective if it is
section? onto.

Solution: Let G be the function that assigns a grade Examples:


to a student in our discrete mathematics class.  Let f be the function from {a, b, c, d} to {1, 2, 3}
Note that G(Adams) = A, for instance. The domain defined by f(a) = 3, f(b) = 2, f(c) = 1, and f(d) = 3. Is f
of G is the set {Adams, Chou, Goodfriend, an onto function?
Rodriguez, Stevens}, and the codomain is the set {A, Solution: Because all three elements of the codomain
B, C, D, F}. The range of G is the set {A, B, C, F}, are images of elements in the domain.
because each grade except D is assigned to some
student.  Is the function f(x) = x2 from the set of integers to
the set of integers onto?
2. Let f : Z → Z assign the square of an integer to this Solution: The function f is not onto because there is no
integer. Then, f (x) = x2, where the domain of f is integer x with x2 = −1, for instance.
the set of all integers, the codomain of f is the set of
all integers, and the range of f is the set of all  Is the function f(x) = x + 1 from the set of integers to
integers that are perfect squares, namely, {0, 1, 4, 9, the set of integers onto?
… }. Solution: This function is onto, because for every
integer y there is an integer x such that f(x) = y. To see
 One-to-One Functions this, note that f(x) = y if and only if x + 1 = y, which holds
A function f is said to be one-to-one, or an injection, if if and only if x = y − 1. (Note that y − 1 is also an integer,
and only if f (a) = f (b) implies that a = b for all a and b in and so, is in the domain of f .)

//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions

 One-to-one correspondence
The function f is a one-to-one correspondence, or a  What are the terms a0, a1, a2, and a3 of the
bijection, if it is both one-to-one and onto. We also say sequence {an}, where an equals (−2)n?
that such a function is bijective. Solution:
a0 = (-2)(0) = 0
Examples: a1 = (-2)(1) = -2
 Let f be the function from {a, b, c, d} to {1, 2, 3, 4} a2 = (-2)(2) = -4
with f(a) = 4, f(b) = 2, f(c) = 1, and f(d) = 3. Is f a a3 = (-2)(3) = -6
bijection? Answer: S = {0, -2, -4, -6}
Solution: The function f is one-to-one and onto. It is
one-to-one because no two values in the domain are  What are the terms a0, a1, a2, and a3 of the
assigned the same function value. It is onto because all sequence {an}, where an equals 7 + 4n?
four elements of the codomain are images of elements Solution:
in the domain. Hence, f is a bijection. a0 = 7 + 4(0) = 7
a1 = 7 + 4(1) = 11
3. Sequences and Sums a2 = 7 + 4(2) = 15
a3 = 7 + 4(3) = 19
A sequence is a discrete structure used to represent an Answer: S = {7, 11, 15, 19}
ordered list.
 Summation
A sequence is a function from a subset of the set of
integers (usually either the set {0, 1, 2, . . .} or the set {1, Summation notation:
2, 3, . . .}) to a set S. We use the notation an to denote
the image of the integer n. We call an a term of the
sequence.

sequence {an}, The list of the terms of this sequence, (read as the sum from j = m to j = n of aj ) to represent
beginning with a1, namely, a1, a2, a3, a4, . . . , am + am+1 + · · · + an.
The variable j is called the index of summation, and the
Examples: an = 1/n => 1/1, ½, 1/3, 1/4 … choice of the letter j as the variable is arbitrary; that is,
we could have used any other letter, such as i or k. Or,
Special Type in notation,
1. An arithmetic progression is a sequence of the form
Examples:
a, a + d, a + 2d, . . . , a + nd, . . .
where the initial term a and the common difference d  What is the value of ∑5𝑗=1 𝑗2
are real numbers. Solution:

2. A geometric progression is a sequence of the form


a, ar, ar2, . . . , arn, . . .
where the initial term a and the common ratio r are real
numbers
 Double summations arise in many contexts (as in
3. The Fibonacci sequence, f0, f1, f2, . . . , is defined by the analysis of nested loops in computer
the initial conditions f0 = 0, f1 = 1, programs). An example of a double summation is
and the recurrence relation fn = fn-1 + fn-2
for n = 2, 3, 4, . . . .

 Sequences Examples
//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions

Summation j^3 = [ n^2(n+1)^2]/4


= [50^2 (50+1)^2]/4
= [2500(2601)]/4
Total = 2,550 + 1,625,625
Solution: Total = 1,628,175

References:

Rosen, 2019, Discrete mathematics

Formula:

Examples:
 Find summation of k from k=1 to 100?
Solution:
n =100
Summation = [n(n+1)]/2
= [(100)(100+1)]/2
= 5,050
 Find summation of 2j + j^3 from j=1 to 50?
 ^ symbol is exponent
Solution:
n=50
Summation 2j = 2[(n(n+1))/2]
= 2[(50(50+1))/2]
= 2, 550
//gguanzon2021

You might also like