SlideShare a Scribd company logo
CBMA2103
Discrete Mathematics
Faculty of Science and Technology
Copyright © Open University Malaysia (OUM)
CBMA2103
DISCRETE
MATHEMATICS
Assoc Prof Dr Abdullah Mohd Zin
Copyright © Open University Malaysia (OUM)
First Edition, November 2008
Second Edition, April 2015 (rs)
Copyright © Open University Malaysia (OUM), April 2015, CBMA2103
All rights reserved. No part of this work may be reproduced in any form or by any means
without the written permission of the President, Open University Malaysia (OUM).
Project Directors: Prof Dato’ Dr Mansor Fadzil
Assoc Prof Dr Norlia T. Goolamally
Open University Malaysia
Module Writer: Assoc Prof Dr Abdullah Mohd Zin
Open University Malaysia
Moderator: Prof Dr Mohammed Yusoff
Open University Malaysia
Enhanced by: Dr Bahari Idrus
Universiti Kebangsaan Malaysia
Developed by: Centre for Instructional Design and Technology
Open University Malaysia
Copyright © Open University Malaysia (OUM)
Table of Contents
Course Guide xi - xv
Topic 1 Set 1
1.1 Concept of Set 2
1.1.1 Listing the Elements of Sets 2
1.1.2 Specifying Properties of Sets 3
1.1.3 Set Membership 4
1.1.4 Empty Set 5
1.1.5 Set of Numbers 6
1.2 Set Equality 7
1.3 Venn Diagram 8
1.4 Subset 10
1.5 Power Set 13
1.6 Set Operation 14
1.6.1 Union 15
1.6.2 Intersection 16
1.6.3 Disjoint Sets 18
1.6.4 Set Difference 19
1.6.5 Set Complementary 19
1.6.6 Characteristics of Set 20
1.7 Generalised Union and Intersection 22
1.8 Partition 23
1.9 Cartesian Product 24
Summary 26
Key Terms 27
References 27
Topic 2 Relation 28
2.1 Concept of Relation 29
2.2 Inverse Relation 32
2.3 Composition of Relations 34
2.4 Relations on a Set 36
2.4.1 Reflexive 37
2.4.2 Symmetric 37
2.4.3 Antisymmetric 38
2.4.4 Transitive 38
2.5 Digraph 39
Copyright © Open University Malaysia (OUM)
 TABLE OF CONTENTS
iv
2.6 Partial Order 41
2.7 Equivalence Relation 43
Summary 44
Key Terms 45
References 46
Topic 3 Function 47
3.1 Concept of Function 48
3.2 Graph of a Function 50
3.3 Types of Function 52
3.3.1 Injective 52
3.3.2 Surjective 54
3.3.3 Bijective 55
3.4 Inverse of a Function 56
3.5 Functions Composition 58
3.6 Binary and Unary Operators 60
Summary 61
Key Terms 62
References 62
Topic 4 Sequence and Strings 63
4.1 Sequence 64
4.1.1 Types of Sequence 66
4.1.2 Subsequence 67
4.2 Sequence Operation 69
4.3 String 72
Summary 74
Key Terms 74
References 74
Topic 5 Propositional Logic 75
5.1 Proposition 76
5.1.1 Conjunction and Disjunction 77
5.1.2 Negation 78
5.2 Conditional Proposition 80
5.3 Biconditional Proposition 82
5.4 Tautologies, Contradictions and Logical Equivalence 84
5.5 Contrapositive and Converse 86
Summary 88
Key Terms 88
References 89
Copyright © Open University Malaysia (OUM)
TABLE OF CONTENTS  v
Topic 6 Predicate Logic 90
6.1 Predicate Logic 91
6.2 Quantifiers 92
6.2.1 Universal Quantifier 93
6.2.2 Existential Quantifier 95
6.2.3 Combining Quantifiers 96
6.3 Generalised De Morgan Laws 98
6.4 Translating Sentences into Logical Expressions 99
Summary 100
Key Terms 101
References 101
Topic 7 Integer 102
7.1 Integer 102
7.1.1 Basic Operations 103
7.1.2 Order 104
7.1.3 Absolute Value 104
7.2 Mod 105
7.3 Divisor and Greatest Common Divisor 107
7.3.1 Divisors 107
7.3.2 Common Divisors 108
7.3.3 Greatest Common Divisors 109
7.3.4 Euclidean Algorithm 109
7.4 Prime Numbers 111
7.5 Cryptography 113
7.5.1 Private Key 114
7.5.2 Public Key 115
Summary 119
Key Terms 120
References 120
Topic 8 Counting 121
8.1 Basic Principle of Counting 121
8.1.1 Multiplication Principle 122
8.1.2 Addition Principle 123
8.1.3 Combining Principles 123
8.2 Permutation 127
8.3 Combination 129
8.4 Pigeonhole Principle 131
8.4.1 First Form 131
8.4.2 Second Form 132
Copyright © Open University Malaysia (OUM)
 TABLE OF CONTENTS
vi
Summary 133
Key Terms 134
References 134
Topic 9 Matrices 135
9.1 Matrices 135
9.1.1 Equal Matrices 137
9.1.2 Matrix Addition 137
9.1.3 Matrix Multiplication 138
9.1.4 Identity Matrix 139
9.1.5 Power of Square Matrices 139
9.1.6 Matrix Transpose 140
9.1.7 Zero-One Matrices 140
9.2 Matrices of Relation 141
9.2.1 Representing Relations as Matrices 141
9.2.2 Using Matrices for Analysis of Relations 143
9.2.3 Checking for Transitivity 145
Summary 148
Key Terms 149
References 149
Topic 10 Introduction to Graphs 151
10.1 The Concept of Graphs 151
10.2 Types of Graphs 154
10.2.1 Directed Graphs 154
10.2.2 Simple Graphs 156
10.2.3 Weighted Graphs 157
10.2.4 Complete Graphs 157
10.2.5 Cycles 158
10.2.6 n-cube 159
10.2.7 Bipartite Graphs 159
10.2.8 Complete Bipartite Graphs 161
10.3 Subgraphs 164
Summary 165
Key Terms 166
References 166
Copyright © Open University Malaysia (OUM)
TABLE OF CONTENTS  vii
Topic 11 Path and Cycle 167
11.1 Path 168
11.2 Connected Graph 171
11.3 Components 172
11.4 Euler Path and Cycle 174
11.5 Hamilton Path and Cycle 179
Summary 181
Key Terms 182
References 182
Topic 12 Graph Representation and Isomorphism 183
12.1 Graph Representation 184
12.1.1 Adjacency Matrix 184
12.1.2 Incidence Matrix 187
12.2 Isomorphism 190
Summary 195
Key Terms 195
References 195
Topic 13 Planar Graph 197
13.1 Planar Graph 198
13.2 Graph Colouring 201
Summary 204
Key Terms 205
References 205
Topic 14 Tree 207
14.1 Concept of Trees 208
14.2 Important Terminology 210
14.3 Binary Tree 213
14.4 Tree Isomorphism 218
14.4.1 Basic Concept of Isomorphism 219
14.4.2 Rooted Isomorphism 221
14.4.3 Binary Isomorphism of Trees 222
Summary 226
Key Terms 226
References 227
Copyright © Open University Malaysia (OUM)
X COURSE ASSIGNMENT GUIDE
xxvi
Copyright © Open University Malaysia (OUM)
COURSEGUIDE
Copyright © Open University Malaysia (OUM)
Copyright © Open University Malaysia (OUM)
COURSE GUIDE DESCRIPTION
You must read this Course Guide carefully from the beginning to the end. It tells
you briefly what the course is about and how you can work your way through
the course material. It also suggests the amount of time you are likely to spend in
order to complete the course successfully. Please keep on referring to Course
Guide as you go through the course material as it will help you to clarify
important study components or points that you might miss or overlook.
INTRODUCTION
CBMA2103 Discrete Mathematics is one of the courses offered by Faculty of
Science and Technology at Open University Malaysia (OUM). This course is
worth 3 credit hours and should be covered over 8 to 15 weeks.
COURSE AUDIENCE
This course is offered to learners undertaking the Bachelor of Information
Technology programme. This module aims to impart the importance of Discrete
Mathematics in digital electronics as well as Information Technology. This
module is basically the introductory course which focuses on concepts and
techniques of Discrete Mathematics.
As an open and distance learner, you should be acquainted with learning
independently and being able to optimise the learning modes and environment
available to you. Before you begin this course, please confirm the course material,
the course requirements and how the course is conducted.
STUDY SCHEDULE
It is a standard OUM practice that learners accumulate 40 study hours for every
credit As such, for a three-credit hour course, you are expected to spend 120
study hours. Table 1 gives an estimation of how the 120 study hours could be
accumulated.
Copyright © Open University Malaysia (OUM)
 COURSE GUIDE
xii
Table 1: Estimation of Time Accumulation of Study Hours
Study Activities
Study
Hours
Briefly go through the course content and participate in initial discussion 3
Study the module 60
Attend 3 to 5 tutorial sessions 10
Online participation 12
Revision 15
Assignment(s), Test(s) and Examination(s) 20
TOTAL STUDY HOURS 120
COURSE OUTCOMES
By the end of this course, you should be able to:
1. Write statements using mathematical language;
2. Develop mathematical arguments using language;
3. Discuss the concept of integers and its role in modelling;
4. Summarise the concept of graphs and trees; and
5. Apply the concept of graph and tree models to solve problems.
COURSE SYNOPSIS
This course is divided into 14 topics. The synopsis for each topic can be listed as
follows:
Topic 1 introduces the concept of sets and subsets. It also shows the theory
application of sets operations such as intersection, union, difference and
products.
Topic 2 discusses the concept of relation. This topic introduces appropriate
methods for representing relations between objects. It also discusses some of the
properties of relations.
Copyright © Open University Malaysia (OUM)
COURSE GUIDE  xiii
Topic 3 elaborates on the concept of function which is basically a special kind of
relation that has been discussed in Topic 2. This topic also explains the graphical
representations of functions and the different types of functions.
Topic 4 discusses the concept of sequence and strings. It also shows the
operations on sequence and strings.
Topic 5 explains the concept of propositions logic. It also explains the type of
logic that deals with propositions and how to reason on propositions.
Topic 6 elaborates on the concept of predicate logic. This topic also teaches you
how to write a statement using the predicate logic concept.
Topic 7 discusses the applications of integers. It also explains the use of integers
in cryptography.
Topic 8 introduces several tools for counting. It also briefly discusses the concept
of recurrence relation.
Topic 9 explains the concept of matrices and applies all matrices operations. This
topic also shows how to use matrices to model relationships between two sets.
Topic 10 introduces the basic concept of graphs and subgraphs. By the end of this
topic, you should be able to identify eight different types of graphs.
Topic 11 discusses the concept of path and cycle in a graph. It also introduces
applications of graphs by using Euler and Hamilton path and cycle.
Topic 12 shows the representation of graphs using matrices. It also explains the
concept of isomorphism.
Topic 13 discusses the concept of planar graphs in problem solving. This topic
also shows how to solve the map colouring problem.
Topic 14 discusses the concept of trees and the characteristics of different types of
trees. Then, you will be introduced to the application of the tree isomorphism
concept.
Copyright © Open University Malaysia (OUM)
 COURSE GUIDE
xiv
TEXT ARRANGEMENT GUIDE
Before you go through this module, it is important that you note the text
arrangement. Understanding the text arrangement will help you to organise your
study of this course in a more objective and effective way. Generally, the text
arrangement for each topic is as follows:
Learning Outcomes: This section refers to what you should achieve after you
have completely covered a topic. As you go through each topic, you should
frequently refer to these learning outcomes. By doing this, you can continuously
gauge your understanding of the topic.
Self-Check: This component of the module is inserted at strategic locations
throughout the module. It may be inserted after one sub-section or a few sub-
sections. It usually comes in the form of a question. When you come across this
component, try to reflect on what you have already learnt thus far. By attempting
to answer the question, you should be able to gauge how well you have
understood the sub-section(s). Most of the time, the answers to the questions can
be found directly from the module itself.
Activity: Like Self-Check, the Activity component is also placed at various
locations or junctures throughout the module. This component may require you
to solve questions, explore short case studies, or conduct an observation or
research. It may even require you to evaluate a given scenario. When you come
across an Activity, you should try to reflect on what you have gathered from the
module and apply it to real situations. You should, at the same time, engage
yourself in higher order thinking where you might be required to analyse,
synthesise and evaluate instead of only having to recall and define.
Summary: You will find this component at the end of each topic. This component
helps you to recap the whole topic. By going through the summary, you should
be able to gauge your knowledge retention level. Should you find points in the
summary that you do not fully understand, it would be a good idea for you to
revisit the details in the module.
Key Terms: This component can be found at the end of each topic. You should go
through this component to remind yourself of important terms or jargon used
throughout the module. Should you find terms here that you are not able to
explain, you should look for the terms in the module.
References: The References section is where a list of relevant and useful
textbooks, journals, articles, electronic contents or sources can be found. The list
can appear in a few locations such as in the Course Guide (at the References
Copyright © Open University Malaysia (OUM)
COURSE GUIDE  xv
section), at the end of every topic or at the back of the module. You are
encouraged to read or refer to the suggested sources to obtain the additional
information needed and to enhance your overall understanding of the course.
PRIOR KNOWLEDGE
No prior knowledge required.
ASSESSMENT METHOD
Please refer to the myINSPIRE.
TAN SRI DR ABDULLAH SANUSI (TSDAS)
DIGITAL LIBRARY
The TSDAS Digital Library has a wide range of print and online resources for the
use of its learners. This comprehensive digital library provides access to more
than 30 online databases comprising e-journals, e-theses, e-books and more.
Examples of databases available are EBSCOhost, ProQuest, SpringerLink,
Books24x7, InfoSci Books, Emerald Management Plus and Ebrary Electronic
Books. As an OUM learner, you are encouraged to make full use of the resources
available through this library.
Copyright © Open University Malaysia (OUM)
X COURSE ASSIGNMENT GUIDE
xxvi
Copyright © Open University Malaysia (OUM)
 INTRODUCTION
Did you know that the concept of set is fundamental to mathematics and
computer science? This is because everything mathematical starts with sets. For
example:
(a) Relationships between two objects are represented as a set of ordered pairs
of objects (the concept of ordered pair is defined using sets);
(b) Natural numbers (the basis of other numbers) are also defined using sets;
(c) The concept of function (a special type of relation) is based on sets; and
(d) Graphs and digraphs consisting of lines and points are described as an
ordered pair of sets.
So what does a set mean? A set is an unordered collection of objects, and, as such,
a set is determined by the objects it contains. Then we have set theory which is an
T
To
op
pi
ic
c
1
1
 Sets
By the end of the topic, you should be able to:
1. Describe the concept of sets;
2. Define set equality;
3. Illustrate sets by using Venn diagrams;
4. Discuss subset and power set;
5. Apply the operations on sets;
6. Solve generalised union and intersection; and
7. Summarise the concept of partition and Cartesian products.
LEARNING OUTCOMES
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
2
important language and tool for reasoning. It is a basis for mathematics. Set
theory is important for computer science because it is a useful tool for
formalising and reasoning about computation and the objects of computation.
CONCEPT OF SET
Let us start the lesson by learning the concept of set; firstly, its definition.
For example:
(a) The collection of all learners taking this course;
(b) The collection of all lecturers at the university; and
(c) The collection of odd numbers between one to fifteen.
1.1.1 Listing the Elements of Sets
Generally, there are several ways to describe sets. One way of describing a set
that has a finite number of elements is by listing the elements of the set between
curly brackets.
Notation
A = {elements of set A}
where A is the name of the set. It could be any other variable name. Other
examples are C, D, E and so on. Normally the name of the set is denoted by
capital letters while elements of a set are with small letters, for example P = {x, y,
z}. Let us look at other examples.
Example 1.1a
Given set A,
A = {1, 2, 3, 4}
describes a set A made up of the four elements 1, 2, 3, and 4.
1.1
Definition 1.1a: A set is any well-defined collection of objects, called
elements or members of the set.
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  3
A set is determined by its elements, and the order in which the elements of a set
are listed does not matter. Another way in writing the same set A is as follows:
A = {1, 3, 4, 2}
The elements comprised in a set could be listed more than once as they are
assumed to be distinct. For this reason, we may also describe the same set A as:
A = {1, 2, 2, 3, 4}
Listing the elements of set could be in order or unordered or distinct.
To summarise, there are three ways for us to represent a set as simplified in
Table 1.1.
Table 1.1: Representation of Elements in a Set
Type of Elements
in a Set
Representation Description
Order A = {1, 2, 3, 4} A set is determined by its elements and order in
which the elements might be listed.
Unorder A = {1, 3, 4, 2} A set is determined by its elements and not by
any particular order in which the elements
might be listed.
Distinct
(unequal)
A = {1, 2, 2, 3, 4} The elements making up a set are assumed to
be distinct, and although for some reason
we may duplicate them out in a list, only
one occurrence of each element is in the set.
Example 1.1b
The set V of all vowels in the English alphabet can be written as
V = {a, e, i, o, u}
1.1.2 Specifying Properties of Sets
Sometimes it is inconvenient or impossible to describe a set by listing all of its
elements. Another useful way to define a set is by specifying a property
that the elements of the set have in common. If a set is a large finite set or an
infinite set, we can describe it by listing a property necessary for membership.
Let us check out the following example.
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
4
Example 1.1c
The set
B = {x | x is a positive and even integer}
describes the set B made up of all positive and even integers; that is, B
consists of the integer 2, 4, 6, 8 and so on.
The vertical bar "|" is read as "such that". Set B can be read as "B equals the set of
all x such that x is a positive and even integer."
1.1.3 Set Membership
Given a description of a set X such as
A = {1, 2, 3, 4} or B = {x| x is a positive and even integer}
with element x, we can determine whether or not x belongs to X.
If x is a member in set X, we write it as x X; otherwise, we write it as x  X.
If X is a finite set, the number of elements in X, is denoted as |X| called
cardinality.
These relationships can be simplified in Table 1.2.
Table 1.2: Membership Representation
Symbols Description
 Is a member/element
 Is not a member/element
Let us look at the following examples of set membership.
Explain how to read the set notation. Give an example.
SELF-CHECK 1.1
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  5
Example 1.1d
Let A = {1, 3, 5, 7}. Then 1  A, 3  A, but 2 A.
Therefore |A| = 4.
Example 1.1e
A is a set consisting of the first five positive integers: A = {1, 2, 3, 4, 5}.
So 2  A but 6  A.
Therefore |A| = 5.
Example 1.1f
Let N = {1, 2, 3, ⁄} be a set of positive integers,
(a) A = {1, 4, 9,⁄., 64, 81}
= {x2 | x  N and x2 < 100}
(b) B = {1, 4, 9, 16}
= {y2 | y  N and y2 16}
(c) C = {2, 4, 6, 8, ⁄⁄⁄}
= {2k | k  N }
A and B are called finite sets while C is called an infinite set.
1.1.4 Empty Set
Did you know that there is a special set that has no elements? This set is called
the empty set or null set, and is denoted by  or { }. This empty set can be
simplified by using symbols, as shown in Figure 1.1.
Figure 1.1: Representation of an empty set
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
6
1.1.5 Set of Numbers
The following Table 1.3 shows you the sets that are normally used when dealing
with numbers.
Table 1.3: Set of Numbers
Set of Numbers Notation Description
Integers Z Z = {x | x is an integer}
Example: ⁄-3,-2,-1,0,1,2,3,⁄
Positive integers Z + Z + = {x | x is a positive integer}
Example: 1,2,3⁄
Natural numbers V N = {x | x is a positive integer}
Example: 1,2,3⁄
Real numbers R R = {x | x is a real number}
ACTIVITY 1.1
1. Let A= {1, 2, 4, a, b, c}. Identify each of the following as true or false:
(a) 2  A
(b) 3  A
(c) c  A
(d)   A
(e) { }  A
(f) A  A
2. Let A= {x | x is an integer and x < 6}. Identify each of the following as
true or false.
(a) 3  A
(b) 6  A
(c) 5  A
(d) 8  A
(e) -8  A
(f) -4  A
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  7
Visit this website which provides detail information on the set theory. It will be
helpful for those who are still confused with sets and is worth reading. Enjoy!
http://en.wikipedia.org/wiki/Naive_set_theory
SET EQUALITY
A set is completely known when its members are all known. Thus, we say two
sets of A and B are equal if they have the same elements and we write A = B. Let
us look at the following examples to understand more on this matter.
Example 1.2a
If A = {1, 2, 3} and B = {x|x is a positive integer and x2 < 12}, then A = B.
Example 1.2b
If A = {BASIC, PASCAL, ADA}, B = {ADA, BASIC, PASCAL} and C = { ADA,
ADA, BASIC, PASCAL, BASIC} then A = B = C.
1.2
3. Describe the following sets by listing their elements.
(a) The set of all positive integers that are less than 10.
(b) {x | x  Zand x2 < 12}
4 Write the following sets in the form {x | p (x)}, where p (x) is a
property that describes the elements of the sets.
(a) {2, 4, 6, 8, 10}
(b) {a, e, i, o, u}
(c) {1, 8, 27, 64, 125}
(d) {-2, -1, 0, 1, 2}
5. What is the cardinality of
(a) empty set?
(b) {}?
(c) {1, 2, 3, 4, 7}?
(d) {a, b, b, c, d, d}?
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
8
Example 1.2c
If A = {x | x2 + x – 6 = 0},
B = {2, –3}
A = B since x2 + x – 6 = 0 can be factorised into (x – 2) (x + 3) = 0, giving x = 2 and
x = – 3.
VENN DIAGRAM
What is the purpose of Venn diagrams? The purpose of Venn diagrams is to
provide pictorial views of a set. Historically, the idea of Venn diagrams was first
proposed by a mathematician by the name of John Venn.
1.3
1. Let A = {1, 2, 3, 4, 5}. Which of the following sets are equal to A?
(a) {4, 1, 2, 3, 5}
(b) {2, 3, 4}
(c) {1, 2, 3, 4, 5, 6}
(d) {x | x is an integer and x2  25}
(e) {x | x is a positive integer and x  5}
(f) {x | x is a positive rational number and x  5}
2. Which of the following sets are empty sets?
(a) {x|x is a real number and x2 – 1 = 0}
(b) {x|x is a real number and x2 + 1 = 0}
(c) {x|x is a real number and x2 = –9}
(d) {x|x is a real number and x = 2x + 1}
(e) {x|x is a real number and x = x + 1}
3. Determine whether each of the following pairs of sets are equal?
(a) {1, 3, 3, 3, 5, 5, 5, 5, 5}, {5, 3, 1}
(b) {{1}}, {1, {1}}
(c) , {}
ACTIVITY 1.2
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  9
In Venn diagrams, the universal set E will normally be denoted by a rectangle,
while sets within E will be denoted by circles as shown in Figure 1.2.
Figure 1.2: Venn diagram
As for subsets of the universal set, they are drawn as circles. The figures inside of
a circle represent the elements of the set (Figure 1.3).
Figure 1.3: Subset representation
How do we represent three sets? We represent three sets by using three
overlapping circles, as shown in Figure 1.4.
Figure 1.4: Three sets representation
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
10
SUBSET
We have learned a little on subset in the previous subtopic. Now let us learn
more on subsets; firstly, its definition.
The Venn diagram in Figure 1.5 represents the subset for sets A and B.
Figure 1.5: Subset for sets A and B
Let us check out some examples on subsets.
Example 1.4a
If C = {1, 3} and A = {1, 2, 3, 4}
Then C is a subset of A, or C A
We can present it in a Venn diagram as shown in Figure 1.6.
1.4
Definition 1.4a: If every element of A is also an element of B, that is
if whenever x  A then x  B, we say that A is a subset of B or A is
contained in B, and we write A  B.
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  11
Figure 1.6: C subset of A
Example 1.4b
Let
A = {1, 2, 3, 4, 5, 6};
B = {2, 4, 5}; and
C = {1, 2, 3, 4, 5}.
B  A, B  C and C  A
Example 1.4c
Let
A = {1, 2, 3, 4, 5, 6}
B = {3, 7}
B is not a subset of A, so we write B A.
Figure 1.7: Venn diagram for Example 1.4c
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
12
Any set X is a subset of itself, since any element in X is in X, so X  X.
As for the empty set, it is a subset of any set. So for any set X,   X.
We can define set equality by using the concept of subsets as follows:
Definition 1.4b: If X is a subset of any set Y and X is not equal to Y, we
say that X is a proper subset of Y and we write X Y.
Definition 1.4c: Two sets, A and B are equal and can be written as A = B if
A B and B A.
ACTIVITY 1.3
1. Let A = {1, 2, 5, 8, 11}. Identify each of the following statements
as true or false.
(a) {5, 1}  A
(b) {8, 1}  A
(c) {1, 8, 2, 11, 5}  A
(d)   A
(e) {1, 6}  A
(f) {2}  A
(g) {3}  A
(h) A  {11, 2, 5, 1, 8, 4}
2. Suppose that A = {2, 4, 6}, B= {2, 6}, C = {4, 6} and D = {4, 6, 8}.
Determine whether
(a) A  B
(b) B  C
(c) C  D
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  13
POWER SET
What is a power set? The following describes the meaning of a power set.
Let us look at some examples of power sets.
Example 1.5a
If A = {a, b, c }, the members of  (A) are
 (A) = {, {a}, {b}, {c }, {a, b}, {a, c }, {b, c }, {a, b, c }}
