M1 - Sets and Functions: University of San Agustin Cpe122 - Discrete Math, 2 Sem Ay2020-21
M1 - Sets and Functions: University of San Agustin Cpe122 - Discrete Math, 2 Sem Ay2020-21
//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
//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions
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
//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:
Sequences Examples
//gguanzon2021
University of San Agustin
CpE122 – Discrete Math, 2nd Sem AY2020-21
M1 – Sets and Functions
References:
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