SlideShare a Scribd company logo
Discrete Structure
Mathematics
Course: Discrete
Structures
(501215-3)
Prepared by : DR. AMR RASHED
PhD in Electronics &
Communication Engineering
References 1-Rosen, Kenneth H. "Discrete Mathematics and
Its Applications.“ seventh edition
2-introduction to set theory
3-rational numbers
4-Introduction to rational and irrational numbers
5-Classification of Numbers
6-SUBSETS AND POWER SETS
7-cartesian products
7-Examples
8-Functions
Course Content:
Chapter 2: Basic
Structures: Sets,
Functions, Sequences,
Sums, and Matrices
Chapter 8: Advanced
Counting Techniques
Chapter 1: The
Foundations: Logic and
Proofs
Chapter 4: Number
Theory and Cryptography
Chapter 5: Induction and
Recursion
Chapter 6: Counting
Chapter 2
Basic Structures: Sets,
Functions, Sequences,
and Sums
Contents 2.1 Sets
2.2 Set Operations
2.3 Functions
2.4 Sequences and Summations
Set Theory
• Definition 1: A set is an unordered collection of objects
• A={1,2,3}
• Definition 2: Objects in a set are called elements, or members of the
set.
• We write a  A to denote that a is an element of the set A.
• we write a  A to denote that a is not an element of the set A.
• It is common for sets to be denoted using uppercase letters.
• Lowercase letters are usually used to denote elements of sets.
• There are several ways to describe a set. One way is to list all the
members of a set, when this is possible. We use a notation where
all members of the set are listed between braces. For example, the
notation {a, b, c, d} represents the set with the four elements a, b, c,
and d. This way of describing a set is known as the roster method.
.1 .2
.3
Visual
List Notation
• The set V of all vowels in the English alphabet can be
written as
• V = {a, e, i, o, u}
• The set O of odd positive integers less than 10 can be
expressed by
• O = {1, 3, 5, 7, 9}
• Although sets are usually used to group together elements with
common properties, there is nothing that prevents a set from
having seemingly unrelated elements. For instance, {a, 2, Fred,
New Jersey} is the set containing the four elements a, 2, Fred,
and New Jersey.
• Sometimes the roster method is used to describe a set without
listing all its members. Some members of the set are listed, and
then ellipses (. . .) are used when the general pattern of three
elements is obvious.
• The set of positive integers less than 100 can be denoted by {1,
2, 3, . . . , 99}.
Set builder notation
• Another way to describe a set is to use set builder
notation. We characterize all those elements in the
set by stating the property or properties they must
have to be members. For instance, the set O of all
odd positive integers less than 10 can be written as
• O = {x|x is an odd positive integer less than 10}
or O = {x ℤ +|x is odd and x<10}
• Q={…,
1
1
,
1
2
,
1
3
,…} ={
𝑚
𝑛
| m, n ∈ ℤ n≠ 0}
• Even integers:
• 2 ℤ={…,-4,-2,0,2,4,…}={2n | n ∈ ℤ}
Additional points
• Sets can be finite or infinite
• A={1, 2, 3, 4, 5, 6}
• Z+ = 1, 2, 3, 4, … all positive integers
• Repeated elements are listed once
• {a, b, a, c, b, a, c}={a, b, c}
• There is no order in a set
• {3,2,1}={1,2,3}={2,1,3}
.a .b
.c
Number systems
• N={1, 2, 3, …}, or {0,1,2,3,…}natural numbers or counting numbers
• W={0,1,2,3,…},whole numbers
• Z={…,-2, -1, 0, 1, 2, …}, integers
• Z+={1, 2, 3, …}, positive integers, zero is neither positive nor negative
• Q={p/q|pZ, qZ, and q0}, rational numbers (fraction numbers and decimals numbers)
• Q+={xR|x=p/q, for positive integers p and q}
• C, the set of complex numbers.
• R, real numbers, i = −1 is not real number
• R+, the set of positive real numbers
• Terminating decimal numbers (finite) and recurring decimal numbers( infinite and repeating)
• Irrational number never terminate and never repeated, there is only one irrational number between any two rational
numbers.
• To get irrational numbers (square ,sum with irrational (rational+irr) , prod with irrational (rational *irr))
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Rational numbers
• Rational numbers=
𝑃
𝑄
p,q are integers , q≠ 0
• 3=
9
3
=
3
1
also 2.5=
25
10
=
5
2
• Terminating decimal (finite)
• 2.5, 3.1, 4.65
• Recurring decimal (infinite and repeating)
•
2
3
= 0.666 = 0.6
•
1
6
= 0.1666 = 0.16
• Test :
37
250
=
37
5∗5∗2∗5
Common sets
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Intervals
• Recall the notation for intervals of real numbers. When a and b are
real numbers with a < b, we write
• [a, b] = {x | a ≤ x ≤ b} closed interval
• [a, b) = {x | a ≤ x < b}
• (a, b] = {x |a < x ≤ b}
• (a, b) = {x |a < x < b} open interval
Example
• The set {N,Z,Q,R} is a set containing four elements, each of which is
a set. The four elements of this set are N, the set of natural
numbers; Z, the set of integers; Q, the set of rational numbers; and
R, the set of real numbers.
• Remark: Note that the concept of a datatype, or type, in computer
science is built upon the concept of a set. In particular, a datatype
or type is the name of a set, together with a set of operations that
can be performed on objects from that set. For example, boolean is
the name of the set {0, 1} together with operators on one or more
elements of this set, such as AND, OR, and NOT.
Definition 3
• Definition 3: Two sets are equal if and only if they
have the same elements.
A=B if x(x  A  x  B)
• {1, 3, 5} and {3, 5, 1} are equal
• The sets {1, 3, 5} and {3, 5, 1} are equal, because they have the
same elements. Note that the order in which the elements of a set
are listed does not matter. Note also that it does not matter if an
element of a set is listed more than once, so {1, 3, 3, 3, 5, 5, 5, 5} is
the same as the set {1, 3, 5} because they have the same elements.
The Empty set
• Empty set (null set):  (or {})
• There is a special set that has no elements. This set is called the
empty set or null set, and is denoted by ∅. The empty set can also
be denoted by { } (that is, we represent the empty set with a pair of
braces that encloses all the elements in this set). Often, a set of
elements with certain properties turns out to be the null set. For
instance, the set of all positive integers that are greater than their
squares is the null set.
• A set with one element is called a singleton set. A common error is
to confuse the empty set ∅ with the set {∅}, which is a singleton set.
The single element of the set {∅} is the empty set itself ! A useful
analogy for remembering this difference is to think of folders in a
computer file system. The empty set can be thought of as an empty
folder and the set consisting of just the empty set can be thought of
as a folder with exactly one folder inside, namely, the empty folder.
Venn diagram
• Venn diagram to graphically represent sets
• Universal set U: rectangle
• Sets: circles
• Elements of a set: point
FIGURE 1 Venn Diagram for the Set of Vowels.
Subsets
• Definition 4: The set A is a subset of B if and only if every
element of A is also an element of B.
A  B if x(x  A  x  B)
• Theorem 1: For every set S,
(1)   S and (2) S  S.
• Proper subset: A is a proper subset of B, we note A  B, if
x(x  A  x  B)  x(x  B  x  A)
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Subsets
• If AB and BA, then A=B
• Sets may have other sets as members
• A={, {a}, {b}, {a,b}}
B={x|x is a subset of the set {a,b}}
• A=B
FIGURE 2 Venn Diagram Showing that A Is a Subset of B.
The Size of a Set
• Definition 5: If there are exactly n distinct members
in the set S (n is a nonnegative integer), we say
that S is a finite set and that n is the cardinality of
S.
• |S|= n
• ||=0 , |{}|=1 ,|{ }|=0
• Definition 6: a set is infinite if it’s not finite.
• Z+
Elements and cardinality
• Let C={yellow, blue, red}
• Yellow is an element of C ,yellow∈ 𝐶
• Green is not an element of C, Green ∉ 𝐶
• The cardinality (size) of C is 3 ,|c|=3
Exercise
• List the elements of D. D={x ∈ ℤ+
| x<6}
• 1,2,3,4,5
• What is the cardinality of D?
• |D|=5
• What is the cardinality of {,{a,b}}
• 2
• What is the cardinality of {,{a},{b}}
• 3
• What is the cardinality of {,a,{b}}
• 3
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
The Power Set
• Definition 7: The power set of S, P(S), is the set of
all subset of the set S.
• P({0,1,2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}.
• P()={∅}
• P({})={∅, {∅}}
• If a set has n elements, then its power set has 2n
elements(2 choices per element).
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Cartesian Products
• Definition 8: Ordered n-tuple (a1, a2, …, an) is the
ordered collection that has ai as its ith element for i=1,
2, …, n.
• Definition 9: Cartesian product of A and B, denoted
by A B, is the set of all ordered pairs (a, b), where a
 A and b  B.
A B = {(a, b)| a  A  b  B}
• E.g. A = {1, 2}, B = {a, b, c}
• A B={(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.
• B×A =...
• A  B and B  A are not equal, unless A= or B= or
A=B
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
• Definition 10: Cartesian product of A1, A2, …, An,
denoted by A1 A2  … An, is the set of all ordered n-
tuples (a1, a2, …, an), where ai  Ai for i=1,2,…,n.
A1 A2  … An = {(a1, a2, …, an)| ai  Ai for i=1,2,…,n}
• A = {0, 1}, B = {1, 2}, and C = {0, 1, 2}
• 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)}.
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
2.2 Set Operations
• Definition 1: The union of the sets A and B,
denoted by AB, is the set containing those
elements that are either in A or in B, or in both.
• AB={x|xA  xB}
• Definition 2: The intersection of the sets A and B,
denoted by AB, is the set containing those
elements in both A and B.
• A  B={x|xA  xB}
FIGURE 1 Venn Diagrams Representing the Union and
intersection of A and B.
P. 122
 
42
• Definition 3: Two sets are disjoint (‫متداخلة‬ ‫)غير‬if their
intersection is the empty set.
• |AB|=|A|+|B|-| A  B |
• {1,2,3} and {3,4,5} ->not disjoint
• {a,b} and {3,4} -> disjoint
• Definition 4: The difference of the sets A
and B, denoted by A-B, is the set
containing those elements that are in A but
not in B.
• Complement of B with respect to A
• A-B={x|xA  xB}
• Definition 5: The complement of the set A,
denoted by Ā, is the complement of A with
resepect to U.
• Ā = {x|xA}
FIGURE 3 (2.2)
FIGURE 3 Venn Diagram for the Difference of A and B.
P. 123
45
FIGURE 4 (2.2)
FIGURE 4 Venn Diagram for the Complement of the Set A.
P. 123
46
• {1, 3, 5} ∪ {1, 2, 3} = {1, 2, 3, 5}
• {1, 3, 5} ∩ {1, 2, 3} = {1, 3}
• A = {1, 3, 5, 7, 9} , B = {2, 4, 6, 8, 10}, A ∩ B = ∅, A
and B are disjoint
• {1, 3, 5} − {1, 2, 3} ={5}
• Let A be the set of positive integers greater than 10. Then Ā
= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
TABLE 1 (2.2)
P. 134
48
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Generalized Unions and
Intersections
• Definition 6: The union of a collection of sets is
the set containing those elements that are
members of at least one set in the collection.
• A1 A2  …  An =
• Definition 7: The intersection of a collection of
sets is the set containing those elements that
are members of all the sets in the collection.
• A1 A2  …  An =
• Computer Representation of Sets
• Using bit strings

n
i
i
A
1


n
i
i
A
1

FIGURE 5 (2.2)
FIGURE 5 The Union and Intersection of A, B, and C.
P. 127
52
Exercise
• Show that if A, B, and C are sets, then 𝐴 ∩ 𝐵 ∩ 𝐶= 𝐴
∪ 𝐵 ∪ 𝐶
• a) by showing each side is a subset of the other side:
…
• b) using a membership table.
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Homework
• Exercises in book page 125 and 136
Functions
• More tutorials :
• https://www.youtube.com/watch?v=OixshZzH8t0
• https://www.youtube.com/watch?v=bZred_Ksz2k
• https://www.youtube.com/watch?v=gBqBZRElQZo
• https://www.youtube.com/watch?v=Kn-LrdgHVhQ
• https://www.youtube.com/watch?v=yLyqXEDnr8E
• https://www.youtube.com/watch?v=GLHWih_RB38
• https://www.youtube.com/watch?v=xKNX8BUWR0g
2.3 Functions
NOT a function
Cont .
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Sum and product of function
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
One-to-One(injective) and Onto (surjective)Functions
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
FIGURE 5 (2.3)
FIGURE 5 Examples of Different Types of Correspondences.
P. 139
96
Inverse Functions and Compositions
of Functions
• Definition 9: Let f be a one-to-one correspondence
from A to B. The inverse function of f is the function
that assigns to an element b in B the unique
element a in A such that f(a)=b.
• f--1(b)=a when f(a)=b
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
FIGURE 6 (2.3)
FIGURE 6 The Function f -1 Is the Inverse of Function f.
P. 139
99
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Exercise
• Let f be the function from {a, b, c} to {1, 2, 3} such that f (a) =
2, f (b) = 3, and f (c) = 1. Is f invertible, and if it is, what is its
inverse?
• f is …
• Let f : Z → Z be such that f(x) = x + 1. Is f invertible, and if it is,
what is its inverse?
• f....
Composition of functions
• Definition 10: Let g be a function from A to B, and f
be a function from B to C. The composition of
functions f and g, denoted by f○g, is defined by
f○g(a) = f(g(a))
• f○g and g○f are not equal
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
FIGURE 7 (2.3)
FIGURE 7 The Composition of the Functions f and g.
P. 141
106
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Exercise
• Let g be the function such that g(a)=b, g(b)=c, and g(c)=a. Let
f be the function such that f (a)=3, f (b)=2, and f (c)=1. What is
f○g and g○f ?
• The composition f○g is defined by (f○g)(a)= f(g(a))=
…
• Note that g○f is not defined, because the range of f is not a subset of
the domain of g
Exercise
• Let f and g be the functions from ℤ to ℤ defined by
f(x)=2x+3 and g(x)=3x+2. What are f○g and g○f ?
• (f○g)(x) = …
• (g○f )(x) = …
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Some important Functions
• Definition 12: The floor function assigns to x the
largest integer that is less than or equal to x (x).
The ceiling function assigns to x the smallest
integer that is greater than or equal to x (x).
• 1/2 = 0, - 1/2  = -1, 3.1 = 3, 7 = 7, 1/2 = 1, - 1/2 
= 0,  3.1  = 4, 7 = 7
P. 150
112
2.5 Sequences and Summations
• Definition 1: A sequence is a function from a subset
of the set of integers to a set S. We use an to
denote the image of the integer n (a term of the
sequence)
• Notation: {an} describes the sequence
• Ex: an=1/n
Progressions
• Definition 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
• Definition 3: A arithmetic progression is a
sequence of the form
a, a+d, a+2d, …, a+nd, …
where the initial term a and the common
difference d are real numbers
Examples
• {bn} with bn = (−1)n
• {cn} with cn = 2・5n
• {dn} with dn= 6・(1/3) n
Examples
• The sequences {sn} with sn = −1 + 4n
• The sequences {tn} with tn = 7 − 3n
Exercise
• Find formulae for the sequences with the following first terms:
• 1, 1/2, 1/4, 1/8, 1/16
• an =
• 1, 3, 5, 7, 9, …
• an =
• 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, …
• an =
TABLE 1 (2.4)
P. 153
118
Summations
• Summation notation:
• am+am+1+…+an
• j: index of summation
• m: lower limit
• n: upper limit