All but {a, b, c } are proper subsets of A. You may also write (A) as ({a, b, c})
The number of elements in a power set is given by the following theorem.
Example 1.5b
For set A in Example 1.5a,
|A| = 3, then |P (A) | = 23 = 8
Example 1.5c
P () = , || = 0 then|P ()|= 20 = 1
1.5
3. Use a Venn diagram to illustrate the relationship A  B and B  C.
4. Suppose that A, B and C are sets, such that A  B and B  C. Show
that A  C.
Definition 1.5a: If A is a set, then the set of all subsets of A including the
empty set and itself is called the power set of A and is denoted by  (A).
Theorem 1.5a: If X  = n then P (X ) = 2n
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
14
Example 1.5d
The power set of the empty set has two subsets,  and {}.
2 = 2
P ({}) = {
SET OPERATION
This subtopic discusses several operations that will combine given sets to
produce new sets. These operations are union, intersection, disjoint sets, set
difference and set complementary.
1.6
1. Find the power set of each of the following sets.
(a) {a}
(b) {a, b}
(c) {, {}}
2. Can you conclude that A = B, if A and B are two sets with the same
power set?
3. How many elements does each of the following sets have?
(a) P ({a, b, {a, b}})
(b) P({, {a, {a}, {{a}}})
(c) P(P())
4. Determine whether each of the following sets is the power set of a set.
(a) 
(b) {, {a}}
(c) {, {a}, {, a}}
(d) {, {a}, {b}, {a, b}}
ACTIVITY 1.4
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  15
1.6.1 Union
What does union mean?
The union of two sets can be illustrated by using a Venn diagram (Figure 1.8).
Figure 1.8: Union of set A and set B
Let us look at an example.
Example 1.6a
Let A = {a, b, c, d, e} and B = {b, d, r, s}.
A B consists of all the elements that belong to either A or B, so
A B = {a, b, c, d, e} {b, d, r, s} = {a, b, c, d, e, r, s}.
Definition 1.6a: If A and B are sets, their union can be defined as a
set consisting of all elements that belong to A or B, and is denoted by A 
B. Thus A  B = {x | x  A or x  B}.
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
16
Figure 1.9: A  B
1.6.2 Intersection
What does it mean by intersection? Let us look its definition.
The intersection of the two sets A and B can be illustrated as follows (Figure 1.10).
Figure 1.10: Intersection of set A and set B
Definition 1.6b: If A and B are sets, their intersection can be defined as a set
consisting of all elements that belong to both A and B. The intersection of A
and B is denoted by A  B. Thus A  B = {x | x  A and x  B}.
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  17
Let us check out the following example.
Example 1.6b
Let
A = {a, b, c, d, e, f}
B = {b, e, f, r, s}
C = {a, t, u, v}.
A  B = {b, e, f } since elements b, e, and f belong to both A and B.
Figure 1.11: A  B
Similarly, A  C = {a}.
Figure 1.12: A  C
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
18
B  C = {}, since there are no elements that belong to both B and C.
Figure 1.13: B  C
1.6.3 Disjoint Sets
What do disjoint sets mean?
We can illustrate the disjoint of two sets with a Venn diagram as follows
(Figure 1.14).
Figure 1.14: Disjoint of set A and set B
Definition 1.6c: Two sets that have no common elements are called disjoint
sets. A  B = .
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  19
1.6.4 Set Difference
Now let us look at set difference; firstly, its meaning.
Figure 1.15: A – B
1.6.5 Set Complementary
What does set complementary mean?
Figure 1.16: Set complementary representation
Definition 1.6d: If A and B are sets, their difference can be defined as a
set consisting of all elements in A that are not in B. The difference between
A and B is denoted by A – B. Thus A – B = {x | x  A and x  B}.
Definition 1.6e: Let E be a universal set and let A be a subset of E. The set of E – A
consisting of all elements of E that are not elements of A is called the complement
of A and is denoted byA .
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
20
Let us consider these examples.
Example 1.6c
Let E = {1, 2, 3, 4, 5, 6} and A = {1, 2}.
Therefore,
A = E – A
= {1, 2, 3, 4, 5, 6} – {1, 2}
= {3, 4, 5, 6}.
Figure 1.17: Ā = E – A
1.6.6 Characteristics of Set
Lastly, let us look at characteristics of sets.
Let us look at Table 1.4 which summarises nine theorems of sets.
Table 1.4: Theorem of Sets
Laws
(a) Associative Laws (A  B)  C = A  (B  C)
(A  B)  C = A  (B  C)
(b) Commutative Laws A  B = B  A
A  B = B  A
Theorem 1.6a: Let E be a universal set and let A, B and C be subsets of E. The
following properties hold (see Table 1.4).
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  21
(c) Distributive Laws A  (B  C) = (A  B)  (A  C)
A  (B  C) = (A  B)  (A  C)
(d) Identity Laws A   = A
A  A = A
(e) Complement Laws A  Ā = E
A  Ā = E
(f) Idempotent Laws A  A = A
A  A = A
(g) Bound Laws A  E = E
A   = 
(h) Absorption Laws A  (A  B) = A
A  (A  B) = A
(i) De Morgan's Laws for Sets
 
   
  
 
   
  
ACTIVITY 1.5
In each statement below, write „true‰ if the statement is true; otherwise,
give a counter example. The sets X, Y and Z are subsets of a universal
set E.
(a) X  (Y – Z ) = (X Y ) – (X Z ) for all sets X, Y and Z.
(b) (X – Y )  (Y – X ) = for all sets X and Y.
(c) X – (Y Z ) = (X – Y ) Z for all sets X, Y and Z.
(d) – –

X Y Y X for all sets X and Y.
(e) 
X Y  X for all sets X and Y.
(f) (X Y)  (Y – X ) = X for all sets X and Y.
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
22
GENERALISED UNION AND INTERSECTION
Firstly, let us get to know the definition of generalised union.
If S = {A1
, A2
, ⁄ An
}, we can write U S =
1
n
i
i
A

 , i = 1, 2, ...n
Next is the definition of generalised intersection.
If S = { A1
, A2
, ⁄, An
}, we can write I S =
1
n
i
i
A

 , i = 1, 2, ...n
Let us check Example 1.7a.
Example 1.7a
Suppose A1 = {1, 2}, A2 = {3, 4} and A3 = {5, 6} then
S = {A1, A2, A3}
= { {1, 2} , {3, 4} , {5, 6} }
Therefore,
U S =
1
n
i
i
A

 = {1, 2, 3, 4, 5, 6 }
 S =
1
n
i
i
A

 = { }
1.7
Definition 1.7a: The generalised union of an arbitrary family, S, of sets are
those elements x belonging to at least one set X in S. Formally,
U S = {x | x  X for some X  S}.
Definition 1.7b: The generalised intersection of an arbitrary family, S, of sets
are those elements x belonging to all sets X in S. Formally,
S = {x | x  X for all X  S}
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  23
PARTITION
A partition of a set X divides n into non-overlapping subsets. More formally,
Let us see Example 1.8a.
Example 1.8a
Since each element of
X = {1, 2, 3, 4, 5, 6, 7, 8}
is in exactly one member of
S = {{1, 4, 5}, {2, 6}, {3}, {7, 8}}
S is a partition of X
Notice that if S is a partition of X, S is a pairwise disjoint, and U S = X.
1.8
Definition 1.8a: Let S be a collection of non-empty subsets of set X. S is
said to be a partition of X, if every element of X belongs to exactly one
member of S.
Let Ai be a set of integers from 1 to 4. Assume A1 = {a, b, c }, A2 = {b, c,
d }, A3 = {b, c, f } and A4 = {b, c, e, f, g }. Find
(a)
1
n
i
i
A


(b)
1
n
i
i
A


ACTIVITY 1.6
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
24
CARTESIAN PRODUCT
What can we say about Cartesian products?
An ordered pair (a, b), is considered distinct from the ordered pair (b,
a), unless, of course a = b. To put it another way, (a, b) = (c, d) if and only if
a = c and b = d.
Let us look at Example 1.9a.
Example 1.9a
If X = {1, 2, 3} and Y = {a, b}, then
X × Y = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)}
Y × X = {(a, 1), (b, 1), (a, 2), (b, 2), (a, 3), (b, 3)}
X × X = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}
Y × Y = {(a, a), (a, b), (b, a), (b, b)}
The example above shows that, in general, X × Y  Y × X.
1.9
Definition 1.9a: If A and B are sets, we let A  B denote the set of all ordered
pairs (a, b) where a  A and b  B. We call A  B the Cartesian product of A
and B.
ACTIVITY 1.7
Determine whether each set D below is a partition of set Y
Y = {x | x is integer and 1  x  5}
(a) D = {{1}, {2, 3}, {4}, {5}}
(b) D = {{1, 4}, {2}, {3,5}}
(c) D = {{1}, {4}, {2}, {3,5}}
(d) D = {{1}, {4}, {2}, {3}, {5}}
(e) D = {{1, 3}, {2}, {4, 5}}
(f) D = {{7, 4}, {2, 6}, {3, 5}}
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  25
Let us look at an example on this.
Example 1.9b
If X = {1, 2} Y = {a, b} Z = {, }, then
X × Y × Z = {(1, a, ), (1, a, ), (1, b, ), (1, b, ), (2, a, ), (2, a, ), (2, b, ), (2, b, )}
The following are some basic properties of Cartesian products:
A ×  = 
A × (B  C) = (A × B)  (A × C)
(A  B) × C = (A × C)  (B × C)
| A × B | = | B × A | = |A|× |B | A and B is finite set.
Definition 1.9b: The Cartesian product of sets X1, X2, ⁄ Xn is defined to be the
set of all n-tuples (x1, x2,⁄. xn) where xi  Xi for i = 1, ⁄ n; it is denoted by X1 ×
X2 ×⁄× Xn.
Theorem 1.9a: | X × Y | = | X | . | Y | and | X × Y × Z | = | X | . | Y | . | Z |. In
general, we have | X1 × X2 × ⁄. X × Xn | = | X1 | . | X1 | . | X2 | ……. | Xn |
1. Find x or y so that the following statements are true.
(a) (x, 3) = (4, 3)
(b) (a, 3y) = (a, 9)
(c) (3x + 1, 2) = (7, 2)
(d) (C++, PASCAL) = (x, y)
ACTIVITY 1.8
Copyright © Open University Malaysia (OUM)
 TOPIC 1 SETS
26
 A set is any well-defined collection of objects, called elements or members of
the set.
 A set is completely known when its members are all known. Thus, we say two
sets of A and B are equal if they have the same elements, and we write A = B.
 A Venn diagram illustrates the universal set E as a rectangle, while sets
within E will be denoted by circles.
 Set A is a subset of set B if every element of A is also an element of B, A
B.
 If A is a set, then the set of all subsets of A including the empty set and
itself is called the power set of A, and is denoted by  (A).
 The operations of sets include union, intersection and difference.
 The generalised union of an arbitrary family, S, of sets are those elements x
belonging to at least one set X in S. Formally, U S = {x | x  X for some X  S}
 The generalised intersection of an arbitrary family, S, of sets are those
elements x belonging to all set X in S. Formally, S = {x | x  X for all X  S}
2. In each of the statements below, write „true„ if the statement is
true; otherwise, give a counter example. The set X, Y and Z are
subsets of a universal set E. Assume that the universe for Cartesian
products is E × E.
(a)   
X Y X Y for all sets X and Y.
(b) X × (Y  Z) = (X × Y)  (X × Z) for all sets X, Y and Z.
(c) X × (Y – Z) = (X × Y) – (X × Z) for all sets X, Y and Z.
(d) X – (Y × Z) = (X – Y) × (X – Z ) for all sets X, Y and Z.
(e) X  (Y × Z) = (X  Y) × (X  Z) for all sets X, Y and Z.
Copyright © Open University Malaysia (OUM)
TOPIC 1 SETS  27
 A partition of a set X divides set X into n non-overlapping subsets.
 If A and B are sets, we let A  B denote the set of all ordered pairs (a, b)
where a  A and b  B. We call A  B the Cartesian product of A and B.
Cartesian product
Disjoint set
Elements
Empty set
Generalised intersection
Generalised union
Intersection
Partition
Power set
Set complement
Set difference
Set equality
Set membership
Sets
Subsets
Union
Venn diagram
Glosser, G. (2015). Introductions to Sets. Retrieved from http://www.math
goodies.com/lessons/sets/
Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate:
Pearson.
Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics
(revised 3rd ed.). New York: McGraw Hill.
Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York:
McGraw Hill.
Set (mathematics). (2015). Retrieved from http://en.wikipedia.org/wiki/
Set_(mathematics)
Shadrach, R. (2014). Introduction to Sets. Retrieved from
http://www.mathsisfun.com/sets/sets-introduction.html
Copyright © Open University Malaysia (OUM)
LEARNING OUTCOMES
 INTRODUCTION
Did you notice that in real life, relationship exists between people and other
entities? For example „father of‰ is a relationship between two individuals.
Similarly, we may have a relationship „owner of‰ between people and car.
How about mathematics? In mathematics, this concept can be formalised by
using relation. Thus, we will discuss the concept of relation in this new topic.
You will be introduced to several geometric and algebraic methods for
representing relations between objects. Some discussion on the properties of
relations will be included too.
By the end of the topic, you should be able to:
1. Describe the concept of relations between two sets;
2. Use the appropriate methods for representing relations;
3. Describe inverse relation;
4. Explain composition of relations;
5. Summarise four properties of relations on a set;
6. Draw a digraph to represent a relation; and
7. Distinguish partial order and equivalence relation.
T
To
op
pi
ic
c
2
2
 Relations
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  29
CONCEPT OF RELATION
Firstly, let us learn the meaning of relation.
Now let us look at some examples of relations.
Example 2.1a
If X is a set of students
X = {Jimmy, Sheila, Shah, Zurai}
and Y is a set of courses
Y = {Computer Science, Math, Art, History}
a relation R between X and Y indicating „courses taken by the students‰ can be
written as
R = {(Jimmy, Computer Science), (Sheila, Math), (Jimmy, Art),
(Shah, History), (Shah, Computer Science), (Zurai, Math)}.
Since (Shah, History)R, we may write Shah R History.
We can represent a relation in Example 2.1a pictorially by using an arrow
diagram as follows (Figure 2.1).
2.1
Definition 2.1a: Let X and Y be two sets. A (binary) relation R from X to Y is
a subset of the Cartesian product X ×Y. If (x, y)R, we write x R y.
Definition 2.1b: The set
{x  X | (x, y) R for some y Y}
is called the domain of R. The set
{y Y | (x, y)R for some x X}
is called the range of R.
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
30
Figure 2.1: Relation between X and Y pictorially
Example 2.1b
Suppose A is a set of lecturers and B is a set of cars.
A = {Ahmad, Johan, Ravie, Zul}
B = {Iswara, Wira, Mercedes}
We can define a relation R between the two sets indicating „types of cars owned
by lecturers‰ as
R = {(Ahmad, Iswara), (Johan, Wira), (Johan, Mercedes), (Ravie, Wira)}
The pictorial representation of this relation is as follows:
Figure 2.2: Relation between A and B in pictorial representation
Example 2.1c
Suppose X = {2, 3, 4} and Y = {3, 4, 5, 6, 7}. If we define a relation R from X to Y by
(x, y)R, if x divides y (with zero remainder)
we obtain
R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)}
The domain of R is the set {2, 3, 4} and the range of R is the set {3, 4, 6}.
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  31
1. Suppose that
A = {Kota Bharu, Taiping, Ipoh, Seremban}
B = {Selangor, Kelantan, Perak}
Write a relation R between set A and set B which is defined by (x, y)
R if „x is a town in y .‰
2. A car manufacturer makes three different types of car frames and
two types of engines. List all possible models of cars.
Frame type: sedan (s), coupe (c), van (v)
Engine type: gas (g), diesel (d)
3. Suppose that
X = {a, b, c, d}
Y = {1, 2, 3, 4, 5}
For the relations R below, determine their domains and ranges.
(a) R = {(a, 1), (b, 2), (c, 3), (d, 4)}
(b) R = {(a, 2), (b, 4), (c, 1), (d, 5)}
(c) R = {(a, 4), (b, 2), (c, 4), (d, 2)}
4. Suppose that
X = {1, 2, 3, 4, 5}
Y = {3, 6, 9}
Let x  X, y  Y and write a relation R between set X and set Y
defined by:
(a) (x, y)  R if x < y
(b) (x, y)  R if y = 2x
ACTIVITY 2.1
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
32
INVERSE RELATION
Now let us move on to inverse relation. Firstly, let us learn its meaning.
Let us look at an example of inverse relation.
Example 2.2a
Let
X = {2, 3, 4} and Y = {3, 4, 5, 6}.
If we define a relation R from X to Y by
(x, y) R if x divides y
we obtain
R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)}
2.2
Definition 2.2a: Let R be a relation from X to Y. The inverse of R, denoted by R-1,
is the relation from Y to X defined by
R-1 = {(y, x) | (x, y)  R}
SELF-CHECK 2.1
I hope that you have understood the basic concepts of relation. Based on
your understanding, write a relation for the following items, G =
gender; and T = toys that kids love to play. You may present your idea
pictorially.
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  33
This relation can be presented pictorially as
Figure 2.3: Relation between X and Y pictorially
The inverse of the relation R is
R-1 = {(4, 2), (6, 2), (3, 3), (6, 3), (4, 4)}.
We can represent it pictorially as Figure 2.4.
Figure 2.4: Inverse relation, R-1 between X and Y pictorially
This relation can be described as „x is divisible by y.‰
Give the inverse for all the relations below:
(a) R = {(a, 6), (b, 2), (a, 1), (c, 1)}
(b) R = {(Suzi, Music), (Emmy, History), (Adri, Mathematics), (Emmy,
Chemistry)}
(c) R = {(2, 2), (5, 6), (1, 2), (7, 1), (9, 1)}
(d) R = {(8, 26), (21, 17), (10, a), (c, 45), (b, 3), (c, 3)}
(e) R = {(Blue, Car), (Red, Flower), (Black, Car), (White, Flower)}
ACTIVITY 2.2
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
34
COMPOSITION OF RELATIONS
Now let us learn composition of relations.
We can represent this relationship pictorially as shown in Figure 2.5.
Figure 2.5: R2 o R1
Let us look at an example of this relationship.
Example 2.3a
Suppose that we have two relations
R1 = {(1, 2), (1, 6), (2, 4), (3, 4), (3, 6), (3, 8)}
and
R2 ={(2, u), (4, s), (4, t), (6, t), (8, u)}
From Definition 2.3a, the relations can be presented pictorially as shown in
Figure 2.6.
2.3
Definition 2.3a: Let R1 be a relation from X to Y and R2 be a relation from Y to Z.
The composition of R1 and R2, denoted by R2 o R1, is the relation from X to Z
defined by
R2 o R1 = {(x, z) | (x, y)  R1 and (y, z)  R2 for some y  Y}
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  35
Figure 2.6: R2 o R1
The composition of these two relations is
R2 o R1= {(1, u), (1, t), (2, s), (2, t), (3, s), (3, t), (3, u)}
Figure 2.7: Composition of the two relations
Write the composition of R2 o R1 for the given relations
(a) R1 = {(4, 10), (8, 2), (6, 6)}
R2 = {(10, w), (2, z), (6, y)}
(b) R1 = {(Math, 3), (Art, 1), (Math, 1), (History, 4), (Chemistry, 2)}
R2 ={(1, Adri), (1, Amy), (2, Amin), (3, Shah), (4, Amy)}
(c) R1= {(Black, a), (Blue, a), (White, b), (Green, d), (Blue, c), (White, c)}
R2 = {(c, 2), (c, 6), (a, 4), (b, 4), (d, 6), (a, 8)}
(d) R1 = {(4, Black), (1, Red), (2, Blue), (3, White)}
R2 = {(Blue, Car), (Red, Flower), (Black, Car), (White, Flower)}
ACTIVITY 2.3
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
36
RELATIONS ON A SET
What can we say about relations on a set?
Let us look at an example of this.
Example 2.4a
Let R be the relation on
X = {1, 2, 3, 4, 5}
defined by (x, y)  R if x  y; x, y  X. Then
R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4),
(3, 5), (4, 4), (4, 5), (5, 5)}
The domain of R is the set {1, 2, 3, 4, 5} and the range of R is the set {1, 2, 3, 4, 5}.
Hence the domain and the range of R are both equal to X.
There are four properties of relations on a set. These properties are listed in
Figure 2.8.
Figure 2.8: Four properties of relations on set
These four properties are further discussed in the following subtopics.
2.4
Definition 2.4a: A (binary) relation R on a set X is a relation from X to X.
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  37
2.4.1 Reflexive
What does reflexive mean?
Example 2.4b
The relation R on X = {1, 2, 3, 4, 5} for Example 2.4a is reflexive because for all
elements x  X and (x, x)  R. Thus the reflexive elements are (1, 1), (2, 2), (3, 3),
(4, 4) and (5, 5).
Example 2.4c
Consider the following relations on {a, b, c}:
R1 = {(a, a), (a, b), (b, b), (b, c), (c, c)}
R2 = {(a, a), (a, b), (b, b), (a, c), (b, c)}
R3 = {(a, a), (b, b), (c, c)}
R4 = {(a, b), (a, c), (b, c)}
The relations R1 and R3 are reflexive because both relations contain all pairs of the
form (x, x).
The relations R2 and R4 are not reflexive because both relations do not contain all
pairs of the form (x, x).
2.4.2 Symmetric
When is a relation symmetric?
The following Example 2.4d shows you a symmetric relationship.
Definition 2.4b: A relation R on a set X is called reflexive if (x, x)  R for all x
X.
Definition 2.4c: A relation R on a set X is called symmetric if for all x, y  X,
and (x, y)  R, then (y, x)  R.
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
38
Example 2.4d
Consider the relation R on X = {a, b, c, d } given as follows:
R = {(a, d ), (b, c), (c, b), (d, a)}
The relation is symmetric because for all x and y, when (x, y )  R, (y, x )  R.
In this case (a, d ) and (d, a), (b, c) and (c, b) are all in R.
2.4.3 Antisymmetric
What happens when a relation is antisymmetric?
Let us examine Example 2.4e.
Example 2.4e
Consider the relation R on X = {a, b, c, d } which is given as follows:
R = {(a, b), (b, c), (c, d )}
The relation is antisymmetric because (a, b) R and (b, a) R, then a b. It is
also the same for (b, c) and (c, d ).
2.4.4 Transitive
What does a transitive relationship mean?
Let us look at Example 2.4f.
Definition 2.4e: A relation R on a set X is called transitive if for all x, y, z
 X, when (x, y)  R, (y, z)  R and (x, z)  R.
