Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 45

Course Module in

DISCRETE STRUCTURES I

ELVIRA S. PECAJAS, Ed. D.


Asso. Prof 1
BiPSU VISION

A state university leading in research and innovation for


human empowerment and societal development.

BiPSU MISSION

To advance the university with innovative human


resources, responsive researches, sustainable production
and demand-driven extension services.

OVERVIEW OF THE MODULE

Purpose of the Module


The field of Discrete Structures introduces some basic concepts from discrete
mathematics that are essential in the study of Computing or Information Technology
Education (ITE). A logic is a formal, symbolic system that tries to capture the
principles of correct reasoning and truth. To describe any formal language precisely,
we need three pieces of information — the alphabet describes the symbols used to
write down the sentences in the language; the syntax describes the rules that must
be followed for describing “grammatically correct” sentences in the language; and
finally, the semantics gives “meaning” to the sentences in our formal language.
The main purpose of this module is to distinguish if a given statement is a
proposition or not. Moreover, writing English statements in symbolic form, and
identify whether a statement is satisfiable, contradictory, or valid. Understand basic
set notation and solve simple problems concerning sets, define relations, specify the
matrix representation of a graph or a relation, and perform basic operations on
matrices; solve simple problems on functions, including problems concerning
partiality and composition.

Title and Description


This course module entitled "Course Module in Discrete Structures 1"
provides mathematical tools of logic, definitions and theorems concerning
foundations of logic, algorithms and their complexity, mathematical reasoning, sets,
relations, and functions.

Module Guide
This module is designed to engage you as a learner in a flexible learning
environment. With that, this module encourages independent and self-regulated
learning. This course module in Discrete Structures I is written in such a way that I,
as your instructor, is communicating directly to you as my students. Moreover, each
lesson is divided into sections that you have to go through to maximize your learning
experience while using this module.

The topics included in this course module is divided into four (4) units,
wherein each unit has subtopics. The overview of each unit is as follows:

• Module 1 – Logical Structures

This unit focuses on two areas of logic, namely: Propositional Logic and First
Order Predicate Logic. It proceeds by describing to you the various structures which
make up these areas, and the rules for combining these structures (or syntax) and
their meaning (or semantics). There concept are then used in studying the different
methods in proving the validity of arguments.

• Module 2 – Set Structures

This unit reviews the basic concepts on sets, its operations and its algebra.
The notion of sets is also further extended to other set related concepts.

• Module 3 – Relations

This unit considers the concepts on sets, whenever sets are being discussed,
the relationship between the elements of the sets is the next thing that comes up.
Relations may exist between objects of the same set or between objects of two or
more sets. Furthermore, properties and operations on relations are met in this
module.

• Module 4 – Functions

A function is a relation between a set of inputs and a set of permissible


outputs, provided that each input is related to exactly one output. The various types
of functions are as follows: One-to- one function. Onto function, and One-to-one
correspondence.

Module Outcomes
After completing this course module, students must be able to:
1. Identify and explain the various structures which make up logical structures
and the rules for combining (or syntax) and their meaning (or semantics).

2. Define and apply the terms, rules, and properties of set theory and use these
as tools to support problem solving and reasoning in applications of logic,
relations and functions.
 Course Outline
MODULE TOPICS SCHEDULE
Propositional Logic Week 1
The Syntax for PL
o Symbols in PL
o Combining Week 2
Propositions
o Precedence Rules
The Semantics for PL
Module 1 o Semantic Rules
o Properties of Week 3
Logical Structures
Sentences
o Truth Tables
The Syntax for FOPL
o Predicates
o Quantifiers Week 4
o Sentences
The Semantics for FOPL
o Semantic Rules Week 5

Deadline:
Assessments for Module 1 Week 5
Basic Set Concepts
o Set and Set
Elements Week 6
o Set Representations
o Universal Set and
Empty Set
o Set Membership and
Containment
Module 2
Set Operations
Set Structures o Unary Operation on Week 7
Sets
o Binary Operations on
Sets
o Venn Diagram

Set Algebra
o Laws of Set Theory Week 8