n
m
j
j
a  
n
m
j j
a  
 n
j
m j
a
Exercises
• Use summation notation to express the sum of the
first 100 terms of the sequence {aj}, where aj = 1/j
for j = 1, 2, 3, . . . .
• What is the value of


100
1
1
j j


5
1
2
j
j
Exercise
• Find


100
50
2
j
k
TABLE 2 (2.4)
P. 157
122
• What are the values of these sums?



5
1
)
1
(
k
k 

100
1
k
k 

100
1
3
k

 
4
1
3
1
i j
ij 
 

4
1
3
0
2
2
i j
j
i 
 

3
1
4
0
i j
j
i

More Related Content

PPTX
Sets and relations
PDF
Set, Relations and Functions
PPT
Set in discrete mathematics
PPTX
Discrete mathematic
PPTX
Pigeonhole Principle,Cardinality,Countability
PDF
Set theory
PPTX
number theory.ppt
PPT
Relations
Sets and relations
Set, Relations and Functions
Set in discrete mathematics
Discrete mathematic
Pigeonhole Principle,Cardinality,Countability
Set theory
number theory.ppt
Relations

What's hot (20)

PPTX
Pigeonhole Principle
PDF
Discrete Structures. Lecture 1
PPT
Graphs - Discrete Math
PPTX
Fuzzy sets
PDF
Intro to Discrete Mathematics
PPT
DESIGN AND ANALYSIS OF ALGORITHMS
PPT
Discrete Math Lecture 03: Methods of Proof
PPTX
Fundamental principle of counting- ch 6 - Discrete Mathematics
PPTX
Turing machine
PPTX
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
PDF
Recurrence relations
PPT
Discrete mathematics
PDF
PPTX
Error Finding in Numerical method
PPTX
Fundamental principle of counting -Discrete Mathematics
PPTX
Modular arithmetic
PPT
systems of linear equations & matrices
PDF
Logical equivalence, laws of logic
PPT
Discrete Math Lecture 01: Propositional Logic
PPTX
Context free grammar
Pigeonhole Principle
Discrete Structures. Lecture 1
Graphs - Discrete Math
Fuzzy sets
Intro to Discrete Mathematics
DESIGN AND ANALYSIS OF ALGORITHMS
Discrete Math Lecture 03: Methods of Proof
Fundamental principle of counting- ch 6 - Discrete Mathematics
Turing machine
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Recurrence relations
Discrete mathematics
Error Finding in Numerical method
Fundamental principle of counting -Discrete Mathematics
Modular arithmetic
systems of linear equations & matrices
Logical equivalence, laws of logic
Discrete Math Lecture 01: Propositional Logic
Context free grammar
Ad

Similar to Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices (20)

PPTX
Discrete Structure Mathematics lecture 1
PPT
Set theory-ppt
PPT
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
PPT
4898850.ppt
PPTX
Discrete mathematics OR Structure
PPT
discrete maths notes.ppt
PPTX
Set theory
PPTX
General Mathematis with the Topic of SETs Story
PPTX
Explore the foundational concepts of sets in discrete mathematics
PPT
Introduction to set theory with application
PPT
A set is a structure, representing an unordered collection (group, plurality)...
PPT
SetTheory.ppt
PPT
SetTheory.ppt
PPT
1. set theory
PPTX
Chapter2.pptx
PPSX
Introduction to Sets
PPTX
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
PPTX
PDF
Sets functions-sequences-exercises
PPTX
Set Theory
Discrete Structure Mathematics lecture 1
Set theory-ppt
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
4898850.ppt
Discrete mathematics OR Structure
discrete maths notes.ppt
Set theory
General Mathematis with the Topic of SETs Story
Explore the foundational concepts of sets in discrete mathematics
Introduction to set theory with application
A set is a structure, representing an unordered collection (group, plurality)...
SetTheory.ppt
SetTheory.ppt
1. set theory
Chapter2.pptx
Introduction to Sets
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
Sets functions-sequences-exercises
Set Theory
Ad

More from Amr Rashed (19)

PDF
Introduction to Deep Learning: Concepts, Architectures, and Applications
PPTX
Introduction to Autoencoders: Types and Applications
PPTX
Introduction to the Fundamentals of Computer Networks
PPTX
Introduction to analog communication system
PPTX
introduction to embedded system presentation
PPT
Discrete Math Ch5 counting + proofs
PPTX
Discrete Math Chapter: 8 Relations
PPTX
Introduction to deep learning
PPTX
Implementation of DNA sequence alignment algorithms using Fpga ,ML,and CNN
PPTX
امن نظم المعلومات وامن الشبكات
PPTX
Machine learning workshop using Orange datamining framework
PPTX
مقدمة عن الفيجوال بيسك 9-2019
PPTX
Deep learning tutorial 9/2019
PPTX
Deep Learning Tutorial
PDF
Matlab plotting
PPT
License Plate Recognition
PDF
Introduction to FPGA, VHDL
PDF
Introduction to Matlab
PDF
Digital image processing using matlab
Introduction to Deep Learning: Concepts, Architectures, and Applications
Introduction to Autoencoders: Types and Applications
Introduction to the Fundamentals of Computer Networks
Introduction to analog communication system
introduction to embedded system presentation
Discrete Math Ch5 counting + proofs
Discrete Math Chapter: 8 Relations
Introduction to deep learning
Implementation of DNA sequence alignment algorithms using Fpga ,ML,and CNN
امن نظم المعلومات وامن الشبكات
Machine learning workshop using Orange datamining framework
مقدمة عن الفيجوال بيسك 9-2019
Deep learning tutorial 9/2019
Deep Learning Tutorial
Matlab plotting
License Plate Recognition
Introduction to FPGA, VHDL
Introduction to Matlab
Digital image processing using matlab

Recently uploaded (20)

PDF
composite construction of structures.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Well-logging-methods_new................
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Construction Project Organization Group 2.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Sustainable Sites - Green Building Construction
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
DOCX
573137875-Attendance-Management-System-original
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Welding lecture in detail for understanding
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
composite construction of structures.pdf
Lecture Notes Electrical Wiring System Components
Structs to JSON How Go Powers REST APIs.pdf
Internet of Things (IOT) - A guide to understanding
Well-logging-methods_new................
Model Code of Practice - Construction Work - 21102022 .pdf
Foundation to blockchain - A guide to Blockchain Tech
Construction Project Organization Group 2.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Arduino robotics embedded978-1-4302-3184-4.pdf
Sustainable Sites - Green Building Construction
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
573137875-Attendance-Management-System-original
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Welding lecture in detail for understanding
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
bas. eng. economics group 4 presentation 1.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx

Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices

  • 1. Discrete Structure Mathematics Course: Discrete Structures (501215-3) Prepared by : DR. AMR RASHED PhD in Electronics & Communication Engineering
  • 2. References 1-Rosen, Kenneth H. "Discrete Mathematics and Its Applications.“ seventh edition 2-introduction to set theory 3-rational numbers 4-Introduction to rational and irrational numbers 5-Classification of Numbers 6-SUBSETS AND POWER SETS 7-cartesian products 7-Examples 8-Functions
  • 3. Course Content: Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices Chapter 8: Advanced Counting Techniques Chapter 1: The Foundations: Logic and Proofs Chapter 4: Number Theory and Cryptography Chapter 5: Induction and Recursion Chapter 6: Counting
  • 4. Chapter 2 Basic Structures: Sets, Functions, Sequences, and Sums
  • 5. Contents 2.1 Sets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations
  • 6. Set Theory • Definition 1: A set is an unordered collection of objects • A={1,2,3} • Definition 2: Objects in a set are called elements, or members of the set. • We write a  A to denote that a is an element of the set A. • we write a  A to denote that a is not an element of the set A. • It is common for sets to be denoted using uppercase letters. • Lowercase letters are usually used to denote elements of sets. • There are several ways to describe a set. One way is to list all the members of a set, when this is possible. We use a notation where all members of the set are listed between braces. For example, the notation {a, b, c, d} represents the set with the four elements a, b, c, and d. This way of describing a set is known as the roster method. .1 .2 .3 Visual List Notation
  • 7. • The set V of all vowels in the English alphabet can be written as • V = {a, e, i, o, u} • The set O of odd positive integers less than 10 can be expressed by • O = {1, 3, 5, 7, 9} • Although sets are usually used to group together elements with common properties, there is nothing that prevents a set from having seemingly unrelated elements. For instance, {a, 2, Fred, New Jersey} is the set containing the four elements a, 2, Fred, and New Jersey. • Sometimes the roster method is used to describe a set without listing all its members. Some members of the set are listed, and then ellipses (. . .) are used when the general pattern of three elements is obvious. • The set of positive integers less than 100 can be denoted by {1, 2, 3, . . . , 99}.
  • 8. Set builder notation • Another way to describe a set is to use set builder notation. We characterize all those elements in the set by stating the property or properties they must have to be members. For instance, the set O of all odd positive integers less than 10 can be written as • O = {x|x is an odd positive integer less than 10} or O = {x ℤ +|x is odd and x<10} • Q={…, 1 1 , 1 2 , 1 3 ,…} ={ 𝑚 𝑛 | m, n ∈ ℤ n≠ 0} • Even integers: • 2 ℤ={…,-4,-2,0,2,4,…}={2n | n ∈ ℤ}
  • 9. Additional points • Sets can be finite or infinite • A={1, 2, 3, 4, 5, 6} • Z+ = 1, 2, 3, 4, … all positive integers • Repeated elements are listed once • {a, b, a, c, b, a, c}={a, b, c} • There is no order in a set • {3,2,1}={1,2,3}={2,1,3} .a .b .c
  • 10. Number systems • N={1, 2, 3, …}, or {0,1,2,3,…}natural numbers or counting numbers • W={0,1,2,3,…},whole numbers • Z={…,-2, -1, 0, 1, 2, …}, integers • Z+={1, 2, 3, …}, positive integers, zero is neither positive nor negative • Q={p/q|pZ, qZ, and q0}, rational numbers (fraction numbers and decimals numbers) • Q+={xR|x=p/q, for positive integers p and q} • C, the set of complex numbers. • R, real numbers, i = −1 is not real number • R+, the set of positive real numbers • Terminating decimal numbers (finite) and recurring decimal numbers( infinite and repeating) • Irrational number never terminate and never repeated, there is only one irrational number between any two rational numbers. • To get irrational numbers (square ,sum with irrational (rational+irr) , prod with irrational (rational *irr))
  • 12. Rational numbers • Rational numbers= 𝑃 𝑄 p,q are integers , q≠ 0 • 3= 9 3 = 3 1 also 2.5= 25 10 = 5 2 • Terminating decimal (finite) • 2.5, 3.1, 4.65 • Recurring decimal (infinite and repeating) • 2 3 = 0.666 = 0.6 • 1 6 = 0.1666 = 0.16 • Test : 37 250 = 37 5∗5∗2∗5
  • 15. Intervals • Recall the notation for intervals of real numbers. When a and b are real numbers with a < b, we write • [a, b] = {x | a ≤ x ≤ b} closed interval • [a, b) = {x | a ≤ x < b} • (a, b] = {x |a < x ≤ b} • (a, b) = {x |a < x < b} open interval
  • 16. Example • The set {N,Z,Q,R} is a set containing four elements, each of which is a set. The four elements of this set are N, the set of natural numbers; Z, the set of integers; Q, the set of rational numbers; and R, the set of real numbers. • Remark: Note that the concept of a datatype, or type, in computer science is built upon the concept of a set. In particular, a datatype or type is the name of a set, together with a set of operations that can be performed on objects from that set. For example, boolean is the name of the set {0, 1} together with operators on one or more elements of this set, such as AND, OR, and NOT.
  • 17. Definition 3 • Definition 3: Two sets are equal if and only if they have the same elements. A=B if x(x  A  x  B) • {1, 3, 5} and {3, 5, 1} are equal • The sets {1, 3, 5} and {3, 5, 1} are equal, because they have the same elements. Note that the order in which the elements of a set are listed does not matter. Note also that it does not matter if an element of a set is listed more than once, so {1, 3, 3, 3, 5, 5, 5, 5} is the same as the set {1, 3, 5} because they have the same elements.
  • 18. The Empty set • Empty set (null set):  (or {}) • There is a special set that has no elements. This set is called the empty set or null set, and is denoted by ∅. The empty set can also be denoted by { } (that is, we represent the empty set with a pair of braces that encloses all the elements in this set). Often, a set of elements with certain properties turns out to be the null set. For instance, the set of all positive integers that are greater than their squares is the null set. • A set with one element is called a singleton set. A common error is to confuse the empty set ∅ with the set {∅}, which is a singleton set. The single element of the set {∅} is the empty set itself ! A useful analogy for remembering this difference is to think of folders in a computer file system. The empty set can be thought of as an empty folder and the set consisting of just the empty set can be thought of as a folder with exactly one folder inside, namely, the empty folder.
  • 19. Venn diagram • Venn diagram to graphically represent sets • Universal set U: rectangle • Sets: circles • Elements of a set: point FIGURE 1 Venn Diagram for the Set of Vowels.
  • 20. Subsets • Definition 4: The set A is a subset of B if and only if every element of A is also an element of B. A  B if x(x  A  x  B) • Theorem 1: For every set S, (1)   S and (2) S  S. • Proper subset: A is a proper subset of B, we note A  B, if x(x  A  x  B)  x(x  B  x  A)
  • 22. Subsets • If AB and BA, then A=B • Sets may have other sets as members • A={, {a}, {b}, {a,b}} B={x|x is a subset of the set {a,b}} • A=B FIGURE 2 Venn Diagram Showing that A Is a Subset of B.
  • 23. The Size of a Set • Definition 5: If there are exactly n distinct members in the set S (n is a nonnegative integer), we say that S is a finite set and that n is the cardinality of S. • |S|= n • ||=0 , |{}|=1 ,|{ }|=0 • Definition 6: a set is infinite if it’s not finite. • Z+
  • 24. Elements and cardinality • Let C={yellow, blue, red} • Yellow is an element of C ,yellow∈ 𝐶 • Green is not an element of C, Green ∉ 𝐶 • The cardinality (size) of C is 3 ,|c|=3
  • 25. Exercise • List the elements of D. D={x ∈ ℤ+ | x<6} • 1,2,3,4,5 • What is the cardinality of D? • |D|=5 • What is the cardinality of {,{a,b}} • 2 • What is the cardinality of {,{a},{b}} • 3 • What is the cardinality of {,a,{b}} • 3
  • 27. The Power Set • Definition 7: The power set of S, P(S), is the set of all subset of the set S. • P({0,1,2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}. • P()={∅} • P({})={∅, {∅}} • If a set has n elements, then its power set has 2n elements(2 choices per element).
  • 35. Cartesian Products • Definition 8: Ordered n-tuple (a1, a2, …, an) is the ordered collection that has ai as its ith element for i=1, 2, …, n. • Definition 9: Cartesian product of A and B, denoted by A B, is the set of all ordered pairs (a, b), where a  A and b  B. A B = {(a, b)| a  A  b  B} • E.g. A = {1, 2}, B = {a, b, c} • A B={(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}. • B×A =... • A  B and B  A are not equal, unless A= or B= or A=B
  • 37. • Definition 10: Cartesian product of A1, A2, …, An, denoted by A1 A2  … An, is the set of all ordered n- tuples (a1, a2, …, an), where ai  Ai for i=1,2,…,n. A1 A2  … An = {(a1, a2, …, an)| ai  Ai for i=1,2,…,n} • A = {0, 1}, B = {1, 2}, and C = {0, 1, 2} • 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)}.
  • 41. 2.2 Set Operations • Definition 1: The union of the sets A and B, denoted by AB, is the set containing those elements that are either in A or in B, or in both. • AB={x|xA  xB} • Definition 2: The intersection of the sets A and B, denoted by AB, is the set containing those elements in both A and B. • A  B={x|xA  xB}
  • 42. FIGURE 1 Venn Diagrams Representing the Union and intersection of A and B. P. 122   42
  • 43. • Definition 3: Two sets are disjoint (‫متداخلة‬ ‫)غير‬if their intersection is the empty set. • |AB|=|A|+|B|-| A  B | • {1,2,3} and {3,4,5} ->not disjoint • {a,b} and {3,4} -> disjoint
  • 44. • Definition 4: The difference of the sets A and B, denoted by A-B, is the set containing those elements that are in A but not in B. • Complement of B with respect to A • A-B={x|xA  xB} • Definition 5: The complement of the set A, denoted by Ā, is the complement of A with resepect to U. • Ā = {x|xA}
  • 45. FIGURE 3 (2.2) FIGURE 3 Venn Diagram for the Difference of A and B. P. 123 45
  • 46. FIGURE 4 (2.2) FIGURE 4 Venn Diagram for the Complement of the Set A. P. 123 46
  • 47. • {1, 3, 5} ∪ {1, 2, 3} = {1, 2, 3, 5} • {1, 3, 5} ∩ {1, 2, 3} = {1, 3} • A = {1, 3, 5, 7, 9} , B = {2, 4, 6, 8, 10}, A ∩ B = ∅, A and B are disjoint • {1, 3, 5} − {1, 2, 3} ={5} • Let A be the set of positive integers greater than 10. Then Ā = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
  • 51. Generalized Unions and Intersections • Definition 6: The union of a collection of sets is the set containing those elements that are members of at least one set in the collection. • A1 A2  …  An = • Definition 7: The intersection of a collection of sets is the set containing those elements that are members of all the sets in the collection. • A1 A2  …  An = • Computer Representation of Sets • Using bit strings  n i i A 1   n i i A 1 
  • 52. FIGURE 5 (2.2) FIGURE 5 The Union and Intersection of A, B, and C. P. 127 52
  • 53. Exercise • Show that if A, B, and C are sets, then 𝐴 ∩ 𝐵 ∩ 𝐶= 𝐴 ∪ 𝐵 ∪ 𝐶 • a) by showing each side is a subset of the other side: … • b) using a membership table.
  • 67. Homework • Exercises in book page 125 and 136
  • 68. Functions • More tutorials : • https://www.youtube.com/watch?v=OixshZzH8t0 • https://www.youtube.com/watch?v=bZred_Ksz2k • https://www.youtube.com/watch?v=gBqBZRElQZo • https://www.youtube.com/watch?v=Kn-LrdgHVhQ • https://www.youtube.com/watch?v=yLyqXEDnr8E • https://www.youtube.com/watch?v=GLHWih_RB38 • https://www.youtube.com/watch?v=xKNX8BUWR0g
  • 80. Sum and product of function
  • 83. One-to-One(injective) and Onto (surjective)Functions
  • 96. FIGURE 5 (2.3) FIGURE 5 Examples of Different Types of Correspondences. P. 139 96
  • 97. Inverse Functions and Compositions of Functions • Definition 9: Let f be a one-to-one correspondence from A to B. The inverse function of f is the function that assigns to an element b in B the unique element a in A such that f(a)=b. • f--1(b)=a when f(a)=b
  • 99. FIGURE 6 (2.3) FIGURE 6 The Function f -1 Is the Inverse of Function f. P. 139 99
  • 102. Exercise • Let f be the function from {a, b, c} to {1, 2, 3} such that f (a) = 2, f (b) = 3, and f (c) = 1. Is f invertible, and if it is, what is its inverse? • f is … • Let f : Z → Z be such that f(x) = x + 1. Is f invertible, and if it is, what is its inverse? • f....
  • 103. Composition of functions • Definition 10: Let g be a function from A to B, and f be a function from B to C. The composition of functions f and g, denoted by f○g, is defined by f○g(a) = f(g(a)) • f○g and g○f are not equal
  • 106. FIGURE 7 (2.3) FIGURE 7 The Composition of the Functions f and g. P. 141 106
  • 108. Exercise • Let g be the function such that g(a)=b, g(b)=c, and g(c)=a. Let f be the function such that f (a)=3, f (b)=2, and f (c)=1. What is f○g and g○f ? • The composition f○g is defined by (f○g)(a)= f(g(a))= … • Note that g○f is not defined, because the range of f is not a subset of the domain of g
  • 109. Exercise • Let f and g be the functions from ℤ to ℤ defined by f(x)=2x+3 and g(x)=3x+2. What are f○g and g○f ? • (f○g)(x) = … • (g○f )(x) = …
  • 111. Some important Functions • Definition 12: The floor function assigns to x the largest integer that is less than or equal to x (x). The ceiling function assigns to x the smallest integer that is greater than or equal to x (x). • 1/2 = 0, - 1/2  = -1, 3.1 = 3, 7 = 7, 1/2 = 1, - 1/2  = 0,  3.1  = 4, 7 = 7
  • 113. 2.5 Sequences and Summations • Definition 1: A sequence is a function from a subset of the set of integers to a set S. We use an to denote the image of the integer n (a term of the sequence) • Notation: {an} describes the sequence • Ex: an=1/n
  • 114. Progressions • Definition 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 • Definition 3: A arithmetic progression is a sequence of the form a, a+d, a+2d, …, a+nd, … where the initial term a and the common difference d are real numbers
  • 115. Examples • {bn} with bn = (−1)n • {cn} with cn = 2・5n • {dn} with dn= 6・(1/3) n
  • 116. Examples • The sequences {sn} with sn = −1 + 4n • The sequences {tn} with tn = 7 − 3n
  • 117. Exercise • Find formulae for the sequences with the following first terms: • 1, 1/2, 1/4, 1/8, 1/16 • an = • 1, 3, 5, 7, 9, … • an = • 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, … • an =
  • 118. TABLE 1 (2.4) P. 153 118
  • 119. Summations • Summation notation: • am+am+1+…+an • j: index of summation • m: lower limit • n: upper limit   n m j j a   n m j j a    n j m j a
  • 120. Exercises • Use summation notation to express the sum of the first 100 terms of the sequence {aj}, where aj = 1/j for j = 1, 2, 3, . . . . • What is the value of   100 1 1 j j   5 1 2 j j
  • 122. TABLE 2 (2.4) P. 157 122
  • 123. • What are the values of these sums?    5 1 ) 1 ( k k   100 1 k k   100 1 3 k    4 1 3 1 i j ij     4 1 3 0 2 2 i j j i     3 1 4 0 i j j i