Definition 2.4d: A relation R on a set X is called antisymmetric if for all x, y
 X; when (x, y)  R and (y, x)  R, then x ≠ y.
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  39
Example 2.4f
Consider the relation R on X = {a, b, c, d } which is given as follows:
R = {(a, b), (a, d ), (a, c), (b, c), (b, d ),(c, d )}
The relation R is transitive because for all x, y, z where (x, y) and (y, z) R, (x,
z) R.
For example, (a, b) R, (b, c) R, and (a, c) R;
(a, b) R, (b, d ) R, and (a, d ) R; and
(a, c) R, (c, d ) R and (a, d ) R.
DIGRAPH
Did you realise that one way to picture a relation on a set is to draw its digraph?
A digraph consists of vertices to represent the elements of X and edges to
represent the relation between the elements. Let us check out some examples of
digraphs.
2.5
1. Write each of the relations below as relations on sets
(a) The relation R on {1, 2, 3, 4} defined by (x, y ) R if x2 y
(b) The relation R on {1, 2, 3, 4, 5} defined by (x, y ) R if y = 2x
(c) Relation R on the set {1, 2, 3, 4, 5} defined by the rule (x, y ) R
if 3 divides x – y.
(d) Relation R on the set {1, 2, 3, 4, 5} defined by the rule (x, y ) R
if x + y6.
(e) Relation R on the set {1, 2, 3, 4, 5} defined by the rule (x, y ) R
if x = y – 1.
2. Is the relation in exercise 1(a) to (e) reflexive, symmetric,
antisymmetric or transitive?
ACTIVITY 2.4
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
40
Example 2.5a
The digraph for the relation
R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4),
(3, 5), (4, 4), (4, 5), (5, 5)}
can be drawn as follows:
Figure 2.9: Digraph for R
Example 2.5b
The relation R on X = {a, b, c, d }
R = {(a, d ), (b, c), (c, b), (d, a)}
is given by the digraph as follows:
Figure 2.10: Relation of symmetric
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  41
Did you know that we can determine the characteristics of a relation by using
digraphs? These characteristics are summarised in Table 2.1.
Table 2.1: Characteristics of a Relation and Digraph
Set Relation Digraph
Reflexive Has a loop at every vertex.
Symmetric Has the property that whenever there is a directed edge from v to
w, there is also a directed edge from w to v.
Antisymmetric Has the property that between any two vertices there is at most one
directed edge.
Transitive Has the property that whenever there are directed edges from x to y
and from y to z, there is also a directed edge from x to z.
PARTIAL ORDER
What does partial order mean?
Let us look at some examples of partial orders.
2.6
Definition 2.6a: A relation R on a set X is called a partial order if R is reflexive,
antisymmetric and transitive.
Draw the digraph of the following relations and identify the
properties of relations on set:
(a) R = {(1, 2), (2, 1), (3, 3), (1, 1), (2, 2)} on X = {1, 2, 3}
(b) R = {(1, 2), (2, 3), (3, 4), (4, 1)} on {1, 2, 3, 4}
(c) R on {1, 2, 3,4} defined by (x, y)  R if x2  y
(d) R = {(a, 3), (b, 1), (c, 4), (d, 1)} from {a, b, c, d} to {1, 3, 4}
ACTIVITY 2.5
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
42
Example 2.6a
Consider the relation R on the set X = {1, 2, 3, 4, 5} defined by
(x, y) R if x divides y
So R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 4) (3, 3), (4, 4), (5, 5)}
R is reflexive since (1, 1), (2, 2), (3, 3), (4, 4), (5, 5) are in R.
R is antisymmetric since (2, 1), (3, 1), (4, 1), (5, 1) and (4, 2) are not in R.
R is transitive since (1, 2), (2, 4) and (1, 4) are in R.
Thus R is a partial order.
Example 2.6b
In general, a relation R on a set of positive integers defined by
(x, y) R if x divides y
is a partial order.
If R is a partial order on a set X, we can denote x y to indicate that (x, y)R.
Then we have comparable and incomparable. What do they mean?
Example 2.6c
The less than or equals relation on the positive integers is a total order since, if x
and y are integers, either x y or y x.
Definition 2.6b: Suppose that R is a partial order on a set X. If x, y  X and
either x  y or y  x, we say that x and y are comparable. Otherwise, we say
that x and y are incomparable.
Definition 2.6c: If every pair of the elements in X is comparable, we call R a
total order.
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  43
EQUIVALENCE RELATION
What does equivalence relation mean?
Let us look at two examples which illustrate equivalence relation.
Example 2.7a
Consider the relation R on {1, 2, 3, 4, 5} defined as
R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1),
(5, 3), (5, 5)}
R is reflexive because (1, 1), (2, 2), (3, 3), (4, 4), (5, 5) R.
R is symmetric because whenever (x, y) is in R, (y, x) is also in R.
R is transitive because whenever (x, y) and (y, z) are in, (x, z) is also in R.
Thus, R is an equivalence relation on {1, 2, 3, 4, 5}.
Example 2.7b
The relation R as shown in the Example 2.6a is not an equivalence relation
because R is not symmetric.
2.7
Determine whether each of the relations defined below on the set of
positive integers is a partial order or not.
(a) (x, y)  R if x = y2
(b) (x, y)  R if x > y
(c) (x, y)  R if x  y
(d) (x, y)  R if x = y
(e) (x, y)  R if 3 divides x – y
ACTIVITY 2.6
Definition 2.7a: A relation that is reflexive, symmetric and transitive on a
set X is called an equivalence relation on X.
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
44
• The relation R between set X and Y is said „x is related to y‰, and denoted by
x R y when (x, y)  R.
• The relation can be presented pictorially by using an arrow diagram.
• Let R be a relation from X to Y. The inverse of R, denoted by R-1, is the
relation from Y to X defined by R-1 = {(y, x) | (x, y) R}
1. Determine whether the given relation is an equivalence
relation on {1, 2, 3, 4, 5}.
(a) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 3), (3, 1)}
(b) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 3), (3, 1), (3, 4), (4, 3)}
(c) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 5), (5, 1), (3, 5), (5, 3), (1, 3),
(3, 1)}}
For the following questions, x, y  {1, 2, 3, 4, 5}.
(d) {(x, y ) | 1  x  5, 1 y  5}.
(e) {(x, y ) | 4 divides x – y}.
(f) {(x, y ) | 3 divides x + y}.
(g) {(x, y ) | x divides 2 – y}.
2. Determine whether the given relation is an equivalence relation
on the set of all people.
(a) {(x, y ) | x and y are the same height}.
(b) {(x, y ) | x and y have, at some time, lived in the same
country}.
(c) {(x, y ) | x and y have the same first name}.
(d) {(x, y ) | x is taller than y }.
(e) {(x, y ) | x and y have the same parents}.
(f) {(x, y ) | x and y have the same colour hair}.
ACTIVITY 2.7
Copyright © Open University Malaysia (OUM)
TOPIC 2 RELATIONS  45
• Let R1 be a relation from X to Y and R2 be a relation from Y to Z. The
composition of R1 and R2, denoted by R2 o R1, is the relation from X to Z,
defined by R2 o R1 = {(x, z) | (x, y)R1 and (y, z)R2 for some y Y }
• A (binary) relation R on a set X is a relation from X to X.
• There are four properties of relations on a set namely reflexive, symmetric,
antisymmetric and transitive.
• The relation R between two sets is reflexive when (x, x )  R for all x  X.
• The relation R between two sets is symmetric when (x, y )  R then (y, x)  R
for all x, y  X.
• The relation R between two sets is antisymmetric when (x, y )  R but (y, x) 
R for all x, y  X.
• The relation R between two sets is transitive when (x, y )  R and (y, z)  R
then (x, z)  R for all x, y, z  X.
• The partial order is a relation R with properties of reflexive, antisymmetric
and transitive.
• The equivalence relation is a relation R with properties of reflexive,
symmetric and transitive.
Antisymmetric relations
Composition of relations
Digraph
Domain
Equivalence relations
Inverse relations
Partial order
Range
Reflexive relations
Relations
Symmetric relations
Transitive relations
Copyright © Open University Malaysia (OUM)
 TOPIC 2 RELATIONS
46
Application to Graph theory. Retrieved from http://aix1.uottawa.ca/
~jkhoury/graph.htm
Graph matrices. (2010). Retrieved from http://compalg.inf.elte.hu/~tony/
Oktatas/TDK/FINAL/ Chap%2010.PDF
Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate:
Pearson.
Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics
(revised 3rd ed.). New York: McGraw Hill.
Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York:
McGraw Hill.
Copyright © Open University Malaysia (OUM)
LEARNING OUTCOMES
 INTRODUCTION
Are you aware that the concept of functions is very important in discrete
mathematics? In fact, functions play important roles in information technology,
such as, to represent the computational complexity of algorithms. In addition,
there are many programs designed to calculate the values of functions.
What does a function mean? A function is basically a special kind of relation that
has exactly one output for every possible input in the domain. So, most of the
terminologies that have been introduced in Topic 2 will be reused in this topic.
By the end of the topic, you should be able to:
1. Describe the concept of function;
2. Represent functions by using graphical representations;
3. Identify three types of functions;
4. Discuss inverse of a function;
5. Apply the operation on function composition; and
6. Distinguish between binary and unary operators.
T
To
op
pi
ic
c
3
3
 Function
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
48
CONCEPT OF FUNCTION
Before we go further, let us learn the concept of function.
Let us look at some examples.
Example 3.1a
The relation
f = {(1, a), (2, b), (3, a)}
from X = {1, 2, 3} to Y = {a, b, c} is a function from X to Y.
By using an arrow diagram, this relation can be presented as:
Figure 3.1: The relation f
The domain of f is X and the range of f is {a, b }.
The range of a relation R is the set {y Y |(x, y ) R for some x  X }
3.1
Definition 3.1a: A function f from X to Y is a relation from X to Y having the
following properties:
1. For each x X
 , there is exactly one y Y
 with  
,
x y f
 .
2. The domain of f is X and the range of f is  
 
,
y x y f
 .
A function from X to Y is sometimes denoted by f : X  Y
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  49
Example 3.1b
The relation is represented as
f(x) = x2 ; x ∈ R
This relation is a function and the domain is the set of all real numbers.
The range of f is the set of all non-negative real numbers.
If f is a function f: X2, given a value in set X, we can obtain the value in set Y. This
process is called function application.
Example 3.1c
We can apply the function given in Example 3.1b as follows:
f (2) = 4,
f (-2) = 4,
f (8) = 64.
1. How can you relate the concept of function and apply it to your
daily life? Give an example.
2. Determine whether the relation R below is a function from
X = {1, 2, 3, 4} to Y = {a, b, c, d }.
If it is a function, find its domain and range, and then draw
the arrow diagram.
(a) R = {(1, a), (2, a), (3, c), (4, b)}
(b) R = {(1, c), (2, a), (3, b), (4, c), (4, d )}
(c) R = {(1, c), (2, d ), (3, a), (4, b)}
(d) R = {(1, d ), (2, d ), (4, b)}
(e) R = {(1, b), (2, b), (3, b), (4, b)}
ACTIVITY 3.1
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
50
GRAPH OF A FUNCTION
Are you aware that another way to visualise a function is to draw its graph? Let
us look at some examples on how to do it.
Example 3.2a
The graph of the function
f(x) = x2,
has the value as in Table 3.1 and the graph is shown in the Figure 3.2.
Table 3.1 The value of the function f(x) = x2
x -2 -1 0 1 2
f(x) = x2 4 1 0 1 4
3.2
3. Determine whether the relation R from A to B is a function.
(a) A = The set of all learners at Open University Malaysia
B = The set of courses offered by Open University Malaysia
(b) A = A set of people in Putrajaya
B = The set of IC numbers
4. Let g = {(1, a), (2, c), (3, c)} be a function from X = {1, 2, 3} to
Y = {a, b, c, d }. Apply the function to find the value of
(a) g(1)
(b) g(2)
5. Let   3, .
f x x x Z
   Apply the function to find the value of
(a) f (5)
(b) f (-1)
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  51
Figure 3.2: The graph of the function f(x) = x2
Example 3.2b
The graph of the function R = {(1, 1), (1, 3), (2, 2), (3, 0)} is as shown in Figure 3.3.
Figure 3.3: The graph of the function R
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
52
TYPES OF FUNCTIONS
Did you know that there are three types of functions? They are shown in Figure 3.4.
Figure 3.4: Three types of functions
These three types of functions are further discussed as follows.
3.3.1 Injective
What does injective mean?
3.3
1. Draw a graph for the function f (x) = x2 + 1 where x  0. Do you get
the parabola shape on your graph?
2. Represent the functions below by using graphical representation.
 
1 2 2
( ) ; ,
f x x x
   
 
3
3 3
( ) ; ,
f x x x
  
3. Represent the functions R below by using graphical representation.
(a) R = {(1, 2), (2, 2), (3, 6), (4, 4)}
(b) R = {(1, 3), (2, 4), (3, 5), (4, 1)}
ACTIVITY 3.2
Definition 3.3a: A function f from X to Y is said to be one to one (or
injective) if for each y Y, there is at most one x  X with f (x) = y.
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  53
The condition given in the definition above for a function to be one to one is
equivalent to: if x, xÊ  X and f(x) = f(xÊ), then x = xÊ.
If a function from X to Y is one to one, each element in Y in its arrow diagram
will have at most one arrow pointing to it (see Figure 3.5). If a function is not
one-to-one, some element in Y in its arrow diagram will have two or more
arrows pointing to it. Let us look at an example.
Example 3.3a
The function f = {(1, b), (3, a), (2, c)} from X = {1, 2, 3} to Y = {a, b, c, d }
is one-to-one.
Figure 3.5: One-to-one relationship
Let us look at an example.
Example 3.3b
The function f(x) = x + 1; x  [-2, 2] is one-to-one.
x -2 -1 0 1 2
f (x) = x + 1 -1 0 1 2 3
Example 3.3c
The function R = {(1, a), (2, b), (3, a)} is not a one-to-one function because a has
two values.
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
54
3.3.2 Surjective
What is surjective?
If the function from X to Y is onto, each element in Y in its arrow diagram will
have at least one arrow pointing to it (see Figure 3.6). Let us look at some
examples.
Example 3.3d
The function f = {(1, D), (2, B), (3, C), (4, C)} is onto on {D, B, C}.
Figure 3.6: Onto relationship
Example 3.3e
Define :
f R R
 by the rule   5 2
f x x
  for all x R
 . Prove that f is onto.
Proof: Let y R
 . (We need to show that x
 in R such that  
f x y
 )
If such a real number exists, then 5 2
x y
  and
2
5
y
x

 . x is a real number
since sums and quotients (except for division by 0) of real numbers are real
numbers. It follows that
 
2
5 2
5
2 2
y
f x
y
y

 
 
 
 
  

Hence, f is onto.
Definition 3.3b: If f is a function from X to Y and the range of f is Y, f is
said to be onto Y (or an onto function or a surjective function).
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  55
3.3.3 Bijective
How about bijective? What does it mean?
Let us look at two examples of this.
Example 3.3f
The function f = {(1, a), (2, b), (3, c)} from X = {1, 2, 3} to Y {a, b, c } is one-to-one
and onto. So it is bijective.
Example 3.3g
The function f = {(1, a), (2, c), (3, b)} from X = {1, 2, 3} to Y = {a, b, c } is
one-to-one and onto Y. Thus, it is bijective.
The arrow diagram for this function is shown in Figure 3.7.
Figure 3.7: One-to-one and onto Y
Definition 3.3c: A function that is both one-to-one and onto is called a
bijective function.
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
56
INVERSE OF A FUNCTION
Suppose that f is one to one, onto function from X to Y. It can be shown that the
inverse relation
{(y, x)|(x, y)  f}
is a function from Y to X. This new function, denoted f–1 is called f inverse.
Given the arrow diagrams of a one-to-one, onto function f from X to Y, we can
obtain the arrow diagram for f-1 simply by reversing the direction of each arrow.
Let us look at some examples.
3.4
1. Show that if f is a one-to-one, onto function from X to Y, then
{(y, x) | (x, y)  f}
is a one-to-one, onto function from Y to X.
2. In each part, sets A and B and a function from A to B are given.
Determine whether the function is one-to-one or onto (or both or
neither).
(a) A = {1, 2, 3, 4} = B;
f = {(1, 1), (2, 3), (3, 4), (4, 2)}
(b) A = {1, 2, 3, 4}; B = {a, b, c, d };
f = {(1, a), (2, b), (3, c)}
(c) A = B = Z ; f (a) = a –1
(d) A = {1.1, 7, 0.06}; B = {p, q };
f = {(1.1, p), (7, q), (0.06, p)}
3. Let f be a function from A to B. Determine whether each function f
is one-to-one and whether it is onto or not.
(a) A = R, B = {x|x is a real and x  0}; f(a) =|a|
(b) A = R ╳R, B = R; f ((a, b)) = a
(c) A = B = R ╳R; f ((a, b)) = (a + b, a – b)
(d) A = R , B = {x|x is a real and x  0}; f(a) = a2.
ACTIVITY 3.3
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  57
Example 3.4a
For the function f in f = {(1, a), (2, c), (3, b)} from X = {1, 2, 3} to Y = {a, b, c } is one-
to-one and onto Y.
f–1 = {(a, 1), (c, 2), (b, 3)}
The arrow diagram for f–1, where f is the function is shown in the following
Figure 3.8.
Figure 3.8: The inverse function
1
f 
Example 3.4b
The function
f(x) = 2x
is one to one function from the set R of all real numbers onto the set R+ of all
positive real numbers. We will derive a formula for f-1(y).
Suppose that (y, x) is in f-1, that is
f-1 (y) = x
then (x, y)  f. Thus
y = 2x.
By definition of logarithm,
log2 y = x
Combining (f-1 (y) = x) and (log2 y = x), we have
f-1 (y) = x = log2 y
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
58
COMPOSITION OF FUNCTIONS
Since functions are special kinds of relations, we can form the composition
of two functions. Specifically, suppose that g is a function from X to Y and f is a
function from Y to Z. The resulting function from X to Z is called the composition
of f with g and is denoted by f o g.
Example 3.5a
Given g = {(1, a), (2, a), (3, c)} a function from X = {1, 2, 3} to Y = {a, b, c}, and f =
{(a, y), (b, x), (c, z)}, a function from Y to Z = {x, y, z}.
The composition function from X to Z can be represented by an arrow diagram as
shown in Figure 3.9.
Figure 3.9: Composition function from X to Z
So,
f o g = {(1, y), (2, y), (3, z)}
The application of f o g on x can be written as (f o g)(x) or alternatively as f(g(x)).
3.5
Each of the functions below is one-to-one. Find the inverse function for
each of them.
(a) f(x) = 4x + 2 (f) f(x) = 6+27x1
(b) f(x) = 3x (g) f(x) = 6x9
(c) f(x) = 3 log2 x (h) f(x) = 3x2
(d) f(x) = 3 + 1/x (i) f(x) = 2x34
(e) f(x) = 4x35
ACTIVITY 3.4
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  59
Example 3.5b
If f(x) = log3 x and g(x) = x4,
f(g(x)) = log3 (x4 ) , g(f(x)) = (log3 x) 4
Composition sometimes allows us to decompose complicated functions into
simpler functions.
Example 3.5c
The function
 
f x = sin2x
can be decomposed into the functions
  
g x x , h(x) = sin x, w(x) = 2x
and we can write
   
 
 

f x g h w x
ACTIVITY 3.5
1. Given f (n) = 3n + 2 and g(n) = 2n – 1. Find a composition of g o f,
and how do you pronounce the answer for g o f?
2. Let f and g be functions from the positive integers to the positive
integers defined by the equations
f(n) = 2n + 1
g(n) = 3n – 1
Find the following function compositions:
(a) f o f
(b) g o g
(c) f o g
(d) g o f
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
60
BINARY AND UNARY OPERATORS
Lastly, let us learn binary and unary operators; firstly, its definition.
Let us look at the following example.
Example 3.6a
Let X = {1, 2, ⁄.}. If we define f(x, y) = x + y, then f is a binary operator on X.
A unary operator of a set X associates each element of X with one element in X.
Example 3.6b
Let E be a universal set and X is a set. If we define
f(X) = X , X  P(E),
Then f is a unary operator on P(E).
3.6
3. Let f and g be functions from the positive integers to the positive
integers defined by the equations
f(x) = 2x
g(x) = x2
Find the following function compositions:
(a) f o f
(b) g o g
(c) f o g
(d) g o f
Definition 3.6a: A function from X x X into X is called a binary operator on X.
Definition 3.6b: A function X into X is called a unary operator on X.
Copyright © Open University Malaysia (OUM)
TOPIC 3 FUNCTION  61
• The function f from X to Y is a relation from X to Y, if for each element in X,
there is exactly one element in Y.
• A function can be drawn into a graphical representation.
• Three types of functions are injective, surjective and bijective.
• The function f from X to Y is said to be one to one (or injective), if each element
in Y in its arrow diagram will have at most one arrow pointing to it.
• The function f from X to Y is said to be onto (or surjective), if each element in Y
in its arrow diagram will have at least one arrow pointing to it.
• The function f from X to Y is said to be bijective function, if it has both one-
to-one and onto function.
• Suppose that f is one to one, onto function from X to Y. It can be shown that
the inverse relation
{(y, x)|(x, y) ∈ f }
is a function from Y to X. This new function, denoted f–1 is called f inverse.
1. A binary operator f in the set X is commutative if f(x, y) = f(y, x)
for all x, y  X. State whether the given function f is a binary
operator on the set X. If f is not a binary operator, state why. State
whether or not each binary operator is commutative.
(a) f(x, y) = x + y, X = {1, 2, ⁄.}
(b) f(x, y) = x – y, X = {1, 2, ⁄.}
(c) f(x, y) =x/y, X = {0, 1, 2, ⁄.}
(d) f(x, y) = x2 + y2 – xy, X = {1, 2, ⁄.}
2. Give an example of a unary operator (different from f(x) = x, for
all x) on the given set.
{⁄, -2, -1, 0, 1, 2, ⁄}
ACTIVITY 3.6
Copyright © Open University Malaysia (OUM)
 TOPIC 3 FUNCTION
62
• The operation on function composition happens when g is a function from X
to Y and f is a function from Y to Z. Then the resulting function from X to Z is
the composition of f with g and is denoted by f o g.
• A function from X  X into X is called a binary operator on X.
• A function X into X is called a unary operator on X.
Bijective
Binary operators
Composition of functions
Functions
Injective
Inverse of functions
One-to-one
Onto
Surjective
Unary operators
Discrete Mathematics/Functions and relations. (2015). Retrieved from http://
en.wikibooks.org/wiki/Discrete_Mathematics/Functions_and_relations
Farlex Inc. (2015). The Free Dictionary: Function. Retrieved from
http://www.thefreedictionary.com/function
Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate: Pearson.
Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics
(revised 3rd ed.). New York: McGraw Hill.
NCS Pearson. (2014). Functions in Discrete Mathematics. Retrieved from
http://math.tutorcircle.com/discrete-math/functions-in-discrete-
mathematics.html
Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York:
McGraw Hill.
Copyright © Open University Malaysia (OUM)
LEARNING OUTCOMES
 INTRODUCTION
What is the function of sequences? Sequences are used to represent an ordered
list of elements. A list of the letters as they appear in a word (or normally called a
string) is an example of a sequence. Another example is the word „form‰ and
„from‰; they are two different words although both of them consist of the same
letters. Thus, the concept of sequence and strings will be the discussion of this
topic.
By the end of the topic, you should be able to:
1. Describe the concept of sequence;
2. Apply the operations on sequences;
3. Describe the concept of strings; and
4. Apply the operations on strings.
T
To
op
pi
ic
c
4
4
 Sequence and
Strings
Copyright © Open University Malaysia (OUM)
 TOPIC 4 SEQUENCE AND STRINGS
64
SEQUENCE
What can you say to define sequence? A sequence is a list in which order is taken
into account. It is a special type of function. The formal definition of a sequence is
as follows:
Let us look at some examples of sequence.
Example 4.1a
The ordered list 2, 4, 6, ⁄. 2n⁄.. is a sequence. The first element is 2, the second
element is 4 and so on. The nth element is 2n. If we let s denote this sequence, we
have
Figure 4.1: Ordered list sequence
Example 4.1b
KLIA Shuttle Inc. charges RM1 for the first km and 50 cents for each additional
km. In general, the cost cn of travelling n km is 1.00 (the cost of travelling the first
km) plus 0.50 times the number (n – 1) of additional km. That is,
cn = 1 + 0.5 (n – 1)
For example:
c1 = 1 + 0.5 (1 – 1)
= 1 + 0.5 (0)
= 1
c5 = 1 + 0.5 (5 – 1)
= 1 + 0.5 (4)
= 3
4.1
Definition 4.1a: A sequence whose smallest index is 1 is a function whose
domain is either the set of all positive integers or a set of the form {1 ⁄. n}.
If s is a sequence, we denote the first element as s1, the second element as s2
and so on. In general, sn denotes the nth element.
Copyright © Open University Malaysia (OUM)
TOPIC 4 SEQUENCE AND STRINGS  65
The list fare in this example is in sequence.
A sequence can have repetitions.
Example 4.1c
The ordered list a, a, b, a, b⁄. is a sequence. The first element of the sequence is
a, the second element of the sequence is a and so on. If we denote this sequence,
we have
Figure 4.2: Ordered list
An alternative notation for the sequence s is sn. Here, s or sn denotes the
entire sequence s1, s2, s3 , ⁄ We use the notation sn to denote the single, nth
element of the sequence s.
A sequence sn is defined by the rule sn = n2  nthe first five terms of this
sequence are
Figure 4.3: Sequence of sn by the rule sn = n2 – 1
The 55th term is
s55 = 552 – 1 = 3024
Example 4.1d
A sequence u is defined by the rule un, which is the nth letter in the word
„digital‰. Then u1 = d, u2 = u4 = i and u7 = l. This sequence is a finite sequence.
Word d i g i t a l
Sequence u1 u2 u3 u4 u5 u6 u7
Figure 4.4: Sequence of un of the word „digital‰
Copyright © Open University Malaysia (OUM)
 TOPIC 4 SEQUENCE AND STRINGS
66
Example 4.1e
If x is the sequence defined by
 
1
3
n
x
n
1 n  4
The elements of x are
1 1 1
3,1, , ,
3 9 27
4.1.1 Types of Sequence
There are two important types of sequence, namely, increasing sequence and
decreasing sequence.
Let us look at some examples.
Example 4.1f
The sequence s
2, 4, 6, ⁄
is increasing since sn = 2n  2(n+1) = sn+1 for all n.
Example 4.1g
The sequence s
3, 5, 5, 7, 8, 8, 13.
is increasing since sn  sn+1 for all n.
Definition 4.1b: A sequence s is increasing if sn  sn+1 for all n.
Definition 4.1c: A sequence s is decreasing if sn  sn+1 for all n.
Copyright © Open University Malaysia (OUM)
TOPIC 4 SEQUENCE AND STRINGS  67
Example 4.1h
The sequence X
1 1 1
3,1, , ,
3 9 27
,⁄
is decreasing since 

   1
1
1 1
3 3
n n
n n
X X for all n.
4.1.2 Subsequence
One way to form a new sequence from a given sequence is to retain only certain
terms of the original sequence and maintaining the order terms in the given
sequence. The resulting sequence is called a subsequence of the original sequence.
Examples for subsequence are as follows:
Example 4.1i
The sequence
b, c
is a subsequence of the sequence
a, a, b, c, q
Notice that the sequence
c, b
is not a subsequence of the sequence.
Definition 4.1d: Let  sn  be a sequence defined for n = m, m + 1, m + 2, ⁄
and let n1, n2, n3, ⁄ be an increasing sequence satisfying nk , nk+1, nk+2 for
all k, whose values are in the set { m, m + 1, m + 2, ⁄ }. We call the sequence
k
n
s a subsequence of n
s .
Copyright © Open University Malaysia (OUM)
 TOPIC 4 SEQUENCE AND STRINGS
68
Table 4.1 illustrates this example further.
Table 4.1: Example 4.1j
Example 4.1j
The sequence
2, 4, 8, 16
is a subsequence of the sequence
2, 4, 6, 8, 10, 12, 14, 16.
Sequence a, a b, c q
Subsequence of sequence b, c
Therefore, c, b is not a subsequence of the sequence
ACTIVITY 4.1
What are strings? Are strings often restricted to sequence?
SELF-CHECK 4.1
1. The sequence s is defined by c, d, d, c, d, c
(a) Find s1
(b) Find s4
2. The sequence k is defined by
kn = 2n – 1, n > 1
(a) Find k3
(b) Find k100
(c) Find k7
(d) Find k2077
(e) Is k increasing or decreasing?
Copyright © Open University Malaysia (OUM)
TOPIC 4 SEQUENCE AND STRINGS  69
SEQUENCE OPERATION
Let us learn on sequence operation.
Operations in sequence are shown in the following examples.
4.2
3. The sequence r defined by
  