Deadline:
Assessments for Module 2 Week 9
Midterm Exam Week 9
Relations and their
Properties
o Cartesian Product
o Properties of Week 10-11
Relation
Module 3
Operations on Relations
Relations o Complement of a
` Relation
o Inverse of a
Relation Week 12-13
o Composite Product
o R Restricted to X
o The Image of X
under R

Deadline: Week 14
Assessments for Module 3
Functions and their
Properties
o Function
o Domain, Codomain,
and Range of a Week 15
Function
o
Module 4 Special Type of Functions
o One-to-One
Functions Function Week 16
o Onto Function
o One-to-One
Correspondence
The Pigeonhole Principle Week 17
Deadline:
Assessments for Module 4 Week 18
Final Exam Week 18

Module Requirements
The learner will submit answers to the exercises/problems given in each
succeeding topics according to the time allotted given to them. After the completion
of this module, the learners must submit a compilation of activity sheets.

PRE-ASSESSMENT
Before we begin with our lessons, let us assess your knowledge on the topic
provided herein.

I. Choose the letter that corresponds to the correct answer.

1. A declarative statement which is either true or false, but not both.


a. language b. logic c. syntax
d. proposition e. none
2. It refers to the lists of elements to another elements. An example of this I s a
table shows which students are taking which courses,
a. functions b. propositions c. relations
d. precedence rules e. none
3. It is a meaning of a sentence in propositional logic or it is the assignment of a
truth value to a sentence.
a. semantics b. propositions c. interpretation
d. precedence rules e. none
4. A part of logic which does not only deal with the form of sentences, but also
with their content.
a. PL b. fuzzy logic c. FOPL
d. AI e. none
5. Words that indicate quantity such as all, some, none or one.
a. quantifiers b. predicates c. syntax
d. semantics e. none
6. it deals with a collection of objects of a certain type.
a. relation b. elements c. content
d. sets e. none
7. It refers to the structure or form of its sentences.
a. syntax b. argument c. content
d. meaning e. none
8. A sentence is ___________ if it is true in every interpretation..
a. satisfiable b. not valid c. valid
d. contradictory e. none
9. It is a quantifier signifying “for all x”, “for each x”, or “for every x”.
a. existential b. essentials c. predicate
d. universal e. none
10. The number of elements in a finite set A termed as the _____ of a set.
a. cardinality b. essentials c. partiality
d. totality e. none

II. Find the Cartesian Product of the given set:

Let A = {2, 3} and B = {1, 2, 4, 6}


1. A x B =
2. B x A =

KEY TERMS
Cartesian product
It is defined as the set of all ordered pairs from A to B.
Codomain
The set into which output values are constrained to fall.

Complex numbers
Based on the concept of real numbers, a complex number is a number of the form a
+ bi, where a and b are real numbers and i is an indeterminate satisfying i 2 = −1.
For example, 2 + 3i is a complex number.

Domain
A set of all possible valid input values as the x-values of the function.

Elements
Is anyone of the distinct objects that make up the set.

Empty set
The empty set is the unique set having no elements; its size or cardinality (count of
elements in a set) is zero.

First Order Predicate Logic (FOPL)


A part of logic which does not only deal with the form of sentences, but also
with their content.

Integers
Is colloquially defined as a number that can be written without a fractional component.
For example, 21, 4, 0, and −2048 are integers, while 9.75, 512, and √2 are not.

Interpretation
Interpretation for a sentence is an assignment of a truth value to each
propositional symbol

Natural numbers
It includes the counting numbers ( 1, 2, 3, …). However, it also includes 0, so that the
non-negative integers (0, 1, 2, 3, …) are also called natural numbers.

One-to-one correspondence
A bijection or bijective function, one-to-one correspondence, or invertible function, is a
function between the elements of two sets, where each element of one set is paired with exactly
one element of the other set, and each element of the other set is paired with exactly one
element of the first set.

One-to-one function
Each element in the domain pairs to exactly one element in the range.

Onto function
A function f from a set X to a set Y is surjective (also known as onto, or a surjection),
if for every element y in the codomain Y of f, there is at least one element x in the domain X
of f such that f(x) = y.

Predicate
An expression of one or more variables defined on some specific domain

Proper subset
Proper subset of a set A is a subset of A that is not equal to A. In other words, if B is
a proper subset of A, then all elements of B are in A but A contains at least one element that is
not in B. In two sets A and B, B is a proper subset of A, if all the elements of B are in A, but A
contains at least one element that is not in B.

Proposition
A declarative sentence that is either true (denoted either T or 1) or false
(denoted either F or 0).

Propositional logic
Also known as statement logic, is the branch of logic that studies ways of
joining and/or modifying entire propositions, statements or sentences to form more
complicated propositions, as well as the logical relationships and properties that are
derived from these methods of combining or altering statements.

Quantifier
A quantifier specifies the quantity of specimens in the domain of discourse that
satisfy an open formula. The two most common formal quantifiers are "for each" (traditionally
symbolized by "∀"), and "there exists some" ("∃").

Range
Set of all actual output values and considered as y-values of the ordered pair.

Rational numbers
  A number that can be made by dividing two integers (an integer is a number with no
fractional part). The word comes from "ratio". Examples: 1/2 is a rational number (1 divided
by 2, or the ratio of 1 to 2) • 0.75 is a rational number (3/4)

Real numbers
A real number is any positive or negative number. This includes all integers and all
rational and irrational numbers. For example, a program may limit all real numbers to a
fixed number of decimal places.

Relations
A set of ordered pairs that a satisfy a relationships.
.
Roster method
Is defined as a way to show the elements of a set by listing the elements inside the
bracket.

Rule method
This method involves specifying a rule or condition which can be used to decide
whether an object can belong to the set. This rule is written inside a pair of curly braces and
can be written either as a statement or expressed symbolically or written using a
combination of statements and symbols.

Syntax
It deals with the form or structure of the language.

Semantics
It adds meaning to the proposition

Set
It is a well-defined collection of distinct objects, considered as an object in its own
right.

Subset
A set A is a subset of another set B if all elements of the set A are elements of the set B.
In other words, the set A is contained inside the set B.

Universal set
A universal set (usually denoted by U) is a set which has elements of all the
related sets, without any repetition of elements. Universal set contains a group of objects or
elements which are available in all the sets.
MODULE 1

LOGICAL STRUCTURES

Logic is the art and science of reasoning. It is a science since it uses


principles, laws and methods in solving problems such as in proving the validity of a
given argument. Logic is also an art since it requires skill and critical insight when
reasoning. The reasoning process is a creative activity which cannot be precisely
described, and must be learned in part from observation and experience.

Now, why study logic? Logic is used in various fields of study. It is used in
mathematics to prove the theorems, in Information Technology Education (ITE) to
develop programs and to prove that those programs do what they are expected to
do, in the natural and physical sciences to draw conclusions from experiments, in the
social sciences, and in our everyday lives to solve a multitude of problrms. Indeed,
we are constantly using logical reasoning.
There are three types of logic:
o Propositional Logic (PL)
o First-Order Predicate Logic (FOPL)
o Fuzzy Logic
In this module, we shall be discussing the first two, PL and FOPL which are used in
mathematics and ITE programs

PROPOSITIONAL LOGIC

In studying propositional logic, you need to know the basic building blocks of
any theory of logic called propositions.
A proposition is a declarative statement which is either true or false, but not
both. Clearly, not all sentences are propositions since not all sentences are
declarative. Clearly, not all sentences are propositions since not all sentences are
declarative.

Intended Learning Outcome


At the end of this section, the students should be able to:
1. identify the given statement if it is a proposition or not;

LET’S START!

Let’s begin the module by watching the video clip.

Go to https://www.youtube.com/watch?v=qV4htTfow-E&feature=share

https://www.youtube.com/watch?v=itrXYg41-V0

Think and Reflect

Which of the following sentences do you think are propositions?


1. How are you?
2. Wow!
3. Sit down
4. X is an integer.
5. 1 + 1 = 2
6. Magellan killed Lapu-Lapu.
7. It is raining today.
8. This sentence is false.
___________________________________________________________________
If you answered sentences 5, 6, and 7 only, then you’re right!
If not, then let us have a closer look and let me clarify some points to you.
 Obviously, sentences (1) to (3) are not propositions since they’re not
declarative. Imagine answering the questions “How are you?”, true or false?
 Sentence (4), though declarative, is not a proposition since it’s truth or falsity
depends on the value of x. you won’t be able to determine if it’s true or false
unless you assign a specific value for the variable x.
 Sentence (8) is declarative, but it’s not a proposition. Try to see whether “This
sentence is false.” Is true or false (but not both).
o case 1: Assume it is true. Now analyze its meaning. Since it is true that
“This sentence is false.”, then what can you conclude about the
sentence? It must be false, isn’t it? Thus, this contradicts our
assumption that the sentence is true.
o case 2: Assume it is false. So this time, it is false that “This sentence is
false.” Therefore, that means the sentence must be true. Right? And
so, you have another contradiction.
In logic, we can’t have sentences which are both true and false at the same time. So,
we rule out such sentences, also called semantical paradoxes.

o Clearly, sentence (5) – (7) are propositions. Sentence (5) is true, (6) is false,
and, (7) is either true or false (but not both), although you have to check the
existing weather condition to identify if it is true or false. Generally, in cases
wherein the truth or falsity of a sentence depends on time, to regard them as
propositions, we simplicity assume that the time is the present.

Let’s Level-up!

Watch https://www.youtube.com/watch?v=P4LyRvlSAUY

Let’s do IT!
Now you should have learned the lesson. Let me check, okay? Please do
your assessment task below.
Task 1. Based from what you have learned in the video and discussion, state
some examples of a declarative statement which is a proposition.
1. ___________________________________________________
2. ___________________________________________________
3. ___________________________________________________
4. ___________________________________________________
5. ___________________________________________________

Task 2. Distinguish if each of the following is a proposition or not. If the sentence is a


proposition, put a check (/) in the box corresponding to it, otherwise, put a cross
mark (x).
1. x + 3 = -5 and x is real
2. Manuel Quezon is a singer.
3. Yes of course!
4. It is hot in Manila.
5. 31/2 + 22 = 53

THE SYNTAX FOR PL


The syntax for propositional logic simply refers to the structure or form of its
sentences. Basically, sentence on PL are constructed using the following building
blocks:
 Propositions, and
 Logical connectives

Intended Learning Outcomes


At the end of this section, the students should be able to:
1. identify a sentence if it is either a single proposition or a compound
proposition.
2. formulate compound proposition using the basic logical connectives,
namely: not, and, or, if-then, and if-and-only-if.

Let’s Start!
https://www.youtube.com/watch?v=5XCBQGg5ZB8

Read and study the given discussion below


Symbols in PL
Before you continue, take note of the following notations that we shall be
using throughout the text.

T, F for the truth symbols corresponding to


TRUE and FALSE
UPPERCASE for the propositions
Letters (& possibly with subscripts)
Examples: P, Q, R, S, P1, P2, P3…
~, >, ˄, ˅, →, ↔ for the logical connectives not, and, or, if-
then, and if-and-only-if, respectively
Script letters (& possibly with subscripts) For sentences in PL

Examples: F, G, H, F1, F2…

Combining Propositions

https://www.youtube.com/watch?v=Ib5njCwNMdk
The basic logical connectives are: not, and, or, if-then, and if-and-only-if.

A not is used to modify propositions, while the and, or, if-then, and if-and-
only-if are used to join propositions.

The logical connectives and their corresponding symbols are given below in a
table. The other headings indicate the following:
 syntax - or usage, tells you how to construct compound propositions
using the given connective
 verbal form - the compound proposition formed, in words
 equivalent term - the name of the compound proposition formed
 other keywords - the words or phrases usually associated with the
given connective

NAME SYMBOLS SYNTAX VERBAL FORM EQUIVALENT OTHER KEYWORDS


FORM
not ~ ~P not P negations “the denial of P”
“it is not the case that P”
and ˄ P˄Q P and Q conjunction “both P an Q”, “but”,
“while”
or ˅ P˅Q P or Q disjunction “either P or Q”, “at least
one of…”
If-then → P→Q if P the Q, P implication “Q if P”. “P only if Q”
implies Q conditional “Q when P”
“Q provided that P”
“P is a sufficient
conduction for Q”
“Q is necessary condition
for P”
If-and- ↔ P↔Q P and only if Q equivalence “P is equivalent to Q”
only-if ,
biconditional

Note: The list of keywords is your key in writing English sentences in symbolic
form. Try to memorize and understand them well.

Think and Reflect

Try writing English statements to symbolic form.


Assume that we have the following propositions:
P: 1 + 1 = 2.
Q: Magellan killed Lapu-lapu.
R: It is raining today.
English Statement Symbolic Form
1. It is not raining today.
2. 1 + 1 = 2 and it is not raining today.
3. Either it is raining today or 1 + 1 = 2.
4. Neither it is raining today nor 1 + 1 =
2.
5. If Magellan killed Lapu-lapu, then it is
raining today.
6. Magellan killed Lapu-lapu if it is
raining today.
7. Magellan killed Lapu-lapu only if it is
raining today.
8. Magellan killed Lapu-lapu if and only if
it is raining today.

Note: In logic, unlike in everyday English, you may join two totally unrelated
statements by one or a combination of the connectives. For instance, in the
conditional statement P → Q, the premise (P) and the conclusion (Q) may
not indicate a causal or inherent relationship.

Let’s Level-up!

Go to https://www.youtube.com/watch?v=gDpDY8ftDcs

Precedence Rule
In forming sentences, we usually put grouping symbols
(parentheses, brackets or braces) to where we want them to be. Without
the presence of grouping symbols, we will assume that the grouping will
follows the precedence rules for the logical connectives.
(highest priority) not
and
or
if-then
(lowest priority) if and only if
That is, the connective with the higher priority will be
considered first over the one with the lowest priority. Connectives having
the same priorities are then considered from left to right.
For example, the sentence ~P ˅ Q ˄ R → S → U, when
written with grouping symbols is actually [(~P ˅ (Q ˄ R)) → S] → U
Let’s do IT!
Now, let’s have a short exercise on what you have learned so far.
Task 1. Translate the following English statements into symbols in propositional
logic. Write your answers in the box provided across each sentence.

Let S, W, and G be the following propositions.

S: I will study discrete structures.

W: I will watch a movie.

G: I am in a good mood.

English Statement Symbolic Form


1. If I am not in a good mood, then I will
not study discrete structures and I will
watch a movie.
2. I will not watch a movie, and I will
study discrete structures.
3. I will watch a movie only if I will not
study discrete structures or I am not in
a good mood.
4. I am in a good mood if I will neither
study discrete structures nor watch a
movie.

THE SEMANTICS FOR PL

The semantics or meaning of a sentence in propositional logic is the truth or falsity of


the sentence. It is the assignment of a truth value to the sentence.

Intended Learning Outcomes


At the end of this section, the students should be able to:
1. determine the truth or falsity of sentences when a particular interpretation
is given to its proposition.
2. perform repeated application of semantic rules to bigger and bigger parts
of the sentence until a single truth value is determined.

Let’s Start!
https://www.youtube.com/watch?v=4SMyPnBNZGE

Read and study the given discussion below


Symbols in PL

Semantic Rules
The semantic rules for the basic compound propositions are summarized in
the following table.

Semantic rules for basic compound propositions

RULE COMPOUND TRUE WHENEVER FALSE WHENEVER


PROPOSITION
not-rule ~P P is false P is true
and-rule P˄Q both P & Q are true at least one of P &
Q is false
or-rule P˅Q at least one of P & both P & Q are
Q is true false
if-then-rule P→Q either P is false or P is true and Q is
Q is true false
if-and-only-if rule P↔Q both P and Q have P & Q have
the same truth different truth
values values

Think and Reflect


Consider the sentence F and evaluate the meaning of the compound
proposition.

F: [((P ˄ ~Q) → R) ˅ Q] ↔ R
I: P is T; Q is F; and, R is F
The meaning of the sentence can be evaluated as follows: application if the
not- rule gives ~Q as true, the and-rule gives (P˄~Q) as true, the if-then-rule gives
(P˄~Q) →R as false, the or-rule gives ((P ˄ ~Q) → R) ˅ Q as false; and
finally, the if-and-only-if gives the sentence F: [((P ˄ ~Q) → R) ˅ Q] ↔ R the
value ___.

Let’s Level-up!

Properties of Sentences

A sentence may have one of the following properties based on the


semantics.

1. Satisfiable
A sentence is satisfiable if it is true for some interpretation. A
satisfiable sentence is also called contingency.

2. Contradictory
A sentence is contradictory (or unsatisfiable) if it false for every
interpretation. A contradictory sentence is also called an absurdity.

3. Valid
A sentence is valid if it is true for every interpretation. A valid
sentence is also called a tautology.

Let P be a proposition
P is satisfiable since it is true for some interpretation, that is,
when P is true. But P is not valid since it become false when P is false.
P ˅ ~P is valid since every interpretation results in a value of true for
(P ˅ ~P). Notice that P and ~P have opposite truth values, one of which
is the value true. Thus, by the or-rule, (P ˅ ~P) is true.
P ˄ ~P is a contradiction since every interpretation results in a value
of false for (P ˄ ~P). Similarly, we know that one of P and ~P is false.
So, by the and-rule, (P ˄ ~P) is always false.
Here are some more examples
Let P and Q be propositions. You should be able to verify that the
following sentences are:
Satisfiable Contradictory Valid
P P↔P P↔P
P˄Q P˄F P→Q
P˅Q ~(P → T) P˅T
F→P
Truth Tables

Go to https://www.youtube.com/watch?v=UiGu57JzLkE

You can easily determine whether a sentence is satisfiable,


contradictory, or valid by constructing a truth table for the given
sentence.
A truth table for a sentence in n propositional variables may be
systematically constructed as follows:

Step 1: The first n columns of the table are labeled by the


component propositional variables. Further columns are constructed for
all intermediate combinations of statements, culminating in the given
statement.

Step 2: Under each of the first n headings, we list all the 2 n


combinations of truth values for the propositional variables. Each
combination is listed on a separate row.

Step 3: For each row, we compute, in sequence, all remaining truth


values.

The sentence is satisfiable if the last column contains some entries


which are true, contradictory, if the entries are all false, and valid when
they are all true.

P ~P P Q P˄Q P˅Q P→Q P↔Q


T F T T T T T T
F T T F F T F F
F T F T T F
F F F F T T

Example
The truth table for the sentence
F: [(P→ Q) ˄ ~Q] ↔ ~(P ˅ Q)

P Q P→ Q ~Q (P→ Q) ˄ ~Q P˅Q ~(P ˅ Q) F


T T T F F T F T
T F F T F T F T
F T T F F T F T
F F T T T F T T

Thus, the given sentence F is valid.

Let’s do IT!
Now, let’s have a short exercise on what you have learned so far.
Identify whether the following sentences are satisfiable, contradictory, or valid. Write
your answer on the blank given before each item. Then explain your answer or show
your solution (using a truth table) on the space provided after each item.
1. F: (P ˅ Q) ˄ ~(P ˅ Q)

2. G: [(P ˅ Q) ˄ (P ˅ ~Q)] ˅ ~P

3. H: P ˅ Q ˄ ~P ˅ ~Q ˄ P

FIRST ORDER PREDICATE LOGIC (FOPL)

First Order Predicate Logic (FOPL) or predicate logic that emphasizes not
only the forms of arguments, but also the content of the sentences involved in the
arguments as well. That’s why logicians regard FOPL, as being more powerful than
PL. The language of FOPL is most commonly used in knowledge representation in
Artificial Intelligence.
Intended Learning Outcomes
At the end of this section, the students should be able to:
1. Translate English statements to sentences in FOPL.
2. Evaluate the truth value of sentences in FOPL; and

LET’S START!

Go to https://www.youtube.com/watch?v=GJpezCUMOxA&feature=share
Read and study the given discussion below
THE SYNTAX FOR FOPL

The syntax OF FOPL pertains to the rules for combining symbols. But first, let us
look at the following basic building blocks of FOPL:
 Predicates, and
 Quantifiers

Predicates

In English we know that a declarative sentence basically consists of two parts:


the subject and the predicate.
In logic, a predicate expression ls written as follows: PREDICATE(subject). Thus, a
predicate is just a name (from the predicate part of the sentence, followed by one or
more arguments (usually coming from the subject enclosed in parentheses. This
arguments maybe constants or variables. Conventionally, we write predicate names
in uppercase and predicate arguments in lower case.

Example
Here are some examples of simple English statements and their
representations as predicates in FOPL.

English Symbolic Form


Rey is a man. MAN(rey)
x is a variable VARIABLE(x)
Rylee eats apple. EATS(rylee, apple)
Chael eats pizza. PIZZA(chael)

Quantifiers

Certain declarative sentences involve words that indicate quantity such as all,
some, none, or one. These words help determine the answer to the question “How
many” since such words indicate quantity, they are called quantifiers.
There are two types of quantifiers:

1. Universal Quantifier – it is denoted by Ɐx: signifying, “for all x”, “all x”, “for
each x” or “for every x”.
If P(x) is a predicate, then Ɐx P(x) is said to be universally quantified statement.

2. Existential Quantifier – it is denoted by ⱻx to mean “for some x”, for at least


one x”, “there is an x”, or “there exists an x such that”

If P(x) is a predicate, then ⱻx P(x) is said to be existentially quantified statement.

Sentences

If x is a variable and F is a sentence, then (Ɐx) F, (ⱻx) F, are sentences and F


is called the scope. The scope F, may consist of one or more predicates which may
be combined using the logical connectives (~, ˄, ˅, →, ↔).

Suppose F contains that variable x. We say x is bound if it follows or is within


the scope of a quantifier naming the variable. If a variable is not bound, it is said to
be free. For example, in the sentence Ɐx(P(x)→Q(x,y)), x is bound, but y is free.

Think and Reflect

Now, let us translate some sentences in English into symbols in FOPL. First,
consider the following statements:

1. All BiPSU students are intelligent.

You can restate the given sentences as follows:


For all x, if x is a BiPSU student, then x is intelligent.

Thus, if we let S(x) : x is a BiPSU student.


I(x) : x is intelligent.

Then u can write the given sentence by symbolically as


(Ɐx) ( S(x) → I(x) )

2. Some BiPSU students are intelligent.

You can restate the given sentences as follows:


There is at least one BiPSU student who is intelligent.

or in more detail

There is at least one x such that x is a BiPSU student and x is intelligent.


Again, using the predicates S(x) : x is a BiPSU student.
I(x) : x is intelligent.
Then you can write the given sentence symbolically

(ⱻx) ( S(x) ˄ I(x) )

Let’s Level-up!

Here’s the general idea!

In translating quantified sentences into symbols, we find a common, yet not


necessarily universal, pattern:

o Ɐx is often followed by an implication, because a universal statement is


usually of the form “given any x, if it has a property P, then it also has
property Q.” That is,
(Ɐx) ( P(x) → Q(x) )

o ⱻx is often followed by a conjunction, because an existential statement


is usually of the form “There exists an x with property P and also
satisfies property Q.” That is,
(ⱻx) ( P(x) ˄ Q(x) )
Here are some more examples of English statements and their equivalent symbolic
form I FOPL.

English Statement Symbolic Form


1. All students are youngsters Ɐx ( S(x) → Y(x) )
2. Some youngsters are cheaters. ⱻx ( Y(x) ˄ C(x) )
3. No student is a cheater. ~ⱻx ( S(x) ˄ C(x) )
This is the same as saying,
“There does not exist a student who is a
cheater.”
4. Not all youngsters are students. ~Ɐx ( Y(x) → S(x) )
This is simply the negation of a
universally quantified statement.
5. Ella admires some teacher. (Let A(x,y) be “x admires y”)
This can be restated as saying,
“there does not exist a teacher whom ⱻx ( T(y) ˄ A(Ella, y) )
Ella admires.”
6. Maria admires all teachers. Ɐx ( T(y) → A(Maria, y) )
7. Maria admires only teachers. Ɐx (A(Maria, y) → T(y) )
Take note that this does not necessarily
mean that Maria admires all teachers.
By the word “only” this indicates that
anyone Maria admires is a teacher.
Let’s do IT!
Now, let’s have a short exercise on what you have learned so far.
Task 1. Translate the following English statements into symbols in FOPL. Use the
underlined letters for your predicate names. Write your answers on the space
provided across each statement.

English Statement Symbolic Form


1. All scholars who are diligent are
honor students.
Restatement: For all x, if x is a scholar
and x is diligent, then x is an honor
student.
2. Some scholars are either diligent or
intelligent.
Restatement: There exist an x such that
x is a scholar and either x is diligent or
x is intelligent.
3. No scholar is not intelligent.
Restatement: There does not exist an x
such that x is a scholar and x is not
intelligent..
4. Some students admire only
teachers.
(Here, let A(x,y) be “x admires y”)
Restatement: There exist an x such that
x is a student, and for any y, if x
admires y then y is a teacher.
5. Maria doesn’t like any cheater.
(Let L(x, y) be “x likes y”)
Restatement: For any y, if y is a cheater
then Maria doesn’t like y.

THE SEMANTICS FOR FOPL

Let us now study the semantics or meaning (or truth value) of a sentence in
FOPL.
First, consider P(x) to be statement involving the variable x. P(x) is also called
an open proposition. It becomes a proposition when the variable x is replaced by a
value from certain allowable choices. The allowable choices constitute the universe
or universe of discourse for P(x). To be precise, the universe must be specified
explicitly, but frequently, the universe is left implicit.

Intended Learning Outcome


At the end of this section, the students should be able to:
1. determine the truth or falsity of sentences when a particular given is
universally or existentially quantified statement.

Let’s Start!
Go to
https://leanprover.github.io/logic_and_proof/semantics_of_first_order_logic.html
Read and study the given discussion below
Semantic Rules
Here are the rules to help u show whether a given universally or existentially
quantified statement is true or false.
 To show that the universally quantified statement
Ɐx P(x)
is true, show that for every x in the universe of discourse the
proposition (Px) is true. Showing that P(x) is true for a particular value x does not
prove that Ɐx P(x) is true.

 To show that the existentially quantified statement


ⱻx P(x)
is true, find one value of x in the universe of discourse for which P(x) is true. One
value suffices.

 To show that the universally quantified statement


Ɐx P(x)
Is false, find one value of x (called counterexample) in the universe of discourse for
which p(x) is false.

 To show that the existentially quantified statement


ⱻx P(x)
is false, show that for every x in the universe of discourse, the proposition P(x) is
false. Showing that P(x) is false for a particular value x does not prove that ⱻx P(x) is
false.

Think and Reflect


Consider the following statement. Note that, the domain is N (consider 0 as a
whole number and a non-negative integer, so therefore it is considered as a natural
number). Show your solution.
1. ⱻx P(x ≤ x) = _____________________________________

2. Ɐx P(x ≤ x) = _____________________________________

3. ⱻx P(x + x ≤ x) = __________________________________

4. Ɐx P(x + x ≤ x) = __________________________________

Let’s Level-up!

Here are some examples of quantified statements and their corresponding


meanings.
1. For every real number x, x2 ≥ 0
This statement is true.
Since no matter what the value of x is, it is true that the square of x is either positive
or zero.

2. For any real number x, x2 -1 > 0.


This sentence is false.
If u take x = , then the proposition
12 -1 > 0
is false. The value 1 is a counterexample to our given statement.

x 2
3. For some real number x, =
x +1 5
2

This statement is true.


It is possible to find at least one real number to satisfy the given equation. For
example, let x = 2. Then we find that the proposition
2 2
=
2 +1 5
2

is true.
1
4. For some real number x, 2
>1
x +1
This statement is false.
1 1
Here, we must show that 2
>1 is false for every real number x. But 2 >1 is
x +1 x +1
1 1
false iff. 2 ≤ 1 is true. Thus, we must show that 2 ≤ 1 for every real number x.
x +1 x +1
Now, we know that x2 ≥ 0.
Adding 1 to both sides of this equation, we get
x2 + 1 ≥ 1
1
Dividing both sides by x2 + 1, we have, 1 ≥ 2 , or
x +1
1
2
≤1
x +1
1
Thus, 2
≤ 1 is true for every real number x. and therefore, we have shown
x +1
1
that 2
>1 is false for every real number x.
x +1

Let’s do IT!
Determine the truth value of the following quantified sentences. If the
sentence is true, write TRUE on the blank, otherwise, write FALSE. Prove your
answer on the space provided after each number.
Assume that the universe of discourse of discourse is the set of real numbers.

1. For every x, x2 > x.

2. For some x, x2 > x.

3. For every x, if x > 1, then x2 > x.

4. For some x, if x > 1, then x2 > x.


Summary

Logical structures is the study of logic that uses principles, laws and methods
in solving problems such as in proving the validity of a given argument. There are
two areas of logic namely: Propositional Logic (PL), and First Order Predicate Logic
(FOPL A proposition is a declarative statement which is either true or false, but not
both. Clearly, not all sentences are propositions since not all sentences are
declarative. Clearly, not all sentences are propositions since not all sentences are
declarative.
The syntax for propositional logic simply refers to the structure or form of its
sentences. Basically, sentence on PL are constructed using the following building
blocks: Propositions, and Logical connectives. Compound proposition can be formed
using the basic logical connectives, namely: not (~), and (˄), or (˅), if-then (→), and
if-and-only-if (↔).
The semantics or meaning of a sentence in propositional logic is the truth or
falsity of the sentence. It is the assignment of a truth value to the sentence. The truth
or falsity of sentences are determined when a particular interpretation is given to its
proposition. A sentence is satisfiable if it is true for some interpretation. It
is also called contingency. Contradictory or unsatisfiable if it false for
every interpretation. It is also called an absurdity. Lastly. it is valid if it is
true for every interpretation or a tautology.
The syntax of FOPL pertains to the rules for combining symbols. The basic
building blocks of FOPL namely: Predicates, and Quantifiers. In logic, a predicate
expression is written as follows: PREDICATE(subject). Thus, a predicate is just a
name (from the predicate part of the sentence, followed by one or more arguments
(usually coming from the subject enclosed in parentheses. This arguments maybe
constants or variables. Conventionally, we write predicate names in uppercase and
predicate arguments in lower case.
The semantics or meaning of a sentence in FOPL can be determined by
replacing a value from certain allowable choices that constitute the universe or
universe of discourse for the given proposition or P(x). To be precise, the universe
must be specified explicitly, but frequently, the universe is left implicit.
Assessment
Write the truth table of each proposition for Y = T; G = F and A = T.

1. ~Y ˄ ~G 4. ( ~Y ˄ G ) ˅ ( A ˄ ~Y )
2. ( ~A ˅ Y ) ˄ (~G ˄ A) 5. ( Y ˄ A) ˅ ( Y ˅ ~G ) ˄ ( ~A ˅ ~Y )
3. ( ~Y ˄ A) ˅ ~( Y ˅ G )

Identify whether the sentence is satisfiable, contradictory or valid. Show your


solution.

F : [ P ˅ (~Q ˄ P) ] ( P ˄ ~Q ) ~ ( P ˅ ~Q )

P Q ~Q ~Q ˄ P P ˄ ~Q P ˅ (~Q ˄ P) [ P ˅ (~Q ˄ P) ] ( P ˄ ~Q ) ~( P ˅~Q ) F


0 0
0 1
1 0
1 1

Restate and translate the English statements into symbols of FOPL. Use the
underlined letters for your predicate names.
1. All scholars who are hardworking are honor students.
2. Some scholars are hardworking.

References

Grimuldi, R. (1994), Discrete and Combinatorial Mathematics, An Applied


Introduction, 3rd edition. Addison-Wesley Publishing Company, Inc.

Lansigan, B., (1996), Discrete Structures in Computer Science. Institute of Computer


Science, , UP Open University.

Kumar, R. (2012). Fundamentals of structural analysis: with computer analysis &


applications. Revised edition. New Delhi, India S. Chand & Company Ltd.
1. Let X = { 1, 2, 3 }, and R = { (1, 2), (2, 3), (4, 5) }
Then,
R”X = { 2, 3 }

2. Let X = { 1, 2, 3, 4 }, and R = { (2, 1), (1, 3), (3, 4) (5, 2) }


Then,
R”X = { 1, 3, 4}

Note that R”X is not a relation.

Let’s do IT!
Now, let’s have an exercise on what you have learned so far.
Let A = { 1, 2, 3 }, X = { 1, 3 }, and
R is a relation on A, such that R = { (x, y) l x < y ˄ x, y ∈ A }
Perform the following operations. Write your answers on the blanks provided:
1. Rc = _______________________________________________________

2. R-1 = ______________________________________________________

3. R o R-1 = ___________________________________________________

4. R-1 o R = ___________________________________________________

5. R|X = ______________________________________________________

6. R”X = ______________________________________________________

Summary
Relations allows to formalize the notion of relationships that exist among the
sets under consideration (e.g. given a set of students and a set of courses, a relation
may be used to describe which students are taking which courses).
The Cartesian product (or cross product) of A and B is defined as:
A x B = { (x, y) l x ∈ A ˄ y ∈ B }

That is, A x B is the set of all ordered pairs (x, y) such that x comes from A,
and y comes from B, x is called the first coordinate (component), and y is called the
second coordinate (component).
A binary relation R from a set A to a set B is any subset of the Cartesian
product A x B. if an ordered pair (x, y) ∈ R, we say x is related to y by R, and we
write xRy. If A = B, we call R a (binary) relation on A.
In other words, a relation is a set of ordered pairs. For a relation R, the
domain of R, denoted by D(R), is the set { x ∈ A l (x, y) ∈ R for some y ∈ B }, and the
range of R, denoted by R(R), is the set { y ∈ B l (x, y) ∈ R for some x ∈ A }. The field of
R denoted by F(R), is D(R) U R(R).
If a relation is given as a table, the domain consists of the entries in the first
column and the range consists of those in the second column.
The properties of relations are namely: 1. ) Reflexive - the relation R is
reflexive if and only if (iff.) (x, x) ∈ R, for all x ∈ A. This means that every element is
related to itself; 2.) Irreflexive - iff. (x, x) R, for all x ∈ A. Thus, no element is
related to itself; 3.) Symmetric - iff. for all x, y ∈ A. If (x, y) ∈ R then (y, x) ∈ R; 4.)
Assymetric - iff. for all x, y ∈ A. If (x, y) ∈ R then (y, x) R. Consequently, R
shouldn’t have an element of the form (x, x), 5.) Antisymmetric - - iff. for all x, y ∈ A. If
(x, y) ∈ R and x ≠y, then (y, x) R. That is, for every ordered pair (x, y) with x and y
distinct, there should be no ordered pair of the form (y, x) in R. Moreover, ordered
pairs of the form (x, x) may be present in an antisymmetric relation; 6.) Transitive -
iff. for all x, y, z ∈ A. If (x, y) and (y. z) ∈ R then (x, z) ∈ R; 7.) Intransitive - iff. for all
x, y, z ∈ A. If (x, y) and (y. z) ∈ R then (x, z) R; and 8.) Equivalence – iff. R is
reflexive, symmetric, and transitive.
The operations on relations are the following: 1.) Complement of a Relation;
2.) Inverse of a Relation; 3.) Composite Product; 4.) R Restricted to X; and 5.) The
Image of X under R.
Assessment

1. Find the domain and range for the following relation.

a. { (1, 1), (2, 1), (3, 1), (4, 1) }


b. { (a, b), (a, d), (c, d), (e, c), (f, b) }

2. For the following relation, write an equation that describes the connection
between x (the first number in an ordered pair) and y (the second number in
an ordered pair).

a. {(1, 1), (1, -1), (4, 2), (4, -2), (9, 3), (9, -3)}
b. {(1, 4), (2, 3), (3, 2), (4, 1), (-2, -3), (6, -1), (7, -2)}

3. If A = {1, 2, 3} and B = {4, 5, 6}, state which of the following is a relation from
A to B.

(a) R₁ = {(1, 4); (2, 5); (6, 3)}    

(b) R₂ = {(2, 5); (3, 6)}

(c) R₃ = {(6, 3); (5, 2); (4, 1)}    

(d) R₄ = {(1, 5); (1, 6); (2, 4); (2, 6), (3, 4), (3, 5)}

4. Let R be a relation on the set { a, b, c, d }


R={ (a, b), (a, c), (a, d), (c, b), (c, d), (d, b)}.
Identify the properties satisfied on this given relation.

References:

Grimuldi, R. (1994), Discrete and Combinatorial Mathematics, An Applied


Introduction, 3rd edition. Addison-Wesley Publishing Company, Inc.

Johnsonbaugh, r. 1993. Discrete Mathematics 3 rd ed. Macmillan Publishing


Company.
Kolman, B. and R. Busby, (1987). Discrete Mathematical Structures for Computer
Science (2nd edition). Prence-Hall International

Mott, J. et. al. (1983). Discrete Mathematics for Computer Science. Reston Publishing
Company, Inc.
MODULE 4

FUNCTIONS

The notion of a function, a special type of a relation, plays an important role in


mathematics, ITE courses, and many applications. We will study its basic properties
and then discuss several special types of functions.

Functions and their Properties

A function is a special kind of relation. Recall that a relation R from A to B is


any subset of the Cartesian Product A x B and that the domain of R, D(R) = { x l (x,
y) ∈ R for some y ∈ B}. If f is a relation from A to B, for f to be a function, the domain
of f must be equal to A, and if (x, y) and (x, z) are in f, we must have y = z.
A function is a relation from a set of inputs to a set of possible outputs where
each input is related exactly one output.
Intended Learning Outcome
At the end of this module, the students will be able to:
1. Distinguish if a given relation is a function or not.

Let’s Start!
Read and study the given discussion below.
For non-empty sets A, B, a function f from A to B , denoted by f : A → B, is a
relation from A to B with the following properties:
1. D(f ) = A; and

2. If ( (x. y) ∈ f ˄ (x, z) ∈ f ), then (y = z), Ɐx ∈ A.


Thus, the function f : A → B, is a relation from A to B whose domain is A, and
in which every element of A appears exactly once as the first coordinate of an
ordered pair in the relation.
We can also view a function simply as a rule, or a mapping, which associates
with each element in A a unique (only one) element in B. Thus, we also say f maps
A into B. We often write f (x) = y when (x, y) ∈ f .

These ideas are illustrated as follows:

Think and Reflect


Let A = { 1, 2, 3 }, B = { a, b, c, d }, and f, g, h, k be relations from A to B.
Which of the following do you think is/are (a) function(s)?
_____1. f = { (1, a), (2, b), (3, b) }
_____2. g = { (1, a), (2, b) }
_____3. h = { (1, a), (2, a), (2, b), (3, c }
_____4. k = { (1, a), (2, d), (3, b) }
_____5. m = { (1, a), (2, a), (3, b), (4, c }

Let’s Level-up!
https://www.youtube.com/watch?v=aQizbVOjrJE

Domain, Codomain, and Range of a Function


If f : A → B is a function, A is called the domain of f , and B the codomain of f .
The subset of B consisting of those elements that appear as second coordinates in
the ordered pairs of f is called the range of f and is also denoted by f (A).
Example
Let A = { 1, 2, 3 }, B = { a, b, c, d }, then the function f : A → B, f = { (1, a),
(2, b), (3, b) } has:
domain = A = { 1, 2, 3 }
codomain = B = { a, b, c, d }
range = f (A) = { a, b }

Let’s do IT!
Now, let’s have an exercise on what you have learned so far.
Determine which of the following relations functions are. On the blanks provided,
write YES if it is a function, write NO if it is not a function.
Let A = { a, b, c, d }, B = { 1, 2, 3 }
_____1. f = { (1, a), (2, b), (3, b) }
_____2. g = { (1, a), (2, b) }
_____3. h = { (1, a), (2, a), (2, b), (3, c }
_____4. j = { (1, a), (2, d), (3, b) }

Special Types of Functions

A function refers to a special relation which maps each element of one set


with only one element belonging to another set. The various types of functions are as
follows: One-to- one function. Onto function, and one-to-one correspondence .
Intended Learning Outcome
At the end of this module, the students will be able to:
1. Identify if a function is one-to-one, onto, and/or a cone-to-one
correspondence; and

Let’s Start!
Watch this link: https://www.youtube.com/watch?v=bp46gL3WcyQ

Think and Reflect

Identify the following:


1. A function f from A to B that for all ‘b’ in B, there is an ‘a’ in A such that f(a) =
b.
2. A function that no two distinct elements of A have the same image in B.
3. It is said to be _______ if it is both one-to-one and onto function.
4. Let A = { 1, 2, 3 }, B = { a, b, c } . Find the elements of f: A → B.

Let’s Level-up!
One-to-One Functions
A function f : A → B is a 1-1 function, or an injection, if and only if for each
element of B, there is at most one element in A with f (x) = y. This is equivalent to:

f : A → B ↔ [f (x) = f (y) → x = y, Ɐx, y ∈ A]


Thus, no two distinct ordered pairs in a 1-1 function f have the same second
coordinates.
These ideas are illustrated as follows.

Example
Which of the following do you think is/are 1-1 functions?
1. Let A = { 1, 2, 3 }, B = { a, b, c, d, e }
a. f1 = { (1, a), (2, c), (3, d) }
b. g1 = { (1, a), (2, c), (3, c) }
2. f2 : R → R, where f2 = { (x, y) l y = 2x + 8 }
3. g2 : R → R, where g2 = { (x, y) l y = x3 - x }

Functions f1 and f2 are 1-1 function.

On the other hand, functions g1 and g2 are not 1-1 since they contain ordered
pairs with the same second coordinates. For instance, (2, c), (3, c) ∈ g1, and
(0, 0), (1, 0) ∈ g2.

Onto Function
A function f : A → B is an onto function, or a surjection, if and only if the range
of f is B. All elements in B are used. Keep in mind that in an onto function, all possible y-
values are used. Such functions are also referred to as surjective.

That is,

f : A → B ↔ R(f ) = B

These ideas are illustrated as follows:

Notice that:
If A, B are finite sets, then for any onto function f : A → B possibly exist, we
must have lAl ≥ lBl.

Example
Which of the following do you think is/are onto functions?
1. f1 = R → R, defined by f1 = { (x, y) l y = x3 } ________
2. g1 = R → R, defined by g1 = { (x, y) l y = x2 } ________
3. f2 : Z → Z, where f2 = { (x, y) l y = 2x + 1 } ________
4. g2 : R → R, where g2 = { (x, y) l y = 2x + 1} ________

The functions f1 and g2 are onto functions since their ranges are equal to their
codomain, i.e. R ( f1 ) = R, and R ( g2 ) = R.
On the other hand, g1 is not onto since its range doesn’t include the negative
real numbers. Also f2 is not onto since its range only consists of { (…, -5, -3, -1, 1, 3,
5, …} which is not equal to the set of integers.

One to One Correspondence


A function f from A to B is a one-to-one correspondence or a
bijective, if and only if f is both 1-1 and onto.
This is illustrated as follows:

Notice that:
If A and B are finite sets, then for any function f : A → B to be one=to-
one correspondence, we must have lAl = lBl.
Example
Which of the following do you think is/are bijection(s)?
1. Let A = { 1, 2, 3, 4 }, B = { a, b, c, d }
f = { (1, a), (2, b), (3, c), (4, d) }

2. a. g : Z → Z, defined by g2 = { (x, y) l y = x }
b. h : Z → Q, denoted by h = { (x, y) l y = x

Functions f and g are bijections since they are both 1-1 and onto.

However, h is not a bijection since h is not onto ( since R(h ) = Z (integers),


which is not Q(rational numbers) ).

Let’s do IT!
Now, let’s have an exercise on what you have learned so far.
Identify which of the following functions is 1-1 onto, and/or a 1-1
correspondence by checking (/) the corresponding box. If the function is not
the given type, write an “x” instead.

Assume that the following functions are functions defined on the set of real numbers.

1-1 function Onto function 1-1 correspondence


1. f = { (x, y) l y = x -1 }
2. g = { (x, y) l y = l x l }
3. h = { (x, y) l y = ex },
where e = 2.718…

Pigeonhole Principle

As you have learned from your previous lesson, if A and B are


nonempty finite sets and lAl > lBl, then there is no one-to-one function
from A to B. That is, if we pair off the elements of A with the elements of
B, then more than one element in A would have to be assigned to an
element in B.
The elements of A are usually thought of as pigeons, and the
elements of B as the pigeonhole. Thus, we have the following result
called the pigeonhole principle.

Intended Learning Outcome


At the end of this module, the students will be able to:
1. Prove using the pigeonhole principle.

Let’s Start!
Watch the videos using this link: https://www.youtube.com/watch?v=2-mxYrCNX60
https://www.youtube.com/watch?v=ROnetLvbl6M

Think and Reflect

Based from the video you’ve watched, answer the following questions.
1. What is pigeonhole principle? Explain with suitable examples.
_____________________________________________________
_____________________________________________________
_____________________________________________________
_____________________________________________________

2. Given m items and n containers, then m > n. Show a figure that elaborate
where is the pigeons and pigeonholes through assigning values of the
given variable m and n.
_____________________________________________________
_____________________________________________________
_____________________________________________________
_____________________________________________________

Let’s Level-up!
If k pigeons occupy n pigeonholes and k > n, then at least
one pigeonhole has two or more pigeons roosting in it. This principle can
be illustrated as follows:

k = 4 pigeons, and n = 3 pigeonholes

Remarks:
This principle tells us nothing about how to locate the pigeonhole
which contains two or more pigeons. It only tells us the existence of a
pigeonhole containing two or more pigeons.

Example
1. Show that if eight people are chosen at random at least two of
them will have been born on the same day of the week.

Solution:
Assign each person (pigeon) to the day in a week in which he/she
was born. Since there are eight people and only seven days in a week,
by the pigeonhole principle, at least two of them will have been born of
the same day of the week.

2. Show that if any five numbers from 1 to 8 are chosen, then two of
them will add to 9.
Solution:
Let us first construct four different sets, each containing two
numbers that add to 9, as follows: { 1, 8 }, { 2, 7 }, { 3, 6 }, and { 4, 5 }.
Then assign each chosen number to the set in which it belongs. Since
there are five chosen numbers (the pigeons) and only four sets (the
pigeonholes), then the pigeonhole principle tells us that two of the
chosen numbers will be assigned to the same set. And these two
numbers will always add to 9.

Let’s do IT!
1. Show that if a department contains thirteen (13) professors
then two (2) of the professors were born in the same month.

2. Let S = { 1, 2, …, 20 }
Suppose we pick 11 numbers and guaranteed that the sum of
two picked numbers is 21. Prove using PHP.

Summary

A function is a special kind of relation. Recall that a relation R from A to B is


any subset of the Cartesian Product A x B and that the domain of R, D(R) = { x l (x,
y) ∈ R for some y ∈ B}. If f is a relation from A to B, for f to be a function, the domain
of f must be equal to A, and if (x, y) and (x, z) are in f, we must have y = z.
A function is a relation from a set of inputs to a set of possible outputs where
each input is related exactly one output.
Domain, Codomain, and Range of a Function
If f : A → B is a function, A is called the domain of f , and B the codomain of f .
The subset of B consisting of those elements that appear as second coordinates in
the ordered pairs of f is called the range of f and is also denoted by f (A).
Let A = { 1, 2, 3 }, B = { a, b, c, d }, then the function f : A → B, f = { (1, a), (2,
b), (3, b) } has: domain = A = { 1, 2, 3 }; codomain = B = { a, b, c, d }; and range = f
(A) = { a, b }

A function refers to a special relation which maps each element of one set
with only one element belonging to another set. The various types of functions are as
follows: One-to- one function. Onto function, and one-to-one correspondence.
One-to-One Functions. A function f : A → B is a 1-1 function, or an injection, if
and only if for each element of B, there is at most one element in A with f (x) = y.
This is equivalent to: f : A → B ↔ [f (x) = f (y) → x = y, Ɐx, y ∈ A]. Thus, no two
distinct ordered pairs in a 1-1 function f have the same second coordinates.
Onto Function. A function f : A → B is an onto function, or a surjection, if and
only if the range of f is B. All elements in B are used. Keep in mind that in an onto
function, all possible y-values are used. Such functions are also referred to as
surjective. That is, f : A → B ↔ R(f ) = B. If A, B are finite sets, then for any onto
function f : A → B possibly exist, we must have lAl ≥ lBl.
One to One Correspondence. A function f from A to B is a one-to-one
correspondence or a bijective, if and only if f is both 1-1 and onto. If A and B are
finite sets, then for any function f : A → B to be one=to-one correspondence, we
must have lAl = lBl.
Pigeonhole Principle, if A and B are nonempty finite sets and lAl > lBl, then
there is no one-to-one function from A to B. That is, if we pair off the elements of A
with the elements of B, then more than one element in A would have to be assigned
to an element in B.
The elements of A are usually thought of as pigeons, and the elements of B
as the pigeonhole. Thus, we have the following result called the pigeonhole principle.

Assessment

Answer the following:


1. Let A = {1, 2, 3}, B = {4, 5} and let f = {(1, 4), (2, 5), (3, 5)}. Show that f is an
surjective function from A into B.

2. Let A = {1, 5, 8, 9) and B {2, 4} And f={(1, 2), (5, 4), (8, 2), (9, 4)}. Then prove f is an onto
function. So, all the element on B has a domain element on A or we can say element 1
and 8 & 5 and 9 has same range 2 & 4 respectively.
3. Is f (x) = x³  a one-to-one function where  ?
4. Is g (x) = | x - 2 | a one-to-one function where  ?

5. Prove and identify what type of function on the given below.


a. b.

References:

Grimuldi, R. (1994), Discrete and Combinatorial Mathematics, An Applied


Introduction, 3rd edition. Addison-Wesley Publishing Company, Inc.

Johnsonbaugh, R. 1993. Discrete Mathematics 3rd ed. Macmillan Publishing


Company.

Kolman, B. and R. Busby, (1987). Discrete Mathematical Structures for


Computer Science (2nd edition). Prence-Hall International

Mott, J. et. al. (1983). Discrete Mathematics for Computer Science. Reston
Publishing Company, Inc.

You might also like