Course Instructors: Dr. Victor T. Odumuyiwa Dr. Ufuoma C. Ogude Department of Computer Sciences University of Lagos
Course Instructors: Dr. Victor T. Odumuyiwa Dr. Ufuoma C. Ogude Department of Computer Sciences University of Lagos
Discrete Mathematics II
Course Instructors:
Dr. Victor T. Odumuyiwa
Dr. Ufuoma C. Ogude
•Lectures:
– E 304, Wednesday 10:00 am to 11:00 am
– E 304, Thursday 8:00 am to 10:00 am
Goal of CSC 413
The goal of this course is to introduce students to a range of
mathematical tools and skills from discrete mathematics that are
widely used in Computer Sciences and Engineering.
Mathematical tools:
Mathematical skills:
proof techniques
discrete probability,
NP-Completeness.
Course Material
Textbook
Discrete Mathematics
and Its Applications
by Kenneth H. Rosen
Properties:
Combining relations:
, , \, composite of relations
Representing relations:
0 R a b
a
0 X X
1
1 X
b
2 X
2
Relations
When (a, b) belongs to R, a is said to be related to b by R.
Example3:
Let P be a set of people, C be a set of cars, and D be the
relation describing which person drives which car(s).
Example
Let A = {a1,a2,a3,a4,a5} and B = {b1,b2,b3}
Let R be a relation from A to B defined as follows
R = {(a1,b1),(a1,b2),(a1,b3),(a3,b1),(a3,b2),(a3,b3),(a5,b1)}
A a1 b1 B
a2 b2
a3 b3
a4
a5
Representations (other than equations)
Table:
x -3 -1 0 2 4 5
y -2 4 1 -5 5 0
Graph:
(-3, -2)
(5, 0)
(0, 1)
(-1, 4)
(4, 5)
(2, -5)
Representations (other than equations)
Mapping
(-3, -2), (5, 0), (0, 1), (-1, 4), (4, 5), (2, -5)
-3 -1 0 2 4 5
-5 -2 0 1 4 5
Representations (other than equations)
-3 -5
-1 -2
0 0
2 1
4 4
5 5
Exercise
A = set of all cities
B = set of the 36 states in Nigeria
You might remember that a function f from a set A to a set B assigns a unique element of B to each
element of A. The graph of f is the set of ordered pairs (a, b) such that b = f(a).
Since the graph of f is a subset of AB, it is a relation from A to B.
Moreover, for each element a of A, there is exactly one ordered pair in the graph that has a as its
first element. Conversely, if R is a relation from A to B such that every element in A is the first
element of exactly one ordered pair of R, then a function can be defined with R as its graph.
This is done by assigning to an element aA the unique element bB such that (a, b)R.
Relations on a Set
Definition:
A relation on the set A is a relation from A to A and is a
subset of AA.
In other words, a relation on the set A is a relation from A
to A, i.e., a subset of A x A
Example1:
A relation on set A {1,2,3,4}
Solution:
R {(1,1), (1,2), (2,1), (2,2), (3,4), (4,1), (4,4)}
Example2:
Let A be the set {1, 2, 3, 4}. Which ordered pairs are in the
relation R = {(a,b)|a divides b}?
Solution:
R={(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}
1 1 R 1 2 3 4
2 2 1 X X X X
3 3 2 X X
3 X
4 4
4 X
Exercise2
Consider these relations on set of integers
R1={(a,b)|a≤b}
R2={(a,b)|a>b}
R3={(a,b)|a=b or a=-b}
R4={(a,b)|a=b}
R5={(a,b)|a=b+1}
R6={(a,b)|a+b≤3}
Note:
As A x A has n2 elements, there are subsets 2
2n
Thus there are relations
n 2
on a set with n elements
2
That is, there are 3 2
relations on the set {a, b, c}
9
2 2 512
Assignment
Define with detailed example the following
functions:
1.One-To-One,
2.ONTO and
3.INVERTIBLE