3.2 4.5 , 0
n n
n
r n
(a) Find r0
(b) Find r1
(c) Find r2
(d) Find r3
(e) Find a formula for rp
(f) Find a formula for rn-2
(g) Show that n
r satisfies
 
  
1 2
7 10 , 2
n n n
r r r n
(h) Is r increasing or decreasing?
4. Define  sn by the rule
sn = 2n – 1, n > 1
The subsequence of s obtained by taking first, third, fifth terms
(a) List the first seven terms of s.
(b) List the first seven terms of the subsequence.
(c) Find a formula for the expression nk of Definition 4.1d.
(d) Find a formula for the k th term of the subsequence.
Definition 4.2a: If
n
i i=m
a is a subsequence, we define the sum and product
of terms in the sequence as
Sum of terms:  
    
1 ...
n
i m i m m n
a a a a
Product of terms:  
    
1 ...
n
i m i m m n
a a a a
Copyright © Open University Malaysia (OUM)
 TOPIC 4 SEQUENCE AND STRINGS
70
Example 4.2a
Let a be a sequence defined by an = 2n, n1. Then

   
1 1 2 3
n
i i
a a a a
= 2(1) + 2(2) + 2(3)
= 2 + 4 + 6
= 12

   
3
1 1 2 3
i i
a a a a
= 2(1)  2(2)  2(3)
= 2  4  6
= 48
Example 4.2b
The geometric sum
a + ar + ar 2 + ⁄ + ar n
can be rewritten compactly using the sum notation as


n
i
i 0
ar
Example 4.2c
Let a be the sequence defined by the rule an = 2( 1)n, where n >1. Find a formula
for the sequence s defined by

  0
n
n i i
s a
We find that
n
s = 2(1)1 + 2(-1)2 + 2(-1)3 + ⁄ + 2(-1)n
= 2 + 2 ⁄ + (-1)n 2 =
0 if is even
2 if is odd
n
n




Copyright © Open University Malaysia (OUM)
TOPIC 4 SEQUENCE AND STRINGS  71
1. The sequence g is defined by
gn = n2 – 3n + 3, n > 1
(a) Find
4
i
=1
i
g

(b) Find
3
5
i
i
g


(c) Find
=1
6
k
k
g

(d) Find
2
1
i
i
g


(e) Find
3
1
i
i
g


2. The sequence v is defined by vn = n(1)n
(a) Find
1
4
i
i
v


(b) Find
1
10
i
i
v


(c) Find a formula for the sequence c defined by
1
n
n i
i
c v

 
(d) Find a formula for the sequence d defined by
1
n
n i
i
d v

 
3. Rewrite the sum
2
1
-
n i
n
i
v v


Replacing the index i by k, where i = k+1
ACTIVITY 4.2
Copyright © Open University Malaysia (OUM)
 TOPIC 4 SEQUENCE AND STRINGS
72
STRING
The following is the definition for string.
Example 4.3a
Let X = {a, b, c}. If we let
q1 = b, q2 = a, q3 = a, q4 = c
We obtain a string over X. This string is written baac.
Figure 4.5: String with order
Since a string is a sequence, order is taken into account. For example, the string
baac is different from the string acab.
Repetition in a string can be specified by superscripts. For example, the string
bbaaac may be written b2a3c.
The string with no elements is called the null string and is denoted as 
4.3
Definition 4.3a: A string over X, where X is a finite set, is a finite sequence of
elements from X.
Definition 4.3b: We let X* denotes the string of all strings over X,
including the null string, and we let X+ denote the set of all nonnull strings
over X.
Copyright © Open University Malaysia (OUM)
TOPIC 4 SEQUENCE AND STRINGS  73
Example 4.3b
Let X = {a, b}. Some elements in X* are
, a, b, abab, b20a5 ba
Example 4.3c
If  = aabab and  = a3b4a32, then
|| = 5 and || = 39
If  and  are two strings, the string consisting of  followed by , written ,
is called the concatenation of  and .
Example 4.3d
If t = aab and e = cabd, then
te = aabcabd, et = cabdaab, t = t = aab,
t = t = aab.
Definition 4.3c: The length of a string is the number of elements inhe
length ofis denoted by||
1. Let X={a, c, e, i, m, s, t }. Find the sequence if the string contains the
word „mathematics‰.
2. Suppose we have three strings as follows
 = baab,  = caaba,  = bbab
(a) Write the string , , , 3
2
, 2
, , 2

(b) Compute the value of ||, ||, ||, ||
ACTIVITY 4.3
Copyright © Open University Malaysia (OUM)
 TOPIC 4 SEQUENCE AND STRINGS
74
• A sequence is a list in which order is taken into account, such as, if s is a
sequence, we denote the first element as s1, the second element as s2 and nth
element denotes as sn. The sequence is increasing when sn  sn+1 for all n. The
sequence is decreasing when sn+1  sn for all n. The certain terms of the
original sequence is called a subsequence. For example, sequence A contains
s1, s2, s3, s4 and s5 while s2, s3 and s4 is a subsequence of A.
• The operation on sequence involves the sum and product of terms in the
sequence.
• A string is a finite sequence of elements which are not necessarily distinct
elements. For example, abaa is the string with four elements and baaa is also
the string with four elements but they are two different strings.
• The operations on strings includes length of a string and concatenation.
Concatenation
Decreasing
Increasing
Length of a string
Nonnull string
Null string
Sequence
String
Subsequence
Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate:
Pearson.
Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics
(revised 3rd ed.). New York: McGraw Hill.
Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York:
McGraw Hill.
Copyright © Open University Malaysia (OUM)
LEARNING OUTCOMES
 INTRODUCTION
Are you aware that logic is the foundation of science and mathematics? We use
logical methods in mathematics to prove the validity of mathematical
statements. As for natural and physical sciences, logic is used to draw
conclusions from experiments or observations. How about in information
technology? In information technology, logic can be used to verify the
correctness of computer programs.
Did you know that there are a few types of logic? In this topic, we will deal with
the simplest form of logic, namely, the propositional logic. This type of logic deals
with propositions and how to reason on propositions.
By the end of the topic, you should be able to:
1. Explain the concept of proposition;
2. Formulate a proposition in words into a symbolic expression for
conditional and biconditional proposition;
3. Solve the truth value of compound propositions using truth tables or
laws of logic; and
4. Apply operations on compound propositions.
T
To
op
pi
ic
c
5
5
 Propositional
Logic
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
76
PROPOSITION
Let us learn the basis of propositions. According to Poly (1945), in order to
translate a sentence from English into French, two things are necessary. First, we
must understand thoroughly the English sentence. Second, we must be familiar
with the forms of expression peculiar to the French language. The situation is
very similar when we attempt to express in mathematical symbols a condition
proposed in words. First, we must understand thoroughly the condition. Second,
we must be familiar with the forms of mathematical expressions.
Now, let us learn the meaning of proposition. Do you have any idea?
Let us look at an example.
Example 5.1a
Which of the following are propositions?
(a) The Earth is round.
(b) Malaysia is a country in South East Asia.
(c) Do you speak English?
(d) 6 + 2x = 5.
(e) Take two panadol tablets.
(f) The temperature in Malaysia is between 28F to 38F.
Solution:
Question (a) and (b) are statements that happen to be true.
Question (c) is a question, so it is not a statement that is either true or false.
Question (d) is not a statement, since it is true or false depending on the value of x.
Question (e) is not a statement, it is a command.
Question (f) is a declarative sentence whose truth or falsity we do not know at this
time; however, we can (in principle) determine if it is true or false; so it is a
statement.
5.1
Definition 5.1a: A statement that is either true or false, but not both, is called
a proposition. It is expressed as a declarative sentence.
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  77
In propositional logic, a proposition is represented by using a lower case letter,
such as p, q or r. For example, we can use the notation
p : The Earth is round
to define p as a proposition „The Earth is round.‰
5.1.1 Conjunction and Disjunction
Let us look at conjunctions first.
We can describe the values of the conjunction of p and q by using a truth
table as shown in Table 5.1.
Table 5.1: Conjunction of p and q
p q p ∧ q
T
T
F
F
T
F
T
F
T
F
F
F
Now let us move on to disjunction. What does it mean?
Definition 5.1b: Let p and q be propositions. The conjunction of p and q,
denoted p  q, is the proposition p and q. The value of this proposition is
true (T ) if both p and q are true, otherwise the proposition is false (F ).
Definition 5.1c: Let p and q be propositions. The disjunction of p and q,
denoted p  q, is the proposition p or q. The value of this proposition is
true (T ) if p or q is true (T ). It is false if both p and q are false (F ).
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
78
The following Table 5.2 is the truth table for the disjunction of p and q.
Table 5.2: Disjunction of p and q
p q p  q
T
T
F
F
T
F
T
F
T
T
T
F
Propositions, such as, p  q and p  q that result from combining propositions
are called compound propositions. Let us look at Example 5.1b.
Example 5.1b
If
p: The Earth is round,
q: A decade is 100 years,
Then the conjunction of p and q is
p  q: The Earth is round and a decade is 100 years
Since p is true and q is false, p  q is false.
The disjunction of p and q is
p  q: The Earth is round or a decade is 100 years.
Since p is true and q is false, p  q is true.
5.1.2 Negation
What is negation?
Definition 5.1d: The negation of p, denoted p is the proposition not p.
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  79
Table 5.3 shows you the truth table for the negation p.
Table 5.3: Negation p
p p
T F
F T
Let us check out an example for negation.
Example 5.1c
If p : The earth is round.
The negation of p is the proposition
p : The earth is not round.
Since p is true, p
 is false.
ACTIVITY 5.1
1. Determine whether each of the statements given is a proposition.
If the statement is a proposition, write its negation.
(a) Give me a cup of tea.
(b) 2 + 5 = 19.
(c) For some positive integer n, 19340 = n  17.
(d) The difference of two primes is always greater than 1.
2. Write the truth value for each of the propositions below:
p = F, q = T, r = T
(a) p q

(b) p q
  
(c)  
p q r
    
(d)      
p r q r r p
     
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
80
CONDITIONAL PROPOSITION
Now let us learn about conditional propositions; firstly, its definition.
5.2
3. Let p and q be the propositions
p : The temperature is more than 40C.
q : It is raining.
Write the following propositions using p and q and logical
connectives.
(a) The temperature is more than 40C but it is raining.
(b) The temperature is less than 40C and it is raining.
(c) Either the temperature is more than 40C or it is raining.
4. Let p, q and r be the propositions
p : Ahmad is sick.
q : Ahmad misses his driving test.
r : Ahmad passes the test.
Express each of the following propositions as an English sentence:
(a) p q

(b) q r

(c) p q r
  
(d)    
p r q r
  
Create truth table for questions (b) and (c).
Definition 5.2a: If p and q are propositions, the compound proposition
if p then q
is called a conditional proposition and is denoted
p  q
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  81
The truth table for the conditional p  q is shown in Table 5.4.
Table 5.4: Conditional p  q
p q p  q
T
T
F
F
T
F
T
F
T
F
T
T
Let us look at two examples of conditional propositions.
Example 5.2a
If we define
p : The faculty is allocated another scholarship.
q : Ravie can further his studies at University of Sheffield.
The conditional statement p  q means
„If the faculty is allocated another scholarship, then Ravie can further his studies
at University of Sheffield.‰
The converse for p  q is q  p.
Example 5.2b
Let
p : 1 > 2,
q : 4 < 8.
Then p is false and q is true.
The proposition p  q, that is, „If 1 > 2 then 4 < 8‰ is true.
Therefore, the converse proposition q  p, that is „If 4 < 8 then 1 > 2‰ is false.
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
82
BICONDITIONAL PROPOSITION
What is a biconditional proposition?
The truth table for the biconditional proposition p  q is shown in Table 5.5.
Table 5.5: Proposition p  q
p q p  q
T
T
F
F
T
F
T
F
T
F
F
T
The biconditional proposition p  q is normally read as „p if and only if q‰ or „p
if q.‰ An alternative way to state this proposition is „p is a necessary and sufficient
condition for q.‰ Let us look at some examples of biconditional propositions.
Example 5.3a
If we define
p: 1 < 5, q: 2 < 8
then the statement
1 < 5 if and only if 2 < 8
can be written symbolically as
p  q
Since p and q are both true, the statement p  q is true.
An alternative way to state the statement above is: „A necessary and sufficient
condition for 1 < 5 is that 2 < 8.‰
5.3
Definition 5.3a: If p and q are propositions, the compound proposition
(p  q)  (q  p)
is called a biconditional proposition and is denoted as
p  q
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  83
Example 5.3b
If we define
p: Ammar can buy shoes online.
q: Ammar has a credit card.
Then the statement
Ammar can buy shoes online if and only if Ammar has a credit card
can be written symbolically as
p  q
An alternative way to state the statement above is: „A necessary and sufficient
condition for Ammar can buy shoes online is that Ammar has a credit card.‰
ACTIVITY 5.2
1. If each of the following statements define p and q, then write in
the form „if p, then q.‰
(a) It rains whenever the wind blows from the north-east.
(b) That the Pistons win the championship implies that they
beat the Lakers.
(c) It is necessary to walk a few kilometre to get to the top of the
mountain.
(d) To get accepted into OUM, you must have at least 3.0 CGPA.
(e) If you drive more than 110 km/h, you will get a ticket.
(f) I will remember to send you the address only if you send me
an e-mail message.
(g) To be a citizen of this country (Malaysia), it is sufficient that
you were born in this country.
(h) That you get the job implies that you had the best
credentials.
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
84
TAUTOLOGIES, CONTRADICTIONS AND
LOGICAL EQUIVALENCE
What do tautology and contradiction mean?
Example 5.4a
p p
  is an example of tautology.
p p
  is an example of contradiction.
How about logically equivalence propositions?
5.4
2. If each of the following statements define p and q, then write in
the form „p if and only if q.‰
(a) If it is hot outside you buy an ice cream cone, and if you
buy an ice cream cone it is hot outside.
(b) You get promoted only if you have connections, and you
have connections only if you get promoted.
(c) For you to pass this course, it is necessary and sufficient
that you learn how to solve most of the problems.
Definition 5.4a: A proposition p that is always true is called a tautology. A
proposition p that is always false is called a contradiction.
Definition 5.4b: Suppose that the compound proposition p is made up of
propositions p1⁄. pn and compound proposition q is made up of
propositions q1⁄. qn, we say that p and q are logically equivalent and write
p  q
provided that given any truth values of p1 ⁄. pn and truth values of q1 ⁄.
qn, either p and q are both true or p and q are both false.
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  85
Let us look at an example.
Example 5.4b
Show that the negation of p q
 is logically equivalent to p q
  .
We must show that  
p q p q
    .
By writing the truth table for  
p q
  and p q
  , we can verify that given
any truth value of p and q, either p and q are both true or p and q are both false
(see Table 5.6).
Table 5.6:  
p q p q
   
p q q pq (pq) pq
T
T
F
F
T
F
T
F
F
T
F
T
T
F
T
T
F
T
F
F
F
T
F
F
Thus  
p q
  is logically equivalent to p q
  . We can write
 
p q p q
    .
Some of the properties of ,and negation is given in the following theorems.
Theorem 5.4a: The operations for propositions have the following properties
(see Table 5.7).
Table 5.7: Theorem 5.4a
Properties Propositions
(a) Commutative properties
p  q ≡q  p
p  q ≡ q  p
(b) Associative properties
p  (q  r) ≡ (p  q)  r
p  (q  r) ≡ (p  q)  r
(c) Distributive properties
p  (q  r) ≡ (p  q)  (p  r)
p  (q  r) ≡ (p  q)  (p  r)
(d) Idempotent properties
p  p ≡ p
p  p ≡ p
(e) Properties of negation  
p p
  
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
86
Some of the properties of conditional propositions are given in the following
theorem:
CONTRAPOSITIVE AND CONVERSE
Before we end this topic, let us learn about contrapositive and converse.
5.5
Theorem 5.4b (De MorganÊs Law):
1.      
p q p q
     
2.      
p q p q
     
Theorem 5.4c:
1.    
p q p q
   
2.    
p q p q
   
For each pair of the propositions below, state whether they are
logically equivalent.
(a) ,
p p q

(b) ,
p q p q
  
(c) ,
p q p q
 
(d)    
,
p p r p q r
    
(e)      
,
p q r p r q r
    
(f) ,
p q q p
   
(g) ,
p q p q
 
(h)    
,
P p q r Q p p r
     
ACTIVITY 5.3
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  87
Notice the difference between the contrapositive and the converse. The
converse of a conditional proposition merely reverses the roles of p and q
 
q p
 , whereas the contrapositive reverses the roles of p and q and
negates each of them. Let us look at an example.
Example 5.5a
If we define
p : 3 < 4,
q : 5 > 8,
Then the given proposition „if 3 < 4 then 5 > 8‰ may be written symbolically as
p  q
The converse is q  p, or in words „if 5 > 8, then 3 < 4.‰
The contrapositive is q p
   , or in words „if 5 is not greater than 8, then 3 is
not less than 4‰ or „if 5 < 8, then 3 > 4.‰
We see that p  q is false, then q p
   is false.
An important fact is that a conditional proposition and its contrapositive are
logically equivalent. This can be shown by using the truth table as shown in
Table 5.9.
Table 5.8: p q q p
    
p q q pq (pq) pq
T T F F T T
T F F T F F
F T T F T T
F F T T T T
Definition 5.5a: The contrapositive for a conditional proposition p  q is the
proposition q p
  
Copyright © Open University Malaysia (OUM)
 TOPIC 5 PROPOSITIONAL LOGIC
88
• Proposition is a statement that is either true or false.
• The propositions in statements can be formulated into symbolic expressions.
• The compound propositions can be proved by using truth tables and laws of
logic.
• The operations on compound propostions are tautologies, contradiction,
logical equivalence, contrapositive and converse.
Biconditional proposition
Conditional proposition
Conjunction
Contradiction
Contrapositive
Converse
Disjunction
Logical equivalence
Negation
Proposition
Tautologies
If each of the following statements define p and q, then state the
converse and contrapositive in an English sentence.
(a) I go to town whenever there is a need to buy a new cloth.
(b) A positive integer is a prime only if it has no division other than 1
and itself.
(c) If it rains tonight, then I will stay at home.
(d) I go to the beach whenever it is a holiday.
ACTIVITY 5.4
Copyright © Open University Malaysia (OUM)
TOPIC 5 PROPOSITIONAL LOGIC  89
Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate:
Pearson.
Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics
(revised 3rd ed.). New York: McGraw Hill.
Logic. (2009). Retrieved from http://www.cs.odu.edu/~toida/nerzic/content
/logic/intr_to_logic.html
Logic. (2015). Retrieved from http://en.wikibooks.org/wiki/Discrete_
Mathematics/Logic
Poly, G. (1945). How to solve it. Princeton: Princeton University Press.
Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York:
McGraw Hill.
Suber, P. (1997). Propositional Logic Terms and Symbols. Retrieved from
http://www.earlham.edu/~peters/courses/log/terms2. htm
Copyright © Open University Malaysia (OUM)
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf
CBMA2103 Discrete Maths cApr15 (rs)(M).pdf

More Related Content

Similar to CBMA2103 Discrete Maths cApr15 (rs)(M).pdf

Sbfs1103 thinking skills and prob solving
Sbfs1103 thinking skills and prob solvingSbfs1103 thinking skills and prob solving
Sbfs1103 thinking skills and prob solving
Md. Sharif Hossain
 
DTCP2023 Fundamentals of Programming
DTCP2023 Fundamentals of ProgrammingDTCP2023 Fundamentals of Programming
DTCP2023 Fundamentals of Programming
Khirulnizam Abd Rahman
 
FIE 2008 Pedagogy Cybernetics
FIE 2008 Pedagogy CyberneticsFIE 2008 Pedagogy Cybernetics
FIE 2008 Pedagogy Cybernetics
arammann
 
Thesis hadi About RME in Indonesia teching geometri
Thesis hadi About RME in Indonesia teching geometriThesis hadi About RME in Indonesia teching geometri
Thesis hadi About RME in Indonesia teching geometri
Muhammad Ja'far
 
Ebook mst209 block1_e1i1_n9780749252816_l1 (2)
Ebook mst209 block1_e1i1_n9780749252816_l1 (2)Ebook mst209 block1_e1i1_n9780749252816_l1 (2)
Ebook mst209 block1_e1i1_n9780749252816_l1 (2)
Fred Stanworth
 
00 Introduction class_SKTK4143.pptx
00 Introduction class_SKTK4143.pptx00 Introduction class_SKTK4143.pptx
00 Introduction class_SKTK4143.pptx
Asmadi Yussuf
 
Se be information technology rev 2016
Se   be information technology rev 2016Se   be information technology rev 2016
Se be information technology rev 2016
SANJEEVKUMARSRIVASTA7
 
Se be information technology rev 2016
Se   be information technology rev 2016Se   be information technology rev 2016
Se be information technology rev 2016
SANJEEVKUMARSRIVASTA7
 
Simulation Report
Simulation ReportSimulation Report
Simulation Report
Lim1990
 
AUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSING
AUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSINGAUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSING
AUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSING
IRJET Journal
 
Fluid-Machinery-1.pdf this document is used for cput lecture in mechanical e...
Fluid-Machinery-1.pdf this document is used for cput  lecture in mechanical e...Fluid-Machinery-1.pdf this document is used for cput  lecture in mechanical e...
Fluid-Machinery-1.pdf this document is used for cput lecture in mechanical e...
smisosphamandla30
 
5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf
5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf
5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf
Muhammad Taufik
 
Teaching learning based optimization technique
Teaching   learning based optimization techniqueTeaching   learning based optimization technique
Teaching learning based optimization technique
Smriti Mehta
 
22222222222222222
2222222222222222222222222222222222
22222222222222222saud2015
 
httpsvtu.ac.inpdd2021syllabusofengineering
httpsvtu.ac.inpdd2021syllabusofengineeringhttpsvtu.ac.inpdd2021syllabusofengineering
httpsvtu.ac.inpdd2021syllabusofengineering
Arjun Bc
 
Trts
TrtsTrts
Trts
shadi808
 
Assignments .30%
Assignments .30%Assignments .30%
Assignments .30%butest
 
Calculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdf
Calculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdfCalculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdf
Calculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdf
sharidthegreat4
 

Similar to CBMA2103 Discrete Maths cApr15 (rs)(M).pdf (20)

Sbfs1103 thinking skills and prob solving
Sbfs1103 thinking skills and prob solvingSbfs1103 thinking skills and prob solving
Sbfs1103 thinking skills and prob solving
 
DTCP2023 Fundamentals of Programming
DTCP2023 Fundamentals of ProgrammingDTCP2023 Fundamentals of Programming
DTCP2023 Fundamentals of Programming
 
FIE 2008 Pedagogy Cybernetics
FIE 2008 Pedagogy CyberneticsFIE 2008 Pedagogy Cybernetics
FIE 2008 Pedagogy Cybernetics
 
Thesis hadi About RME in Indonesia teching geometri
Thesis hadi About RME in Indonesia teching geometriThesis hadi About RME in Indonesia teching geometri
Thesis hadi About RME in Indonesia teching geometri
 
Ebook mst209 block1_e1i1_n9780749252816_l1 (2)
Ebook mst209 block1_e1i1_n9780749252816_l1 (2)Ebook mst209 block1_e1i1_n9780749252816_l1 (2)
Ebook mst209 block1_e1i1_n9780749252816_l1 (2)
 
عبدالمجيد Trts1
عبدالمجيد Trts1عبدالمجيد Trts1
عبدالمجيد Trts1
 
00 Introduction class_SKTK4143.pptx
00 Introduction class_SKTK4143.pptx00 Introduction class_SKTK4143.pptx
00 Introduction class_SKTK4143.pptx
 
Se be information technology rev 2016
Se   be information technology rev 2016Se   be information technology rev 2016
Se be information technology rev 2016
 
Se be information technology rev 2016
Se   be information technology rev 2016Se   be information technology rev 2016
Se be information technology rev 2016
 
Simulation Report
Simulation ReportSimulation Report
Simulation Report
 
AUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSING
AUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSINGAUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSING
AUTOMATIC QUESTION GENERATION USING NATURAL LANGUAGE PROCESSING
 
Fluid-Machinery-1.pdf this document is used for cput lecture in mechanical e...
Fluid-Machinery-1.pdf this document is used for cput  lecture in mechanical e...Fluid-Machinery-1.pdf this document is used for cput  lecture in mechanical e...
Fluid-Machinery-1.pdf this document is used for cput lecture in mechanical e...
 
14110
1411014110
14110
 
5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf
5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf
5.SYLLABUS_DEB1053_ELECTRONIC WORKSHOP.pdf
 
Teaching learning based optimization technique
Teaching   learning based optimization techniqueTeaching   learning based optimization technique
Teaching learning based optimization technique
 
22222222222222222
2222222222222222222222222222222222
22222222222222222
 
httpsvtu.ac.inpdd2021syllabusofengineering
httpsvtu.ac.inpdd2021syllabusofengineeringhttpsvtu.ac.inpdd2021syllabusofengineering
httpsvtu.ac.inpdd2021syllabusofengineering
 
Trts
TrtsTrts
Trts
 
Assignments .30%
Assignments .30%Assignments .30%
Assignments .30%
 
Calculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdf
Calculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdfCalculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdf
Calculus and Matrices(MA1001)- Course Handout- July-Dec. 2023.pdf
 

Recently uploaded

Understanding User Needs and Satisfying Them
Understanding User Needs and Satisfying ThemUnderstanding User Needs and Satisfying Them
Understanding User Needs and Satisfying Them
Aggregage
 
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.
AnnySerafinaLove
 
