Professional Documents
Culture Documents
CPE132 Discrete Mathematics Notes V2
CPE132 Discrete Mathematics Notes V2
CPE132 Discrete Mathematics Notes V2
Cabansay, BSCpE
LICENSING
NON-COMMERCIAL
This set of modules is not for sale and is freely distributed. It is also used for educational purposes only.
LICENSING
TABLE OF CONTENTS
Licensing .............................................................................................................................................................. 1
Non-Commercial ............................................................................................................................................. 1
Licensing .......................................................................................................................................................... 1
Lesson 1: Logical Structures .............................................................................................................................. 5
What is Discrete Mathematics? ...................................................................................................................... 5
Logic and Propositions ................................................................................................................................... 5
Logical Operators ........................................................................................................................................... 6
Negation....................................................................................................................................................... 6
Conjunction.................................................................................................................................................. 6
Disjunction ................................................................................................................................................... 7
Exclusive Disjunction/Exclusive Or ............................................................................................................ 7
Implication ................................................................................................................................................... 8
Biconditional ................................................................................................................................................ 9
Precedence of Operators ................................................................................................................................... 9
Lesson 2: logical Equivalence ......................................................................................................................... 10
Types of Compound Propositions ............................................................................................................. 10
Logical Equivalence ..................................................................................................................................... 10
Lesson 3: Sets ................................................................................................................................................... 16
Sets ................................................................................................................................................................ 16
Describing a Set ........................................................................................................................................... 16
Some Other Terms ....................................................................................................................................... 16
Cardinality of Sets .................................................................................................................................... 16
Subsets ...................................................................................................................................................... 17
Power Set .................................................................................................................................................. 17
Universal Set ............................................................................................................................................. 17
Set Operations.............................................................................................................................................. 18
Union ......................................................................................................................................................... 18
Intersection ............................................................................................................................................... 18
Complement ............................................................................................................................................. 19
Difference .................................................................................................................................................. 19
Cartesian Product ..................................................................................................................................... 20
Special Sets: Number Sets .......................................................................................................................... 20
Lesson 4: Quantifiers ....................................................................................................................................... 21
Prepared by: Nathaniel M. Cabansay, BSCpE
Discrete mathematics is the part of mathematics devoted to the study of discrete objects. Discrete
here is in the sense of “distinct” or “unconnected”.
Logic is the study of reasoning, which is especially concerned whether that reasoning is correct. It
focuses more on the relationship among statements than the content of any particular statement.
A proposition or statement is a declarative sentence that is either true or false but not both.
ax2 + bx + c = y
• This is neither true nor false unless a, b,
c, x, and y are all assigned values.
Propositions come in two types:
• An atomic proposition is true or false whether or not any other propositions are true or false.
o A simple proposition has only one idea and has no logical connectives or operators
connecting.
• A compound proposition is composed of at least two simple/atomic propositions connected
using logical operators or connectives.
Prepared by: Nathaniel M. Cabansay, BSCpE
• This is considered a simple proposition as there is only one idea and no logical connectives are
there.
• This is a compound proposition as a logical connective “and” appears, but the statement can
be considered atomic as Belle being Filipina does not depend on 2+2 equaling 4. Conversely,
2+2 equaling 4 does not depend on Belle being Filipina.
• This is also a compound proposition as the “if-then” conditional structure is used. Here, Clair’s
being French depends on if she lives in Paris or not.
• This is yet again a compound proposition, as the logical connective “but” appears.
LOGICAL OPERATORS
Before anything else, let us denote the truth value of “True” by T and “False” by F.
NEGATION
Negation states the opposite truth value of a statement. This is the only unary (requires only one
operand) logical operator.
Let p be a proposition. ~p or ¬p denotes its negation. When written out in sentence form, we can say
“It is not the case that p” or simply “Not p”.
For example: We have proposition p “Today is Tuesday.” ~p would then be “It is not the case that
today is Tuesday” or simply “Today is not Tuesday”.
p ¬p or ~p
T F
F T
CONJUNCTION
Conjunction is a proposition where the two simple statements connected must both be true in order
for the entire compound statement to be true.
Prepared by: Nathaniel M. Cabansay, BSCpE
Let p and q be propositions. The conjunction is thus written: p ∧ q. When written out in sentence form,
we can say “p and q”. One alternative form is “p but q”.
For example: If we have proposition p “Hedgehogs are blue” and q “Hedgehogs can swim”, then the
proposition p ∧ q is written as “Hedgehogs are blue and can swim”.
If we are to use the “but” conjunction, we have: p ∧ ~q written as “Hedgehogs are blue but cannot
swim.”
Here, we have the truth table for conjunction given two propositions p and q:
p q p∧q
T T T
T F F
F T F
F F F
DISJUNCTION
Disjunction is a proposition where at least one of two statements connected must be true in order for
the entire compound statement to be true. This disjunction is an inclusive one, so the compound
statement is still true if both statements connected are true.
Let p and q be propositions. The disjunction is thus written p ∨ q. When written out in sentence form,
we can say “p or q”.
For example: If we have propositions p “The car is red” and q “The motorcycle is red”, we can write
out p ∨ q as “The car or the motorcycle is red.” Note that the “or” here is assumed to be an inclusive or,
so the statement is still true if both propositions are true. In this case, “The car or the motorcycle is red”
is still true if both the motorcycle and the car are red.
Here, we have the truth table for disjunction given two propositions p and q:
p q p∨q
T T T
T F T
F T T
F F F
EXCLUSIVE DISJUNCTION/EXCLUSIVE OR
Exclusive disjunction is a proposition where exactly one of the two statements connected must be
true in order for the entire compound statement to be true. Unlike regular disjunction, the compound
statement is now false if both statements connected are true.
Let p and q be propositions. The exclusive disjunction is thus written p ⊕ q. When written out in
sentence form, we can say “p or q but not both”.
For example: If we have propositions p “Eevee can evolve into Sylveon” and q “Eevee can evolve into
Umbreon”, we can write out p ⊕ q as “Eevee can evolve into either Sylveon or Umbreon but not both
at once.”
Prepared by: Nathaniel M. Cabansay, BSCpE
Here, we have the truth table for exclusive disjunction given two propositions p and q:
p q p⊕q
T T F
T F T
F T T
F F F
IMPLICATION
Implication is a proposition which is false when its conclusion or consequent q is false and its
hypothesis or antecedent p is true, and is true otherwise, as p being true should imply q being true in
order for the implication to be true.
Let p and q be propositions. An implication is thus written p → q. When written out in sentence form,
this can be any of:
For example: If we have propositions p “Mario obtains a green mushroom” and q “Mario gets one
extra life”, we can write out p → q as any of the following:
• “If Mario obtains a green mushroom, (then) he gets one extra life.”
• “Mario obtaining a green mushroom implies him getting an extra life.”
• “Mario gets one extra life if he obtains a green mushroom.”
• “Mario will obtain a green mushroom only if he gets an extra life.”
• “Mario gets an extra life whenever he obtains a green mushroom.”
“Here, we have the truth table for exclusive disjunction given two propositions p and q:
p q p→q
T T T
T F F
F T T
F F T
Now, you might be wondering why the conditional is false whenever p is true, and q is false. Going
back to the earlier example:
Prepared by: Nathaniel M. Cabansay, BSCpE
• We have the compound proposition “If Mario obtains a green mushroom, then he gets an
extra life”.
o Mario obtains a green mushroom and gets an extra life means both propositions are
true. This means that him getting a green mushroom indeed grants him an extra life.
o Mario does not obtain a green mushroom, but still gets an extra life. This is considered
true as he can obtain an extra life through other means.
o Mario does not obtain a green mushroom, and does not obtain an extra life. This is still
true.
o If Mario does obtain a green mushroom but not an extra life, this seems to defeat the
purpose of him obtaining a green mushroom, which is why that statement is false.
BICONDITIONAL
Biconditional is a proposition where both statements connected must have the same truth value for
the entire compound statement to be true.
Let p and q be propositions. A biconditional is thus written p ↔ q. When written out in sentence form,
this can be any of:
For example: If we have propositions p “You can take a train” and q “You buy a train ticket”, we can
write out p ↔ q as “You can take a train if and only if you buy a train ticket”.
Here, we have the truth table for biconditional given two propositions p and q:
p q p↔q
T T T
T F F
F T F
F F T
PRECEDENCE OF OPERATORS
Operator Precedence
Not (¬) 1
And (∧) 2
Or (∨) 3
Imply (→) 4
Biconditional (↔) 5
Prepared by: Nathaniel M. Cabansay, BSCpE
• Tautology – it is always true no matter the truth value of the individual simple propositions. It is
represented by “T” (the same symbol for True)
• Contradiction – it is always false no matter the truth value of the individual simple
propositions. It is represented by “F” (the same symbol for False)
• Contingency – neither tautology nor contradiction.
LOGICAL EQUIVALENCE
Two propositions p and q are logically equivalent if p ↔ q is a tautology. The notation p ≡ q denotes
that p and q are logically equivalent.
Here are some common logical equivalences and laws governing them. Proofs are provided on the
rightmost column of this table
Equivalence Proofs
I. Identity Laws 1. 𝑝 ∧ 𝑇 ≡ 𝑝
𝒑∧𝑻≡ 𝒑 p p∧T
T T
𝒑∨𝑭 ≡𝒑 F F
2. 𝑝 ∨ 𝐹 ≡ 𝑝
p p∨F
T T
F F
II. Domination Laws 1. 𝑝 ∨ 𝑇 ≡ 𝑇
𝒑∨𝑻≡𝑻 p p∨T
T T
𝒑∧𝑭≡𝑭 F T
2. 𝑝 ∧ 𝐹 ≡ 𝐹
p p∧F
T F
F F
III. Idempotent Laws p p∨p p∧p
T T T
𝒑∨𝒑≡𝒑 F F F
𝒑∧𝒑≡𝒑
IV. Double Negation Law p ~p ~(~p)
T F T
¬(¬𝒑) ≡ 𝒑 F T F
V. Commutative Laws 1. 𝑝 ∨ 𝑞 ≡ 𝑞 ∨ 𝑝
𝒑∨𝒒≡𝒒∨𝒑 p q p∨q q∨p
T T T T
𝒑∧𝒒≡𝒒∧𝒑 T F T T
F T T T
F F F F
Prepared by: Nathaniel M. Cabansay, BSCpE
2. 𝑝 ∧ 𝑞 ≡ 𝑞 ∧ 𝑝
p q p∧q q∧p
T T T T
T F F F
F T F F
F F F F
VI. Associative Laws 1. (𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟)
(𝒑 ∨ 𝒒) ∨ 𝒓 ≡ 𝒑 ∨ (𝒒 ∨ 𝒓) p q r p ∨ q q ∨ r (p ∨ q) ∨ r p ∨ (q ∨ r)
T T T T T T T
(𝒑 ∧ 𝒒) ∧ 𝒓 ≡ 𝒑 ∧ (𝒒 ∧ 𝒓) T T F T T T T
T F T T T T T
T F F T F T T
F T T T T T T
F T F T T T T
F F T F T T T
F F F F F F F
2. (𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟)
p q r p ∧ q q ∧ r (p ∧ q) ∧ r p ∧ (q ∧ r)
T T T T T T T
T T F T F F F
T F T F F F F
T F F F F F F
F T T F T F F
F T F F F F F
F F T F F F F
F F F F F F F
VII. Distributive Laws 1. 𝑝 ∨ (𝑞 ∧ 𝑟) ≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟)
𝒑 ∨ (𝒒 ∧ 𝒓) ≡ (𝒑 ∨ 𝒒) ∧ (𝒑 ∨ 𝒓) p q r q ∧ r p ∨ q p ∨ r p ∨ (q ∧ r) (p ∨ q) ∧ (p ∨ r)
T T T T T T T T
𝒑 ∧ (𝒒 ∨ 𝒓) ≡ (𝒑 ∧ 𝒒) ∨ (𝒑 ∧ 𝒓) T T F F T T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F T F F F
F F T F F T F F
F F F F F F F F
2. 𝑝 ∧ (𝑞 ∨ 𝑟) ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟)
p q r q ∨ r p ∧ q p ∧ r p ∧ (q ∨ r) (p ∧ q) ∨ (p ∧ r)
T T T T T T T T
T T F T T F T T
T F T T F T T T
T F F F F F F F
F T T T F F F F
F T F T F F F F
F F T T F F F F
F F F F F F F F
Prepared by: Nathaniel M. Cabansay, BSCpE
3. 𝑝 ∨ 𝑞 ≡ ¬𝑝 → 𝑞
p q ~p p∨q ~p → q
T T F T T
T F F T T
F T T T T
F F T F F
4. 𝑝 ∧ 𝑞 ≡ ¬(𝑝 → ¬𝑞)
p q ~q p ∧ q p → ~q ~ (p → ~q)
T T F T F T
T F T F T F
F T F F T F
F F T F T F
5. ¬(𝑝 → 𝑞) ≡ 𝑝 ∧ ¬𝑞
p q ~q p → q ~ (p → q) p ∧ ~q
T T F T F F
T F T F T T
F T F T F F
F F T T F F
XII. Distributive, Absorption, 1. (𝑝 → 𝑞) ∧ (𝑝 → 𝑟) ≡ 𝑝 → (𝑞 ∧ 𝑟)
and Exportation Laws of p q r p→q p→r q∧r (p → q) ∧ (p → r) p → (q ∧ r)
Conditionals T T T T T T T T
(𝒑 → 𝒒) ∧ (𝒑 → 𝒓) ≡ 𝒑 → (𝒒 ∧ 𝒓) T T F T F F F F
T F T F T F F F
(𝒑 → 𝒓) ∧ (𝒒 → 𝒓) ≡ (𝒑 ∨ 𝒒) → 𝒓 T F F F F F F F
(𝒑 → 𝒒) ∨ (𝒑 → 𝒓) ≡ 𝒑 → (𝒒 ∨ 𝒓) F T T T T T T T
(𝒑 → 𝒓) ∨ (𝒒 → 𝒓) ≡ (𝒑 ∧ 𝒒) → 𝒓 F T F T T F T T
F F T T T F T T
𝒑 → 𝒒 ≡ 𝒑 → (𝒑 ∧ 𝒒) F F F T T F T T
(𝒑 ∧ 𝒒) → 𝒓 ≡ 𝒑 → (𝒒 → 𝒓)
2. (𝑝 → 𝑟) ∧ (𝑞 → 𝑟) ≡ (𝑝 ∨ 𝑞) → 𝑟
p q r p→r q→r p∨q (p → r) ∧ (q → r) (p ∨ q) → r
T T T T T T T T
T T F F F T F F
T F T T T T T T
T F F F T T F F
F T T T T T T T
F T F T F T F F
F F T T T F T T
F F F T T F T T
3. (𝑝 → 𝑞) ∨ (𝑝 → 𝑟) ≡ 𝑝 → (𝑞 ∨ 𝑟)
p q r p→q p→r q∨r (p → q) ∨ (p → r) p → (q ∨ r)
T T T T T T T T
T T F T F T T T
T F T F T T T T
T F F F F F F F
F T T T T T T T
F T F T T T T T
F F T T T T T T
F F F T T F T T
Prepared by: Nathaniel M. Cabansay, BSCpE
4. (𝑝 → 𝑟) ∨ (𝑞 → 𝑟) ≡ (𝑝 ∧ 𝑞) → 𝑟
p q r p→r q→r p∧q (p → r) ∨ (q → r) (p ∧ q) → r
T T T T T T T T
T T F F F T F F
T F T T T F T T
T F F F T F T T
F T T T T F T T
F T F T F F T T
F F T T T F T T
F F F T T F T T
5. 𝑝 → 𝑞 ≡ 𝑝 → (𝑝 ∧ 𝑞)
p q p∧q p→q p → (p ∧ q)
T T T T T
T F F F F
F T F T T
F F F T T
6. (𝑝 ∧ 𝑞) → 𝑟 ≡ 𝑝 → (𝑞 → 𝑟)
p q r q→r p∧q (p ∧ q) → r p → (q → r)
T T T T T T T
T T F F T F F
T F T T F T T
T F F T F T T
F T T T F T T
F T F F F T T
F F T T F T T
F F F T F T T
XIII. Identity and Dominance 1. 𝑇 → 𝑝 ≡ 𝑝
Laws Involving Conditionals p T→p
𝑻→𝒑≡𝒑 T T
F F
𝑭→𝒑≡𝑻
2. 𝐹 → 𝑝 ≡ 𝑇
𝒑→𝑻≡𝑻
p F→p
𝒑 → 𝑭 ≡ ¬𝒑 T T
𝒑 → ¬𝒑 ≡ ¬𝒑 F T
¬𝒑 → 𝒑 ≡ 𝒑 3. 𝑝 → 𝑇 ≡ 𝑇
p p→T
T T
F T
4. 𝑝 → 𝐹 ≡ ¬𝑝
p ~p p→F
T F F
F T T
5. 𝑝 → ¬𝑝 ≡ ¬𝑝
p ~p p → ~p
T F F
F T T
Prepared by: Nathaniel M. Cabansay, BSCpE
6. ¬𝑝 → 𝑝 ≡ 𝑝
p ~p ~p → p
T F T
F T F
XIV. Logical Equivalences 1. 𝑝 ↔ 𝑞 ≡ (𝑝 → 𝑞) ∧ (𝑞 → 𝑝)
Involving Biconditionals p q p→q q→p p↔q (p → q) ∧ (q → p)
𝒑 ↔ 𝒒 ≡ (𝒑 → 𝒒) ∧ (𝒒 → 𝒑) T T T T T T
T F F T F F
𝒑↔𝒒≡𝒒↔𝒑 F T T F F F
𝒑 ↔ 𝒒 ≡ ¬𝒑 ↔ ¬𝒒 F F T T T T
𝒑 ↔ 𝒒 ≡ (𝒑 ∧ 𝒒) ∨ (¬𝒑 ∧ ¬𝒒) 2. 𝑝 ↔ 𝑞 ≡ 𝑞 ↔ 𝑝
¬(𝒑 ↔ 𝒒) ≡ 𝒑 ↔ ¬𝒒 ≡ ¬𝒑 ↔ 𝒒 p q p↔q q↔p
T T T T
𝒑 ⊕ 𝒒 ≡ ¬(𝒑 ↔ 𝒒)
T F F F
F T F F
F F T T
3. 𝑝 ↔ 𝑞 ≡ ¬𝑝 ↔ ¬𝑞
p q ~p ~q p↔q ~p ↔ ~q
T T F F T T
T F F T F F
F T T F F F
F F T T T T
4. 𝑝 ↔ 𝑞 ≡ (𝑝 ∧ 𝑞) ∨ (¬𝑝 ∧ ¬𝑞)
p q ~p ~q p∧q ~p ∧ ~q p↔q (p ∧ q) ∨ (~p ∧ ~q)
T T F F T F T T
T F F T F F F F
F T T F F F F F
F F T T F T T T
5. ¬(𝑝 ↔ 𝑞) ≡ 𝑝 ↔ ¬𝑞 ≡ ¬𝑝 ↔ 𝑞
p q ~p ~q p↔q ~ (p ↔ q) p ↔ ~q ~p ↔ q
T T F F T F F F
T F F T F T T T
F T T F F T T T
F F T T T F F F
6. 𝑝 ⊕ 𝑞 ≡ ¬(𝑝 ↔ 𝑞)
p q p↔q ~ (p ↔ q) p⊕q
T T T F F
T F F T T
F T F T T
F F T F F
Prepared by: Nathaniel M. Cabansay, BSCpE
LESSON 3: SETS
SETS
Sets are well-defined collections of objects. Objects in sets are called elements. The elements in a set
are enclosed by a pair of braces {} and separated by commas.
Uppercase letters like A, B, C, … are used to denote sets. Lowercase letters such as m, n, x, y, …
denote a set’s elements.
The symbol ∈ denotes membership to a set and is read “is an element of”, “belongs to” or “is in”.
Similarly, the symbol ∉ is read as “is not an element of”, “does not belong to”, or “is not in”.
For example: If we have set A = {3, 6, 9, 12, 15, 18, 21, …, 60}, the statement “3 ∈ A” is read as “3 is an
element of set A” or “3 is in set A”, while “7 ∉ A” is read as “7 is not an element of set A”.
DESCRIBING A SET
CARDINALITY OF SETS
The cardinality of a set A, denoted n(A) is the number of elements in that set A.
A set is finite (read /faɪ-naɪt/) if we can count the number of elements in the set.
For example: We have set A= {3, 6, 9, 12, 15, …, 60}, B = {4, 8, 12, 16, …, 60}, C = {5, 10, 15, 20, …, 60},
and X= {0, 1, 2, 3, 4, …}.
This means: n(A) = 20 since there are 20 multiples of 3 from 1 to 60, n(B) = 15 since there are 15
multiples of 4 from 1 to 60, and n(C) = 12 since there are 12 multiples of 5 from 1 to 60. Sets A, B, and
C are therefore finite sets. The cardinality of set X, n(X) = ∞, so set X is an infinite set.
The null set or empty set ∅ contains no elements. Its cardinality is therefore 0.
The singleton set contains just one element. Its cardinality is therefore 1.
Equal sets contain the same elements (no matter the repetition or order).
Prepared by: Nathaniel M. Cabansay, BSCpE
SUBSETS
A set A is a subset of another set B if and only if all elements of A are elements of B. It is denoted as
𝐴 ⊆ 𝐵. We can read that as “A is a subset of B” or “A is contained in B”. Equivalently, set B is a superset
of set A, denoted 𝐵 ⊇ 𝐴. We can read this as “B is a superset of A” or “B contains A”
Laws of subsets
• All sets are subsets of themselves. That is, 𝐴 ⊆ 𝐴 for any set A.
• The null set is a subset of any set, so for any set A, ∅ ⊆ 𝐴.
We can then say 𝐵 ⊆ 𝐷, as all elements in set B are found in set D. We can say that 𝐶 ⊈ 𝐴, since there
are elements in C that are not in set A.
A set A is a proper subset of another set B, denoted 𝐴 ⊂ 𝐵, if A is a subset of B and there is at least
one element in B not in A.
Example: Given set M = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and N = {5, 10}. We can say that 𝑁 ⊂ 𝑀.
Equivalently, since M is a superset of N, 𝑀 ⊃ 𝑁.
POWER SET
The power set of a set A, ℘(𝐴), is the set of all subsets of that set A. If a set has n elements, its power
set has 2n elements.
For example: We have set Q = {69, 143, 420}. This set has 3 elements, so the power set has 2 3 = 8
elements. This means ℘(𝑄) = {∅, {69}, {143}, {420}, {69, 143}, {69, 420}, {143, 420}, {69, 143, 420}}. Note
that the empty set and the set itself are members of the power set.
We can note a pattern with the power set. For a set with n elements, the number of subsets with k
𝑛!
elements is equal to 𝑛 𝐶𝑘 = . In the example above, we have a set of 3 elements, so we have 8
𝑘!(𝑛−𝑘)!
subsets distributed as follows:
Notice how these numbers correspond to row n of the Pascal’s triangle, where row 0 is the starting row
consisting of just a single 1. The power set of the empty set contains just 1 element: the empty set
itself, so ℘(∅) = {∅}, 𝑛({∅}) = 1.
UNIVERSAL SET
The set containing all elements for any particular discussion is the universal set, denoted as U.
Prepared by: Nathaniel M. Cabansay, BSCpE
SET OPERATIONS
For example: 𝐵 ∪ 𝐶 = {4, 5, 8, 10, 12, 15, 16, 20, 24, 25, 28, 30, 32, 35, 36, 40, 44, 45, 48, 50, 52, 55, 56, 60}
1. The union of any set with the null set is the set itself.
𝐶 ∪ ∅ = 𝐶 = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}
2. The union of any set with itself is the set itself.
𝐶 ∪ 𝐶 = 𝐶 = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}
3. Set union is commutative.
𝐵 ∪ 𝐶 = 𝐶 ∪ 𝐵
= {4, 5, 8, 10, 12, 15, 16, 20, 24, 25, 28, 30, 32, 35, 36, 40, 44, 45, 48, 50, 52, 55, 56, 60}
4. Set union is associative.
𝐴 ∪ (𝐵 ∪ 𝐶) = (𝐴 ∪ 𝐵) ∪ 𝐶 = {3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32,
33, 35, 36, 39, 40, 42, 44, 45, 48, 50, 51, 52, 54, 55, 56, 57, 60}
5. Any set is a subset of its union with another set.
𝐶 ⊆ (𝐵 ∪ 𝐶), as 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, and 60 are all elements of 𝐵 ∪ 𝐶.
INTERSECTION
The intersection of two sets A and B is the set of elements contained in both A and B. It is denoted by
𝐴 ∩ 𝐵 and can be defined by: 𝐴 ∩ 𝐵 = {𝑥| 𝑥 ∈ 𝐴 ∧ 𝑥 ∈ 𝐵}. This is commutative, so switching around
the sets will give the same results.
For example: 𝐴 ∩ 𝐵 = {12, 24, 36, 48, 60}
Two sets are disjoint if the two sets have nothing in common, meaning their intersection has no
elements. For example: M = {magenta, cyan, yellow}, N = {black, white}, M and N are disjoint sets, as
𝑀 ∩ 𝑁 = {}.
1. The intersection of any set with the null set is the null set.
𝐶 ∩ ∅ = ∅ = {}
2. The intersection of any set with itself is the set itself.
𝐶 ∩ 𝐶 = 𝐶 = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}
3. Set intersection is commutative.
𝐵 ∩ 𝐶 = 𝐶 ∩ 𝐵 = {20, 40, 60}
4. Set intersection is associative.
Prepared by: Nathaniel M. Cabansay, BSCpE
𝐴 ∩ (𝐵 ∩ 𝐶) = (𝐴 ∩ 𝐵) ∩ 𝐶 = {60}
5. The intersection of any given set with another set is a subset of the given set.
(𝐵 ∩ 𝐶) ⊆ 𝐶, as 20, 40, and 60 are all elements of 𝐶.
6. Distributive laws of union and intersection.
𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶) = {3, 6, 9, 12, 15, 18, 20, 21, 24, 27, 30, 33, 36, 39, 40, 42,
45, 48, 51, 54, 57, 60}
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶) = {12, 15, 24, 30, 36, 45, 48, 60}
7. The cardinality of the union of two sets P and Q is 𝑛(𝑃 ∪ 𝑄) = 𝑛(𝑃) + 𝑛(𝑄) – 𝑛(𝑃 ∩ 𝑄)
𝑛(𝐵 ∪ 𝐶) = 𝑛(𝐵) + 𝑛(𝐶) – 𝑛(𝐵 ∩ 𝐶) = 15 + 12 – 3 = 24.
COMPLEMENT
The complement of the set A, denoted by A’ is the set of all elements in the universal set but NOT in
set A. 𝐴’ = {𝑥 | 𝑥 ∉ 𝐴}
For example: A’ = {1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37,
38, 40, 41, 43, 44, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59}
DIFFERENCE
The difference of two sets A and B is the set containing all elements in set A but not in set B. This is
also called the complement of B with respect to A. This is not commutative and switching the sets
around will not give you the same results. 𝐴 – 𝐵 = {𝑥 | 𝑥 ∈ 𝐴 ∧ 𝑥 ∉ 𝐵}, similarly, 𝐵 – 𝐴 = {𝑥 | 𝑥 ∈
𝐵 ∧ 𝑥 ∉ 𝐴}.
For example: A – B = {3, 6, 9, 15, 18, 21, 27, 30, 33, 39, 42, 45, 51, 54, 57}; while B – A = {4, 8, 16, 20,
28, 32, 40, 44, 52, 56}. Similarly, A – C = {3, 6, 9, 12, 18, 21, 24, 27, 33, 36, 39, 42, 48, 51, 54, 57}, while
C – A = {5, 10, 20, 25, 35, 40, 50, 55}.
1. The removal of the null set from any set has no effect on the set.
𝐶 − ∅ = 𝐶 = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}
2. The removal of the elements of any set from the set itself will leave the empty set.
𝐶 – 𝐶 = ∅ = {}
3. No elements can be removed from an empty set.
∅ − 𝐶 = ∅ = {}
4. Set subtraction is not commutative.
B – C ≠ C – B. B – C = {4, 8, 12, 16, 24, 28, 32, 36, 44, 48, 52, 56}, C – B = {5, 10, 15, 25, 30, 35,
45, 50, 55}
5. The result of removing the elements of a set from any given set is a subset of the given set.
(𝐶 – 𝐴) ⊆ 𝐶 = {5, 10, 20, 25, 35, 40, 50, 55} is a subset of C
6. Distributive laws of set difference
𝐴 – (𝐵 ∩ 𝐶) = (𝐴 – 𝐵) ∪ (𝐴 – 𝐶) = {3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 51, 54,
57}
𝐴 – (𝐵 ∪ 𝐶) = (𝐴 – 𝐵) ∩ (𝐴 – 𝐶) = {3, 6, 9, 18, 21, 27, 33, 39, 42, 51, 54, 57}
7. Properties of set cardinality
𝑛(𝐴 ∩ 𝐵) = 𝑛(𝐴) – 𝑛(𝐴 – 𝐵) = 20 – 15 = 5
𝑛(𝐴 – 𝐵) = 𝑛(𝐴) – 𝑛 (𝐴 ∩ 𝐵) = 20 – 5 = 15
Prepared by: Nathaniel M. Cabansay, BSCpE
CARTESIAN PRODUCT
The Cartesian product of n sets, denoted A1 × A2 × … × An, is the set of ordered n-tuples (ordered
pairs when multiplying two sets, ordered triples when multiplying three sets, and so on), obtained by
matching up each element of one set with every element of the next set. This is also not commutative,
so switching the operands around will not get you the same results.
For example: A × C = {(3, 5), (3, 10), (3, 15), (3, 20), (3, 25), (3, 20), …, (3, 60), (6, 5), (6, 10), …, (6, 60),
…, (60, 55), (60, 60)}; while C × A = {(5, 3), (5, 6), (5, 9), …, (5, 60), (10, 3), (10, 6), …, (10, 60), …, (60,
57), (60, 60)}
Useful properties involving Cartesian products are:
1. Cartesian multiplication is not commutative
A × C ≠ C × A (as seen earlier)
2. The cardinality of the Cartesian product is the product of each individual set’s cardinalities.
Specifically, for sets P1, P2, P3, …, Pn, n(P1 × P2 × P3 × … × Pn) = n(P1) × n(P2) × n(P3) × … × n(Pn).
n(A × C) = n(A) × n(C) = 20 × 12 = 480.
3. Multiplication of cardinalities is commutative. Specifically, for two sets P and Q, n(P × Q) = n(Q
× P)
n(A × C) = n(C × A), n(A) × n(C) = n(C) × n(A), 20 × 12 = 12 × 20, 480 = 480.
LESSON 4: QUANTIFIERS
The logic detailed in Lessons 1 and 2 is not enough to deal with most statements in math and
computer science (and computer engineering for that matter). For example:
𝑝: 𝑥 is an even integer.
Recall that propositions are declarative statements that can either be true or false. The statement 𝑝 by
itself is not a proposition, as its truth value depends on the value of 𝑥. 𝑝 is true if, for example, n = 38,
but false if, for example, n = 69.
Most statements in mathematics and computer science (and computer engineering) use variables, so
we must extend the logic system to include such statements.
Let 𝑃(𝑥) be a statement involving the variable 𝑥 and 𝐷 be a set. We call 𝑷 a propositional function or
predicate with respect to 𝐷, if for each 𝑥 ∈ 𝐷, 𝑃(𝑥) is a proposition. 𝑫 is then the domain of discourse
of 𝑃. Now, let’s get back to that previous statement, now written as a propositional function:
𝑃(𝑥) by itself is neither true nor false, but if we substituted 𝑥 with any integer (or any element in its
domain of discourse), such as -2, 0, 400, we would get a proposition that could either be true or false.
For example:
When we substituted x with 420, we got a proposition. 420 is indeed an even integer, so the
proposition is true.
When we substituted x with 143, we still got a proposition. 143, however, is an odd integer, so the
proposition is false. 𝑃 is also called a predicate.
QUANTIFIERS
Quantifiers specify how many elements in the domain of discourse must make a propositional
function produce a true proposition.
The two most common quantifiers are ∀ (the universal quantifier) and ∃ (the existential quantifier).
UNIVERSAL QUANTIFIER
A universally quantified statement is a statement “for every x, P(x)” or “for all x, P(x)” for a given
propositional function P and its domain of discourse D.
We can also specify the domain of discourse in the statement, like “for all x in D, P(x)”.
Prepared by: Nathaniel M. Cabansay, BSCpE
The statement may be written ∀𝑥 𝑃(𝑥). The symbol ∀ is called the universal quantifier and is read as
“for every”, “for each”, “for any”, or “for all”.
A universally quantified statement is only true if 𝑃(𝑥) is true for every 𝑥 in 𝐷. It becomes false if there is
at least one 𝑥 in 𝐷 that makes the statement false. Any value that makes 𝑃(𝑥) false is called a
counterexample.
EXISTENTIAL QUANTIFIER
An existentially quantified statement is a statement “for some x, P(x)” or “there exists x, P(x)” for a
given propositional function P and its domain of discourse D.
We can also specify the domain of discourse in the statement, like “there exists x in D, P(x)”.
The statement may be written ∃𝑥 𝑃(𝑥). The symbol ∃ is called the existential quantifier and is read as
“for some”, “for at least one”, or “there exists”.
An existentially quantified statement is true if there is at least one 𝑥 in 𝐷 that makes the statement true.
It becomes false only if 𝑃(𝑥) is false for every 𝑥 in 𝐷.
BINDING VARIABLES
The variable 𝑥 in 𝑃(𝑥) is a free variable as it can take any value in the domain of discourse. Given a
quantified statement ∀𝑥 𝑃(𝑥) or ∃𝑥 𝑃(𝑥), the variable 𝑥 is a bound variable as 𝑥 is bound to ∀ or ∃.
𝑃(𝑥) is an unquantified statement, so this is not a proposition. ∀𝑥 𝑃(𝑥) and ∃𝑥 𝑃(𝑥) are quantified
statements, so they are propositions. The quantifiers ∀ and ∃ assign truth values to propositional
functions. The scope of a quantifier is the part of a logical expression where the quantifier is applied.
Example: In the statement ∃𝑥 𝑃(𝑥, 𝑦), 𝑥 is bound by the existential quantification ∃𝑥, but 𝑦 is free
because it is not bound by a quantifier and no value is assigned to it.
SUMMARY
STATEMENT WHEN IS IT TRUE? WHEN IS IT FALSE?
∀𝒙 𝑷(𝒙) P(x) is true for all x There is an x for which P(x) is
false
∃𝒙 𝑷(𝒙) There is an x for which P(x) is P(x) is false for all x
true
NEGATING QUANTIFIERS
“It is not the case that all x satisfies P(x)” is equivalent to “There is an x that does not satisfy P(x).”
Proof:
“It is not the case that there is an x that satisfies P(x) “is equivalent to “All x does not satisfy P(x).”
Proof:
∀𝑥(𝑃(𝑥) → 𝑄(𝑥))
This is read “All x satisfying P(x) also satisfy Q(x).” or “All P is/are Q”. Here, the x in P(x) is bound by the
universal quantifier, but the x in Q(x) is not, so we use the conditional. It is much like “All x satisfying
P(x) implies all x satisfies Q(x).”
Example 1: “If x is a real number, its square is non-negative.” This means that for every real number x,
its square is non-negative. Since we see the “for every” here, we use the universal quantifier. This then
means we can rewrite to “All real numbers have non-negative squares.” For all real numbers, we do
see that their squares are non-negative, so this statement is true.
Example 2: “If x is a student, then s/he has taken an English class.” This means that for every student x,
x has taken an English class. Again, since there is a “for every”, we use the universal quantifier. This
Prepared by: Nathaniel M. Cabansay, BSCpE
then means we can rewrite to “All students have taken an English class.” However, there may be a
student that has not taken an English class, so this statement can still prove false.
Example 3: “If x is a hedgehog, then it is spiny.” This means that for all hedgehogs, we should see
spines on that hedgehog. We use the universal quantifier in that case. This then means we can rewrite
to “All hedgehogs are spiny.”
In categorical logic, the form ∀𝑥(𝑆(𝑥) → 𝑃(𝑥)) is read as “All S is/are P” and is called the universal
affirmative, symbolized as A from Latin “affirmo”.
∃𝑥 (𝑃(𝑥) ∧ 𝑄(𝑥))
This is read “Some x satisfying P(x) also satisfies Q(x)” or “Some P are Q”. We cannot use a conditional
here, since if P(x) is not satisfied, the entire statement would still be satisfied, even though the whole
statement should be false.
Example 1: “Some hedgehogs are sea urchins”. If we have a certain x that is a particular sea urchin,
P(x) “x is a hedgehog” would be false, but Q(x) “x is a sea urchin” would be true. 𝐹 → 𝑇 evaluates to
true, even though the statement “Some hedgehogs are sea urchins” is false, as you wouldn’t find a
hedgehog that is a sea urchin (even if they’re both spiny animals). If we use a conjunction, 𝐹 ∧ 𝑇
evaluates to false, which is consistent with the falseness of “Some hedgehogs are sea urchins”.
Example 2: “A certain video game character is yellow and releases electric sparks.” If we have x be an
element of the domain of discourse “video game characters”, P(x) is taken to be “x is yellow” and Q(x)
is taken to be “x releases electric sparks”. To make this statement true, there must be a certain video
game character that satisfies this. If you have played Pokémon before, you’ll come to realize that at
least one such character: Pikachu, for example, Jolteon (an evolution of Eevee), for another, is yellow
and releases electric sparks. Seeing the “at least one” implies the use of an existential quantifier.
Example 3: “At least one musical instrument can play chords and has six strings.” If we have x be an
element of the domain of discourse “musical instrument”, P(x) is taken to be “x can play chords” and
Q(x) is “x has six strings”. At least one musical instrument fits both P(x) and Q(x): the acoustic guitar. In
fact, more than one instrument fits: the classical guitar fits as well.
In categorical logic, the form ∃𝑥(𝑆(𝑥) ∧ 𝑃(𝑥)) is read as “Some S is/are P” and is called the particular
affirmative, symbolized I from the Latin “affirmo”.
Statement 4 can be read as “All x satisfying P(x) does not satisfy Q(x)”, while statement 1 can be read
“There is not at least one x satisfying P(x) that satisfies Q(x)”. Both of these can simplify to “No P is/are
Q”. 𝑝 → ¬𝑞 always has the opposite truth value of 𝑝 → 𝑞, so the logic still follows.
Example 1: “If x is a lemon, then it is not a red object.” If we have x be an element in the set of
“objects”, P(x) is “x is a lemon” and Q(x) is “x is a red object”, this means ¬Q(x) is “x is not a red object”.
This then means that for every lemon x, none of them are red objects (Have you ever seen a red
lemon?). This means we can rewrite this statement to “No lemons are red objects.” Since we have not
seen a red lemon so far, this statement holds true.
Example 2: “There are no animals that are bears and can fly.” If we have x be an element in the set of
“animals”, P(x) is “x is a bear” and Q(x) is “x can fly”, this means ¬Q(x) is “x cannot fly”. There is indeed
no animal that is a bear and can fly. This means we rewrite the statement to “No bears can fly” and the
statement holds true.
Example 3: “There is no positive integer that is one more than a square and one less than a cube”. If
we have x be an element in the set of positive integers, P(x) is “x is one more than a square” and Q(x) is
“x is one less than a cube”. We can then rewrite the statement to “No number one more than a square
is one less than a cube”. The positive integer 26 is one more than a square (in this case, 25 = 52) and
one less than a cube (in this case, 27 = 33), so this statement is false.
In categorical logic, the forms ∀𝑥(𝑆(𝑥) → ¬𝑃(𝑥)) and ¬∃𝑥(𝑆(𝑥) ∧ 𝑃(𝑥)) are both read as “No S is/are
P” and is called the universal negative, symbolized E from the Latin “nego”.
Example 1: “There exists a pen that does not write in black.” We can rewrite and negate this to “If x is a
pen, it writes in black.” For every pen x, there is at least one pen that does not write in black. It could,
for all you know, write in blue, red, green, or any other color. This statement can then be rewritten to
“Not all pens write in black” or “Some pens do not write in black”
Example 2: “There exists a member of MNL48 who is not from Luzon.” We can rewrite and negate this
to “If x is an MNL48 member, then she is from Luzon.” We can then rewrite the statement to “Not all
MNL48 members are from Luzon” or “Some MNL48 members are not from Luzon”. There is at least
one member of MNL48 who is not from Luzon. At least one is from Iloilo, which is in Visayas; and
several are from Davao, which is in Mindanao.
Prepared by: Nathaniel M. Cabansay, BSCpE
Example 3: “There exists a real number whose square is negative.” We can rewrite and negate this to
“If x is a real number, then its square is non-negative”. We can then rewrite the statement to “Not all
real numbers have non-negative squares” or “Some real numbers do not have non-negative squares.”
All real numbers have non-negative squares, so this statement is false.
In categorical logic, the forms ¬∀𝑥(𝑆(𝑥) → 𝑃(𝑥)) and ∃𝑥(𝑆(𝑥) ∧ ¬𝑃(𝑥)) are both read as “Some S is/are
not P.” and is called the particular negative, symbolized O from the Latin “nego”.
Prepared by: Nathaniel M. Cabansay, BSCpE
INTRODUCTION
Methods of proof show certain statements are true and certain logic follows. These methods are used
in computer science and mathematics
DEFINING TERMS
Theorem – can be shown to be true. These can also be called propositions, facts, or results.
Proof – sequence of statements forming an argument to establish.
Axioms/Postulates – underlying assumptions about mathematical structures. Includes hypotheses of
theorem to be proved and previously proven theorems.
Definition – used to create new concepts in terms of existing ones.
Rules of Inference – can draw conclusions from other assertions and tie together the steps of the
proof.
Lemma (pl. lemmas or lemmata) – simple theorem used to prove other theorems.
Corollary – follows easily from another theorem.
Fallacy – incorrect reasoning
Conjecture – statement with no known truth value. If a proof for one is found, it becomes a theorem.
The process of drawing a conclusion from a sequence of propositions is called deductive reasoning.
An argument is a set of propositions whose conclusion is claimed to follow from the premises which
support that conclusion (Dimasuay et al., 2016). It is considered valid if the conclusion is true whenever
its hypotheses are true.
A formal proof of validity is a sequence of statements, which are either premises or statements
following from previous ones by elementary valid arguments, and its last statement is the conclusion of
the argument whose validity is being proved.
Rules of inference explain the steps used to show that the conclusion follows logically from a set of
hypotheses, rendering an argument valid. These rules of inference are:
∴𝑞
∴ ¬𝑝
Prepared by: Nathaniel M. Cabansay, BSCpE
∴𝑝→𝑟
4. Disjunctive Syllogism (abbreviated D.S.)
𝑝∨𝑞 𝑝∨𝑞
¬𝑝 ¬𝑞
OR
∴𝑞 ∴𝑝
5. Constructive Dilemma (abbreviated C.D.)
(𝑝 → 𝑞) ∧ (𝑟 → 𝑠)
𝑝∨𝑟
∴𝑞∨𝑠
6. Destructive Dilemma (abbreviated D.D.)
(𝑝 → 𝑞) ∧ (𝑟 → 𝑠)
¬𝑞 ∨ ¬𝑠
∴ ¬𝑝 ∨ ¬𝑟
7. Simplification (abbreviated Simp.)
𝑝∧𝑞 𝑝∧𝑞
OR
∴𝑝 ∴𝑞
8. Conjunction (abbreviated Conj.)
𝑝
𝑞
∴𝑝∧𝑞
9. Addition (abbreviated Add.)
𝑝
∴𝑝∨𝑞
10. Resolution (abbreviated Res.)
𝑝∨𝑞
¬𝑝 ∨ 𝑟
∴𝑞∨𝑟
11. Absorption (abbreviated Abs.)
𝑝→𝑞
∴ 𝑝 → (𝑝 ∧ 𝑞)
Rules of replacement allow certain logically equivalent expressions to replace each other when they
occur.
1. Universal instantiation – used to conclude that 𝑃(𝑐) is true, where 𝑐 ∈ domain of discourse,
given ∀𝑥, 𝑃(𝑥)
∀𝑥, 𝑃(𝑥)
∴ 𝑃(𝑐)
2. Universal generalization – used to conclude that ∀𝑥, 𝑃(𝑥) is true given the premise that 𝑃(𝑐) is
true for all 𝑐 ∈ domain of discourse.
𝑃(𝑐) for an arbitrary 𝑐
∴ ∀𝑥, 𝑃(𝑥)
3. Existential instantiation – used to conclude that there is at least one 𝑐 ∈ domain of discourse
that makes 𝑃(𝑐) true if we know ∃𝑥, 𝑃(𝑥) is true.
∃𝑥, 𝑃(𝑥)
∴ ∃𝑥, 𝑃(𝑥)
Prepared by: Nathaniel M. Cabansay, BSCpE
CATEGORICAL SYLLOGISMS
Syllogisms are deductive arguments with two premises and one conclusion. Categorical syllogisms
consist of three categorical statements, where two are premises, and one is the conclusion.
Major premise
Minor premise
Conclusion.
The major premise contains the major term. The minor premise contains the minor term.
A categorical syllogism also contains three terms: the major term, the minor term, and the middle
term. The major term appears in the major premise and is the predicate in the conclusion, the minor
Prepared by: Nathaniel M. Cabansay, BSCpE
term appears in the minor premise and is the subject of the conclusion, and the middle term appears
with the same meaning in both premises and does not appear in the conclusion.
For example:
The major premise is “All men are mortal”. The minor premise is “Socrates is a man”. Since the term
“man” appears in both premises and with the same meaning, this is the middle term. The term “mortal”
appears in the major premise, so this is the major term, and is thus the predicate of the conclusion. The
term “Socrates” appears in the minor premise, so this is the minor term, and is thus the subject of the
conclusion.
A term can either be distributed or undistributed depending on the type of categorical proposition. A
term is distributed if all members of the term’s set are affected by the proposition (some sources call
this universal), and undistributed if only some of the members of the term’s set are affected.
The subject (first term) of a statement is distributed/universal if the statement is a universal statement
(A/E), and undistributed/particular if the statement is a particular statement (I/O). The predicate
(second term) of a statement is universal if the statement is a negative statement (E/O), and is particular
if the statement is an affirmative statement (A/I).
The term “men” is distributed here because all men are indeed mortal. The term “mortal” however is
undistributed, as you cannot say that men are the only mortal beings that exist. There are other mortal
beings that exist, such as hedgehogs, echidnas, cats, dogs, rabbits, mice, and basically any other living
being.
The term “apple”, or more specifically “not apple” applies to all members the set of oranges, so the
term “apple” is distributed. If we say: “No apples are oranges”, we could also say that “No oranges are
apples”, so the term “orange” is also distributed here. Both terms are thus distributed.
The term “men” applies only to some members of people who are wealthy, as there are women and
even non-binary people who are wealthy, thus the term “men” is undistributed. Likewise, the term
Prepared by: Nathaniel M. Cabansay, BSCpE
“wealthy” is undistributed here because the set of wealthy people only includes some members of the
set of men, not all of them. Both terms are thus undistributed.
The term “students” is undistributed here. It becomes clearer if we rewrite the proposition to “Not all
students are CpE majors”, since the rule of being a CpE major does not define all students, but only
some of them. The term “CpE majors”, however, is distributed since the set of students who are not
CpE majors would be removed. This leaves the set of students who are CpE majors, and all members
of that set are affected by the term.
RULES OF SYLLOGISM
1. There should only be three terms in the syllogism: the major, minor, and middle terms.
The meaning in the middle term should be the same in both premises.
Fallacy: Fallacy of Four Terms and Fallacy of Equivocation – instead of the syllogism having
three terms, it has four. This can also be because the middle term changes meanings between
premises.
The term “star” has different meanings between the two premises, so there are technically four
terms in this syllogism.
2. The major and minor terms should only be distributed in the conclusion if they are
distributed in the premises.
Fallacies: Fallacy of Illicit Major and Fallacy of Illicit Minor – the major and/or minor term(s)
is/are distributed or universal in the conclusion, but not in the major and/or minor premise(s),
respectively.
The major term here is “Japanese food”. It is distributed in the conclusion, but not in the major
premise. If you say that “No ramen is Japanese food”, you could also say that “No Japanese
food is ramen”, so the term “Japanese food” is distributed here in the conclusion. However, if
you say that “All sushi is Japanese food”, you cannot say that “All Japanese food is sushi”, so
the term “Japanese food” is undistributed in the major premise.
The minor term here is “loners”. It is distributed in the conclusion, but not in the minor premise.
If you say that “All loners are intelligent”, the term intelligent describes all loners, so the term
“loners” is distributed here in the conclusion. However, if you say that “All computer
programmers are loners”, you cannot say that “All loners are computer programmers”, so the
term “loners” is undistributed in the minor premise.
The middle term here is “Australian”. In the statement “Some Australians do not live in New
South Wales”, the condition of living in New South Wales does not apply to all Australians, and
neither does the term Australian apply to all those not living in New South Wales, so the term
“Australian” is undistributed in the major premise. In the statement “Katie is an Australian”, the
term Australian does not always refer to Katie, so the term “Australian” is also undistributed in
the minor premise.
Lars may indeed not enjoy Baltic herring, but the argument does not logically support that. If
we compared it to sets and subsets, we have a set of people who enjoy Baltic herring and a set
of people who are Swedish. At least some part of the set of Swedish intersects with the set of
people who enjoy Baltic herring. The set containing Lars as its only element is a subset of the
set of people who are Swedish. We cannot conclude if Lars is part of the set of people who
enjoy Baltic herring or not, so this argument is invalid.
5. If one premise is affirmative and the other negative, then the conclusion must be
negative.
Fallacy: Affirmative Conclusion from a Negative Premise or Illicit Negative – the conclusion
is affirmative, but one of its premises is negative.
Prepared by: Nathaniel M. Cabansay, BSCpE
The conclusion is obviously counterfactual. If you’ve played Pokémon before, you do know that
Raichu never evolve from any Eevee. The premises are true, though, since Eevee never evolves
into a Pikachu, and if a Pikachu evolves, it always evolves into a Raichu.
Yes, sliced bread may indeed be spread with peanut butter, but it does not follow logically
from the premises. There is no way to logically deduce that sliced bread has peanut butter
from the fact that sliced bread is not a cookie, and no cookies have peanut butter.
Some pencils may indeed not write in blue, but this commits the fallacy of Illicit Major, as the
term “objects that write in blue” is distributed in the conclusion, but not in the major premise.
8. If one premise is particular, then the conclusion must be particular. Similarly, if the
conclusion is particular, one premise must be particular.
Fallacy: Any of Fallacy of the Undistributed Middle, Illicit Major, Illicit Minor, Illicit Affirmative,
Illicit Negative, or Existential Fallacy. Existential Fallacy – a particular conclusion is drawn from
two universal premises
Example of a syllogism where a universal conclusion is drawn from at least one particular
premise:
Some plumbers are Italian.
No turtles are Italian.
Therefore, no turtles are plumbers.
This commits the fallacy of the Illicit Major, as the term “plumbers” is distributed in the
Prepared by: Nathaniel M. Cabansay, BSCpE
TYPES OF PROOFS
• Direct Proof
• Indirect Proof
• Proof by Contradiction
• Proof by Mathematical Induction
DIRECT PROOF
Given 𝑝 → 𝑞, we assume p is true, then using p and other axioms, definitions, and previously derived
theorems, show directly that q is true.
Example: Prove using a direct proof that for all rational numbers 𝑥 and 𝑦, 𝑥 + 𝑦 is also rational.
INDIRECT PROOF
Since the implication 𝑝 → 𝑞 has the same truth value as its contrapositive, ¬𝑞 → ¬𝑝, we can prove the
implication by showing the contrapositive is also true.
Prepared by: Nathaniel M. Cabansay, BSCpE
PROOF BY CONTRADICTION
This establishes that 𝑝 → 𝑞 is true by assuming 𝑝 is true and 𝑞 is false, then using 𝑝 and ¬𝑞 as well as
other axioms, definitions, and previously derived theorems, derives a contradiction.
4 𝑎 𝑎 Suppose √2 is rational
√2 = where is in lowest terms.
𝑏 𝑏
5 𝑎2 Square both sides
2=
𝑏2
6 𝑎2 = 2𝑏 2 Multiply both sides by 𝑏 2
Prepared by: Nathaniel M. Cabansay, BSCpE
MATHEMATICAL INDUCTION
Example 1: Prove that ∑𝑛𝑘=1(2𝑘 − 1) = 𝑛2 for all the natural numbers 𝑛 (Chua et al., 2016).
2 1(2) Set 𝑛 = 1.
1(2)
= 1, thus, the base
𝑆1 : 1 = 2
2 case is true.
3 𝑛(𝑛 + 1) Assume 𝑆𝑛 is true
𝑆𝑛 : 1 + 2 + 3 + ⋯ + 𝑛 =
2
4 (𝑛 + 1)(𝑛 + 2) Set 𝑛 = 𝑛 + 1 to prove that 𝑛 + 1 is
𝑆𝑛+1 : 1 + 2 + 3 + ⋯ + 𝑛 + (𝑛 + 1) =
2 true when 𝑛 is true.
5 𝑛(𝑛 + 1) (𝑛 + 1)(𝑛 + 2) Substitute statement 3 into
+ (𝑛 + 1) =
2 2 statement 4
6 𝑛(𝑛 + 1) + 2(𝑛 + 1) = (𝑛 + 1)(𝑛 + 2) Multiply both sides by 2
7 (𝑛 + 1)(𝑛 + 2) = (𝑛 + 1)(𝑛 + 2) Factor by grouping on the left
Since the two sides equal, we have proven not only 𝑆𝑛+1 side.
but also 𝑆𝑛 → 𝑆𝑛+1 , so we can conclude that 𝑆𝑛 is true for
all 𝑛 ∈ ℕ.
The methods of proofs shown here are not the only ways you can prove certain statements. In fact, we
even have a method for disproving a certain statement, or proving that a certain statement is false.
Here, we use a method known as proof by exhaustion, which manually and rigorously shows that all
cases will really make the statement true.
Here, we use a disproof by counterexample which shows a counterexample that makes the statement
false.
SEQUENCES
Sequences are ordered lists of elements, usually numbers. They are sometimes called progressions.
They are similar to sets, but the elements can duplicate and are ordered. For example, the first element
and the fourth element of a sequence can both be 12, and the 12 as the first element of the sequence
is distinct from the 12 as the fourth element of the sequence.
It is a function from a subset of any set of numbers (usually ℤ, ℚ, or ℝ). Individual elements in the
sequence are denoted 𝑎𝑛 , which is the 𝑛th element of the sequence. For example: 𝑎5 is the fifth
element of a sequence. {𝑎𝑛 } denotes an entire sequence.
TYPES OF SEQUENCES
1. Arithmetic sequence – each term in the sequence is added by constant amount from the
previous one.
The 𝑛th term of an arithmetic sequence is obtained by 𝑎𝑛 = 𝑎1 + (𝑛 − 1)𝑑, where 𝑎1 is the first
term of the sequence, and 𝑑 is the common difference.
Example: 10, 14, 18, 22, 26, 30, …. Each term of the sequence is 4 more than the previous
term, so the common difference here is 4. The first term is 10, so the 𝑛th term of the sequence
is equal to 𝑎𝑛 = 10 + (𝑛 − 1)4
2. Geometric sequence – each term in the sequence is multiplied by a factor from the previous
one.
The 𝑛th term of a geometric sequence is obtained by 𝑎𝑛 = 𝑎1 𝑟 𝑛−1 , where 𝑎1 is the first term of
the sequence, and 𝑟 is the common ratio.
Example: 9, 18, 36, 72, 144, …. Each term of the sequence is twice the previous term, so the
common ratio here is 2. The first term is 9, so the 𝑛th term of the sequence is equal to 𝑎𝑛 = 9 ⋅
2𝑛−1
3. Harmonic sequence – sequence formed from the reciprocals of the elements of an arithmetic
sequence. Note: The reciprocal of a geometric sequence is a different geometric sequence.
1 4 2 4 1
Example: , , , , , …. The sequence is not immediately obvious, but if we rewrite the
3 13 7 15 4
4 4 4 4 4
sequence such that the numerators are all the same, we get the sequence , , , , , ….
12 13 14 15 16
12 13 14 15 16
Get the reciprocals of the terms and we get , , , , , …. The common difference of the
4 4 4 4 4
1
equivalent arithmetic sequence is .
4
Other types of sequences include the Fibonacci sequence and other sequences formed by other rules.
The Fibonacci sequence is a sequence whose next term is defined by the sum of its two previous
terms (Aufmann et al., 2013). Its first two terms are 1 and 1, then they are followed by 2, 3, 5, 8, 13, 21,
34, 55, …. A formula to find the 𝑛th Fibonacci number is shown below:
Prepared by: Nathaniel M. Cabansay, BSCpE
𝑛 𝑛
(1 + √5) − (1 − √5)
𝐹𝑛 =
√5 ⋅ 2𝑛
Example 1: Suppose we have the sequence 7, 14, 21, 28, 35, …. We can tell that this is an arithmetic
sequence with its first term equal to 7 and its common difference also equal to 7. We could
immediately tell that the formula for this sequence is 𝑎𝑛 = 7𝑛, but let’s just make sure. We have 𝑎𝑛 =
𝑎1 + (𝑛 − 1)𝑑. Just substitute the values in: 𝑎𝑛 = 7 + (𝑛 − 1)7, then multiply: 𝑎𝑛 = 7 + 7𝑛 − 7, then
combine like terms: 𝑎𝑛 = 7𝑛. This confirms that this is indeed the formula.
Example 2: Suppose we have the sequence 62, 50, 38, 26, …. We can tell that this is an arithmetic
sequence with its first term equal to 62 and its common difference equal to 12, but since it is a
decrease, that common difference is -12. We use our formula 𝑎𝑛 = 𝑎1 + (𝑛 − 1)𝑑 then substitute to get
𝑎𝑛 = 62 + (𝑛 − 1)(−12). We then multiply (𝑛 − 1) by -12, so our formula becomes 𝑎𝑛 = 62 − 12𝑛 + 12.
We combine like terms and we arrive at the simplest form of the rule: 𝑎𝑛 = 74 − 12𝑛.
Example 3: Suppose we have the sequence 18, 35, 52, 69, 86, …. We can tell that this is an arithmetic
sequence with its first term equal to 18 and its common difference equal to 17. We use our formula
𝑎𝑛 = 𝑎1 + (𝑛 − 1)𝑑, then substitute to get 𝑎𝑛 = 18 + (𝑛 − 1)(17). Multiply (𝑛 − 1) by 17 then combine
like terms and we get the simplest form of the rule: 𝑎𝑛 = 17𝑛 + 1
Example 4: Suppose we have the sequence 100, 50, 25, 12.5, 6.25, …. We can tell that this is a
1
geometric sequence with its first term equal to 100. Its common ratio equals since the quantities are
2
being divided by 2. We can then use our formula 𝑎𝑛 = 𝑎1 𝑟 𝑛−1 and then substitute the values so we
1 𝑛−1 1 𝑛−1
have 𝑎𝑛 = 100 ⋅ ( ) . We can simplify further by using laws of exponents to split ( ) so we get
2 2
1 𝑛 1 −1 100 1 𝑛 2 1 𝑛 1 𝑛
𝑎𝑛 = 100 ⋅ ( ) ( ) , then 𝑎𝑛 = 1 ⋅ ( ) , then 𝑎𝑛 = 100 ⋅ ⋅ ( ) , then 𝑎𝑛 = 200 ⋅ ( ) , and 𝑎𝑛 = 200 ⋅
2 2 2 1 2 2
2
1 1 200
. Finally, we can multiply 200 by to get 𝑎𝑛 =
2𝑛 2𝑛 2𝑛
Example 5: Suppose we have the sequence 2.5, 5, 10, 20, 40, …. We can tell that this is a geometric
sequence with its first term equal to 2.5. Each term is twice the previous term, so its common ratio is 2.
We can then use our formula 𝑎𝑛 = 𝑎1 𝑟 𝑛−1 and then substitute the values so we have 𝑎𝑛 = 2.5 ⋅ 2𝑛−1 . We
can simplify the formula by breaking up the exponent: 𝑎𝑛 = 2.5 ⋅ 2𝑛 ⋅ 2−1 then we get 𝑎𝑛 = 1.25 ⋅ 2𝑛 .
Prepared by: Nathaniel M. Cabansay, BSCpE
3 2 3 6 1
Example 6: Suppose we have the sequence , , , , , …. We cannot immediately tell if this is a
4 3 5 11 2
sequence, but if we express all these fractions in higher terms such that the numerator of the fraction is
6 6 6 6 6
6, we get: , , , , , …. This means we have a harmonic sequence. We get the reciprocals of the
8 9 10 11 12
8 9 10 11 12 8
terms, so we get , , , , . We get an arithmetic sequence whose first term is and common
6 6 6 6 6 6
1
difference is . We use our formula for an arithmetic sequence, but since these are reciprocals of the
6
1 8 1 1 8+𝑛−1 𝑛+7
original harmonic sequence, we have = + (𝑛 − 1) ( ). We then get = = . We then get its
𝑎𝑛 6 6 𝑎𝑛 6 6
6
reciprocal, so we have 𝑎𝑛 = .
𝑛+7
4 2 4 4
Example 7: Suppose we have the sequence , , , 1, , 2, 4. We cannot immediately tell if this is even a
7 3 5 3
sequence to begin with, but we shall try to express these fractions in higher terms. If we have all the
4 4 4 4 4 4 4
numerators be 4, we get , , , , , , . This means we have a harmonic sequence. We get the
7 6 5 4 3 2 1
7 6 5 4 3 2 1 7
reciprocals of the terms, so we get , , , , , , . We get an arithmetic sequence whose first term is
4 4 4 4 4 4 4 4
1
and common difference is − . We use our formula for an arithmetic sequence, but since these are
4
1 7 1 1 7−𝑛+1
reciprocals of the original harmonic sequence, we have = + (𝑛 − 1) (− ). We then get = =
𝑎𝑛 4 4 𝑎𝑛 4
8−𝑛 4
. We then get its reciprocal, so we have 𝑎𝑛 = .
4 8−𝑛
1 1 1
Example 8: Suppose we have the sequence 1, 1, , , , …. We cannot tell if this is a sequence to begin
2 6 24
with, but if we get the reciprocals, we get 1, 1, 2, 6, 24, …, which is the familiar sequence of factorials. Our
first term is 1, and our second term is also 1, which means our first term uses 0! and our second term
1
uses 1!. This means that the rule here is 𝑎𝑛 = (𝑛−1)!
SUMMATIONS
A summation, or series, is the sum of a few terms of a sequence. It is typically written in the sigma
notation or summation notation.
𝑛
∑ 𝑎𝑖
𝑖=𝑚
Here, 𝑖 is the index of summation; 𝑎𝑖 is the 𝑖th term of the sequence; 𝑚 is the starting value of the
summation; and 𝑛 is the final value of the summation. For example:
∑ 2𝑖
𝑖=1
This is a compact way of writing that we add the first 8 even numbers together, and is the same as 2 +
4 + 6 + ⋯ + 16 = 72.
In programming, it is similar to a for loop. ∑𝑛𝑘=0 𝑎𝑘 translates to the code snippet below:
int k, sum = 0;
for (k=0; k<=n; k++){
sum+=a(k); //For some function a defined elsewhere in the program
}
Prepared by: Nathaniel M. Cabansay, BSCpE
CALCULATOR TECHNIQUE
If you have the following model(s) of calculators, you can perform summations as follows:
A. CASIO fx-570/991 ES Plus
1. Press SHIFT then log ∎ □ (It reads ∑□□ ∎ above it in yellow)
2. Input the expression inside the summation, but use the variable x instead of the given
variables like 𝑖, 𝑗, 𝑘, 𝑛 or any other variable. For example, if the expression inside the
summation is 2𝑘 − 1, use the expression 2𝑥 − 1.
To input 𝑥, press ALPHA then closing parenthesis (it reads X above it in red)
3. Press the right arrow key then input the starting value for 𝑥
4. Press the right arrow key again, then input the final value for 𝑥
5. Press =
B. CASIO fx-570/991 EX
1. Press SHIFT then 𝑥 (It reads ∑□□ ∎ above it in yellow)
2. Input the expression inside the summation, but use the variable x instead of the given
variables like 𝑖, 𝑗, 𝑘, 𝑛 or any other variable.
To input 𝑥, you can either press the 𝑥 key or press ALPHA then closing parenthesis (it
reads 𝑥 above it in red)
3. Press the right arrow key then input the starting value for 𝑥
4. Press the right arrow key again then input the final value for 𝑥
5. Press =
C. Canon F-789SGA
1. Press “Apps” then 2.
2. Input the expression inside the summation, but use the variable x instead of the given
variables like 𝑖, 𝑗, 𝑘, 𝑛 or any other variable.
To input 𝑥, press ALPHA then closing parenthesis (it reads X above it in red)
3. Press the right arrow key then input the starting value for 𝑥
4. Press the right arrow key again then input the final value for 𝑥
5. Press =
D. SHARP EL-W506T
1. Press ALPHA then × (It reads Σ above it in green)
2. Input the starting value for 𝑥
3. Press the right arrow key then input the final value for 𝑥
4. Press the right arrow key again then input the expression inside the summation, but use
the variable x instead of the given variables like 𝑖, 𝑗, 𝑘, 𝑛 or any other variable.
To input 𝑥 press ALPHA then RCL (it reads X above it in green)
5. Press =
𝑛 𝑛
𝑆𝑛 = (𝑎 + 𝑎𝑛 ) = [2𝑎1 + (𝑛 − 1)𝑑]
2 1 2
It is derived as follows:
15
𝑆15 = [2(3) + (15 − 1)4]
2
15
𝑆15 = [6 + 56]
2
15
𝑆15 = [62]
2
𝑆15 = 465
It is derived as follows:
For example, find the sum of the first seven powers of two (𝑛 = 1 to 𝑛 = 7). We have seven terms, so
𝑛 = 7, and the first power of 2 is 2, so 𝑎1 = 2, its common ratio is 2, so 𝑟 = 2
2 − 2(2)7
𝑆7 =
1−2
2 − 2(128)
𝑆7 =
−1
2 − 256
𝑆7 =
1
−254
𝑆7 =
−1
𝑆7 = 254
1
𝑆∞ =
1
1−
2
1
𝑆∞ =
1
2
𝑆∞ = 2
If 𝑟 = 1, we can simply multiply the first term by how many terms there are. For example, if we have a
geometric sequence consisting of nothing but the number 69. That sequence has 10 terms.
MULTIPLE SUMMATIONS
For example:
𝑚 𝑛
∑ ∑ 𝑥𝑦
𝑥=0 𝑦=0
int x, y, m, n, sum = 0;
for (x=0; x<=m; x++){
for(y=0; y<=n; y++){
sum+=(x*y);
}
}
2 1(2) Set 𝑛 = 1.
1(2)
= 1, thus, the base
𝑆1 : 1 = 2
2 case is true.
3 𝑛(𝑛 + 1) Assume 𝑆𝑛 is true
𝑆𝑛 : 1 + 2 + 3 + ⋯ + 𝑛 =
2
4 (𝑛 + 1)(𝑛 + 2) Set 𝑛 = 𝑛 + 1 to prove that 𝑛 + 1 is
𝑆𝑛+1 : 1 + 2 + 3 + ⋯ + 𝑛 + (𝑛 + 1) =
2 true when 𝑛 is true.
5 𝑛(𝑛 + 1) (𝑛 + 1)(𝑛 + 2) Substitute statement 3 into
+ (𝑛 + 1) =
2 2 statement 4
6 𝑛(𝑛 + 1) + 2(𝑛 + 1) = (𝑛 + 1)(𝑛 + 2) Multiply both sides by 2
7 (𝑛 + 1)(𝑛 + 2) = (𝑛 + 1)(𝑛 + 2) Factor by grouping on the left
Since the two sides equal, we have proven not only 𝑆𝑛+1 side.
but also 𝑆𝑛 → 𝑆𝑛+1 , so we can conclude that 𝑆𝑛 is true for
all 𝑛 ∈ ℕ.
Prepared by: Nathaniel M. Cabansay, BSCpE
∑(2𝑘 − 1) = 𝑘 2
𝑘=1
We have also proven this by mathematical induction back in Lesson 6, but here is the proof of
the formula
∑ 2𝑘 = 𝑛(𝑛 + 1)
𝑘=1
This can be derived easily from the formula for Sum of First n Natural Numbers
∑ 2𝑘−1 = 2𝑛 − 1
𝑘=1
LESSON 8: FUNCTIONS
CONCEPTS OF FUNCTIONS
A function 𝑓 relates a set of inputs 𝐴 to a set of outputs 𝐵. Exactly one element of 𝐵 is assigned to each
element of 𝐴. Functions can be written as 𝑓(𝑎) = 𝑏 to denote that an element 𝑎 of set A is assigned the
element 𝑏 of set B. If 𝑓 is a function from set A to set B, we write 𝑓: 𝐴 → 𝐵.
Example: if we a function 𝑓: ℝ → ℝ assign the square of a real number to another real number, we
have 𝑓(𝑥) = 𝑥 2 , where the domain of 𝑓 is the set of all real numbers, and the codomain of 𝑓 can also
be chosen to be the set of all real numbers. The range of 𝑓, however, is the set of all non-negative real
numbers, such as {0, 0.01, 1 × 10−8 , 3.1415926 … , 2.718 … , 12, 38, 69, 420, … }, better denoted as ℝ0+ ,
since no negative real numbers can be represented by perfect squares.
In programming languages, the domain and codomain of functions are almost always specified when
creating functions. For example, in C [and languages using a similar syntax], we have:
OPERATIONS ON FUNCTIONS
Let 𝑓 and 𝑔 be two real-valued functions with the same domain. We can add, subtract, multiply, and
divide functions.
The four operations are: (𝑓 + 𝑔)(𝑥) = 𝑓(𝑥) + 𝑔(𝑥), (𝑓𝑔)(𝑥) = 𝑓(𝑥)𝑔(𝑥), (𝑓 − 𝑔)(𝑥) = 𝑓(𝑥) − 𝑔(𝑥) [this is
𝑓 𝑓(𝑥)
just the same as adding 𝑔(𝑥) multiplied by -1], and ( ) (𝑥) =
𝑔 𝑔(𝑥)
Prepared by: Nathaniel M. Cabansay, BSCpE
We can also do compositions of functions. In a composition of functions, the output of one function
becomes the input of a second function. For example: (𝑓 ∘ 𝑔)(𝑥) = 𝑓(𝑔(𝑥)) means that the output of
𝑔(𝑥) becomes the input of 𝑓(𝑥).
Of the five operations we can do on functions, only addition and multiplication of functions are
commutative
We have:
IMAGE OF A SUBSET
Let 𝑓 be a function from set 𝐴 to set 𝐵, then let 𝑆 be a subset of 𝐴. The image of 𝑆 is the subset of 𝐵
consisting of all the images of the elements of 𝑆. We denote the image of a subset 𝑆 by 𝑓(𝑆), so we
have 𝑓(𝑆) = {𝑓(𝑠)|𝑠 ∈ 𝑆}.
Example: Let 𝐴 = {1, 3, 5, 7, 9, … } and 𝐵 = {2, 6, 10, 14, 18, … } with 𝑓(1) = 2, 𝑓(3) = 6, 𝑓(5) = 10, 𝑓(7) =
14, and 𝑓(9) = 18. We then define a subset 𝑆 = {3, 5, 7}. The image of the subset is the set 𝑓(𝑆) =
{6, 10, 14}.
One-to-one functions or injective functions (or injections) have only one element in the domain
paired up with a single element in the codomain. This happens if and only if 𝑓(𝑥) = 𝑓(𝑦) implies that
𝑥 = 𝑦 for all 𝑥 and 𝑦 in the domain of 𝑓.
Onto functions or surjective functions (or surjections) have every element in the codomain assigned
to at least one element of the domain. This happens if for every element b in the codomain B, there is
an element a in the domain A with 𝑓(𝑎) = 𝑏.
One-to-one correspondences or bijective functions (or bijections) are functions that are both one-
to-one/injective and onto/surjective.
Prepared by: Nathaniel M. Cabansay, BSCpE
Functions can also be strictly increasing or strictly decreasing. They are strictly increasing if 𝑓(𝑥) <
𝑓(𝑦) whenever 𝑥 < 𝑦 and 𝑥 and 𝑦 are in the domain of 𝑓 and strictly decreasing if 𝑓(𝑥) > 𝑓(𝑦)
whenever 𝑥 < 𝑦 and 𝑥 and 𝑦 are in the domain of 𝑓. Functions that are strictly increasing or strictly
decreasing must be one-to-one (injective or bijective).
INVERSE FUNCTIONS
The inverse function assigns an element 𝑏 in the set 𝐵 to the unique element 𝑎 in 𝐴 such that 𝑓(𝑎) = 𝑏.
The inverse function of 𝑓 is denoted as 𝑓 −1 , so 𝑓 −1 (𝑏) = 𝑎 when 𝑓(𝑎) = 𝑏. Only bijective functions have
inverse functions.
A bijection is invertible since we can define an inverse of this function. A function is not invertible if it
is not a bijection, so no inverse can be defined. If an inverse were to be done, the result would not be a
function.
𝑥−1
Example: 𝑦 = 3𝑥 + 1 is invertible as this is a bijection. Its inverse is 𝑦 = .
3
GRAPH OF A FUNCTION
Let 𝑓 be a function from set 𝐴 to set 𝐵. The graph of the function 𝑓 is the set of ordered pairs
{(𝑎, 𝑏)|𝑎 ∈ 𝐴 and 𝑓(𝑎) = 𝑏}. An interesting fact about graphs of inverse functions is that the graph of the
inverse function is the reflection of the graph of the original function across the line 𝑦 = 𝑥.
In the graph above, the blue function above, 𝑦 = 3𝑥 + 1 has an inverse function, which is the red
𝑥−1
function 𝑦 = .
3
In the graph above, the blue function above 𝑦 = e𝑥 has an inverse function, which is the red function
𝑦 = ln(𝑥).
• Floor function – assigns the largest integer less than or equal to a real number 𝑥. It is denoted
by ⌊𝑥⌋. This basically always rounds down a decimal number. It is the same as the greatest
integer function denoted by ⟦𝑥⟧.
• Ceiling function – assigns the smallest integer greater than or equal to a real number 𝑥. It is
denoted by ⌈𝑥⌉. This basically always rounds up a decimal number.
Property Statement
Basic Definitions of Floor and Ceiling ⌊𝑥⌋ = 𝑛 ↔ 𝑛 ≤ 𝑥 < 𝑛 + 1
⌈𝑥⌉ = 𝑛 ↔ 𝑛 − 1 < 𝑥 ≤ 𝑛
⌊𝑥⌋ = 𝑛 ↔ 𝑥 − 1 < 𝑛 ≤ 𝑥
⌈𝑥⌉ = 𝑛 ↔ 𝑥 ≤ 𝑛 < 𝑥 + 1
Floor and Ceiling in Relation to 𝒙 − 𝟏 and 𝒙 + 𝑥 − 1 < ⌊𝑥⌋ ≤ 𝑥 ≤ ⌈𝑥⌉ < 𝑥 + 1
𝟏
Floor and Ceiling Function Inversion ⌊−𝑥⌋ = −⌈𝑥⌉
⌈−𝑥⌉ = −⌊𝑥⌋
Adding an Integer ⌊𝑥 + 𝑛⌋ = ⌊𝑥⌋ + 𝑛
⌈𝑥 + 𝑛⌉ = ⌈𝑥⌉ + 𝑛
• Factorial function – the product of the first 𝑛 positive integers. 𝑓: ℕ → ℤ+ and denoted by
𝑓(𝑛) = 𝑛!. 𝑛! = 1 ⋅ 2 ⋅ … ⋅ (𝑛 − 1) ⋅ 𝑛. Note that 0! = 1.
CALCULATOR TECHNIQUE
If you have the following model(s) of calculators, you can use the factorial function in this way:
A. CASIO fx-570/991MS, CASIO fx-570/991ES PLUS, CASIO fx-570/991EX, and Canon F-
789SGA (only the button locations on the physical calculators differ)
1. Input the number 𝑛
2. Press SHIFT then 𝑥 −1 to insert the factorial symbol (it reads 𝑥! above it in yellow).
3. Press =
B. SHARP EL-W506T
1. Input the number 𝑛
2. Press 2ndF then 4 to insert the factorial symbol (it reads 𝑥! above it in orange).
3. Press =
• Mod and div functions – Known as integer division and remainder. If we have 𝑚 and 𝑛 be
natural numbers, the integer division 𝒎 div 𝒏 returns the whole number result of dividing 𝑚 by
𝑛 (if 𝑛 ≠ 0), while 𝒎 mod 𝒏 returns the remainder of that division.
CALCULATOR TECHNIQUE
If you have the following model(s) of calculators, you can use the integer division and the remainder
functions in this way:
A. Canon F-789SGA
Prepared by: Nathaniel M. Cabansay, BSCpE
1. Press “Apps”
2. Press 5 to perform both integer division and modulus and 6 to perform just the
modulus.
3. Input the first number 𝑚 then press shift then closing parenthesis to input a comma (It
reads “,” above it in orange), then input the second number 𝑛
4. Input the closing parenthesis and then press =.
b. If you pressed “5” during step 2, the result of 𝑚 div 𝑛 is represented by the number
that appears after the 𝑄 =, and the result of 𝑚 mod 𝑛 is represented by the number
that appears after the 𝑅 =.
c. If you pressed “6” during step 2, the result of 𝑚 mod 𝑛 appears.
B. SHARP EL-W506T
1. Input the first number 𝑚
2. Press 2ndF then STO (it reads “int÷” above it in orange)
3. Input the second number 𝑛
4. Press =. The number that appears in the first line (after the “Q: “) represents the result of
𝑚 div 𝑛 and the number that appears in the second line (after the “R: “) represents the
result of 𝑚 mod 𝑛.
OR
1. Press MATH
2. Press the down arrow once
3. Press 5 to select int
4. Press open parenthesis, input (First number) ÷ (Second number), then close parenthesis.
(Example: int(14÷5))
5. Press =. The result is only the result of 𝑚 div 𝑛.
• Hashing functions ℎ assign a memory location ℎ(𝑘) to the record/item with 𝑘 as its key. In
practice, many different hashing functions are used. One of these is commonly ℎ(𝑘) =
𝑘 mod 𝑚.
For a hash function 𝐻, a collision occurs if 𝐻(𝑥) = 𝐻(𝑦) but 𝑥 ≠ 𝑦. To handle these, a collision
resolution policy is required. A simple one would be to find the next highest unoccupied cell.
If we want to locate a certain stored value 𝑘, we compute 𝑚 = ℎ(𝑘) and begin looking at
location 𝑚. If 𝑘 is not in this position, we proceed to the next highest position until we reach an
empty cell or return to our original position. If that happens, we conclude that 𝑘 is not present,
otherwise, we obtain the position of 𝑘.
Prepared by: Nathaniel M. Cabansay, BSCpE
REFERENCES
Aufmann, R. N., Lockwood, J. S., Nation, R. D., Clegg, D. K. (2013). Mathematical excursions (3rd ed.).
Brooks/Cole.
Baronett, S. (2018). Logic: An emphasis on formal logic (4th ed.). Oxford University Press.
Chua, S., Ubarro, A., Baluca, R., Guerrero, R., Tan, J. L. (2016). Soaring 21st century mathematics:
Precalculus. Phoenix Publishing House.
Dimasuay, L., Alcala, J., Palacio, J. (2016). General mathematics. C & E Publishing.
Jain, M. [Exam Race] (2020, August 26). Distributed & Undistributed Terms in 4 Types of Categorical
Propositions (A, E, I & O) | Logic , NET [Video]. YouTube. https://www.youtube.com/
watch?v=W22-H1buywM
Lipschutz, S., Lipson, M. (2007). Schaum’s outline of discrete mathematics (3rd ed.). McGraw-Hill.
Parsons, T. (2017). “The Traditional Square of Opposition”. In Zalta, E. (ed), The Stanford Encyclopedia
of Philosophy (Summer 2017 ed.). https://plato.stanford.edu/entries/square/#ModRevSqu
Prepared by: Nathaniel M. Cabansay, BSCpE
Rosen, K. (2019). Discrete mathematics and its applications (8th ed.). McGraw-Hill.
Woo, E. (2021, May 11). Proof: a3 – a is always divisible by 6 (1 of 2: Two different approaches) [Video].
YouTube. https://www.youtube.com/watch?v=5nilsaCdTfE
Woo, E. (2021, May 11). Proof: a3 – a is always divisible by 6 (2 of 2: Proof by exhaustion) [Video].
YouTube. https://www.youtube.com/watch?v=P-jn2SKD9O4