SlideShare ist ein Scribd-Unternehmen logo
1 von 123
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))
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
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)
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
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).
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
• 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)}.
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
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.
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 .
Sum and product of function
One-to-One(injective) and Onto (surjective)Functions
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
FIGURE 6 (2.3)
FIGURE 6 The Function f -1 Is the Inverse of Function f.
P. 139
99
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
FIGURE 7 (2.3)
FIGURE 7 The Composition of the Functions f and g.
P. 141
106
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) = …
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

Weitere ähnliche Inhalte

Was ist angesagt?

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
Set Theory
Set TheorySet Theory
Set Theory
itutor
 

Was ist angesagt? (20)

Sets, functions and groups
Sets, functions and groupsSets, functions and groups
Sets, functions and groups
 
Complex Number's Applications
Complex Number's ApplicationsComplex Number's Applications
Complex Number's Applications
 
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
 
Set theory
Set theorySet theory
Set theory
 
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDiscrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
 
Determinants
DeterminantsDeterminants
Determinants
 
Hasse diagram
Hasse diagramHasse diagram
Hasse diagram
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Rules of inference
Rules of inferenceRules of inference
Rules of inference
 
lattice
 lattice lattice
lattice
 
Set Theory
Set TheorySet Theory
Set Theory
 
Recursion
RecursionRecursion
Recursion
 
Graphs in data structure
Graphs in data structureGraphs in data structure
Graphs in data structure
 
GCD of n Numbers
GCD of n NumbersGCD of n Numbers
GCD of n Numbers
 
Predicates and Quantifiers
Predicates and QuantifiersPredicates and Quantifiers
Predicates and Quantifiers
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiers
 
2.2 Set Operations
2.2 Set Operations2.2 Set Operations
2.2 Set Operations
 
Unit 1 quantifiers
Unit 1  quantifiersUnit 1  quantifiers
Unit 1 quantifiers
 
Discrete Mathematics and Its Applications 7th Edition Rose Solutions Manual
Discrete Mathematics and Its Applications 7th Edition Rose Solutions ManualDiscrete Mathematics and Its Applications 7th Edition Rose Solutions Manual
Discrete Mathematics and Its Applications 7th Edition Rose Solutions Manual
 
System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 

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

Introduction to Sets
Introduction to SetsIntroduction to Sets
Introduction to Sets
Ashita Agrawal
 

Ähnlich wie Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, and Matrices (20)

Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1
 
Set theory
Set theorySet theory
Set theory
 
set an introduction.pptx
set an introduction.pptxset an introduction.pptx
set an introduction.pptx
 
Set theory
Set theorySet theory
Set theory
 
Introduction to Sets
Introduction to SetsIntroduction to Sets
Introduction to Sets
 
sets.pptx
sets.pptxsets.pptx
sets.pptx
 
7-Sets-1.ppt
7-Sets-1.ppt7-Sets-1.ppt
7-Sets-1.ppt
 
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptxMoazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
 
file_5.pptx
file_5.pptxfile_5.pptx
file_5.pptx
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
 
Blackbox task 2
Blackbox task 2Blackbox task 2
Blackbox task 2
 
SetTheory.ppt
SetTheory.pptSetTheory.ppt
SetTheory.ppt
 
SetTheory.ppt
SetTheory.pptSetTheory.ppt
SetTheory.ppt
 
1. set theory
1. set theory1. set theory
1. set theory
 
Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"
 
Set theory and its operations
Set theory and its operations Set theory and its operations
Set theory and its operations
 
sets.ppt
sets.pptsets.ppt
sets.ppt
 
Grade 7 Sets.ppt
Grade 7 Sets.pptGrade 7 Sets.ppt
Grade 7 Sets.ppt
 
Set and function.pptx
Set and function.pptxSet and function.pptx
Set and function.pptx
 
1. sets
1. sets1. sets
1. sets
 

Mehr von Amr Rashed

Mehr von Amr Rashed (15)

introduction to embedded system presentation
introduction to embedded system presentationintroduction to embedded system presentation
introduction to embedded system presentation
 
Discrete Math Ch5 counting + proofs
Discrete Math Ch5 counting + proofsDiscrete Math Ch5 counting + proofs
Discrete Math Ch5 counting + proofs
 
Discrete Math Chapter: 8 Relations
Discrete Math Chapter: 8 RelationsDiscrete Math Chapter: 8 Relations
Discrete Math Chapter: 8 Relations
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Implementation of DNA sequence alignment algorithms using Fpga ,ML,and CNN
Implementation of DNA sequence alignment algorithms  using Fpga ,ML,and CNNImplementation of DNA sequence alignment algorithms  using Fpga ,ML,and CNN
Implementation of DNA sequence alignment algorithms using Fpga ,ML,and CNN
 
امن نظم المعلومات وامن الشبكات
امن نظم المعلومات وامن الشبكاتامن نظم المعلومات وامن الشبكات
امن نظم المعلومات وامن الشبكات
 
Machine learning workshop using Orange datamining framework
Machine learning workshop using Orange datamining frameworkMachine learning workshop using Orange datamining framework
Machine learning workshop using Orange datamining framework
 
مقدمة عن الفيجوال بيسك 9-2019
مقدمة عن الفيجوال بيسك  9-2019مقدمة عن الفيجوال بيسك  9-2019
مقدمة عن الفيجوال بيسك 9-2019
 
Deep learning tutorial 9/2019
Deep learning tutorial 9/2019Deep learning tutorial 9/2019
Deep learning tutorial 9/2019
 
Deep Learning Tutorial
Deep Learning TutorialDeep Learning Tutorial
Deep Learning Tutorial
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
License Plate Recognition
License Plate RecognitionLicense Plate Recognition
License Plate Recognition
 
Introduction to FPGA, VHDL
Introduction to FPGA, VHDL  Introduction to FPGA, VHDL
Introduction to FPGA, VHDL
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Digital image processing using matlab
Digital image processing using matlab Digital image processing using matlab
Digital image processing using matlab
 

Kürzlich hochgeladen

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Kürzlich hochgeladen (20)

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

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))
  • 11.
  • 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
  • 14.
  • 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)
  • 21.
  • 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
  • 26.
  • 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).
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 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
  • 36.
  • 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)}.
  • 38.
  • 39.
  • 40.
  • 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}.
  • 49.
  • 50.
  • 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.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 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
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80. Sum and product of function
  • 81.
  • 82.
  • 83. One-to-One(injective) and Onto (surjective)Functions
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 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
  • 98.
  • 99. FIGURE 6 (2.3) FIGURE 6 The Function f -1 Is the Inverse of Function f. P. 139 99
  • 100.
  • 101.
  • 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
  • 104.
  • 105.
  • 106. FIGURE 7 (2.3) FIGURE 7 The Composition of the Functions f and g. P. 141 106
  • 107.
  • 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) = …
  • 110.
  • 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