Agency Managed Advisory Board As a Solution To Career Path Defining Business ...
Agency Managed Advisory Board As a Solution To Career Path Defining Business ...Agency Managed Advisory Board As a Solution To Career Path Defining Business ...
Agency Managed Advisory Board As a Solution To Career Path Defining Business ...
Boris Ziegler
 
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdfikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
agatadrynko
 
Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...
Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...
Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...
Lviv Startup Club
 
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...
jamalseoexpert1978
 
Project File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdfProject File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdf
RajPriye
 
amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05
marketing317746
 
Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...
Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...
Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...
bosssp10
 
Recruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media MasterclassRecruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media Masterclass
LuanWise
 
The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...
balatucanapplelovely
 
Exploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social DreamingExploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social Dreaming
Nicola Wreford-Howard
 
ikea_woodgreen_petscharity_cat-alogue_digital.pdf
ikea_woodgreen_petscharity_cat-alogue_digital.pdfikea_woodgreen_petscharity_cat-alogue_digital.pdf
ikea_woodgreen_petscharity_cat-alogue_digital.pdf
agatadrynko
 
Organizational Change Leadership Agile Tour Geneve 2024
Organizational Change Leadership Agile Tour Geneve 2024Organizational Change Leadership Agile Tour Geneve 2024
Organizational Change Leadership Agile Tour Geneve 2024
Kirill Klimov
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
fisherameliaisabella
 
3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx
tanyjahb
 
Building Your Employer Brand with Social Media
Building Your Employer Brand with Social MediaBuilding Your Employer Brand with Social Media
Building Your Employer Brand with Social Media
LuanWise
 
Creative Web Design Company in Singapore
Creative Web Design Company in SingaporeCreative Web Design Company in Singapore
Creative Web Design Company in Singapore
techboxsqauremedia
 
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdfMeas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
dylandmeas
 
BeMetals Investor Presentation_June 1, 2024.pdf
BeMetals Investor Presentation_June 1, 2024.pdfBeMetals Investor Presentation_June 1, 2024.pdf
BeMetals Investor Presentation_June 1, 2024.pdf
DerekIwanaka1
 

Recently uploaded (20)

Understanding User Needs and Satisfying Them
Understanding User Needs and Satisfying ThemUnderstanding User Needs and Satisfying Them
Understanding User Needs and Satisfying Them
 
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.
 
Agency Managed Advisory Board As a Solution To Career Path Defining Business ...
Agency Managed Advisory Board As a Solution To Career Path Defining Business ...Agency Managed Advisory Board As a Solution To Career Path Defining Business ...
Agency Managed Advisory Board As a Solution To Career Path Defining Business ...
 
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdfikea_woodgreen_petscharity_dog-alogue_digital.pdf
ikea_woodgreen_petscharity_dog-alogue_digital.pdf
 
Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...
Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...
Evgen Osmak: Methods of key project parameters estimation: from the shaman-in...
 
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...
FIA officials brutally tortured innocent and snatched 200 Bitcoins of worth 4...
 
Project File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdfProject File Report BBA 6th semester.pdf
Project File Report BBA 6th semester.pdf
 
amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05amptalk_RecruitingDeck_english_2024.06.05
amptalk_RecruitingDeck_english_2024.06.05
 
Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...
Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...
Call 8867766396 Satta Matka Dpboss Matka Guessing Satta batta Matka 420 Satta...
 
Recruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media MasterclassRecruiting in the Digital Age: A Social Media Masterclass
Recruiting in the Digital Age: A Social Media Masterclass
 
The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...The effects of customers service quality and online reviews on customer loyal...
The effects of customers service quality and online reviews on customer loyal...
 
Exploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social DreamingExploring Patterns of Connection with Social Dreaming
Exploring Patterns of Connection with Social Dreaming
 
ikea_woodgreen_petscharity_cat-alogue_digital.pdf
ikea_woodgreen_petscharity_cat-alogue_digital.pdfikea_woodgreen_petscharity_cat-alogue_digital.pdf
ikea_woodgreen_petscharity_cat-alogue_digital.pdf
 
Organizational Change Leadership Agile Tour Geneve 2024
Organizational Change Leadership Agile Tour Geneve 2024Organizational Change Leadership Agile Tour Geneve 2024
Organizational Change Leadership Agile Tour Geneve 2024
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
 
3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx3.0 Project 2_ Developing My Brand Identity Kit.pptx
3.0 Project 2_ Developing My Brand Identity Kit.pptx
 
Building Your Employer Brand with Social Media
Building Your Employer Brand with Social MediaBuilding Your Employer Brand with Social Media
Building Your Employer Brand with Social Media
 
Creative Web Design Company in Singapore
Creative Web Design Company in SingaporeCreative Web Design Company in Singapore
Creative Web Design Company in Singapore
 
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdfMeas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
 
BeMetals Investor Presentation_June 1, 2024.pdf
BeMetals Investor Presentation_June 1, 2024.pdfBeMetals Investor Presentation_June 1, 2024.pdf
BeMetals Investor Presentation_June 1, 2024.pdf
 

