Professional Documents
Culture Documents
Pecajas Module1 DS1
Pecajas Module1 DS1
DISCRETE STRUCTURES I
BiPSU MISSION
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:
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.
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
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.
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.
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
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.
LET’S START!
Go to https://www.youtube.com/watch?v=qV4htTfow-E&feature=share
https://www.youtube.com/watch?v=itrXYg41-V0
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. ___________________________________________________
Let’s Start!
https://www.youtube.com/watch?v=5XCBQGg5ZB8
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
Note: The list of keywords is your key in writing English sentences in symbolic
form. Try to memorize and understand them well.
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.
G: I am in a good mood.
Let’s Start!
https://www.youtube.com/watch?v=4SMyPnBNZGE
Semantic Rules
The semantic rules for the basic compound propositions are summarized in
the following table.
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
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
Example
The truth table for the sentence
F: [(P→ Q) ˄ ~Q] ↔ ~(P ˅ Q)
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) 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
Example
Here are some examples of simple English statements and their
representations as predicates in FOPL.
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.
Sentences
Now, let us translate some sentences in English into symbols in FOPL. First,
consider the following statements:
or in more detail
Let’s Level-up!
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.
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.
2. Ɐx P(x ≤ x) = _____________________________________
3. ⱻx P(x + x ≤ x) = __________________________________
4. Ɐx P(x + x ≤ x) = __________________________________
Let’s Level-up!
x 2
3. For some real number x, =
x +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.
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 )
F : [ P ˅ (~Q ˄ P) ] ( P ˄ ~Q ) ~ ( P ˅ ~Q )
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
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
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.
(d) R₄ = {(1, 5); (1, 6); (2, 4); (2, 6), (3, 4), (3, 5)}
References:
Mott, J. et. al. (1983). Discrete Mathematics for Computer Science. Reston Publishing
Company, Inc.
MODULE 4
FUNCTIONS
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
Let’s Level-up!
https://www.youtube.com/watch?v=aQizbVOjrJE
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) }
Let’s Start!
Watch this link: https://www.youtube.com/watch?v=bp46gL3WcyQ
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:
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 }
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
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.
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.
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.
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
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:
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 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
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 ?
References:
Mott, J. et. al. (1983). Discrete Mathematics for Computer Science. Reston
Publishing Company, Inc.