CBMA2103 Discrete Maths cApr15 (rs)(M).pdf

  • 1. CBMA2103 Discrete Mathematics Faculty of Science and Technology Copyright © Open University Malaysia (OUM)
  • 2. CBMA2103 DISCRETE MATHEMATICS Assoc Prof Dr Abdullah Mohd Zin Copyright © Open University Malaysia (OUM)
  • 3. First Edition, November 2008 Second Edition, April 2015 (rs) Copyright © Open University Malaysia (OUM), April 2015, CBMA2103 All rights reserved. No part of this work may be reproduced in any form or by any means without the written permission of the President, Open University Malaysia (OUM). Project Directors: Prof Dato’ Dr Mansor Fadzil Assoc Prof Dr Norlia T. Goolamally Open University Malaysia Module Writer: Assoc Prof Dr Abdullah Mohd Zin Open University Malaysia Moderator: Prof Dr Mohammed Yusoff Open University Malaysia Enhanced by: Dr Bahari Idrus Universiti Kebangsaan Malaysia Developed by: Centre for Instructional Design and Technology Open University Malaysia Copyright © Open University Malaysia (OUM)
  • 4. Table of Contents Course Guide xi - xv Topic 1 Set 1 1.1 Concept of Set 2 1.1.1 Listing the Elements of Sets 2 1.1.2 Specifying Properties of Sets 3 1.1.3 Set Membership 4 1.1.4 Empty Set 5 1.1.5 Set of Numbers 6 1.2 Set Equality 7 1.3 Venn Diagram 8 1.4 Subset 10 1.5 Power Set 13 1.6 Set Operation 14 1.6.1 Union 15 1.6.2 Intersection 16 1.6.3 Disjoint Sets 18 1.6.4 Set Difference 19 1.6.5 Set Complementary 19 1.6.6 Characteristics of Set 20 1.7 Generalised Union and Intersection 22 1.8 Partition 23 1.9 Cartesian Product 24 Summary 26 Key Terms 27 References 27 Topic 2 Relation 28 2.1 Concept of Relation 29 2.2 Inverse Relation 32 2.3 Composition of Relations 34 2.4 Relations on a Set 36 2.4.1 Reflexive 37 2.4.2 Symmetric 37 2.4.3 Antisymmetric 38 2.4.4 Transitive 38 2.5 Digraph 39 Copyright © Open University Malaysia (OUM)
  • 5.  TABLE OF CONTENTS iv 2.6 Partial Order 41 2.7 Equivalence Relation 43 Summary 44 Key Terms 45 References 46 Topic 3 Function 47 3.1 Concept of Function 48 3.2 Graph of a Function 50 3.3 Types of Function 52 3.3.1 Injective 52 3.3.2 Surjective 54 3.3.3 Bijective 55 3.4 Inverse of a Function 56 3.5 Functions Composition 58 3.6 Binary and Unary Operators 60 Summary 61 Key Terms 62 References 62 Topic 4 Sequence and Strings 63 4.1 Sequence 64 4.1.1 Types of Sequence 66 4.1.2 Subsequence 67 4.2 Sequence Operation 69 4.3 String 72 Summary 74 Key Terms 74 References 74 Topic 5 Propositional Logic 75 5.1 Proposition 76 5.1.1 Conjunction and Disjunction 77 5.1.2 Negation 78 5.2 Conditional Proposition 80 5.3 Biconditional Proposition 82 5.4 Tautologies, Contradictions and Logical Equivalence 84 5.5 Contrapositive and Converse 86 Summary 88 Key Terms 88 References 89 Copyright © Open University Malaysia (OUM)
  • 6. TABLE OF CONTENTS  v Topic 6 Predicate Logic 90 6.1 Predicate Logic 91 6.2 Quantifiers 92 6.2.1 Universal Quantifier 93 6.2.2 Existential Quantifier 95 6.2.3 Combining Quantifiers 96 6.3 Generalised De Morgan Laws 98 6.4 Translating Sentences into Logical Expressions 99 Summary 100 Key Terms 101 References 101 Topic 7 Integer 102 7.1 Integer 102 7.1.1 Basic Operations 103 7.1.2 Order 104 7.1.3 Absolute Value 104 7.2 Mod 105 7.3 Divisor and Greatest Common Divisor 107 7.3.1 Divisors 107 7.3.2 Common Divisors 108 7.3.3 Greatest Common Divisors 109 7.3.4 Euclidean Algorithm 109 7.4 Prime Numbers 111 7.5 Cryptography 113 7.5.1 Private Key 114 7.5.2 Public Key 115 Summary 119 Key Terms 120 References 120 Topic 8 Counting 121 8.1 Basic Principle of Counting 121 8.1.1 Multiplication Principle 122 8.1.2 Addition Principle 123 8.1.3 Combining Principles 123 8.2 Permutation 127 8.3 Combination 129 8.4 Pigeonhole Principle 131 8.4.1 First Form 131 8.4.2 Second Form 132 Copyright © Open University Malaysia (OUM)
  • 7.  TABLE OF CONTENTS vi Summary 133 Key Terms 134 References 134 Topic 9 Matrices 135 9.1 Matrices 135 9.1.1 Equal Matrices 137 9.1.2 Matrix Addition 137 9.1.3 Matrix Multiplication 138 9.1.4 Identity Matrix 139 9.1.5 Power of Square Matrices 139 9.1.6 Matrix Transpose 140 9.1.7 Zero-One Matrices 140 9.2 Matrices of Relation 141 9.2.1 Representing Relations as Matrices 141 9.2.2 Using Matrices for Analysis of Relations 143 9.2.3 Checking for Transitivity 145 Summary 148 Key Terms 149 References 149 Topic 10 Introduction to Graphs 151 10.1 The Concept of Graphs 151 10.2 Types of Graphs 154 10.2.1 Directed Graphs 154 10.2.2 Simple Graphs 156 10.2.3 Weighted Graphs 157 10.2.4 Complete Graphs 157 10.2.5 Cycles 158 10.2.6 n-cube 159 10.2.7 Bipartite Graphs 159 10.2.8 Complete Bipartite Graphs 161 10.3 Subgraphs 164 Summary 165 Key Terms 166 References 166 Copyright © Open University Malaysia (OUM)
  • 8. TABLE OF CONTENTS  vii Topic 11 Path and Cycle 167 11.1 Path 168 11.2 Connected Graph 171 11.3 Components 172 11.4 Euler Path and Cycle 174 11.5 Hamilton Path and Cycle 179 Summary 181 Key Terms 182 References 182 Topic 12 Graph Representation and Isomorphism 183 12.1 Graph Representation 184 12.1.1 Adjacency Matrix 184 12.1.2 Incidence Matrix 187 12.2 Isomorphism 190 Summary 195 Key Terms 195 References 195 Topic 13 Planar Graph 197 13.1 Planar Graph 198 13.2 Graph Colouring 201 Summary 204 Key Terms 205 References 205 Topic 14 Tree 207 14.1 Concept of Trees 208 14.2 Important Terminology 210 14.3 Binary Tree 213 14.4 Tree Isomorphism 218 14.4.1 Basic Concept of Isomorphism 219 14.4.2 Rooted Isomorphism 221 14.4.3 Binary Isomorphism of Trees 222 Summary 226 Key Terms 226 References 227 Copyright © Open University Malaysia (OUM)
  • 9. X COURSE ASSIGNMENT GUIDE xxvi Copyright © Open University Malaysia (OUM)
  • 10. COURSEGUIDE Copyright © Open University Malaysia (OUM)
  • 11. Copyright © Open University Malaysia (OUM)
  • 12. COURSE GUIDE DESCRIPTION You must read this Course Guide carefully from the beginning to the end. It tells you briefly what the course is about and how you can work your way through the course material. It also suggests the amount of time you are likely to spend in order to complete the course successfully. Please keep on referring to Course Guide as you go through the course material as it will help you to clarify important study components or points that you might miss or overlook. INTRODUCTION CBMA2103 Discrete Mathematics is one of the courses offered by Faculty of Science and Technology at Open University Malaysia (OUM). This course is worth 3 credit hours and should be covered over 8 to 15 weeks. COURSE AUDIENCE This course is offered to learners undertaking the Bachelor of Information Technology programme. This module aims to impart the importance of Discrete Mathematics in digital electronics as well as Information Technology. This module is basically the introductory course which focuses on concepts and techniques of Discrete Mathematics. As an open and distance learner, you should be acquainted with learning independently and being able to optimise the learning modes and environment available to you. Before you begin this course, please confirm the course material, the course requirements and how the course is conducted. STUDY SCHEDULE It is a standard OUM practice that learners accumulate 40 study hours for every credit As such, for a three-credit hour course, you are expected to spend 120 study hours. Table 1 gives an estimation of how the 120 study hours could be accumulated. Copyright © Open University Malaysia (OUM)
  • 13.  COURSE GUIDE xii Table 1: Estimation of Time Accumulation of Study Hours Study Activities Study Hours Briefly go through the course content and participate in initial discussion 3 Study the module 60 Attend 3 to 5 tutorial sessions 10 Online participation 12 Revision 15 Assignment(s), Test(s) and Examination(s) 20 TOTAL STUDY HOURS 120 COURSE OUTCOMES By the end of this course, you should be able to: 1. Write statements using mathematical language; 2. Develop mathematical arguments using language; 3. Discuss the concept of integers and its role in modelling; 4. Summarise the concept of graphs and trees; and 5. Apply the concept of graph and tree models to solve problems. COURSE SYNOPSIS This course is divided into 14 topics. The synopsis for each topic can be listed as follows: Topic 1 introduces the concept of sets and subsets. It also shows the theory application of sets operations such as intersection, union, difference and products. Topic 2 discusses the concept of relation. This topic introduces appropriate methods for representing relations between objects. It also discusses some of the properties of relations. Copyright © Open University Malaysia (OUM)
  • 14. COURSE GUIDE  xiii Topic 3 elaborates on the concept of function which is basically a special kind of relation that has been discussed in Topic 2. This topic also explains the graphical representations of functions and the different types of functions. Topic 4 discusses the concept of sequence and strings. It also shows the operations on sequence and strings. Topic 5 explains the concept of propositions logic. It also explains the type of logic that deals with propositions and how to reason on propositions. Topic 6 elaborates on the concept of predicate logic. This topic also teaches you how to write a statement using the predicate logic concept. Topic 7 discusses the applications of integers. It also explains the use of integers in cryptography. Topic 8 introduces several tools for counting. It also briefly discusses the concept of recurrence relation. Topic 9 explains the concept of matrices and applies all matrices operations. This topic also shows how to use matrices to model relationships between two sets. Topic 10 introduces the basic concept of graphs and subgraphs. By the end of this topic, you should be able to identify eight different types of graphs. Topic 11 discusses the concept of path and cycle in a graph. It also introduces applications of graphs by using Euler and Hamilton path and cycle. Topic 12 shows the representation of graphs using matrices. It also explains the concept of isomorphism. Topic 13 discusses the concept of planar graphs in problem solving. This topic also shows how to solve the map colouring problem. Topic 14 discusses the concept of trees and the characteristics of different types of trees. Then, you will be introduced to the application of the tree isomorphism concept. Copyright © Open University Malaysia (OUM)
  • 15.  COURSE GUIDE xiv TEXT ARRANGEMENT GUIDE Before you go through this module, it is important that you note the text arrangement. Understanding the text arrangement will help you to organise your study of this course in a more objective and effective way. Generally, the text arrangement for each topic is as follows: Learning Outcomes: This section refers to what you should achieve after you have completely covered a topic. As you go through each topic, you should frequently refer to these learning outcomes. By doing this, you can continuously gauge your understanding of the topic. Self-Check: This component of the module is inserted at strategic locations throughout the module. It may be inserted after one sub-section or a few sub- sections. It usually comes in the form of a question. When you come across this component, try to reflect on what you have already learnt thus far. By attempting to answer the question, you should be able to gauge how well you have understood the sub-section(s). Most of the time, the answers to the questions can be found directly from the module itself. Activity: Like Self-Check, the Activity component is also placed at various locations or junctures throughout the module. This component may require you to solve questions, explore short case studies, or conduct an observation or research. It may even require you to evaluate a given scenario. When you come across an Activity, you should try to reflect on what you have gathered from the module and apply it to real situations. You should, at the same time, engage yourself in higher order thinking where you might be required to analyse, synthesise and evaluate instead of only having to recall and define. Summary: You will find this component at the end of each topic. This component helps you to recap the whole topic. By going through the summary, you should be able to gauge your knowledge retention level. Should you find points in the summary that you do not fully understand, it would be a good idea for you to revisit the details in the module. Key Terms: This component can be found at the end of each topic. You should go through this component to remind yourself of important terms or jargon used throughout the module. Should you find terms here that you are not able to explain, you should look for the terms in the module. References: The References section is where a list of relevant and useful textbooks, journals, articles, electronic contents or sources can be found. The list can appear in a few locations such as in the Course Guide (at the References Copyright © Open University Malaysia (OUM)
  • 16. COURSE GUIDE  xv section), at the end of every topic or at the back of the module. You are encouraged to read or refer to the suggested sources to obtain the additional information needed and to enhance your overall understanding of the course. PRIOR KNOWLEDGE No prior knowledge required. ASSESSMENT METHOD Please refer to the myINSPIRE. TAN SRI DR ABDULLAH SANUSI (TSDAS) DIGITAL LIBRARY The TSDAS Digital Library has a wide range of print and online resources for the use of its learners. This comprehensive digital library provides access to more than 30 online databases comprising e-journals, e-theses, e-books and more. Examples of databases available are EBSCOhost, ProQuest, SpringerLink, Books24x7, InfoSci Books, Emerald Management Plus and Ebrary Electronic Books. As an OUM learner, you are encouraged to make full use of the resources available through this library. Copyright © Open University Malaysia (OUM)
  • 17. X COURSE ASSIGNMENT GUIDE xxvi Copyright © Open University Malaysia (OUM)
  • 18.  INTRODUCTION Did you know that the concept of set is fundamental to mathematics and computer science? This is because everything mathematical starts with sets. For example: (a) Relationships between two objects are represented as a set of ordered pairs of objects (the concept of ordered pair is defined using sets); (b) Natural numbers (the basis of other numbers) are also defined using sets; (c) The concept of function (a special type of relation) is based on sets; and (d) Graphs and digraphs consisting of lines and points are described as an ordered pair of sets. So what does a set mean? A set is an unordered collection of objects, and, as such, a set is determined by the objects it contains. Then we have set theory which is an T To op pi ic c 1 1  Sets By the end of the topic, you should be able to: 1. Describe the concept of sets; 2. Define set equality; 3. Illustrate sets by using Venn diagrams; 4. Discuss subset and power set; 5. Apply the operations on sets; 6. Solve generalised union and intersection; and 7. Summarise the concept of partition and Cartesian products. LEARNING OUTCOMES Copyright © Open University Malaysia (OUM)
  • 19.  TOPIC 1 SETS 2 important language and tool for reasoning. It is a basis for mathematics. Set theory is important for computer science because it is a useful tool for formalising and reasoning about computation and the objects of computation. CONCEPT OF SET Let us start the lesson by learning the concept of set; firstly, its definition. For example: (a) The collection of all learners taking this course; (b) The collection of all lecturers at the university; and (c) The collection of odd numbers between one to fifteen. 1.1.1 Listing the Elements of Sets Generally, there are several ways to describe sets. One way of describing a set that has a finite number of elements is by listing the elements of the set between curly brackets. Notation A = {elements of set A} where A is the name of the set. It could be any other variable name. Other examples are C, D, E and so on. Normally the name of the set is denoted by capital letters while elements of a set are with small letters, for example P = {x, y, z}. Let us look at other examples. Example 1.1a Given set A, A = {1, 2, 3, 4} describes a set A made up of the four elements 1, 2, 3, and 4. 1.1 Definition 1.1a: A set is any well-defined collection of objects, called elements or members of the set. Copyright © Open University Malaysia (OUM)
  • 20. TOPIC 1 SETS  3 A set is determined by its elements, and the order in which the elements of a set are listed does not matter. Another way in writing the same set A is as follows: A = {1, 3, 4, 2} The elements comprised in a set could be listed more than once as they are assumed to be distinct. For this reason, we may also describe the same set A as: A = {1, 2, 2, 3, 4} Listing the elements of set could be in order or unordered or distinct. To summarise, there are three ways for us to represent a set as simplified in Table 1.1. Table 1.1: Representation of Elements in a Set Type of Elements in a Set Representation Description Order A = {1, 2, 3, 4} A set is determined by its elements and order in which the elements might be listed. Unorder A = {1, 3, 4, 2} A set is determined by its elements and not by any particular order in which the elements might be listed. Distinct (unequal) A = {1, 2, 2, 3, 4} The elements making up a set are assumed to be distinct, and although for some reason we may duplicate them out in a list, only one occurrence of each element is in the set. Example 1.1b The set V of all vowels in the English alphabet can be written as V = {a, e, i, o, u} 1.1.2 Specifying Properties of Sets Sometimes it is inconvenient or impossible to describe a set by listing all of its elements. Another useful way to define a set is by specifying a property that the elements of the set have in common. If a set is a large finite set or an infinite set, we can describe it by listing a property necessary for membership. Let us check out the following example. Copyright © Open University Malaysia (OUM)
  • 21.  TOPIC 1 SETS 4 Example 1.1c The set B = {x | x is a positive and even integer} describes the set B made up of all positive and even integers; that is, B consists of the integer 2, 4, 6, 8 and so on. The vertical bar "|" is read as "such that". Set B can be read as "B equals the set of all x such that x is a positive and even integer." 1.1.3 Set Membership Given a description of a set X such as A = {1, 2, 3, 4} or B = {x| x is a positive and even integer} with element x, we can determine whether or not x belongs to X. If x is a member in set X, we write it as x X; otherwise, we write it as x  X. If X is a finite set, the number of elements in X, is denoted as |X| called cardinality. These relationships can be simplified in Table 1.2. Table 1.2: Membership Representation Symbols Description  Is a member/element  Is not a member/element Let us look at the following examples of set membership. Explain how to read the set notation. Give an example. SELF-CHECK 1.1 Copyright © Open University Malaysia (OUM)
  • 22. TOPIC 1 SETS  5 Example 1.1d Let A = {1, 3, 5, 7}. Then 1  A, 3  A, but 2 A. Therefore |A| = 4. Example 1.1e A is a set consisting of the first five positive integers: A = {1, 2, 3, 4, 5}. So 2  A but 6  A. Therefore |A| = 5. Example 1.1f Let N = {1, 2, 3, ⁄} be a set of positive integers, (a) A = {1, 4, 9,⁄., 64, 81} = {x2 | x  N and x2 < 100} (b) B = {1, 4, 9, 16} = {y2 | y  N and y2 16} (c) C = {2, 4, 6, 8, ⁄⁄⁄} = {2k | k  N } A and B are called finite sets while C is called an infinite set. 1.1.4 Empty Set Did you know that there is a special set that has no elements? This set is called the empty set or null set, and is denoted by  or { }. This empty set can be simplified by using symbols, as shown in Figure 1.1. Figure 1.1: Representation of an empty set Copyright © Open University Malaysia (OUM)
  • 23.  TOPIC 1 SETS 6 1.1.5 Set of Numbers The following Table 1.3 shows you the sets that are normally used when dealing with numbers. Table 1.3: Set of Numbers Set of Numbers Notation Description Integers Z Z = {x | x is an integer} Example: ⁄-3,-2,-1,0,1,2,3,⁄ Positive integers Z + Z + = {x | x is a positive integer} Example: 1,2,3⁄ Natural numbers V N = {x | x is a positive integer} Example: 1,2,3⁄ Real numbers R R = {x | x is a real number} ACTIVITY 1.1 1. Let A= {1, 2, 4, a, b, c}. Identify each of the following as true or false: (a) 2  A (b) 3  A (c) c  A (d)   A (e) { }  A (f) A  A 2. Let A= {x | x is an integer and x < 6}. Identify each of the following as true or false. (a) 3  A (b) 6  A (c) 5  A (d) 8  A (e) -8  A (f) -4  A Copyright © Open University Malaysia (OUM)
  • 24. TOPIC 1 SETS  7 Visit this website which provides detail information on the set theory. It will be helpful for those who are still confused with sets and is worth reading. Enjoy! http://en.wikipedia.org/wiki/Naive_set_theory SET EQUALITY A set is completely known when its members are all known. Thus, we say two sets of A and B are equal if they have the same elements and we write A = B. Let us look at the following examples to understand more on this matter. Example 1.2a If A = {1, 2, 3} and B = {x|x is a positive integer and x2 < 12}, then A = B. Example 1.2b If A = {BASIC, PASCAL, ADA}, B = {ADA, BASIC, PASCAL} and C = { ADA, ADA, BASIC, PASCAL, BASIC} then A = B = C. 1.2 3. Describe the following sets by listing their elements. (a) The set of all positive integers that are less than 10. (b) {x | x  Zand x2 < 12} 4 Write the following sets in the form {x | p (x)}, where p (x) is a property that describes the elements of the sets. (a) {2, 4, 6, 8, 10} (b) {a, e, i, o, u} (c) {1, 8, 27, 64, 125} (d) {-2, -1, 0, 1, 2} 5. What is the cardinality of (a) empty set? (b) {}? (c) {1, 2, 3, 4, 7}? (d) {a, b, b, c, d, d}? Copyright © Open University Malaysia (OUM)
  • 25.  TOPIC 1 SETS 8 Example 1.2c If A = {x | x2 + x – 6 = 0}, B = {2, –3} A = B since x2 + x – 6 = 0 can be factorised into (x – 2) (x + 3) = 0, giving x = 2 and x = – 3. VENN DIAGRAM What is the purpose of Venn diagrams? The purpose of Venn diagrams is to provide pictorial views of a set. Historically, the idea of Venn diagrams was first proposed by a mathematician by the name of John Venn. 1.3 1. Let A = {1, 2, 3, 4, 5}. Which of the following sets are equal to A? (a) {4, 1, 2, 3, 5} (b) {2, 3, 4} (c) {1, 2, 3, 4, 5, 6} (d) {x | x is an integer and x2  25} (e) {x | x is a positive integer and x  5} (f) {x | x is a positive rational number and x  5} 2. Which of the following sets are empty sets? (a) {x|x is a real number and x2 – 1 = 0} (b) {x|x is a real number and x2 + 1 = 0} (c) {x|x is a real number and x2 = –9} (d) {x|x is a real number and x = 2x + 1} (e) {x|x is a real number and x = x + 1} 3. Determine whether each of the following pairs of sets are equal? (a) {1, 3, 3, 3, 5, 5, 5, 5, 5}, {5, 3, 1} (b) {{1}}, {1, {1}} (c) , {} ACTIVITY 1.2 Copyright © Open University Malaysia (OUM)
  • 26. TOPIC 1 SETS  9 In Venn diagrams, the universal set E will normally be denoted by a rectangle, while sets within E will be denoted by circles as shown in Figure 1.2. Figure 1.2: Venn diagram As for subsets of the universal set, they are drawn as circles. The figures inside of a circle represent the elements of the set (Figure 1.3). Figure 1.3: Subset representation How do we represent three sets? We represent three sets by using three overlapping circles, as shown in Figure 1.4. Figure 1.4: Three sets representation Copyright © Open University Malaysia (OUM)
  • 27.  TOPIC 1 SETS 10 SUBSET We have learned a little on subset in the previous subtopic. Now let us learn more on subsets; firstly, its definition. The Venn diagram in Figure 1.5 represents the subset for sets A and B. Figure 1.5: Subset for sets A and B Let us check out some examples on subsets. Example 1.4a If C = {1, 3} and A = {1, 2, 3, 4} Then C is a subset of A, or C A We can present it in a Venn diagram as shown in Figure 1.6. 1.4 Definition 1.4a: If every element of A is also an element of B, that is if whenever x  A then x  B, we say that A is a subset of B or A is contained in B, and we write A  B. Copyright © Open University Malaysia (OUM)
  • 28. TOPIC 1 SETS  11 Figure 1.6: C subset of A Example 1.4b Let A = {1, 2, 3, 4, 5, 6}; B = {2, 4, 5}; and C = {1, 2, 3, 4, 5}. B  A, B  C and C  A Example 1.4c Let A = {1, 2, 3, 4, 5, 6} B = {3, 7} B is not a subset of A, so we write B A. Figure 1.7: Venn diagram for Example 1.4c Copyright © Open University Malaysia (OUM)
  • 29.  TOPIC 1 SETS 12 Any set X is a subset of itself, since any element in X is in X, so X  X. As for the empty set, it is a subset of any set. So for any set X,   X. We can define set equality by using the concept of subsets as follows: Definition 1.4b: If X is a subset of any set Y and X is not equal to Y, we say that X is a proper subset of Y and we write X Y. Definition 1.4c: Two sets, A and B are equal and can be written as A = B if A B and B A. ACTIVITY 1.3 1. Let A = {1, 2, 5, 8, 11}. Identify each of the following statements as true or false. (a) {5, 1}  A (b) {8, 1}  A (c) {1, 8, 2, 11, 5}  A (d)   A (e) {1, 6}  A (f) {2}  A (g) {3}  A (h) A  {11, 2, 5, 1, 8, 4} 2. Suppose that A = {2, 4, 6}, B= {2, 6}, C = {4, 6} and D = {4, 6, 8}. Determine whether (a) A  B (b) B  C (c) C  D Copyright © Open University Malaysia (OUM)
  • 30. TOPIC 1 SETS  13 POWER SET What is a power set? The following describes the meaning of a power set. Let us look at some examples of power sets. Example 1.5a If A = {a, b, c }, the members of  (A) are  (A) = {, {a}, {b}, {c }, {a, b}, {a, c }, {b, c }, {a, b, c }} All but {a, b, c } are proper subsets of A. You may also write (A) as ({a, b, c}) The number of elements in a power set is given by the following theorem. Example 1.5b For set A in Example 1.5a, |A| = 3, then |P (A) | = 23 = 8 Example 1.5c P () = , || = 0 then|P ()|= 20 = 1 1.5 3. Use a Venn diagram to illustrate the relationship A  B and B  C. 4. Suppose that A, B and C are sets, such that A  B and B  C. Show that A  C. Definition 1.5a: If A is a set, then the set of all subsets of A including the empty set and itself is called the power set of A and is denoted by  (A). Theorem 1.5a: If X  = n then P (X ) = 2n Copyright © Open University Malaysia (OUM)
  • 31.  TOPIC 1 SETS 14 Example 1.5d The power set of the empty set has two subsets,  and {}. 2 = 2 P ({}) = { SET OPERATION This subtopic discusses several operations that will combine given sets to produce new sets. These operations are union, intersection, disjoint sets, set difference and set complementary. 1.6 1. Find the power set of each of the following sets. (a) {a} (b) {a, b} (c) {, {}} 2. Can you conclude that A = B, if A and B are two sets with the same power set? 3. How many elements does each of the following sets have? (a) P ({a, b, {a, b}}) (b) P({, {a, {a}, {{a}}}) (c) P(P()) 4. Determine whether each of the following sets is the power set of a set. (a)  (b) {, {a}} (c) {, {a}, {, a}} (d) {, {a}, {b}, {a, b}} ACTIVITY 1.4 Copyright © Open University Malaysia (OUM)
  • 32. TOPIC 1 SETS  15 1.6.1 Union What does union mean? The union of two sets can be illustrated by using a Venn diagram (Figure 1.8). Figure 1.8: Union of set A and set B Let us look at an example. Example 1.6a Let A = {a, b, c, d, e} and B = {b, d, r, s}. A B consists of all the elements that belong to either A or B, so A B = {a, b, c, d, e} {b, d, r, s} = {a, b, c, d, e, r, s}. Definition 1.6a: If A and B are sets, their union can be defined as a set consisting of all elements that belong to A or B, and is denoted by A  B. Thus A  B = {x | x  A or x  B}. Copyright © Open University Malaysia (OUM)
  • 33.  TOPIC 1 SETS 16 Figure 1.9: A  B 1.6.2 Intersection What does it mean by intersection? Let us look its definition. The intersection of the two sets A and B can be illustrated as follows (Figure 1.10). Figure 1.10: Intersection of set A and set B Definition 1.6b: If A and B are sets, their intersection can be defined as a set consisting of all elements that belong to both A and B. The intersection of A and B is denoted by A  B. Thus A  B = {x | x  A and x  B}. Copyright © Open University Malaysia (OUM)
  • 34. TOPIC 1 SETS  17 Let us check out the following example. Example 1.6b Let A = {a, b, c, d, e, f} B = {b, e, f, r, s} C = {a, t, u, v}. A  B = {b, e, f } since elements b, e, and f belong to both A and B. Figure 1.11: A  B Similarly, A  C = {a}. Figure 1.12: A  C Copyright © Open University Malaysia (OUM)
  • 35.  TOPIC 1 SETS 18 B  C = {}, since there are no elements that belong to both B and C. Figure 1.13: B  C 1.6.3 Disjoint Sets What do disjoint sets mean? We can illustrate the disjoint of two sets with a Venn diagram as follows (Figure 1.14). Figure 1.14: Disjoint of set A and set B Definition 1.6c: Two sets that have no common elements are called disjoint sets. A  B = . Copyright © Open University Malaysia (OUM)
  • 36. TOPIC 1 SETS  19 1.6.4 Set Difference Now let us look at set difference; firstly, its meaning. Figure 1.15: A – B 1.6.5 Set Complementary What does set complementary mean? Figure 1.16: Set complementary representation Definition 1.6d: If A and B are sets, their difference can be defined as a set consisting of all elements in A that are not in B. The difference between A and B is denoted by A – B. Thus A – B = {x | x  A and x  B}. Definition 1.6e: Let E be a universal set and let A be a subset of E. The set of E – A consisting of all elements of E that are not elements of A is called the complement of A and is denoted byA . Copyright © Open University Malaysia (OUM)
  • 37.  TOPIC 1 SETS 20 Let us consider these examples. Example 1.6c Let E = {1, 2, 3, 4, 5, 6} and A = {1, 2}. Therefore, A = E – A = {1, 2, 3, 4, 5, 6} – {1, 2} = {3, 4, 5, 6}. Figure 1.17: Ā = E – A 1.6.6 Characteristics of Set Lastly, let us look at characteristics of sets. Let us look at Table 1.4 which summarises nine theorems of sets. Table 1.4: Theorem of Sets Laws (a) Associative Laws (A  B)  C = A  (B  C) (A  B)  C = A  (B  C) (b) Commutative Laws A  B = B  A A  B = B  A Theorem 1.6a: Let E be a universal set and let A, B and C be subsets of E. The following properties hold (see Table 1.4). Copyright © Open University Malaysia (OUM)
  • 38. TOPIC 1 SETS  21 (c) Distributive Laws A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) (d) Identity Laws A   = A A  A = A (e) Complement Laws A  Ā = E A  Ā = E (f) Idempotent Laws A  A = A A  A = A (g) Bound Laws A  E = E A   =  (h) Absorption Laws A  (A  B) = A A  (A  B) = A (i) De Morgan's Laws for Sets                   ACTIVITY 1.5 In each statement below, write „true‰ if the statement is true; otherwise, give a counter example. The sets X, Y and Z are subsets of a universal set E. (a) X  (Y – Z ) = (X Y ) – (X Z ) for all sets X, Y and Z. (b) (X – Y )  (Y – X ) = for all sets X and Y. (c) X – (Y Z ) = (X – Y ) Z for all sets X, Y and Z. (d) – –  X Y Y X for all sets X and Y. (e)  X Y  X for all sets X and Y. (f) (X Y)  (Y – X ) = X for all sets X and Y. Copyright © Open University Malaysia (OUM)
  • 39.  TOPIC 1 SETS 22 GENERALISED UNION AND INTERSECTION Firstly, let us get to know the definition of generalised union. If S = {A1 , A2 , ⁄ An }, we can write U S = 1 n i i A   , i = 1, 2, ...n Next is the definition of generalised intersection. If S = { A1 , A2 , ⁄, An }, we can write I S = 1 n i i A   , i = 1, 2, ...n Let us check Example 1.7a. Example 1.7a Suppose A1 = {1, 2}, A2 = {3, 4} and A3 = {5, 6} then S = {A1, A2, A3} = { {1, 2} , {3, 4} , {5, 6} } Therefore, U S = 1 n i i A   = {1, 2, 3, 4, 5, 6 }  S = 1 n i i A   = { } 1.7 Definition 1.7a: The generalised union of an arbitrary family, S, of sets are those elements x belonging to at least one set X in S. Formally, U S = {x | x  X for some X  S}. Definition 1.7b: The generalised intersection of an arbitrary family, S, of sets are those elements x belonging to all sets X in S. Formally, S = {x | x  X for all X  S} Copyright © Open University Malaysia (OUM)
  • 40. TOPIC 1 SETS  23 PARTITION A partition of a set X divides n into non-overlapping subsets. More formally, Let us see Example 1.8a. Example 1.8a Since each element of X = {1, 2, 3, 4, 5, 6, 7, 8} is in exactly one member of S = {{1, 4, 5}, {2, 6}, {3}, {7, 8}} S is a partition of X Notice that if S is a partition of X, S is a pairwise disjoint, and U S = X. 1.8 Definition 1.8a: Let S be a collection of non-empty subsets of set X. S is said to be a partition of X, if every element of X belongs to exactly one member of S. Let Ai be a set of integers from 1 to 4. Assume A1 = {a, b, c }, A2 = {b, c, d }, A3 = {b, c, f } and A4 = {b, c, e, f, g }. Find (a) 1 n i i A   (b) 1 n i i A   ACTIVITY 1.6 Copyright © Open University Malaysia (OUM)
  • 41.  TOPIC 1 SETS 24 CARTESIAN PRODUCT What can we say about Cartesian products? An ordered pair (a, b), is considered distinct from the ordered pair (b, a), unless, of course a = b. To put it another way, (a, b) = (c, d) if and only if a = c and b = d. Let us look at Example 1.9a. Example 1.9a If X = {1, 2, 3} and Y = {a, b}, then X × Y = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)} Y × X = {(a, 1), (b, 1), (a, 2), (b, 2), (a, 3), (b, 3)} X × X = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)} Y × Y = {(a, a), (a, b), (b, a), (b, b)} The example above shows that, in general, X × Y  Y × X. 1.9 Definition 1.9a: If A and B are sets, we let A  B denote the set of all ordered pairs (a, b) where a  A and b  B. We call A  B the Cartesian product of A and B. ACTIVITY 1.7 Determine whether each set D below is a partition of set Y Y = {x | x is integer and 1  x  5} (a) D = {{1}, {2, 3}, {4}, {5}} (b) D = {{1, 4}, {2}, {3,5}} (c) D = {{1}, {4}, {2}, {3,5}} (d) D = {{1}, {4}, {2}, {3}, {5}} (e) D = {{1, 3}, {2}, {4, 5}} (f) D = {{7, 4}, {2, 6}, {3, 5}} Copyright © Open University Malaysia (OUM)
  • 42. TOPIC 1 SETS  25 Let us look at an example on this. Example 1.9b If X = {1, 2} Y = {a, b} Z = {, }, then X × Y × Z = {(1, a, ), (1, a, ), (1, b, ), (1, b, ), (2, a, ), (2, a, ), (2, b, ), (2, b, )} The following are some basic properties of Cartesian products: A ×  =  A × (B  C) = (A × B)  (A × C) (A  B) × C = (A × C)  (B × C) | A × B | = | B × A | = |A|× |B | A and B is finite set. Definition 1.9b: The Cartesian product of sets X1, X2, ⁄ Xn is defined to be the set of all n-tuples (x1, x2,⁄. xn) where xi  Xi for i = 1, ⁄ n; it is denoted by X1 × X2 ×⁄× Xn. Theorem 1.9a: | X × Y | = | X | . | Y | and | X × Y × Z | = | X | . | Y | . | Z |. In general, we have | X1 × X2 × ⁄. X × Xn | = | X1 | . | X1 | . | X2 | ……. | Xn | 1. Find x or y so that the following statements are true. (a) (x, 3) = (4, 3) (b) (a, 3y) = (a, 9) (c) (3x + 1, 2) = (7, 2) (d) (C++, PASCAL) = (x, y) ACTIVITY 1.8 Copyright © Open University Malaysia (OUM)
  • 43.  TOPIC 1 SETS 26  A set is any well-defined collection of objects, called elements or members of the set.  A set is completely known when its members are all known. Thus, we say two sets of A and B are equal if they have the same elements, and we write A = B.  A Venn diagram illustrates the universal set E as a rectangle, while sets within E will be denoted by circles.  Set A is a subset of set B if every element of A is also an element of B, A B.  If A is a set, then the set of all subsets of A including the empty set and itself is called the power set of A, and is denoted by  (A).  The operations of sets include union, intersection and difference.  The generalised union of an arbitrary family, S, of sets are those elements x belonging to at least one set X in S. Formally, U S = {x | x  X for some X  S}  The generalised intersection of an arbitrary family, S, of sets are those elements x belonging to all set X in S. Formally, S = {x | x  X for all X  S} 2. In each of the statements below, write „true„ if the statement is true; otherwise, give a counter example. The set X, Y and Z are subsets of a universal set E. Assume that the universe for Cartesian products is E × E. (a)    X Y X Y for all sets X and Y. (b) X × (Y  Z) = (X × Y)  (X × Z) for all sets X, Y and Z. (c) X × (Y – Z) = (X × Y) – (X × Z) for all sets X, Y and Z. (d) X – (Y × Z) = (X – Y) × (X – Z ) for all sets X, Y and Z. (e) X  (Y × Z) = (X  Y) × (X  Z) for all sets X, Y and Z. Copyright © Open University Malaysia (OUM)
  • 44. TOPIC 1 SETS  27  A partition of a set X divides set X into n non-overlapping subsets.  If A and B are sets, we let A  B denote the set of all ordered pairs (a, b) where a  A and b  B. We call A  B the Cartesian product of A and B. Cartesian product Disjoint set Elements Empty set Generalised intersection Generalised union Intersection Partition Power set Set complement Set difference Set equality Set membership Sets Subsets Union Venn diagram Glosser, G. (2015). Introductions to Sets. Retrieved from http://www.math goodies.com/lessons/sets/ Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate: Pearson. Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics (revised 3rd ed.). New York: McGraw Hill. Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York: McGraw Hill. Set (mathematics). (2015). Retrieved from http://en.wikipedia.org/wiki/ Set_(mathematics) Shadrach, R. (2014). Introduction to Sets. Retrieved from http://www.mathsisfun.com/sets/sets-introduction.html Copyright © Open University Malaysia (OUM)
  • 45. LEARNING OUTCOMES  INTRODUCTION Did you notice that in real life, relationship exists between people and other entities? For example „father of‰ is a relationship between two individuals. Similarly, we may have a relationship „owner of‰ between people and car. How about mathematics? In mathematics, this concept can be formalised by using relation. Thus, we will discuss the concept of relation in this new topic. You will be introduced to several geometric and algebraic methods for representing relations between objects. Some discussion on the properties of relations will be included too. By the end of the topic, you should be able to: 1. Describe the concept of relations between two sets; 2. Use the appropriate methods for representing relations; 3. Describe inverse relation; 4. Explain composition of relations; 5. Summarise four properties of relations on a set; 6. Draw a digraph to represent a relation; and 7. Distinguish partial order and equivalence relation. T To op pi ic c 2 2  Relations Copyright © Open University Malaysia (OUM)
  • 46. TOPIC 2 RELATIONS  29 CONCEPT OF RELATION Firstly, let us learn the meaning of relation. Now let us look at some examples of relations. Example 2.1a If X is a set of students X = {Jimmy, Sheila, Shah, Zurai} and Y is a set of courses Y = {Computer Science, Math, Art, History} a relation R between X and Y indicating „courses taken by the students‰ can be written as R = {(Jimmy, Computer Science), (Sheila, Math), (Jimmy, Art), (Shah, History), (Shah, Computer Science), (Zurai, Math)}. Since (Shah, History)R, we may write Shah R History. We can represent a relation in Example 2.1a pictorially by using an arrow diagram as follows (Figure 2.1). 2.1 Definition 2.1a: Let X and Y be two sets. A (binary) relation R from X to Y is a subset of the Cartesian product X ×Y. If (x, y)R, we write x R y. Definition 2.1b: The set {x  X | (x, y) R for some y Y} is called the domain of R. The set {y Y | (x, y)R for some x X} is called the range of R. Copyright © Open University Malaysia (OUM)
  • 47.  TOPIC 2 RELATIONS 30 Figure 2.1: Relation between X and Y pictorially Example 2.1b Suppose A is a set of lecturers and B is a set of cars. A = {Ahmad, Johan, Ravie, Zul} B = {Iswara, Wira, Mercedes} We can define a relation R between the two sets indicating „types of cars owned by lecturers‰ as R = {(Ahmad, Iswara), (Johan, Wira), (Johan, Mercedes), (Ravie, Wira)} The pictorial representation of this relation is as follows: Figure 2.2: Relation between A and B in pictorial representation Example 2.1c Suppose X = {2, 3, 4} and Y = {3, 4, 5, 6, 7}. If we define a relation R from X to Y by (x, y)R, if x divides y (with zero remainder) we obtain R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)} The domain of R is the set {2, 3, 4} and the range of R is the set {3, 4, 6}. Copyright © Open University Malaysia (OUM)
  • 48. TOPIC 2 RELATIONS  31 1. Suppose that A = {Kota Bharu, Taiping, Ipoh, Seremban} B = {Selangor, Kelantan, Perak} Write a relation R between set A and set B which is defined by (x, y) R if „x is a town in y .‰ 2. A car manufacturer makes three different types of car frames and two types of engines. List all possible models of cars. Frame type: sedan (s), coupe (c), van (v) Engine type: gas (g), diesel (d) 3. Suppose that X = {a, b, c, d} Y = {1, 2, 3, 4, 5} For the relations R below, determine their domains and ranges. (a) R = {(a, 1), (b, 2), (c, 3), (d, 4)} (b) R = {(a, 2), (b, 4), (c, 1), (d, 5)} (c) R = {(a, 4), (b, 2), (c, 4), (d, 2)} 4. Suppose that X = {1, 2, 3, 4, 5} Y = {3, 6, 9} Let x  X, y  Y and write a relation R between set X and set Y defined by: (a) (x, y)  R if x < y (b) (x, y)  R if y = 2x ACTIVITY 2.1 Copyright © Open University Malaysia (OUM)
  • 49.  TOPIC 2 RELATIONS 32 INVERSE RELATION Now let us move on to inverse relation. Firstly, let us learn its meaning. Let us look at an example of inverse relation. Example 2.2a Let X = {2, 3, 4} and Y = {3, 4, 5, 6}. If we define a relation R from X to Y by (x, y) R if x divides y we obtain R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)} 2.2 Definition 2.2a: Let R be a relation from X to Y. The inverse of R, denoted by R-1, is the relation from Y to X defined by R-1 = {(y, x) | (x, y)  R} SELF-CHECK 2.1 I hope that you have understood the basic concepts of relation. Based on your understanding, write a relation for the following items, G = gender; and T = toys that kids love to play. You may present your idea pictorially. Copyright © Open University Malaysia (OUM)
  • 50. TOPIC 2 RELATIONS  33 This relation can be presented pictorially as Figure 2.3: Relation between X and Y pictorially The inverse of the relation R is R-1 = {(4, 2), (6, 2), (3, 3), (6, 3), (4, 4)}. We can represent it pictorially as Figure 2.4. Figure 2.4: Inverse relation, R-1 between X and Y pictorially This relation can be described as „x is divisible by y.‰ Give the inverse for all the relations below: (a) R = {(a, 6), (b, 2), (a, 1), (c, 1)} (b) R = {(Suzi, Music), (Emmy, History), (Adri, Mathematics), (Emmy, Chemistry)} (c) R = {(2, 2), (5, 6), (1, 2), (7, 1), (9, 1)} (d) R = {(8, 26), (21, 17), (10, a), (c, 45), (b, 3), (c, 3)} (e) R = {(Blue, Car), (Red, Flower), (Black, Car), (White, Flower)} ACTIVITY 2.2 Copyright © Open University Malaysia (OUM)
  • 51.  TOPIC 2 RELATIONS 34 COMPOSITION OF RELATIONS Now let us learn composition of relations. We can represent this relationship pictorially as shown in Figure 2.5. Figure 2.5: R2 o R1 Let us look at an example of this relationship. Example 2.3a Suppose that we have two relations R1 = {(1, 2), (1, 6), (2, 4), (3, 4), (3, 6), (3, 8)} and R2 ={(2, u), (4, s), (4, t), (6, t), (8, u)} From Definition 2.3a, the relations can be presented pictorially as shown in Figure 2.6. 2.3 Definition 2.3a: Let R1 be a relation from X to Y and R2 be a relation from Y to Z. The composition of R1 and R2, denoted by R2 o R1, is the relation from X to Z defined by R2 o R1 = {(x, z) | (x, y)  R1 and (y, z)  R2 for some y  Y} Copyright © Open University Malaysia (OUM)
  • 52. TOPIC 2 RELATIONS  35 Figure 2.6: R2 o R1 The composition of these two relations is R2 o R1= {(1, u), (1, t), (2, s), (2, t), (3, s), (3, t), (3, u)} Figure 2.7: Composition of the two relations Write the composition of R2 o R1 for the given relations (a) R1 = {(4, 10), (8, 2), (6, 6)} R2 = {(10, w), (2, z), (6, y)} (b) R1 = {(Math, 3), (Art, 1), (Math, 1), (History, 4), (Chemistry, 2)} R2 ={(1, Adri), (1, Amy), (2, Amin), (3, Shah), (4, Amy)} (c) R1= {(Black, a), (Blue, a), (White, b), (Green, d), (Blue, c), (White, c)} R2 = {(c, 2), (c, 6), (a, 4), (b, 4), (d, 6), (a, 8)} (d) R1 = {(4, Black), (1, Red), (2, Blue), (3, White)} R2 = {(Blue, Car), (Red, Flower), (Black, Car), (White, Flower)} ACTIVITY 2.3 Copyright © Open University Malaysia (OUM)
  • 53.  TOPIC 2 RELATIONS 36 RELATIONS ON A SET What can we say about relations on a set? Let us look at an example of this. Example 2.4a Let R be the relation on X = {1, 2, 3, 4, 5} defined by (x, y)  R if x  y; x, y  X. Then R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5), (5, 5)} The domain of R is the set {1, 2, 3, 4, 5} and the range of R is the set {1, 2, 3, 4, 5}. Hence the domain and the range of R are both equal to X. There are four properties of relations on a set. These properties are listed in Figure 2.8. Figure 2.8: Four properties of relations on set These four properties are further discussed in the following subtopics. 2.4 Definition 2.4a: A (binary) relation R on a set X is a relation from X to X. Copyright © Open University Malaysia (OUM)
  • 54. TOPIC 2 RELATIONS  37 2.4.1 Reflexive What does reflexive mean? Example 2.4b The relation R on X = {1, 2, 3, 4, 5} for Example 2.4a is reflexive because for all elements x  X and (x, x)  R. Thus the reflexive elements are (1, 1), (2, 2), (3, 3), (4, 4) and (5, 5). Example 2.4c Consider the following relations on {a, b, c}: R1 = {(a, a), (a, b), (b, b), (b, c), (c, c)} R2 = {(a, a), (a, b), (b, b), (a, c), (b, c)} R3 = {(a, a), (b, b), (c, c)} R4 = {(a, b), (a, c), (b, c)} The relations R1 and R3 are reflexive because both relations contain all pairs of the form (x, x). The relations R2 and R4 are not reflexive because both relations do not contain all pairs of the form (x, x). 2.4.2 Symmetric When is a relation symmetric? The following Example 2.4d shows you a symmetric relationship. Definition 2.4b: A relation R on a set X is called reflexive if (x, x)  R for all x X. Definition 2.4c: A relation R on a set X is called symmetric if for all x, y  X, and (x, y)  R, then (y, x)  R. Copyright © Open University Malaysia (OUM)
  • 55.  TOPIC 2 RELATIONS 38 Example 2.4d Consider the relation R on X = {a, b, c, d } given as follows: R = {(a, d ), (b, c), (c, b), (d, a)} The relation is symmetric because for all x and y, when (x, y )  R, (y, x )  R. In this case (a, d ) and (d, a), (b, c) and (c, b) are all in R. 2.4.3 Antisymmetric What happens when a relation is antisymmetric? Let us examine Example 2.4e. Example 2.4e Consider the relation R on X = {a, b, c, d } which is given as follows: R = {(a, b), (b, c), (c, d )} The relation is antisymmetric because (a, b) R and (b, a) R, then a b. It is also the same for (b, c) and (c, d ). 2.4.4 Transitive What does a transitive relationship mean? Let us look at Example 2.4f. Definition 2.4e: A relation R on a set X is called transitive if for all x, y, z  X, when (x, y)  R, (y, z)  R and (x, z)  R. Definition 2.4d: A relation R on a set X is called antisymmetric if for all x, y  X; when (x, y)  R and (y, x)  R, then x ≠ y. Copyright © Open University Malaysia (OUM)
  • 56. TOPIC 2 RELATIONS  39 Example 2.4f Consider the relation R on X = {a, b, c, d } which is given as follows: R = {(a, b), (a, d ), (a, c), (b, c), (b, d ),(c, d )} The relation R is transitive because for all x, y, z where (x, y) and (y, z) R, (x, z) R. For example, (a, b) R, (b, c) R, and (a, c) R; (a, b) R, (b, d ) R, and (a, d ) R; and (a, c) R, (c, d ) R and (a, d ) R. DIGRAPH Did you realise that one way to picture a relation on a set is to draw its digraph? A digraph consists of vertices to represent the elements of X and edges to represent the relation between the elements. Let us check out some examples of digraphs. 2.5 1. Write each of the relations below as relations on sets (a) The relation R on {1, 2, 3, 4} defined by (x, y ) R if x2 y (b) The relation R on {1, 2, 3, 4, 5} defined by (x, y ) R if y = 2x (c) Relation R on the set {1, 2, 3, 4, 5} defined by the rule (x, y ) R if 3 divides x – y. (d) Relation R on the set {1, 2, 3, 4, 5} defined by the rule (x, y ) R if x + y6. (e) Relation R on the set {1, 2, 3, 4, 5} defined by the rule (x, y ) R if x = y – 1. 2. Is the relation in exercise 1(a) to (e) reflexive, symmetric, antisymmetric or transitive? ACTIVITY 2.4 Copyright © Open University Malaysia (OUM)
  • 57.  TOPIC 2 RELATIONS 40 Example 2.5a The digraph for the relation R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5), (5, 5)} can be drawn as follows: Figure 2.9: Digraph for R Example 2.5b The relation R on X = {a, b, c, d } R = {(a, d ), (b, c), (c, b), (d, a)} is given by the digraph as follows: Figure 2.10: Relation of symmetric Copyright © Open University Malaysia (OUM)
  • 58. TOPIC 2 RELATIONS  41 Did you know that we can determine the characteristics of a relation by using digraphs? These characteristics are summarised in Table 2.1. Table 2.1: Characteristics of a Relation and Digraph Set Relation Digraph Reflexive Has a loop at every vertex. Symmetric Has the property that whenever there is a directed edge from v to w, there is also a directed edge from w to v. Antisymmetric Has the property that between any two vertices there is at most one directed edge. Transitive Has the property that whenever there are directed edges from x to y and from y to z, there is also a directed edge from x to z. PARTIAL ORDER What does partial order mean? Let us look at some examples of partial orders. 2.6 Definition 2.6a: A relation R on a set X is called a partial order if R is reflexive, antisymmetric and transitive. Draw the digraph of the following relations and identify the properties of relations on set: (a) R = {(1, 2), (2, 1), (3, 3), (1, 1), (2, 2)} on X = {1, 2, 3} (b) R = {(1, 2), (2, 3), (3, 4), (4, 1)} on {1, 2, 3, 4} (c) R on {1, 2, 3,4} defined by (x, y)  R if x2  y (d) R = {(a, 3), (b, 1), (c, 4), (d, 1)} from {a, b, c, d} to {1, 3, 4} ACTIVITY 2.5 Copyright © Open University Malaysia (OUM)
  • 59.  TOPIC 2 RELATIONS 42 Example 2.6a Consider the relation R on the set X = {1, 2, 3, 4, 5} defined by (x, y) R if x divides y So R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 2), (2, 4) (3, 3), (4, 4), (5, 5)} R is reflexive since (1, 1), (2, 2), (3, 3), (4, 4), (5, 5) are in R. R is antisymmetric since (2, 1), (3, 1), (4, 1), (5, 1) and (4, 2) are not in R. R is transitive since (1, 2), (2, 4) and (1, 4) are in R. Thus R is a partial order. Example 2.6b In general, a relation R on a set of positive integers defined by (x, y) R if x divides y is a partial order. If R is a partial order on a set X, we can denote x y to indicate that (x, y)R. Then we have comparable and incomparable. What do they mean? Example 2.6c The less than or equals relation on the positive integers is a total order since, if x and y are integers, either x y or y x. Definition 2.6b: Suppose that R is a partial order on a set X. If x, y  X and either x  y or y  x, we say that x and y are comparable. Otherwise, we say that x and y are incomparable. Definition 2.6c: If every pair of the elements in X is comparable, we call R a total order. Copyright © Open University Malaysia (OUM)
  • 60. TOPIC 2 RELATIONS  43 EQUIVALENCE RELATION What does equivalence relation mean? Let us look at two examples which illustrate equivalence relation. Example 2.7a Consider the relation R on {1, 2, 3, 4, 5} defined as R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1), (5, 3), (5, 5)} R is reflexive because (1, 1), (2, 2), (3, 3), (4, 4), (5, 5) R. R is symmetric because whenever (x, y) is in R, (y, x) is also in R. R is transitive because whenever (x, y) and (y, z) are in, (x, z) is also in R. Thus, R is an equivalence relation on {1, 2, 3, 4, 5}. Example 2.7b The relation R as shown in the Example 2.6a is not an equivalence relation because R is not symmetric. 2.7 Determine whether each of the relations defined below on the set of positive integers is a partial order or not. (a) (x, y)  R if x = y2 (b) (x, y)  R if x > y (c) (x, y)  R if x  y (d) (x, y)  R if x = y (e) (x, y)  R if 3 divides x – y ACTIVITY 2.6 Definition 2.7a: A relation that is reflexive, symmetric and transitive on a set X is called an equivalence relation on X. Copyright © Open University Malaysia (OUM)
  • 61.  TOPIC 2 RELATIONS 44 • The relation R between set X and Y is said „x is related to y‰, and denoted by x R y when (x, y)  R. • The relation can be presented pictorially by using an arrow diagram. • Let R be a relation from X to Y. The inverse of R, denoted by R-1, is the relation from Y to X defined by R-1 = {(y, x) | (x, y) R} 1. Determine whether the given relation is an equivalence relation on {1, 2, 3, 4, 5}. (a) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 3), (3, 1)} (b) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 3), (3, 1), (3, 4), (4, 3)} (c) {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (1, 5), (5, 1), (3, 5), (5, 3), (1, 3), (3, 1)}} For the following questions, x, y  {1, 2, 3, 4, 5}. (d) {(x, y ) | 1  x  5, 1 y  5}. (e) {(x, y ) | 4 divides x – y}. (f) {(x, y ) | 3 divides x + y}. (g) {(x, y ) | x divides 2 – y}. 2. Determine whether the given relation is an equivalence relation on the set of all people. (a) {(x, y ) | x and y are the same height}. (b) {(x, y ) | x and y have, at some time, lived in the same country}. (c) {(x, y ) | x and y have the same first name}. (d) {(x, y ) | x is taller than y }. (e) {(x, y ) | x and y have the same parents}. (f) {(x, y ) | x and y have the same colour hair}. ACTIVITY 2.7 Copyright © Open University Malaysia (OUM)
  • 62. TOPIC 2 RELATIONS  45 • Let R1 be a relation from X to Y and R2 be a relation from Y to Z. The composition of R1 and R2, denoted by R2 o R1, is the relation from X to Z, defined by R2 o R1 = {(x, z) | (x, y)R1 and (y, z)R2 for some y Y } • A (binary) relation R on a set X is a relation from X to X. • There are four properties of relations on a set namely reflexive, symmetric, antisymmetric and transitive. • The relation R between two sets is reflexive when (x, x )  R for all x  X. • The relation R between two sets is symmetric when (x, y )  R then (y, x)  R for all x, y  X. • The relation R between two sets is antisymmetric when (x, y )  R but (y, x)  R for all x, y  X. • The relation R between two sets is transitive when (x, y )  R and (y, z)  R then (x, z)  R for all x, y, z  X. • The partial order is a relation R with properties of reflexive, antisymmetric and transitive. • The equivalence relation is a relation R with properties of reflexive, symmetric and transitive. Antisymmetric relations Composition of relations Digraph Domain Equivalence relations Inverse relations Partial order Range Reflexive relations Relations Symmetric relations Transitive relations Copyright © Open University Malaysia (OUM)
  • 63.  TOPIC 2 RELATIONS 46 Application to Graph theory. Retrieved from http://aix1.uottawa.ca/ ~jkhoury/graph.htm Graph matrices. (2010). Retrieved from http://compalg.inf.elte.hu/~tony/ Oktatas/TDK/FINAL/ Chap%2010.PDF Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate: Pearson. Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics (revised 3rd ed.). New York: McGraw Hill. Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York: McGraw Hill. Copyright © Open University Malaysia (OUM)
  • 64. LEARNING OUTCOMES  INTRODUCTION Are you aware that the concept of functions is very important in discrete mathematics? In fact, functions play important roles in information technology, such as, to represent the computational complexity of algorithms. In addition, there are many programs designed to calculate the values of functions. What does a function mean? A function is basically a special kind of relation that has exactly one output for every possible input in the domain. So, most of the terminologies that have been introduced in Topic 2 will be reused in this topic. By the end of the topic, you should be able to: 1. Describe the concept of function; 2. Represent functions by using graphical representations; 3. Identify three types of functions; 4. Discuss inverse of a function; 5. Apply the operation on function composition; and 6. Distinguish between binary and unary operators. T To op pi ic c 3 3  Function Copyright © Open University Malaysia (OUM)
  • 65.  TOPIC 3 FUNCTION 48 CONCEPT OF FUNCTION Before we go further, let us learn the concept of function. Let us look at some examples. Example 3.1a The relation f = {(1, a), (2, b), (3, a)} from X = {1, 2, 3} to Y = {a, b, c} is a function from X to Y. By using an arrow diagram, this relation can be presented as: Figure 3.1: The relation f The domain of f is X and the range of f is {a, b }. The range of a relation R is the set {y Y |(x, y ) R for some x  X } 3.1 Definition 3.1a: A function f from X to Y is a relation from X to Y having the following properties: 1. For each x X  , there is exactly one y Y  with   , x y f  . 2. The domain of f is X and the range of f is     , y x y f  . A function from X to Y is sometimes denoted by f : X  Y Copyright © Open University Malaysia (OUM)
  • 66. TOPIC 3 FUNCTION  49 Example 3.1b The relation is represented as f(x) = x2 ; x ∈ R This relation is a function and the domain is the set of all real numbers. The range of f is the set of all non-negative real numbers. If f is a function f: X2, given a value in set X, we can obtain the value in set Y. This process is called function application. Example 3.1c We can apply the function given in Example 3.1b as follows: f (2) = 4, f (-2) = 4, f (8) = 64. 1. How can you relate the concept of function and apply it to your daily life? Give an example. 2. Determine whether the relation R below is a function from X = {1, 2, 3, 4} to Y = {a, b, c, d }. If it is a function, find its domain and range, and then draw the arrow diagram. (a) R = {(1, a), (2, a), (3, c), (4, b)} (b) R = {(1, c), (2, a), (3, b), (4, c), (4, d )} (c) R = {(1, c), (2, d ), (3, a), (4, b)} (d) R = {(1, d ), (2, d ), (4, b)} (e) R = {(1, b), (2, b), (3, b), (4, b)} ACTIVITY 3.1 Copyright © Open University Malaysia (OUM)
  • 67.  TOPIC 3 FUNCTION 50 GRAPH OF A FUNCTION Are you aware that another way to visualise a function is to draw its graph? Let us look at some examples on how to do it. Example 3.2a The graph of the function f(x) = x2, has the value as in Table 3.1 and the graph is shown in the Figure 3.2. Table 3.1 The value of the function f(x) = x2 x -2 -1 0 1 2 f(x) = x2 4 1 0 1 4 3.2 3. Determine whether the relation R from A to B is a function. (a) A = The set of all learners at Open University Malaysia B = The set of courses offered by Open University Malaysia (b) A = A set of people in Putrajaya B = The set of IC numbers 4. Let g = {(1, a), (2, c), (3, c)} be a function from X = {1, 2, 3} to Y = {a, b, c, d }. Apply the function to find the value of (a) g(1) (b) g(2) 5. Let   3, . f x x x Z    Apply the function to find the value of (a) f (5) (b) f (-1) Copyright © Open University Malaysia (OUM)
  • 68. TOPIC 3 FUNCTION  51 Figure 3.2: The graph of the function f(x) = x2 Example 3.2b The graph of the function R = {(1, 1), (1, 3), (2, 2), (3, 0)} is as shown in Figure 3.3. Figure 3.3: The graph of the function R Copyright © Open University Malaysia (OUM)
  • 69.  TOPIC 3 FUNCTION 52 TYPES OF FUNCTIONS Did you know that there are three types of functions? They are shown in Figure 3.4. Figure 3.4: Three types of functions These three types of functions are further discussed as follows. 3.3.1 Injective What does injective mean? 3.3 1. Draw a graph for the function f (x) = x2 + 1 where x  0. Do you get the parabola shape on your graph? 2. Represent the functions below by using graphical representation.   1 2 2 ( ) ; , f x x x       3 3 3 ( ) ; , f x x x    3. Represent the functions R below by using graphical representation. (a) R = {(1, 2), (2, 2), (3, 6), (4, 4)} (b) R = {(1, 3), (2, 4), (3, 5), (4, 1)} ACTIVITY 3.2 Definition 3.3a: A function f from X to Y is said to be one to one (or injective) if for each y Y, there is at most one x  X with f (x) = y. Copyright © Open University Malaysia (OUM)
  • 70. TOPIC 3 FUNCTION  53 The condition given in the definition above for a function to be one to one is equivalent to: if x, xÊ  X and f(x) = f(xÊ), then x = xÊ. If a function from X to Y is one to one, each element in Y in its arrow diagram will have at most one arrow pointing to it (see Figure 3.5). If a function is not one-to-one, some element in Y in its arrow diagram will have two or more arrows pointing to it. Let us look at an example. Example 3.3a The function f = {(1, b), (3, a), (2, c)} from X = {1, 2, 3} to Y = {a, b, c, d } is one-to-one. Figure 3.5: One-to-one relationship Let us look at an example. Example 3.3b The function f(x) = x + 1; x  [-2, 2] is one-to-one. x -2 -1 0 1 2 f (x) = x + 1 -1 0 1 2 3 Example 3.3c The function R = {(1, a), (2, b), (3, a)} is not a one-to-one function because a has two values. Copyright © Open University Malaysia (OUM)
  • 71.  TOPIC 3 FUNCTION 54 3.3.2 Surjective What is surjective? If the function from X to Y is onto, each element in Y in its arrow diagram will have at least one arrow pointing to it (see Figure 3.6). Let us look at some examples. Example 3.3d The function f = {(1, D), (2, B), (3, C), (4, C)} is onto on {D, B, C}. Figure 3.6: Onto relationship Example 3.3e Define : f R R  by the rule   5 2 f x x   for all x R  . Prove that f is onto. Proof: Let y R  . (We need to show that x  in R such that   f x y  ) If such a real number exists, then 5 2 x y   and 2 5 y x   . x is a real number since sums and quotients (except for division by 0) of real numbers are real numbers. It follows that   2 5 2 5 2 2 y f x y y              Hence, f is onto. Definition 3.3b: If f is a function from X to Y and the range of f is Y, f is said to be onto Y (or an onto function or a surjective function). Copyright © Open University Malaysia (OUM)
  • 72. TOPIC 3 FUNCTION  55 3.3.3 Bijective How about bijective? What does it mean? Let us look at two examples of this. Example 3.3f The function f = {(1, a), (2, b), (3, c)} from X = {1, 2, 3} to Y {a, b, c } is one-to-one and onto. So it is bijective. Example 3.3g The function f = {(1, a), (2, c), (3, b)} from X = {1, 2, 3} to Y = {a, b, c } is one-to-one and onto Y. Thus, it is bijective. The arrow diagram for this function is shown in Figure 3.7. Figure 3.7: One-to-one and onto Y Definition 3.3c: A function that is both one-to-one and onto is called a bijective function. Copyright © Open University Malaysia (OUM)
  • 73.  TOPIC 3 FUNCTION 56 INVERSE OF A FUNCTION Suppose that f is one to one, onto function from X to Y. It can be shown that the inverse relation {(y, x)|(x, y)  f} is a function from Y to X. This new function, denoted f–1 is called f inverse. Given the arrow diagrams of a one-to-one, onto function f from X to Y, we can obtain the arrow diagram for f-1 simply by reversing the direction of each arrow. Let us look at some examples. 3.4 1. Show that if f is a one-to-one, onto function from X to Y, then {(y, x) | (x, y)  f} is a one-to-one, onto function from Y to X. 2. In each part, sets A and B and a function from A to B are given. Determine whether the function is one-to-one or onto (or both or neither). (a) A = {1, 2, 3, 4} = B; f = {(1, 1), (2, 3), (3, 4), (4, 2)} (b) A = {1, 2, 3, 4}; B = {a, b, c, d }; f = {(1, a), (2, b), (3, c)} (c) A = B = Z ; f (a) = a –1 (d) A = {1.1, 7, 0.06}; B = {p, q }; f = {(1.1, p), (7, q), (0.06, p)} 3. Let f be a function from A to B. Determine whether each function f is one-to-one and whether it is onto or not. (a) A = R, B = {x|x is a real and x  0}; f(a) =|a| (b) A = R ╳R, B = R; f ((a, b)) = a (c) A = B = R ╳R; f ((a, b)) = (a + b, a – b) (d) A = R , B = {x|x is a real and x  0}; f(a) = a2. ACTIVITY 3.3 Copyright © Open University Malaysia (OUM)
  • 74. TOPIC 3 FUNCTION  57 Example 3.4a For the function f in f = {(1, a), (2, c), (3, b)} from X = {1, 2, 3} to Y = {a, b, c } is one- to-one and onto Y. f–1 = {(a, 1), (c, 2), (b, 3)} The arrow diagram for f–1, where f is the function is shown in the following Figure 3.8. Figure 3.8: The inverse function 1 f  Example 3.4b The function f(x) = 2x is one to one function from the set R of all real numbers onto the set R+ of all positive real numbers. We will derive a formula for f-1(y). Suppose that (y, x) is in f-1, that is f-1 (y) = x then (x, y)  f. Thus y = 2x. By definition of logarithm, log2 y = x Combining (f-1 (y) = x) and (log2 y = x), we have f-1 (y) = x = log2 y Copyright © Open University Malaysia (OUM)
  • 75.  TOPIC 3 FUNCTION 58 COMPOSITION OF FUNCTIONS Since functions are special kinds of relations, we can form the composition of two functions. Specifically, suppose that g is a function from X to Y and f is a function from Y to Z. The resulting function from X to Z is called the composition of f with g and is denoted by f o g. Example 3.5a Given g = {(1, a), (2, a), (3, c)} a function from X = {1, 2, 3} to Y = {a, b, c}, and f = {(a, y), (b, x), (c, z)}, a function from Y to Z = {x, y, z}. The composition function from X to Z can be represented by an arrow diagram as shown in Figure 3.9. Figure 3.9: Composition function from X to Z So, f o g = {(1, y), (2, y), (3, z)} The application of f o g on x can be written as (f o g)(x) or alternatively as f(g(x)). 3.5 Each of the functions below is one-to-one. Find the inverse function for each of them. (a) f(x) = 4x + 2 (f) f(x) = 6+27x1 (b) f(x) = 3x (g) f(x) = 6x9 (c) f(x) = 3 log2 x (h) f(x) = 3x2 (d) f(x) = 3 + 1/x (i) f(x) = 2x34 (e) f(x) = 4x35 ACTIVITY 3.4 Copyright © Open University Malaysia (OUM)
  • 76. TOPIC 3 FUNCTION  59 Example 3.5b If f(x) = log3 x and g(x) = x4, f(g(x)) = log3 (x4 ) , g(f(x)) = (log3 x) 4 Composition sometimes allows us to decompose complicated functions into simpler functions. Example 3.5c The function   f x = sin2x can be decomposed into the functions    g x x , h(x) = sin x, w(x) = 2x and we can write          f x g h w x ACTIVITY 3.5 1. Given f (n) = 3n + 2 and g(n) = 2n – 1. Find a composition of g o f, and how do you pronounce the answer for g o f? 2. Let f and g be functions from the positive integers to the positive integers defined by the equations f(n) = 2n + 1 g(n) = 3n – 1 Find the following function compositions: (a) f o f (b) g o g (c) f o g (d) g o f Copyright © Open University Malaysia (OUM)
  • 77.  TOPIC 3 FUNCTION 60 BINARY AND UNARY OPERATORS Lastly, let us learn binary and unary operators; firstly, its definition. Let us look at the following example. Example 3.6a Let X = {1, 2, ⁄.}. If we define f(x, y) = x + y, then f is a binary operator on X. A unary operator of a set X associates each element of X with one element in X. Example 3.6b Let E be a universal set and X is a set. If we define f(X) = X , X  P(E), Then f is a unary operator on P(E). 3.6 3. Let f and g be functions from the positive integers to the positive integers defined by the equations f(x) = 2x g(x) = x2 Find the following function compositions: (a) f o f (b) g o g (c) f o g (d) g o f Definition 3.6a: A function from X x X into X is called a binary operator on X. Definition 3.6b: A function X into X is called a unary operator on X. Copyright © Open University Malaysia (OUM)
  • 78. TOPIC 3 FUNCTION  61 • The function f from X to Y is a relation from X to Y, if for each element in X, there is exactly one element in Y. • A function can be drawn into a graphical representation. • Three types of functions are injective, surjective and bijective. • The function f from X to Y is said to be one to one (or injective), if each element in Y in its arrow diagram will have at most one arrow pointing to it. • The function f from X to Y is said to be onto (or surjective), if each element in Y in its arrow diagram will have at least one arrow pointing to it. • The function f from X to Y is said to be bijective function, if it has both one- to-one and onto function. • Suppose that f is one to one, onto function from X to Y. It can be shown that the inverse relation {(y, x)|(x, y) ∈ f } is a function from Y to X. This new function, denoted f–1 is called f inverse. 1. A binary operator f in the set X is commutative if f(x, y) = f(y, x) for all x, y  X. State whether the given function f is a binary operator on the set X. If f is not a binary operator, state why. State whether or not each binary operator is commutative. (a) f(x, y) = x + y, X = {1, 2, ⁄.} (b) f(x, y) = x – y, X = {1, 2, ⁄.} (c) f(x, y) =x/y, X = {0, 1, 2, ⁄.} (d) f(x, y) = x2 + y2 – xy, X = {1, 2, ⁄.} 2. Give an example of a unary operator (different from f(x) = x, for all x) on the given set. {⁄, -2, -1, 0, 1, 2, ⁄} ACTIVITY 3.6 Copyright © Open University Malaysia (OUM)
  • 79.  TOPIC 3 FUNCTION 62 • The operation on function composition happens when g is a function from X to Y and f is a function from Y to Z. Then the resulting function from X to Z is the composition of f with g and is denoted by f o g. • A function from X  X into X is called a binary operator on X. • A function X into X is called a unary operator on X. Bijective Binary operators Composition of functions Functions Injective Inverse of functions One-to-one Onto Surjective Unary operators Discrete Mathematics/Functions and relations. (2015). Retrieved from http:// en.wikibooks.org/wiki/Discrete_Mathematics/Functions_and_relations Farlex Inc. (2015). The Free Dictionary: Function. Retrieved from http://www.thefreedictionary.com/function Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate: Pearson. Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics (revised 3rd ed.). New York: McGraw Hill. NCS Pearson. (2014). Functions in Discrete Mathematics. Retrieved from http://math.tutorcircle.com/discrete-math/functions-in-discrete- mathematics.html Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York: McGraw Hill. Copyright © Open University Malaysia (OUM)
  • 80. LEARNING OUTCOMES  INTRODUCTION What is the function of sequences? Sequences are used to represent an ordered list of elements. A list of the letters as they appear in a word (or normally called a string) is an example of a sequence. Another example is the word „form‰ and „from‰; they are two different words although both of them consist of the same letters. Thus, the concept of sequence and strings will be the discussion of this topic. By the end of the topic, you should be able to: 1. Describe the concept of sequence; 2. Apply the operations on sequences; 3. Describe the concept of strings; and 4. Apply the operations on strings. T To op pi ic c 4 4  Sequence and Strings Copyright © Open University Malaysia (OUM)
  • 81.  TOPIC 4 SEQUENCE AND STRINGS 64 SEQUENCE What can you say to define sequence? A sequence is a list in which order is taken into account. It is a special type of function. The formal definition of a sequence is as follows: Let us look at some examples of sequence. Example 4.1a The ordered list 2, 4, 6, ⁄. 2n⁄.. is a sequence. The first element is 2, the second element is 4 and so on. The nth element is 2n. If we let s denote this sequence, we have Figure 4.1: Ordered list sequence Example 4.1b KLIA Shuttle Inc. charges RM1 for the first km and 50 cents for each additional km. In general, the cost cn of travelling n km is 1.00 (the cost of travelling the first km) plus 0.50 times the number (n – 1) of additional km. That is, cn = 1 + 0.5 (n – 1) For example: c1 = 1 + 0.5 (1 – 1) = 1 + 0.5 (0) = 1 c5 = 1 + 0.5 (5 – 1) = 1 + 0.5 (4) = 3 4.1 Definition 4.1a: A sequence whose smallest index is 1 is a function whose domain is either the set of all positive integers or a set of the form {1 ⁄. n}. If s is a sequence, we denote the first element as s1, the second element as s2 and so on. In general, sn denotes the nth element. Copyright © Open University Malaysia (OUM)
  • 82. TOPIC 4 SEQUENCE AND STRINGS  65 The list fare in this example is in sequence. A sequence can have repetitions. Example 4.1c The ordered list a, a, b, a, b⁄. is a sequence. The first element of the sequence is a, the second element of the sequence is a and so on. If we denote this sequence, we have Figure 4.2: Ordered list An alternative notation for the sequence s is sn. Here, s or sn denotes the entire sequence s1, s2, s3 , ⁄ We use the notation sn to denote the single, nth element of the sequence s. A sequence sn is defined by the rule sn = n2  nthe first five terms of this sequence are Figure 4.3: Sequence of sn by the rule sn = n2 – 1 The 55th term is s55 = 552 – 1 = 3024 Example 4.1d A sequence u is defined by the rule un, which is the nth letter in the word „digital‰. Then u1 = d, u2 = u4 = i and u7 = l. This sequence is a finite sequence. Word d i g i t a l Sequence u1 u2 u3 u4 u5 u6 u7 Figure 4.4: Sequence of un of the word „digital‰ Copyright © Open University Malaysia (OUM)
  • 83.  TOPIC 4 SEQUENCE AND STRINGS 66 Example 4.1e If x is the sequence defined by   1 3 n x n 1 n  4 The elements of x are 1 1 1 3,1, , , 3 9 27 4.1.1 Types of Sequence There are two important types of sequence, namely, increasing sequence and decreasing sequence. Let us look at some examples. Example 4.1f The sequence s 2, 4, 6, ⁄ is increasing since sn = 2n  2(n+1) = sn+1 for all n. Example 4.1g The sequence s 3, 5, 5, 7, 8, 8, 13. is increasing since sn  sn+1 for all n. Definition 4.1b: A sequence s is increasing if sn  sn+1 for all n. Definition 4.1c: A sequence s is decreasing if sn  sn+1 for all n. Copyright © Open University Malaysia (OUM)
  • 84. TOPIC 4 SEQUENCE AND STRINGS  67 Example 4.1h The sequence X 1 1 1 3,1, , , 3 9 27 ,⁄ is decreasing since      1 1 1 1 3 3 n n n n X X for all n. 4.1.2 Subsequence One way to form a new sequence from a given sequence is to retain only certain terms of the original sequence and maintaining the order terms in the given sequence. The resulting sequence is called a subsequence of the original sequence. Examples for subsequence are as follows: Example 4.1i The sequence b, c is a subsequence of the sequence a, a, b, c, q Notice that the sequence c, b is not a subsequence of the sequence. Definition 4.1d: Let  sn  be a sequence defined for n = m, m + 1, m + 2, ⁄ and let n1, n2, n3, ⁄ be an increasing sequence satisfying nk , nk+1, nk+2 for all k, whose values are in the set { m, m + 1, m + 2, ⁄ }. We call the sequence k n s a subsequence of n s . Copyright © Open University Malaysia (OUM)
  • 85.  TOPIC 4 SEQUENCE AND STRINGS 68 Table 4.1 illustrates this example further. Table 4.1: Example 4.1j Example 4.1j The sequence 2, 4, 8, 16 is a subsequence of the sequence 2, 4, 6, 8, 10, 12, 14, 16. Sequence a, a b, c q Subsequence of sequence b, c Therefore, c, b is not a subsequence of the sequence ACTIVITY 4.1 What are strings? Are strings often restricted to sequence? SELF-CHECK 4.1 1. The sequence s is defined by c, d, d, c, d, c (a) Find s1 (b) Find s4 2. The sequence k is defined by kn = 2n – 1, n > 1 (a) Find k3 (b) Find k100 (c) Find k7 (d) Find k2077 (e) Is k increasing or decreasing? Copyright © Open University Malaysia (OUM)
  • 86. TOPIC 4 SEQUENCE AND STRINGS  69 SEQUENCE OPERATION Let us learn on sequence operation. Operations in sequence are shown in the following examples. 4.2 3. The sequence r defined by    3.2 4.5 , 0 n n n r n (a) Find r0 (b) Find r1 (c) Find r2 (d) Find r3 (e) Find a formula for rp (f) Find a formula for rn-2 (g) Show that n r satisfies      1 2 7 10 , 2 n n n r r r n (h) Is r increasing or decreasing? 4. Define  sn by the rule sn = 2n – 1, n > 1 The subsequence of s obtained by taking first, third, fifth terms (a) List the first seven terms of s. (b) List the first seven terms of the subsequence. (c) Find a formula for the expression nk of Definition 4.1d. (d) Find a formula for the k th term of the subsequence. Definition 4.2a: If n i i=m a is a subsequence, we define the sum and product of terms in the sequence as Sum of terms:        1 ... n i m i m m n a a a a Product of terms:        1 ... n i m i m m n a a a a Copyright © Open University Malaysia (OUM)
  • 87.  TOPIC 4 SEQUENCE AND STRINGS 70 Example 4.2a Let a be a sequence defined by an = 2n, n1. Then      1 1 2 3 n i i a a a a = 2(1) + 2(2) + 2(3) = 2 + 4 + 6 = 12      3 1 1 2 3 i i a a a a = 2(1)  2(2)  2(3) = 2  4  6 = 48 Example 4.2b The geometric sum a + ar + ar 2 + ⁄ + ar n can be rewritten compactly using the sum notation as   n i i 0 ar Example 4.2c Let a be the sequence defined by the rule an = 2( 1)n, where n >1. Find a formula for the sequence s defined by    0 n n i i s a We find that n s = 2(1)1 + 2(-1)2 + 2(-1)3 + ⁄ + 2(-1)n = 2 + 2 ⁄ + (-1)n 2 = 0 if is even 2 if is odd n n     Copyright © Open University Malaysia (OUM)
  • 88. TOPIC 4 SEQUENCE AND STRINGS  71 1. The sequence g is defined by gn = n2 – 3n + 3, n > 1 (a) Find 4 i =1 i g  (b) Find 3 5 i i g   (c) Find =1 6 k k g  (d) Find 2 1 i i g   (e) Find 3 1 i i g   2. The sequence v is defined by vn = n(1)n (a) Find 1 4 i i v   (b) Find 1 10 i i v   (c) Find a formula for the sequence c defined by 1 n n i i c v    (d) Find a formula for the sequence d defined by 1 n n i i d v    3. Rewrite the sum 2 1 - n i n i v v   Replacing the index i by k, where i = k+1 ACTIVITY 4.2 Copyright © Open University Malaysia (OUM)
  • 89.  TOPIC 4 SEQUENCE AND STRINGS 72 STRING The following is the definition for string. Example 4.3a Let X = {a, b, c}. If we let q1 = b, q2 = a, q3 = a, q4 = c We obtain a string over X. This string is written baac. Figure 4.5: String with order Since a string is a sequence, order is taken into account. For example, the string baac is different from the string acab. Repetition in a string can be specified by superscripts. For example, the string bbaaac may be written b2a3c. The string with no elements is called the null string and is denoted as  4.3 Definition 4.3a: A string over X, where X is a finite set, is a finite sequence of elements from X. Definition 4.3b: We let X* denotes the string of all strings over X, including the null string, and we let X+ denote the set of all nonnull strings over X. Copyright © Open University Malaysia (OUM)
  • 90. TOPIC 4 SEQUENCE AND STRINGS  73 Example 4.3b Let X = {a, b}. Some elements in X* are , a, b, abab, b20a5 ba Example 4.3c If  = aabab and  = a3b4a32, then || = 5 and || = 39 If  and  are two strings, the string consisting of  followed by , written , is called the concatenation of  and . Example 4.3d If t = aab and e = cabd, then te = aabcabd, et = cabdaab, t = t = aab, t = t = aab. Definition 4.3c: The length of a string is the number of elements inhe length ofis denoted by|| 1. Let X={a, c, e, i, m, s, t }. Find the sequence if the string contains the word „mathematics‰. 2. Suppose we have three strings as follows  = baab,  = caaba,  = bbab (a) Write the string , , , 3 2 , 2 , , 2  (b) Compute the value of ||, ||, ||, || ACTIVITY 4.3 Copyright © Open University Malaysia (OUM)
  • 91.  TOPIC 4 SEQUENCE AND STRINGS 74 • A sequence is a list in which order is taken into account, such as, if s is a sequence, we denote the first element as s1, the second element as s2 and nth element denotes as sn. The sequence is increasing when sn  sn+1 for all n. The sequence is decreasing when sn+1  sn for all n. The certain terms of the original sequence is called a subsequence. For example, sequence A contains s1, s2, s3, s4 and s5 while s2, s3 and s4 is a subsequence of A. • The operation on sequence involves the sum and product of terms in the sequence. • A string is a finite sequence of elements which are not necessarily distinct elements. For example, abaa is the string with four elements and baaa is also the string with four elements but they are two different strings. • The operations on strings includes length of a string and concatenation. Concatenation Decreasing Increasing Length of a string Nonnull string Null string Sequence String Subsequence Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate: Pearson. Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics (revised 3rd ed.). New York: McGraw Hill. Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York: McGraw Hill. Copyright © Open University Malaysia (OUM)
  • 92. LEARNING OUTCOMES  INTRODUCTION Are you aware that logic is the foundation of science and mathematics? We use logical methods in mathematics to prove the validity of mathematical statements. As for natural and physical sciences, logic is used to draw conclusions from experiments or observations. How about in information technology? In information technology, logic can be used to verify the correctness of computer programs. Did you know that there are a few types of logic? In this topic, we will deal with the simplest form of logic, namely, the propositional logic. This type of logic deals with propositions and how to reason on propositions. By the end of the topic, you should be able to: 1. Explain the concept of proposition; 2. Formulate a proposition in words into a symbolic expression for conditional and biconditional proposition; 3. Solve the truth value of compound propositions using truth tables or laws of logic; and 4. Apply operations on compound propositions. T To op pi ic c 5 5  Propositional Logic Copyright © Open University Malaysia (OUM)
  • 93.  TOPIC 5 PROPOSITIONAL LOGIC 76 PROPOSITION Let us learn the basis of propositions. According to Poly (1945), in order to translate a sentence from English into French, two things are necessary. First, we must understand thoroughly the English sentence. Second, we must be familiar with the forms of expression peculiar to the French language. The situation is very similar when we attempt to express in mathematical symbols a condition proposed in words. First, we must understand thoroughly the condition. Second, we must be familiar with the forms of mathematical expressions. Now, let us learn the meaning of proposition. Do you have any idea? Let us look at an example. Example 5.1a Which of the following are propositions? (a) The Earth is round. (b) Malaysia is a country in South East Asia. (c) Do you speak English? (d) 6 + 2x = 5. (e) Take two panadol tablets. (f) The temperature in Malaysia is between 28F to 38F. Solution: Question (a) and (b) are statements that happen to be true. Question (c) is a question, so it is not a statement that is either true or false. Question (d) is not a statement, since it is true or false depending on the value of x. Question (e) is not a statement, it is a command. Question (f) is a declarative sentence whose truth or falsity we do not know at this time; however, we can (in principle) determine if it is true or false; so it is a statement. 5.1 Definition 5.1a: A statement that is either true or false, but not both, is called a proposition. It is expressed as a declarative sentence. Copyright © Open University Malaysia (OUM)
  • 94. TOPIC 5 PROPOSITIONAL LOGIC  77 In propositional logic, a proposition is represented by using a lower case letter, such as p, q or r. For example, we can use the notation p : The Earth is round to define p as a proposition „The Earth is round.‰ 5.1.1 Conjunction and Disjunction Let us look at conjunctions first. We can describe the values of the conjunction of p and q by using a truth table as shown in Table 5.1. Table 5.1: Conjunction of p and q p q p ∧ q T T F F T F T F T F F F Now let us move on to disjunction. What does it mean? Definition 5.1b: Let p and q be propositions. The conjunction of p and q, denoted p  q, is the proposition p and q. The value of this proposition is true (T ) if both p and q are true, otherwise the proposition is false (F ). Definition 5.1c: Let p and q be propositions. The disjunction of p and q, denoted p  q, is the proposition p or q. The value of this proposition is true (T ) if p or q is true (T ). It is false if both p and q are false (F ). Copyright © Open University Malaysia (OUM)
  • 95.  TOPIC 5 PROPOSITIONAL LOGIC 78 The following Table 5.2 is the truth table for the disjunction of p and q. Table 5.2: Disjunction of p and q p q p  q T T F F T F T F T T T F Propositions, such as, p  q and p  q that result from combining propositions are called compound propositions. Let us look at Example 5.1b. Example 5.1b If p: The Earth is round, q: A decade is 100 years, Then the conjunction of p and q is p  q: The Earth is round and a decade is 100 years Since p is true and q is false, p  q is false. The disjunction of p and q is p  q: The Earth is round or a decade is 100 years. Since p is true and q is false, p  q is true. 5.1.2 Negation What is negation? Definition 5.1d: The negation of p, denoted p is the proposition not p. Copyright © Open University Malaysia (OUM)
  • 96. TOPIC 5 PROPOSITIONAL LOGIC  79 Table 5.3 shows you the truth table for the negation p. Table 5.3: Negation p p p T F F T Let us check out an example for negation. Example 5.1c If p : The earth is round. The negation of p is the proposition p : The earth is not round. Since p is true, p  is false. ACTIVITY 5.1 1. Determine whether each of the statements given is a proposition. If the statement is a proposition, write its negation. (a) Give me a cup of tea. (b) 2 + 5 = 19. (c) For some positive integer n, 19340 = n  17. (d) The difference of two primes is always greater than 1. 2. Write the truth value for each of the propositions below: p = F, q = T, r = T (a) p q  (b) p q    (c)   p q r      (d)       p r q r r p       Copyright © Open University Malaysia (OUM)
  • 97.  TOPIC 5 PROPOSITIONAL LOGIC 80 CONDITIONAL PROPOSITION Now let us learn about conditional propositions; firstly, its definition. 5.2 3. Let p and q be the propositions p : The temperature is more than 40C. q : It is raining. Write the following propositions using p and q and logical connectives. (a) The temperature is more than 40C but it is raining. (b) The temperature is less than 40C and it is raining. (c) Either the temperature is more than 40C or it is raining. 4. Let p, q and r be the propositions p : Ahmad is sick. q : Ahmad misses his driving test. r : Ahmad passes the test. Express each of the following propositions as an English sentence: (a) p q  (b) q r  (c) p q r    (d)     p r q r    Create truth table for questions (b) and (c). Definition 5.2a: If p and q are propositions, the compound proposition if p then q is called a conditional proposition and is denoted p  q Copyright © Open University Malaysia (OUM)
  • 98. TOPIC 5 PROPOSITIONAL LOGIC  81 The truth table for the conditional p  q is shown in Table 5.4. Table 5.4: Conditional p  q p q p  q T T F F T F T F T F T T Let us look at two examples of conditional propositions. Example 5.2a If we define p : The faculty is allocated another scholarship. q : Ravie can further his studies at University of Sheffield. The conditional statement p  q means „If the faculty is allocated another scholarship, then Ravie can further his studies at University of Sheffield.‰ The converse for p  q is q  p. Example 5.2b Let p : 1 > 2, q : 4 < 8. Then p is false and q is true. The proposition p  q, that is, „If 1 > 2 then 4 < 8‰ is true. Therefore, the converse proposition q  p, that is „If 4 < 8 then 1 > 2‰ is false. Copyright © Open University Malaysia (OUM)
  • 99.  TOPIC 5 PROPOSITIONAL LOGIC 82 BICONDITIONAL PROPOSITION What is a biconditional proposition? The truth table for the biconditional proposition p  q is shown in Table 5.5. Table 5.5: Proposition p  q p q p  q T T F F T F T F T F F T The biconditional proposition p  q is normally read as „p if and only if q‰ or „p if q.‰ An alternative way to state this proposition is „p is a necessary and sufficient condition for q.‰ Let us look at some examples of biconditional propositions. Example 5.3a If we define p: 1 < 5, q: 2 < 8 then the statement 1 < 5 if and only if 2 < 8 can be written symbolically as p  q Since p and q are both true, the statement p  q is true. An alternative way to state the statement above is: „A necessary and sufficient condition for 1 < 5 is that 2 < 8.‰ 5.3 Definition 5.3a: If p and q are propositions, the compound proposition (p  q)  (q  p) is called a biconditional proposition and is denoted as p  q Copyright © Open University Malaysia (OUM)
  • 100. TOPIC 5 PROPOSITIONAL LOGIC  83 Example 5.3b If we define p: Ammar can buy shoes online. q: Ammar has a credit card. Then the statement Ammar can buy shoes online if and only if Ammar has a credit card can be written symbolically as p  q An alternative way to state the statement above is: „A necessary and sufficient condition for Ammar can buy shoes online is that Ammar has a credit card.‰ ACTIVITY 5.2 1. If each of the following statements define p and q, then write in the form „if p, then q.‰ (a) It rains whenever the wind blows from the north-east. (b) That the Pistons win the championship implies that they beat the Lakers. (c) It is necessary to walk a few kilometre to get to the top of the mountain. (d) To get accepted into OUM, you must have at least 3.0 CGPA. (e) If you drive more than 110 km/h, you will get a ticket. (f) I will remember to send you the address only if you send me an e-mail message. (g) To be a citizen of this country (Malaysia), it is sufficient that you were born in this country. (h) That you get the job implies that you had the best credentials. Copyright © Open University Malaysia (OUM)
  • 101.  TOPIC 5 PROPOSITIONAL LOGIC 84 TAUTOLOGIES, CONTRADICTIONS AND LOGICAL EQUIVALENCE What do tautology and contradiction mean? Example 5.4a p p   is an example of tautology. p p   is an example of contradiction. How about logically equivalence propositions? 5.4 2. If each of the following statements define p and q, then write in the form „p if and only if q.‰ (a) If it is hot outside you buy an ice cream cone, and if you buy an ice cream cone it is hot outside. (b) You get promoted only if you have connections, and you have connections only if you get promoted. (c) For you to pass this course, it is necessary and sufficient that you learn how to solve most of the problems. Definition 5.4a: A proposition p that is always true is called a tautology. A proposition p that is always false is called a contradiction. Definition 5.4b: Suppose that the compound proposition p is made up of propositions p1⁄. pn and compound proposition q is made up of propositions q1⁄. qn, we say that p and q are logically equivalent and write p  q provided that given any truth values of p1 ⁄. pn and truth values of q1 ⁄. qn, either p and q are both true or p and q are both false. Copyright © Open University Malaysia (OUM)
  • 102. TOPIC 5 PROPOSITIONAL LOGIC  85 Let us look at an example. Example 5.4b Show that the negation of p q  is logically equivalent to p q   . We must show that   p q p q     . By writing the truth table for   p q   and p q   , we can verify that given any truth value of p and q, either p and q are both true or p and q are both false (see Table 5.6). Table 5.6:   p q p q     p q q pq (pq) pq T T F F T F T F F T F T T F T T F T F F F T F F Thus   p q   is logically equivalent to p q   . We can write   p q p q     . Some of the properties of ,and negation is given in the following theorems. Theorem 5.4a: The operations for propositions have the following properties (see Table 5.7). Table 5.7: Theorem 5.4a Properties Propositions (a) Commutative properties p  q ≡q  p p  q ≡ q  p (b) Associative properties p  (q  r) ≡ (p  q)  r p  (q  r) ≡ (p  q)  r (c) Distributive properties p  (q  r) ≡ (p  q)  (p  r) p  (q  r) ≡ (p  q)  (p  r) (d) Idempotent properties p  p ≡ p p  p ≡ p (e) Properties of negation   p p    Copyright © Open University Malaysia (OUM)
  • 103.  TOPIC 5 PROPOSITIONAL LOGIC 86 Some of the properties of conditional propositions are given in the following theorem: CONTRAPOSITIVE AND CONVERSE Before we end this topic, let us learn about contrapositive and converse. 5.5 Theorem 5.4b (De MorganÊs Law): 1.       p q p q       2.       p q p q       Theorem 5.4c: 1.     p q p q     2.     p q p q     For each pair of the propositions below, state whether they are logically equivalent. (a) , p p q  (b) , p q p q    (c) , p q p q   (d)     , p p r p q r      (e)       , p q r p r q r      (f) , p q q p     (g) , p q p q   (h)     , P p q r Q p p r       ACTIVITY 5.3 Copyright © Open University Malaysia (OUM)
  • 104. TOPIC 5 PROPOSITIONAL LOGIC  87 Notice the difference between the contrapositive and the converse. The converse of a conditional proposition merely reverses the roles of p and q   q p  , whereas the contrapositive reverses the roles of p and q and negates each of them. Let us look at an example. Example 5.5a If we define p : 3 < 4, q : 5 > 8, Then the given proposition „if 3 < 4 then 5 > 8‰ may be written symbolically as p  q The converse is q  p, or in words „if 5 > 8, then 3 < 4.‰ The contrapositive is q p    , or in words „if 5 is not greater than 8, then 3 is not less than 4‰ or „if 5 < 8, then 3 > 4.‰ We see that p  q is false, then q p    is false. An important fact is that a conditional proposition and its contrapositive are logically equivalent. This can be shown by using the truth table as shown in Table 5.9. Table 5.8: p q q p      p q q pq (pq) pq T T F F T T T F F T F F F T T F T T F F T T T T Definition 5.5a: The contrapositive for a conditional proposition p  q is the proposition q p    Copyright © Open University Malaysia (OUM)
  • 105.  TOPIC 5 PROPOSITIONAL LOGIC 88 • Proposition is a statement that is either true or false. • The propositions in statements can be formulated into symbolic expressions. • The compound propositions can be proved by using truth tables and laws of logic. • The operations on compound propostions are tautologies, contradiction, logical equivalence, contrapositive and converse. Biconditional proposition Conditional proposition Conjunction Contradiction Contrapositive Converse Disjunction Logical equivalence Negation Proposition Tautologies If each of the following statements define p and q, then state the converse and contrapositive in an English sentence. (a) I go to town whenever there is a need to buy a new cloth. (b) A positive integer is a prime only if it has no division other than 1 and itself. (c) If it rains tonight, then I will stay at home. (d) I go to the beach whenever it is a holiday. ACTIVITY 5.4 Copyright © Open University Malaysia (OUM)
  • 106. TOPIC 5 PROPOSITIONAL LOGIC  89 Johnsonbaugh, R. (2014). Discrete mathematics (7th ed.). Edinburgh Gate: Pearson. Lipschutz, S., & Lipson, M. (2009). SchaumÊs outline of discrete mathematics (revised 3rd ed.). New York: McGraw Hill. Logic. (2009). Retrieved from http://www.cs.odu.edu/~toida/nerzic/content /logic/intr_to_logic.html Logic. (2015). Retrieved from http://en.wikibooks.org/wiki/Discrete_ Mathematics/Logic Poly, G. (1945). How to solve it. Princeton: Princeton University Press. Rosen, K. (2011). Discrete mathematics and its application (7th ed.). New York: McGraw Hill. Suber, P. (1997). Propositional Logic Terms and Symbols. Retrieved from http://www.earlham.edu/~peters/courses/log/terms2. htm Copyright © Open University Malaysia (OUM)