COMP-20043 Discrete Structure
COMP-20043 Discrete Structure
COMP 20043
Compiled by:
i
LESSON 1: PROPOSITIONAL LOGIC
Overview
The rules of logic give precise meaning to mathematical statements. These rules
are used to determine the validity of the mathematical arguments. Computer science
needs to study logic. Logic has numerous applications. It can be used to design
computer circuits, construct computer programs, verify the correctness of programs, etc.
In this lesson, the concept and application of logic will be discussed.
Objectives
After successfully completing this lesson, the students should be able to:
• Discuss the concept and application of propositional logic.
• Differentiate simple and complex sentences.
• Convert logical statements from informal language to propositional and predicate
logic expressions.
Course Materials
Propositional Logic
A proposition is a declarative statement and propositional logic studies the
relationship between two or more propositions regardless of its content. Example, the
proposition “If the moon is made of cheese then basketballs are round,” and “if spiders
have eight legs then Anne walks with a limp” are exactly the same since they are both
implications: statements of the form, P→Q.
Example:
P: a grizzly is a bear.
Q: a bear is a mammal.
R: a grizzly is a mammal.
P&Q→R
Each proposition (also called atomic statement) can be combined with logical
connectives to form compound or complex statements.
~P, P & Q, P v Q, P = Q, P→Q
A Complex sentence has at least one sentence and has one or more logical
connectives as a component. There are five types in propositional logic:
● Negations
● Conjunctions
● Disjunctions
● Conditionals
● Biconditional
Negations
A Negation asserts that something is not the case or it simply reverses a statement.
It is symbolized by placing this symbol ‘¬’ or ~’ before the sentence-letter.
For example, the negation of the statement “Polytechnic University of the
Philippines is in Sta. Mesa, Manila.” is “Polytechnic University of the Philippines is not in
Sta. Mesa, Manila.”
P: Polytechnic University of the Philippines is in Sta. Mesa, Manila.
¬P: Polytechnic University of the Philippines is not in Sta. Mesa, Manila.
A negation is true whenever the negated sentence is false. If it is true that it is not
33 degrees outside, then it must be false that it is 33 degrees outside.
Note: When translating, try to keep the simple sentences positive in meaning. Also,
denying is not simply the negation of affirming.
Conjunction
Conjunctions are “and” sentences. They put two sentences together and claim that
they are both true. Conjunctions use the ampersand ‘&’ or ‘ ^ ‘ symbol or in some cases,
a dot.
Conjunction stands for;
● and
● but
● also
● however
● yet
● still
● moreover
● although
● nevertheless
● both
Disjunction
A disjunction is an “or” sentence. It claims that at least one of two sentences are
true. It is represented by the symbol ‘∨’ which is called as “vel”.
For example, if I say that either I will go to the movies this weekend or I will stay
home and grade critical thinking homework, then I have told the truth provided that I do
one or both of those things. If I do neither, though, then my claim was false.
Disjunction stands for;
● or
● unless
● either
● neither
Conditional
A conditional (implication) statement becomes false if its hypothesis is true but the
conclusion is false. It is represented using the symbol “→”.
Example:
● If you will study tonight, then you will get a high score in our quiz tomorrow. (S→H)
● You will pass Discrete Mathematics, provided you study. (P→S)
The arrow translates many English words and phrases, including
● if
● if… then
● only if
● whenever
● when
● only when
● implies
● provided that
● means
● entails
● is a sufficient condition for
● is a necessary condition for
● given that
● on the condition that
● in case
Example : in the conditional statement, “If you will study tonight, then you will get a high
score in our quiz tomorrow”, our antecedent is “You will study tonight” and the consequent
is “You will get a high score in our quiz tomorrow.”
Note that:
● ‘If’ introduces antecedents, but Only if introduces consequents.
● If A is a necessary condition for B, then B→A.
● If A is a sufficient condition for B, then A→B
Biconditional
It is called a biconditional statement when something is both a necessary and a
sufficient condition for something else. It is represented using the symbol “↔”.
For example, completing all your requirements is both sufficient and necessary to
earn a degree. You can’t have a degree if you don’t complete all your requirements and
completing your requirements guarantees earning a degree.
● A↔B
NOTE: Similar to conjunction and disjunction statements, the order of the statement does
not matter in biconditional.
Here are some English phrases that signify biconditionals:
● it and only if
● when and only when
● just in case
● is a necessary and sufficient condition for
For example:
V: Victor hit the ball.
R: Reineil caught the ball.
L: Lucas chased the ball.
Using the simple statements above and logical operators, we can construct
complex statements.
For example;
The “syntax” of a language refers to the “form” of the expressions such as words,
sentences, and the like. The “semantics” of a language refers to the content, or meaning
of expressions. Even though syntax and semantics have a strong correlation, it shall be
treated quite distinctly.
Syntax
The syntax of propositional logic is composed of the rules in generating complex claims
from simple ones. Basically, the Syntax of Propositional Logic is by using logical
connectives and operators (which connect or operate on propositions)
Wherein:
- Negation: ~ or ¬
- Conjunction; and: ∧ or •
- Disjunction; or: V
- Material Implication; if...the…: ⇒
- Biconditional; if and only if: ⇔
NOTE:
Parentheses are very important. For instance, ~(P ∧ Q) is different from ~P ∧ Q.
Semantics
Semantic rules of Propositional Logic tell us how the meaning of its constituent
parts, and their mode of combination, determine the meaning of a compound statement.
This meaning represents its truth value. Logical operators determine what the truth-values
of compound statements are depending on the truth-values of the formulae in the
compound.
Example:
Intuitively, the meaning of “A ∧ B” is that
“this is only true if both A and B are true”.
● A truth table shows all the possible truth values of a given proportion.
● The number of possible outcomes or the row is determined by the formula 2 raised
to n, where n stands for the number of variables present in the given statement.
P ¬P
T F
F T
Example:
P: Today is raining.
¬P: Today is not raining.
Example:
P Q P^Q
T T T
T F F
F T F
F F F
P Q PνQ
T T T
T F T
F T T
F F F
4. Implication (Conditional Statement “→”)
● This proposition is false if and only if P (hypothesis) is true and Q (conclusion) is
false.
P Q P→Q
T T T
T F F
F T T
F F T
P Q ~ P → ~Q
T T T
T F T
F T F
F F T
6. Converse Statement
● The converse of a conditional statement is the compound proposition “if Q then P”.
P Q Q→P
T T T
T F T
F T F
F F T
7. Contrapositive Statement
● The contrapositive of a conditional statement is the compound proposition
“if not Q then not P”
P Q ~ Q →~P
T T T
T F F
F T T
F F T
P Q P↔Q
T T T
T F F
F T F
F F T
NATURE OF PROPOSITION
1. Tautology (P P) - a proposition that is always true for all possible truth values
of its propositional variables. It contains only T (true) in the last column of its truth
table
10 | P a g e Propositional Logic
2. Contradiction (P P) - a proposition that is always false for all possible truth
values of its propositional variables. It contains only F (false) in the last column of
its truth table
3. Contingency (P Q) - a proposition that is neither a tautology nor a contradiction.
It contains both T (true) and F (false) in the last column of its truth table.
EXERCISE II
11 | P a g e Propositional Logic
Logically Equivalent Statements
T T F T
T F F F
F T T T
F F T T
Notice that the end results of the two statements both have the same truth values,
therefore P→Q ≡ ¬P ν Q.
12 | P a g e Propositional Logic
EXERCISE III
13 | P a g e Propositional Logic
Assessment
14 | P a g e Propositional Logic
References
Estella, M. (2020) Introduction to Truth Tables, Statements, and Logical Connectives. Retrieved
from:
https://www.chilimath.com/lessons/introduction-to-number-theory/intro-to-truth-tables-
statements-and-connectives/
Geeks for Geeks (n.d.). Mathematics | Introduction to Propositional Logic | Set 1. Retrieved from
https://www.geeksforgeeks.org/proposition-logic/
Levin, O. (ND) Discrete Mathematics: An Open Introduction. Propositional Logic. Retrieved from
http://discrete.openmathbooks.org/dmoi2/sec_propositional.html
Ikenaga, B. (2019) Truth Tables, Tautologies, and Logical Equivalences. Retrieved from
http://sites.millersville.edu/bikenaga/math-proof/truth-tables/truth-tables.html
Popov, N. & Jebelean, T. (ND) Mathematical Logic, Propositional Logic. Syntax and Semantics.
Retrieved from
https://www3.risc.jku.at/education/courses/ws2012/logic-1/Logic-2012-10-11.pdf
Pursuing Truth: A Guide to Critical Thinking. Chapter 4 Propositional Logic (ND) Retrieved from
https://bookdown.org/rlridenour/ct-text/propositional-logic.html
Stemwedel, J. (2010, September 24) Syntax and semantics of propositional logic. Retrieved
from
https://www.slideshare.net/docfreeride/syntax-and-semantics-of-propositional-logic
15 | P a g e Propositional Logic
LESSON 2: PROVIDING TECHNIQUES IN
PROPOSITIONAL LOGIC
Overview
An important type of step used in a mathematical argument is the replacement of
a statement with another statement with the same truth value. These rules are
propositional equivalences. Propositional equivalences and rules of inference can be
used to simplify and validate mathematical statement.
Objectives
After successfully completing this lesson, the students should be able to:
Course Materials
Propositional Equivalences
Idempotence P≡PᴠP
P≡PᴧP
Commutative (P ᴠ Q) ≡ (Q ᴠ P)
(P ᴧ Q) ≡ (Q ᴧ P)
Associative (P ᴠ (Q ᴠ R)) ≡ ((P ᴠ Q) ᴠ R)
(P ᴧ (Q ᴧ R)) ≡ ((P ᴧ Q) ᴧ R)
De Morgan’s ¬ (P ᴠ Q) ≡ (¬P ᴧ ¬Q)
¬ (P ᴧ Q) ≡ (¬P ᴠ ¬Q)
Distributive (P ᴧ (Q ᴠ R)) ≡ ((P ᴧ Q) ᴠ (P ᴧ R))
(P ᴠ (Q ᴧ R)) ≡ ((P ᴠ Q) ᴧ (P ᴠ R))
Material Equivalence (P ↔ Q) ≡ ((P → Q) ᴧ (Q → P))
Involution P 𠪪P
Commutative
This commutative says, for example, that "Daniel Kang is rich or (Daniel Kang is)
famous." is equivalent to "Daniel Kang is famous or (Daniel Kang is) rich". On the other
hand, "Daniel Kang is rich and (Daniel Kang is) famous." is equivalent to "Daniel Kang is
famous and (Daniel Kang is) rich". It means that with this operation, the result obtained
does not differ with the order in which the elements are used.
Associative
This associative says, for example, that "Jennie Kim is beautiful, or she is also hot
or (she is) famous" is equivalent to "Jennie Kim is beautiful or (Jennie Kim is) hot, or she
is also famous". Using the logical operator “and”, "Jennie Kim is beautiful, and she is also
hot and (she is) famous" is equivalent to "Jennie Kim is beautiful and (Jennie Kim is) hot,
and she is also famous".
De Morgan’s Law
This De Morgan’s Law says, for example, "It is not the case that Park Jihyo is fat
or ugly." is true if and only if "Park Jihyo is not fat and she is not ugly." On the other hand,
it can also be "It is not the case that Park Jihyo is fat and ugly." that is equivalent to "Park
Jihyo is not fat or she is not ugly."
Distributive
This distributive says, for example, that "Kim Taehyung is an actor, and he is singer
or (he is) a dancer." is equivalent to "Kim Taehyung is an actor and (he is) a singer, or Kim
Taehyung is an actor and (he is) a dancer". It can also be "Kim Taehyung is an actor, or
he is singer and (he is) a dancer." which is equivalent to "Kim Taehyung is an actor or (he
is) a singer, and Kim Taehyung is an actor or (he is) a dancer".
Material Equivalence
This material equivalence says, for example, that "Chaeyoung is happy if and only
if Mina is healthy." is logically equivalent to "If Chaeyoung is happy, then Mina is healthy,
and if Mina is healthy, Chaeyoung is happy." On the other hand, the statement
"Chaeyoung is happy if and only if Mina is healthy." is also logically equivalent to
“Chaeyoung is happy and Mina is healthy, or Chaeyoung is not happy and Mina is not
healthy.”
Involution
This involution says, for example, that "It is not the case that John is not multi-
talented." is equivalent to "John is multi-talented."
Exportation
This exportation says, for example, "If there are no corrupt government officials
and the Filipino people vote wisely, then there will be better future for all of us." is logically
equivalent to "If there are no corrupt government officials, then if the Filipino people vote
wisely, then there will be better future for all of us."
Identities
Here, true is a proposition that is always true. Regardless of what P is, the
proposition (P ᴠ TRUE) is always true. Although rarely used, this and the next three
identities, like identities 1 and 2, are useful when manipulating propositions in reasoning
in symbolic form.
This says that a statement such as "Chanyeol is 6 foot tall or he is not 6 foot tall." is always
true.
This says that a statement such as "Xiumin is 5 foot tall and he is not 5 foot tall." is always
false.
a. (P ∧ Q) ∧ T ≡ P ∧ Q
b. P ∧ (Q ∧ R) ≡ (P ∧ Q) ∧ R
c. ¬ (P ∨ Q) ≡ ¬P ∧ ¬ Q
d. P ∧ Q ≡ Q ∧ P
e. [¬ (¬P) ∨ Q)] ≡ P ∨ Q
P
Addition
∴P∨Q
P ∧ Q or P ∧ Q
Simplification
∴P ∴Q
P
Conjunction Q
∴P∧Q
P→Q
Absorption
∴ P → (P ∧ Q)
P→Q
Modus Ponens P
∴Q
P→Q
Modus Tollens ¬Q
∴ ¬P
P∨Q
Disjunctive Syllogism ¬P
∴Q
P→Q
Hypothetical Syllogism Q→R
∴P→R
(P → Q) ∧ (R → S)
Constructive Dilemma P∨R
∴Q∨S
(P → Q) ∧ (R → S)
Destructive Dilemma ¬Q ∨ ¬S
∴ ¬P ∨ ¬R
P∧Q
Decomposing a
P
Conjunction
∴Q
Addition
This inference is also called as “disjunction introduction”. It is similarly related to
Disjunctive Syllogism. This inference means that if “P” or the premise is true, then “P ∨ Q”
or the conclusion is also true. Addition builds up “∨” statements.
Simplification
This inference is also called as "conjunction elimination". It is some sort of the
opposite of conjunction. Simplification means that in an instance “P ∧ Q” appears on a line
of proof, it can result to either of “P” and “Q”. It is useful for breaking down or turning long
“∧” statements into shorter “∧” statements at the beginning of a proof.
Absorption
This rule of inference is an identity linking a pair of binary operations. Suppose P
implies Q, we can conclude that Q is absorbed by P.
Modus Ponens
The first premise is the conditional claim P implies Q (also known as the “if-then”
statement) which we know is true. The second premise is that P is also true. With these
two premises, we can conclude that Q must be true as well. It can be summarized as "P
implies Q and P is asserted to be true, therefore Q must be true."
Modus Tollens
It has two premises. The first premise is a conditional claim (an "if-then" statement)
which we know is true. The second premise is that it is not the case that Q. With these
two premises, we can conclude that it is not the case that P. In simplest terms, it states
that if a statement is true, and another statement is false, the conclusion must be false. If
so, it is a contrapositive.
Disjunctive Syllogism
This inference means that at least one of the two statements is true; if we know
that the former is not true, we can conclude that it has to be the latter that is true. So in
symbols, if P is true or Q is true and P is false, then Q is true. Disjunctive Syllogism breaks
down “∨” statements.
Hypothetical Syllogism
Hypothetical syllogism, also called as "chain reasoning" or "chain deduction" is a
valid rule of inference wherein if we know that P leads to Q, and that Q leads to R, then
we can conclude that P leads to R.
Constructive Dilemma
Suppose we know that P leads to Q and that R leads to S. And that either P or R
is true. Then we can arrive at the conclusion that either Q or S has to be true.
Destructive Dilemma
This inference is related to Constructive Dilemma. It states that if P leads to Q and
R leads to S, and either Q is false or S is false, then we can conclude that either P is false
or R is false.
Example:
Proof of Validity for the given arguments
a. ¬ Q → R
b. R ∧ P
c. ¬ (Q ∧ ¬ R) / ∴R
Solution
a. ¬ Q → R Given (Premise 1)
b. ¬R ∧ P Given(Premise 2)
c. ¬ (Q ∧ ¬ R) Given (Premise 3)
d. ¬R Simplification(from b)
e. ¬ Q ∨ ¬ ¬R De Morgan’s (from c)
f. ¬ Q ∨ R Double Negation (from e)
g. ¬ ¬ Q Modus Tollens(from a and d)
h. R Disjunctive Syllogism (from f and g)
1. P ∧ (¬ P ∨ Q) ≡ P ∧ Q
2. P ∨ (¬ P ∧ Q) ≡ P ∨ Q
3. ¬ (P ∧ Q) ∧ (¬ P ∨ Q) ≡ ¬ P
4. P ∨ (P∧ Q) ≡ P
5. [(P ∨ Q) ∧ (P ∨ ¬ Q)] ∨ R ≡ P ∨ (Q ∨ R)
It is made up of two parts: the given statements called the premises and a
conclusion. An argument is valid if the conclusion is true whenever the premises are
assumed to be true. It is said to be an invalid argument or fallacy if it is not valid.
Example:
Premise 1: If one loves Biology, then he loves Science
Premise 2: Shin loves biology
Conclusion: Therefore, Shin loves Science
Writing the two premises and the conclusion in symbolic for, we have:
[(P → Q) ^ P] → Q
P Q P→Q ( P → Q) ^ P [( P → Q) ^ P]→Q
T T T T T
T F F F T
F T T F T
F F T F T
Since the final column in the truth table is true in every case, then the statement is
a tautology. Since the conclusion is true whenever the premises are true (first case), then
the argument is valid.
NOTE: If the conditional statement in the final column is false in the first case, then the
argument is invalid or is a fallacy. And the statement is no longer a tautology. Note that it
is not a contradiction either.
Use the truth table to determine whether the symbolic form of the argument is a tautology
and whether it is valid or a fallacy.
1. P → Q
Q→R
∴ ¬R→ ¬P
2. P → Q
¬P
∴P
3. (P ^ Q) ^ (Q^P)
P
∴P ∨ Q
5. (P ^ Q) → R
¬P ∨ ¬Q
∴¬R
Test I. Proving
1. ¬ (p ∨ (¬p ∧ q)) ≡ ¬p ∧ ¬q
2. ¬ (q → p) ∨ (p ∧ q) ≡ q
3. ¬ (p ↔ q) ≡ (p ↔ ¬q)
4. 1. ~ (~A V B) Premise
2. _______ De Morgan
5. 1. (A ∧ B) →~ C Premise
2. ~B→ C Premise
3. ~C Premise
4. ______ 1, 2 Transitive Law
5. ______ 3, 4 MT
6. 1. A→ (C ∧ B) Premise
2. ~C Premise
3. _______ 2, Addition of ~q
4. _______ 3, De Morgan
5._______ 1, 4 Modus Tollens
1. A→ ~ (~A) Premise
2. A→A ______
3. ~A V A ______
4. (~A V A) A V ~B ______
5. ~A V (A V ~B) ______
6. ~A V (~B V A) ______
7. A → (~B V A) ______
8. A → (B → A) ______
8. (A V B) → (C ∧ D), A ∴C
9. (S → r) ∧ (q → r) ∴(s ∨ q) → r
1. (s → r) ∧ (q → r) Premise
2. (¬s ∨ r) ∧ (¬q ∨ r) ________
Pospesel, Howard and William G. Lycan. (2000) Introduction to Logic: Propositional Logic
Overview
Propositional logic cannot adequately express the meaning of all statements in
mathematics and in natural language. For example, suppose that we know that:
where MATH3 is one of the computers connected to the university network. Likewise, we
cannot use the rules of propositional logic to conclude from the statement:
In this lesson we will introduce a more powerful type of logic called predicate logic.
We will see how predicate logic can be used to express the meaning of a wide range of
statements in mathematics and computer science in ways that permit us to reason and
explore relationships between objects. To understand predicate logic, we first need to
introduce the concept of a predicate. Afterward, we will introduce the notion of quantifiers,
which enable us to reason with statements that assert that a certain property holds for all
objects of a certain type and with statements that assert the existence of an object with a
particular property.
Objectives
After successfully completing this lesson, the students should be able to:
• Explain the advantage of predicate logic from the propositional logic.
• List down and discuss the different types of quantifiers.
• Analyze basic mathematical proofs and discriminate between valid and unreliable
arguments.
Statement 1:
All students passed the Discrete Structure.
Statement 2:
John studied the Discrete Structure.
In these statements, we can “logically” conclude that since John studied the Discrete
Structure and he is a student technically, he passed the subject. But to further analyze
these statements, we need more lessons.
Predicate
In elementary English, you already learned that every complete sentence is
composed of a subject and a predicate. If we will connect this to our topic, these logical
statements also have subjects and predicate wherein the predicate refers to the property
a subject can have.
Example:
Y is greater than 5.
We can conclude that “Y” is the subject in the statement and the predicate is
“greater than 5”. The statement above can be denoted as K(Y) wherein the K represents
the predicate and the Y is the subject. By this representation, we can see that the predicate
is a function because it shows the truth values of the subject.
Another example:
Statement 1: x is the set of all animals.
S(x) = x has a fur.
We can say that S(x) is true if x is a bear and false if x is a snake. The domain of
a predicate variable is all the possible values the variable may have. The example above
shows that there are different possible answers in each predicate.
Quantifiers
Some statements look like this—
Example:
All students will pass discrete mathematics.
Some of the students are having a hard time on answering their assignments.
As you’ve noticed in the statements, they’ve used the words “all” and “some” which
are the keywords for using the quantifiers.
Universal Quantifier
Universal quantifier is the quantifier that tells the amount or quantity that means
“given any” or “for all”. It uses the symbol
∀ (𝑢𝑛𝑖𝑣𝑒𝑟𝑠𝑎𝑙 𝑞𝑢𝑎𝑛𝑡𝑖𝑓𝑖𝑐𝑎𝑡𝑖𝑜𝑛)
Example:
“∀x∈D P(x) is true” if only if “P(x) is true for every x in D”.
• ∀ – Universal quantifiers, “for all”, “for every”
• ∈ – “is a member (or) element of”, “belonging to”
• D – domain of predicate variable
Example #2:
All foxes are sly.
Based on the statement, we will use the universal quantifier but first we will convert
this into a predicate statement.
F(x) – x is a fox.
S(x) – x is sly.
Now that you’ve converted the statements into a predicate one, we will use the
quantifier to convert this into a mathematical statement. Giving us an answer—
∀x[F(x) → S(x)]
Existential Quantifier
Existential quantifier is the quantifier that tells the amount or quantity that means
“there is at least one” or “some”. It uses the symbol
∃ (existential
quantification)
Example #1:
“∃ x∈D, P(x) is true” if and only if “P(x) is true for at least one x in D”.
• ∃ Existential quantifier, “there exists”
Example #2:
Some students are having online classes.
Predicate statements:
S(x) – x is a student.
O(x) – x is having online classes.
The solution will be ∃x[S(x) → O(x)] .
If you fully understand the lesson, you also grasp the predicate logic. Predicate
Logic is the description of the property (or properties) a variable (or subject) may have.
Or simply the logic behind the predicate in each statement. The next part of the lesson will
discuss the proofs and techniques on how we can prove the predicate and quantified
statements we answered.
H(x): x is a Student.
E(x): x is Happy.
Y(x): x likes Taylor Swift.
In every argument, we need to check whether they are valid or not and these proof
techniques will help us to determine them fast.
Proof consists of a sequence of (algorithmic) steps that reduces, by certain
“reasoning rules” until it arrives at the situation at which answer is known. Proof should
not only tell whether or not a goal follows from the assumptions but it should also convince
the readers or listeners by giving arguments why the goal is true whenever the
assumptions hold. In almost every case, we prove the propositions by this form “if p then
q” which p is the hypothesis and q is the conclusion.
Example:
All fish is color orange.
Nemo is a fish.
Therefore, Nemo is color orange.
In this example we can see that the arguments are “All fish are orange” and “Nemo
is a fish”. The conclusion is “Nemo is color orange”.
We can only prove that these arguments are valid if it only uses the given
hypotheses together with the axioms, definitions, and the rules of inferences. These rules
of inference are the guides on making a conclusion in every premise like this rule:
𝑝𝑞
∴𝑝⋀𝑞
If there are rules of inference for arguments, there are also rules of inference for
quantifiers. These rules are added to the given rules of inference in the propositions
namely:
∀𝑥𝑃(𝑥)
Universal Instantiation
∴ 𝑃(𝑐)
𝑃(𝑐)𝑓𝑜𝑟 𝑎𝑟𝑏𝑖𝑡𝑟𝑎𝑟𝑦 𝑚𝑒𝑚𝑏𝑒𝑟, 𝑐, 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑖𝑣𝑒𝑟𝑠𝑒
Universal Generalization
∴ ∀𝑥𝑃(𝑥)
𝑃(𝑐)𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑚𝑒𝑚𝑏𝑒𝑟, 𝑐, 𝑜𝑓 𝑡ℎ𝑒 𝑢𝑛𝑖𝑣𝑒𝑟𝑠𝑒
Existential Generalization
∴ ∃𝑥𝑃(𝑥)
∃𝑥𝑃(𝑥)
Existential Instantiation
∴ 𝑃(𝑐)
Universal Instantiation
This says that if D is true for every element of the domain, we can name such
element by a variable, and D is still true for all these things.
𝑷(𝒙)
∴∀𝒙𝑷(𝒄)
But universal instantiation have its restrictions wherein if F(t) derives F(n), n must
not fall within the scope of the quantifier for t. Because without this restriction, the premise
(∀x) (∃n)F(x,n) could lead to the conclusion of F(n,n) and this is invalid. We should take
consideration that F(x,n) means that "n>x".
Existential Instantiation
This says that if you want to prove the argument, you will specify a certain predicate
and make a variable out of that to make the argument true.
∃𝒙𝑷(𝒙)
Example #2:
Domain = all students;
B(x) = "x gets a B"
J(x) = "x gets 85 in the exam"
- If any student gets >85 then s/he gets a B.
- There are students who get >85 in the exam, Jay is such a student.
- Therefore, Jay gets a B.
1. ∀x[J(x)→B(x)] Hypothesis
2. ∃xJ(x) Hypothesis
3. J(Jay) Hypothesis + Existential Instantiation
4. J(Jay)→B(Jay) Universal Instantiation (1)
Universal Generalization
This says that if you want to prove the argument, you will assume a member and
will not put any restrictions to that for it to become true. If you can show that P(x) is true,
then all the objects satisfying the argument for x will also become true. In other words,
P(x) is true for the domain of ∀xP(x).
𝑃(𝑐)
∀𝑥𝑃(𝑥)
Example #1:
where P(c) holds for every element g of the domain
- Let F(x) = x>1
- Let W(x) = x-1>0
wherein we assume that every number is above 0.
[∀x[F(x)→W(x)^∀xF(x)] →∀xW(x)
Proving:
1. ∀x[F(x)→W(x)] Hypothesis
2. ∀xF(x) Hypothesis
3. [F(x)→W(x)] Universal Instantiation (1)
4. F(x) for the same x as in 3. Universal Instantiation (2)
5. W(x) Modus Ponens (3, 4)
6. ∀xW(x) Universal Generalization (6)
Existential Generalization
This rule says that if there is some element a in the domain that has a property P,
then we can say that there is at least one existing in the domain that has the property P.
𝑷(𝒄)
∃𝒙𝑷(𝒙)
Example #2:
P(a)
∴ ∃xP(x) for some specific element of domain.
Domain = (all people)
Sell(y) = "y is selling bananas"
- If everyone is selling bananas, then someone is selling bananas.
∀xSell(x)→∃xSell(x)
1. ∀xSell(x) (Hypothesis)
2. Sell(a) (Universal Instantiation)
Methods of Proof
★ If you are proving an implication p→q, there are different strategies you can try.
o Trivial Proof – if q is true, then p → q is true.
Example #1:
Prove the statement:
If 300 students enroll in this semester, then 52 = 25
This statement is true.
Example #2:
P(n): a>=b → an >= bn for positive integers
Is P(0) true?
Proof: P(0) a0 >= b0 is equivalent to 1>=1.
Therefore, q is true and thus p→q is true.
Example #1:
Proving p→q ≡ ¬p is True
If n is odd and even, then n2 = n + n
Proof: The statement is false since n can never be both an odd and an even. So,
the theorem is vacuously true.
Example #2:
Prove the statement:
If 9 is an even number, then 92 = 20.
The statement is wrong. (Although q is also false)
o Direct Proof – Assume p, then use rules of inference, axioms, definitions, and
logical equivalences, to prove q.
Example #1:
Prove the statement: For all integers k and g, if k and g are odd integers, then k +
g is an even integer.
Proof:
k = 2h + 1 and g = 2b + 1
where h and b are also integer. Then,
k + g = (2h + 1) + (2b + 1) (Substitution)
= 2h + 2b + 2 (Associative and Commutative Laws of Addition)
= 2(h + b + 1) (Distributive Law)
Since h + g is twice another integer, namely, h + g + 1, h + g is an even integer.
Example #2:
Prove the statement:
if y is an odd number, then y2 is an odd number
Proof:
Assume that y is an odd integer.
Y = 2k + 1
Then y2 = (2k + 1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1
Example#1:
Prove the statement:
For all integers r and l, if the product of r and l is even, then r is even or l is even.
- But before proving this, we will change the statement into contrapositive: If r and l
are both odd integers, then rl is odd.
Proof:
r = 2a + 1 and l = 2b + 1
where a and b are also integers. Then,
rl = (2a + 1) (2b +1) (Substitution)
= 4ab + 2a + 2b + 1 (Associative, Commutative, Distributive Laws)
= 2 (2ab +a + b) + 1 (Distributive law)
Since rl is twice an integer (namely 2ab + a + b) plus 1, rl is old.
Example #2:
Prove the statement:
if g = r s, where r and s are positive, then r<= √g or s < = √g.
Proof:
Assume that both r and s are larger than √n. Thus, r s > g so that g!= a b. Since
the negation of conclusion implies the negation of hypothesis, the original
conditional statements is true.
o Proof of Cases - if the hypothesis p can be separated from p1vp2...pk, prove each
proposition separately.
Example #1:
Prove the statement:
if an integer y is not divisible by 3, then y2 = 3k + 1 fof some integer k
Proof:
" y is not divisible by 3" is equivalent to
" y = 3m + 1 for some integer m" or " y = 3m + 2 for some integer m"
Case 1:
y2 = (3m + 1)2 = 9m + 6m + 1
=3(3m2 + 2m) + 1 = 3k + 1 for some k.
Case 2:
y2 = (3m + 2)2 = 9m2 + 12m + 4
= 3(3m2 + 4m + 1) + 1 = 3k + 1 for some k.
We obtain the same answer making the statements true.
Example #2:
If p is a real number such that p2 - 1
---------- > 0, then either p > 1 or -2 < p < -1.
p2 + 2
Assume x is a real number for which the inequality
★ Existence Proof
This proves the statement ∃xP(x). The common types are:
1. Constructive Proof – establish P(k) for some k in the domain.
Example #1:
Prove a statement:
There exists a triple (d, j, k) of negative integers such that a2 + b2 + c.
Proof:
d = -1
j = -8
k = -2
As you can see, the values of the three givens are having the characteristics
being searched therefore its true.
Example #2:
If y(j) = j3 + j - 5, then there exists a positive real number y(h) = 7.
Proof:
We will calculate the derivative of y : y'(j) = 3j2 + 1. Then find a positive number
h such that y'(h) = 3h2 + 1 = 7. Solving for h.
3h2 = 6
h2 = 2
c = +-√2
Then c = √2 is a positive real number and y'(√2) = 3(√2)2 + 1 = 7.
Example #1:
Prove a statement:
There exist irrational numbers x y s.t. xv is rational.
In these statements, we will provide only rational.
Proof:
Consider √2√2 . Either (a) it is rational of (b) it is rational
Example #2:
There exists x ∈ R such that x5-3x+1=0
Proof:
Let f(x)=x5-3x+1
F(1) = -1<0 and f(2) =27 >0.
F(x) is a continuous function
We can define that because the function continuously give answers or there is
other possible ways to solve it, we use the Intermediate Value Theorem – if f is
continuous on a closed interval [a,b], and c is any number between f(a) and f(b)
inclusive wherein the closest value exists x∈[1, 2] such that f(x) = 0. So the answer
is f(x) = 0.
★ Biconditional
Use the fact that p↔q is equivalent to (p→q) ∧ (q→p) and proving both
the implication by using the methods above.
Example #1:
Prove the statement:
For any integer h, h is odd if and only if h2 is odd.
The implications are:
(a) if h is odd, then h2 is odd.
(b) if h2 is odd, then h is odd.
Proof of (a): Use direct proof in proving this statement
n = (2a + 1)2
= 4h2 + 4h + 1 = 2(2h2 + 2h) +1 which is twice an integer plus 1. Thus h2 is odd.
Proof of (b): In this statement, we can see that the hypothesis is clearly even
so we use contrapositive to prove this. The contrapositive of this statement is:
“If n is even, then n2 is even”. Then—
n=2a
N2=(2a)2 = 4a2 = 2(2a2), which is an even integer.
Example #2:
Prove the statement:
Suppose d and e are integers. Then a ≡ b (mod 6) if and only if a ≡ b (mod 2) and
a ≡ b (mod 3)
Proof:
We can substitute a ≡ b (mod 6) to a - b = 6n.
To prove this statement, we can get from a ≡ b (mod 2) the formula a - b = 2k
where we can conclude that a - b is even. For the a ≡ b (mod 3) we can get a formula of
a - b = 3l but since we know that a - b is even, then we can substitute l = 2m. Thus making
the formula, a - b = 3l = 3 • 2m = 6m, this means 6 (a-b), so a ≡ b (mod 6).
And at last you finished the chapter about predicate logic. But before going to the
next chapter why don't you assess yourself first if you learn something? We’ve prepare an
exercise and a quiz for you to practice and answer. Try first this exercise.
Translation
Let I(x) be the statement “x spends more than five hours every Wednesday in computer
programming class,” where the domain for x consists of IT students. Express each of these
quantifications in English.
1. ∃x = I(x)
2. ∀x = I(x)
3. ∃x = ¬I(x)
4. ∀x = ¬I(x)
Proving
9. ∃x (C(x) ∧ ¬B(x)) and ∀x(C(x) → P(x)) ≡ ∃x (P(x)∧¬B(x))
10. ∀x (H(x) → M(x)) H(x) ∴ M(x)
Dr. Bryant, J., & Dr. Kirby, P. (2011). Florida State University Course Notes MAD 2104 Discrete
Mathematics I [PDF]. Tallahassee, Florida. Retrieved from
https://www.math.fsu.edu/~pkirby/mad2104/SlideShow/CourseNotesMAD2104
John, R., & Eric W., W. Intermediate Value Theorem. Retrieved from
https://mathworld.wolfram.com/IntermediateValueTheorem.html
Overview
Set is the fundamental discrete structure on which all other discrete structures are
built. Sets are used to group objects together. Often, but not always, the objects in a set
have similar properties. For instance, all the students who are currently enrolled in your
school make up a set. Likewise, all the students currently taking a course in discrete
mathematics at any school make up a set. In addition, those students enrolled in your
school who are taking a course in discrete mathematics form a set that can be obtained
by taking the elements common to the first two collections. The language of sets is a
means to study such collections in an organized fashion. We now provide a definition of a
set. This definition is an intuitive definition, which is not part of a formal theory of sets.
Objectives
After successfully completing the lesson, the students should be able to:
• Identify and apply basic concepts of set, set representation and set operations.
• Create connection between set operations and logic.
• Prove elementary results involving sets.
Course Materials
Sets
A set is an unordered collection of different elements.
According to G. Cantor (Georg Cantor), a German mathematician, he had
defined a set as a collection of definite and distinguishable objects selected by the means
of certain rules or description.
Example of sets:
● A set of all positive integers
● A set of all the planets in the solar system
● A set of all the lowercase letters of the alphabet
Representations of Sets
Examples:
o Let N denote the set of first six natural numbers.
N = {1, 2, 3, 4, 5, 6}
o The set of all vowels of the English alphabet.
Example:
Assume that N is a set of counting numbers greater than 12:
P = {x : x is a counting number and greater than 12}
or
P = {x | x is a counting number and greater than 12}
Let A denote the set of even numbers between 4 and 16.
A = {x|x is an even number, 4 < x < 16}
3. Cardinality
The cardinality of a set is a measure of a set's size/ the number of elements in the
set, and is denoted by vertical bars, like absolute value signs; |A|
Example:
A = {2, 4, 6, 8, 12}
|A| = 5
A = {1, 2, 3, 3, 4, 6, 8}
|A| = 6
Operations of Sets
Union
The symbol ∪ is used to denote the union of two sets, the set that consists of all
elements belonging to either set A or set B (or both).
Examples:
Given:
U = {1, 2, 3, 4, 5, 6, 7, 8, 10}
A = {1, 2, 5, 8}
B = {1, 3, 4, 6, 7}
Solution:
Example:
Let:
A = {1, 2, 3, 4}
B = {2, 4, 6, 8}
Complement
Example 1:
If A = { 1, 2, 3, 4}
U = { 1, 2, 3, 4, 5, 6, 7, 8}
Solution :
Example 2:
Solution :
P = U = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, … }
A = { x | x is a multiple of 3, x ∉ N }
A = { 3, 6, 9, 12, 15, … }
Then, A’ = { 1, 2, 4, 5, 7, 8, 10,11, … }
Difference
The difference (subtraction) is defined as set A−B consists of elements that are
in A but not in B (Figure 1) or set B–A consists of elements that are in B but not in A (Figure
2).
Figure 1 Figure 2
Example:
Let’s consider:
The Cartesian products of sets mean the product of two non-empty sets in an
ordered way, obtained by the product of two non-empty sets. The Cartesian product of
two non-empty sets A and B is denoted by A × B.
Example:
Let:
A = {H, T}
B = {1, 2, 3, 4, 5, 6}.
A × B = {(H, 1), (H, 2), (H, 3), (H, 4), (H, 5), (H, 6), (T, 1), (T, 2), (T, 3), (T, 4), (T,
5), (T, 6)}
B × A = {(1, H), (2, H), (3, H), (4, H), (5, H), (6, H), (1, T), (2, T), (3, T), (4, T), (5,
T), (6, T)}
Note that in this case A × B ≠ B × A, i.e., the Cartesian product is not commutative.
Also, note that n(A) ∙ n(B) = 2(6) = 12 = n(A × B).
Symmetric Difference
A △ B = (A – B) ∪ (B – A)
Example:
Given:
A = {1, 2, 3, 4, 5, 6, 7, 8}
B = {1, 3, 5, 6, 7, 8, 9}
1. Commutative Laws:
AUB=BUA
A∩B=B∩A
2. Associative Laws:
(A U B) U C = A U (B U C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
3. Idempotent Laws:
AUA=A
A∩A=A
4. Distributive Laws:
A U (B ∩ C) = (A U B) ∩ (A U C)
A ∩ (B U C) = (A ∩ B) U (A ∩ C)
5. De Morgan’s Laws:
(A U B)’ = A' ∩ B'
(A ∩ B)’ = A' U B'
6. Identity Law
AU0=A
A∩B=A
7. Domination Law
AUB=B
A∩0=0
8. Complement
AUᾹ=u
A∩Ᾱ=0
9. Negation
(Ᾱ) = A
1. A secretary of an event was asked to buy drinks for the guests. The total number
of guests were 60 people, 27 like cold drinks and 42 like hot drinks and each guest
likes at least one of the two drinks. How many like both cold and hot drinks?
3. A language elective class has a total of 100 students enrolled, 75 students can
speak English and 47 can speak Italian.
a. How many can speak in English language only?
b. How many can speak Italian language only?
c. How many can speak both languages?
4. By the end of the year, art students were given medals according to their
excellency in their majors, 40 medals in dancing, 12 medals in theater acting and
18 medals in abstract painting. If the medals were awarded to 50 students and
only 8 students received medals in all three categories, how many received medals
in two categories?
SET OPERATIONS
Find the answer on the given sets below corresponding the operations (union,
intersection and complement) asked on each item.
SET REPRESENTATION
Perform the exercises below on the representation of sets. The questions are based on
representing the set using both the methods Roster Form and Set-Builder Form.
Write each of the following sets in both Roster (tabular) Form and Set-Builder Notation:
Courtney Taylor (2018, June). What Is the Difference of Two Sets in Set Theory?
Retrieved from: https://www.thoughtco.com/difference-of-two-sets
Online Math Learning (2005), Set Theory: Union of Sets. Retrieved from:
https://www.onlinemathlearning.com/union-of-sets.html
Robert R. Stoll and Herbert Enderton (1999). Set theory. Retrieved from:
https://www.britannica.com/science/set-theory/Axiomatic-set-theory
Timothy Peil (2010, April). The Language of Sets — Cartesian Product. Retrieved from:
http://web.mnstate.edu/peil/MDEV102/U1/S7/Cartesian4.htm
Toppr (n.d.). Relations and Functions: Cartesian Product of Sets. Retrieved from:
https://www.toppr.com/guides/maths/
Overview
Relationships between elements of sets occur in many contexts. Every day we
deal with relationships such as those between a business and its telephone number, an
employee and his or her salary, a person and a relative, and so on. In mathematics we
study relationships such as those between a positive integer and one that it divides, an
integer and one that it is congruent to modulo 5, a real number and one that is larger than
it, a real number x and the value f (x) where f is a function, and so on. Relationships such
as that between a program and a variable it uses, and that between a computer language
and a valid statement in this language often arise in computer science.
Relationships between elements of sets are represented using the structure called
a relation, which is just a subset of the Cartesian product of the sets. Relations can be
used to solve problems such as determining which pairs of cities are linked by airline flights
in a network, finding a viable order for the different phases of a complicated project, or
producing a useful way to store information in computer databases.
Objectives
After successfully completing this lesson, the students should be able to:
• Discuss the concept and definition of relation.
• Identify the properties of relation.
• Apply practical concepts to the appropriate set, function, or relation model,
• Interpret the associated operations and terminology in context.
Course Materials
Relations
It is the representation of the relationship between the elements of the set. Binary
relation is a set of ordered pairs. It may exist between the objects in a same set, or
between objects in a different set.
We use the notation a R b to denote (a,b) € R and a Ṟ b to denote (a,b) R. If a
R b, we say that a is related to b by R.
Example:
Let p = { 1, 2, 3, 4}
q = { a, b, c, d}
R = { (1,a), (1,b), (2,c), (2,d), (3,b), (1,c), (4,a), (1,d) }
Table:
Range
a b c d
1 X X
2 X X
3 X X
4 X X
Domain
Or
Table:
Range
a b c d
1 1 1 0 0
2 0 0 1 1
3 0 1 1 0
4 1 0 0 1
Domain
Example:
Let p = { Elisse, Teemo, Ashe }
q = { Math, Science }
R = { (Elisse,Math), (Teemo,Math), (Teemo,Science), (Ashe,Science) }
Example:
Let R = { (1,1), (1,2), (1,4), (2,2), (3,3), (4,1), (4,4) }
Graph:
1 3
2 4
Examples:
R = {(1,1), (2,1), (3,2), (4,3)} → NOT REFLEXIVE / IRREFLEXIVE
R = {(1,1), (2,2), (3,3), (4,4)} → REFLEXIVE
NOTE: The directed graph of Reflexive Relation includes a directed arrow of edges
on itself (i.e. loop)
1 3
2 4
Examples:
R1 = {(1,1), (1,2), (2,4), (4,1)} → NOT SYMMETRIC / ASSYMETRIC
R2 = {(1,1), (2,2), (3,3), (4,4)} → SYMMETRIC
R1 = {(1,4), (1,2), (2,1), (4,1)} → SYMMETRIC
NOTE: The directed graph of Symmetric Relation includes a directed arrow in each
other:
Examples:
R = {(2,1), (3,1), (3,2), (4,1), (4,2), (4,3)} → TRANSITIVE
R = {(1,1), (1,2), (2,1)} → NOT TRANSITIVE
NOTE: The directed graph of Transitive Relation is if there is a path from one vertex
to another, there is an edge from the vertex to another.
Ordering of Relations
Order of Relations is a type of relation that deals with comparison between objects.
There are three types of order: partial order and total order.
Example: Show whether the relation (x, y) ∈ R, if, x ≥ y defined on the set of +ve
integers is a partial order relation.
Reflexive: The relation is reflexive as for every a ∈ A. (a, a) ∈ R, i.e. (1, 1), (2, 2),
(3, 3), (4, 4) ∈ R.
Poset
The ordered pair (A, R) is called a poset (partially ordered set) when R is
a partial order.
Example 1: The less-than-or-equal-to (≤) relation on the set of integers X is a
partial order, and the set X with this relation is a poset.
Example 2: The relation on a set power {1, 2} , is also a partial order, and the set
{1, 2} with the subset relation is a poset.
2. Total Order (or Linear Order) – When all the elements of a partial order relation
are Comparable.
- The “less than or equal to” relation on real numbers is a total order
relation.
- A binary relation R on a set A is a total order if and only if it is
(1) a partial order, and
(2) for any pair of elements a and b of A, (a,b) R or (b,a) R.
2. Do an arrowed diagram to show the relation between the products (ball pen, pencil,
eraser, ruler, pad paper) and its estimated prices.
For each relation, decide whether or not that relation is reflexive, symmetric,
antisymmetric or transitive:
The x or any letter inside the parentheses, represent the domain set while the
entire symbol, usually f(x), represent the range set.
The f (x) notation is also a substitute for the y-value in a function, y = f (x). The
ordered pairs may be written as (x, f (x)), instead of (x, y).
To evaluate a function, substitute the given number to the function's variable (place
holder, x).
SOLUTION: When substituting expressions, like 4w, into a function, parentheses should
be used to avoid algebraic errors.
1. f(x) = x2 + 7x –24
a. Find f(0)
b. Find f(-1)
c. Find f(3)
2. f(x) = x+5/x-5
a. find f(4)
b. find f(6)
Algebraic Function
A function can be classified as algebraic function if only if the function used an
algebraic function such as addition, subtraction, multiplication, division and taking roots.
Example of an algebraic functions are polynomials, power functions, rational function,
exponential, logarithmic, and sinusoidal.
Polynomials
A function p is a polynomial if:
p(x) = anxn + an−1xn−1 + ... + a2x2 + a1x + a0
where n is a nonnegative integer and a0, a1, a2, ..., an−1, an are all constants called
coefficients of the polynomials
n + an−1x
n−1 + . . . + a2x
2 + a1x + a0 where n is a non-negative integer. There are different function of
polynomials such as linear, quadratic, cubic, quartic, quintic function and so on.
If an algebraic expression has long expression and you are assigned to find out
the degree of polynomial of it. There are 4 steps on how to find it.
Example
5x^5+3x^4+3x^5+3x^3+2x^2+3x^4+2x+5
Step 1. We must combine all the like the terms with also the same power.
(5x^5+3x^5)+(3x^4+3x^4)+3x^3+2x^2+2x+5
Step 2. We must ignore the coefficients
x^5+x^4+x^3+x^2+x+0
Step 4 The largest power of the variable is alsk the degree of the polynomial
deg(x^5+x^4+x^3+x^2+x+0) =5
Examples
Explanation
As you can in the image above, we have a constant b because all the expression
has the same value of b and that is (2). Meanwhile in the a, if the a is a>0 the straight line
goes up as the x increases. Example of a>0 is the function b, it has a value of x (2,3,4)
and you can see on the image above it increases. If the a is a<0 the straight goes down
as the x decreases. Example of a<0 is the function c, it has a value of (2,0, -2) and you
can see on the image above it decreases.
Power Function
A power function can be determined in the form of k(x) = kx^n, where k and x is a
variable that is a real number and n is the power. Both k and n are non-zero constants.
There is different form of power function:
a = n where is n a positive integer,
a = 1/n where n is a positive integer,
and a = −1.
1.f(x) = 5 is a constant function but also a power function because we can rewrite f(x) =5
as f=x^1
2.f(x) = x^3 is a cubic function but also a power function because f(x) =x^3 is a power
functions with a whole number.
Rational Function
A rational function can be determined in the form of f(x) = p(x)/q(x) where in q(x)
must not equal equal to zero. p(x) is the numerator and q(x) is the denominator.
The rational function has a asymptote, the vertical and horizontal asympote.
To find the vertical asymptote, find a way that the denominator of a rational function
must equal to zero.
For example:
x+5/x-3
The vertical asymptote is x=3
First, if the highest is in the denominator not in the numerator, the horizontal asymptote
must be y=0
For example: f(x)= x+5/x^2+5
Second, if the denominator and the numerator have the same degree, the horizontal
asymptote must be the ratio of the leading co efficient
For example: f(x) =5x+5/3x+5, the horizontal asymptote has a ratio of y= 5/3
Third, if the highest degree is in the numerator, there will be no horizontal asymptote.
For example: f(x)= x^2+4/x+2, there will be no horizontal asymptote
Operation of Function
Now that we have discussed some of the algebraic functions, let's now focus on
the operation of function.
Example:
Let f(x) = 5x+3 and g(x)= x^2
Operation to be used:
(f+g) (x) =f(x) + g(x)
and x=3
Let f(3)= 5(3)+3
=15+3
=18
Let g(3) =3^2
=9
EXERCISE
To the given function determine what it is function and tell whether it is power function or
not.
1. 5x^4+5x^3+3x^2+1
2. sq.rt of 144
Find the vertical and horizontal asympote of the given rational function.
3. 2x^4+4/x^4-3
4. 5x^3+2/ 3x^2+2
Solve the following algebraic function using the given operation of function.
In some cases, two or more functions are joined together to form a composite function. In
programming terms, the output of one function will serve as the input for the other.
→f() → g()→
The result of f() is sent through g()
The notation used for composition is (f ᵒ g)(x)= f(g(x)) and is read as “f composed
with g of x” or simply “f of g of x”. Take note that the symbol for composition is a small
circle and not a filled dot as that means multiply.
If we combine these two functions, then we get the composite function as follows:
g ᵒ f: A→C
i.e. for some a in A, and for some c in C, g(f(x))=c
For example,
Starting domain for function g is limited to the values 1,2,3, and 4.
Let: g(x)= 2x
f(x)= x+1
“x” is just a placeholder. Do not be confused. To avoid confusion, let us treat it as the input.
Therefore,
g(input)= 2(input)
Then,
f ᵒ g(1)= f(g(1))= f(2x1)= 2
f ᵒ g(2)= f(g(2))= f(2x2)= 4
f ᵒ g(3)= f(g(3))= f(2x3)= 6
f ᵒ g(4)= f(g(4))= f(2x4)= 8
As we can see, the range of g(x) which is 2,4,6, and 8 will be the domain of f(x)
f(2)= 2+1= 3
f(4)= 4+1= 5
f(6)= 6+1= 7
f(8)= 8+1= 9
Under the composition In this given example, the following ordered pairs (x,y) are created:
(1.3), (2,5), (3,7), and (4,9).
Another example,
Then,
g ᵒ f(1)= g(f(1))= g(2x1)= g(2)= 2+1= 3
g ᵒ f(2)= g(f(2))= g(2x2)= g(4)= 4+1= 5
g ᵒ f(3)= g(f(3))= g(2x3)= g(6)= 6+1= 7
Again,
f ᵒ g(1)= f(g(1))= f(1+1)= f(2)= 2x2= 4
f ᵒ g(2)= f(g(2))= f(2+1)= f(3)= 3x2= 6
f ᵒ g(3)= f(g(3))= f(3+1)= f(4)= 4x2= 8
Therefore,
gᵒf≠fᵒg
“If more than n objects are placed into n boxes, then at least one box contain
more than one object”
Also known as the Dirichlet’s principle, the Pigeonhole principle might appear
too confusing and not clear but it is actually too obvious to be useful. This principle states
that if n+1 or more pigeons are placed in the n holes, then one hole must contain two or
more pigeons.
Although a very simple and easily understandable concept, this is powerful theory
to prove truths that are impossible to be obvious.
For example,
Two or more people watching a movie in a cinema has the same birthday.
There are 366 days in a year (including February 29). Meaning, 366 possible
birth dates and if more than 366 people are watching in a cinema, then 2 of them
must be sharing the same birthday.
Another one,
A section composed of 14 boys and 22 girls is playing the game the Boat is Sinking.
How many members should a group be composed in order to form a group with at least
one female member?
Knowing the fact that there are 36 players with only 14 boys, having 15 members in
a group will surely guarantee that the 15 th member is a female. Therefore, the answer
is 15.
EXERCISE
(COMPOSITION OF FUNCTION)
1.) Let: f(x)= 3x+4
Find (f ᵒ f)(x)
1) March 2020, a woman was said to be exactly 3 months pregnant. How many days
will it take to make sure that the baby is already delivered?
2) How many letter characters should a password be composed making sure that there
are at least 2 same letter in the password?
3) If John has a box containing 1 pair of yellow, red, blue, and black handkerchiefs,
how many handkerchiefs must John pull out of the box to guarantee that he has a
pair?
4.) How many cards should you pick in a deck making sure that at least two of the cards
will be spades?
5.) If a woman has 45 pairs of sandals, how many days will it take for her to repeat her
sandals if she uses one everyday?
1. Using the table graph, show the association “number of letters” from a set of the colors:
blue, green, orange, red and yellow.
2. From the set of relation {(1,1), (1,2), (1,4), (2,1), (2,2), (2,4), (3,3), (4,3), (4,4)}, draw
the directed edges/lines to the digraph.
1 3
2 4
Functional Notation
A firm spends x dollars on product development and y dollars on advertising. Its profit is
described by the following relationship:
3. What is profit if the firm spends $5,000 on product development and $15,000 on
advertising?
4. What is profit if the firm spends $8,000 on product development and $12,000 on
advertising?
Algebra of Function
Solve the following algebraic function using the given operation of function.
7-8.) Prove that g ᵒ f ≠ f ᵒ g given that the starting domain for function g is limited to the even
values less than 10.
Let: g(x)= 2x
f(x)= x+1
9.) How many cards should you pick in a deck making sure that at least two of the cards will be
of the same suit/sign?
10.) How many birth certificates do you need to guarantee that there are at least 2 people who
have the same birth month?
Aslam, A. (n.d). Discrete Mathematics and Its Applications 7th Edition. Retrieved from
https://www.slideshare.net/AdilAslam4/chapter-9-relations-in-discrete-mathematics
Hauskrecht, M. (n.d). CS 441 Discrete Mathematics for CS: Relations. Retrieved from
https://people.cs.pitt.edu/~milos/courses/cs441/lectures/Class21b.pdf
He, M. (2009, August 2). CS381 Discrete Structures/Discrete Mathematics Web Course
Manual: Order Relations. Retrieved from
https://www.cs.odu.edu/~toida/nerzic/content/relation/order/order.html
FUNCTIONAL NOTATION:
ALGEBRA OF FUNCTIONS:
Tutorials Point (2006). Learn Discrete Mathematics. mathematical structures. Retrieved from
https://www.tutorialspoint.com/discrete_mathematics/discrete_mathematics_functions.ht
m
Overview
Combinatorics, the study of arrangements of objects, is an important part of
discrete mathematics. This subject was studied as long ago as the seventeenth century,
when combinatorial questions arose in the study of gambling games. Enumeration, the
counting of objects with certain properties, is an important part of combinatorics. We must
count objects to solve many different types of problems. For instance, counting is used to
determine the complexity of algorithms. Counting is also required to determine whether
there are enough telephone numbers or Internet protocol addresses to meet demand.
The basic rules of counting can solve a tremendous variety of problems. For
instance, we can use these rules to enumerate the different telephone numbers possible,
the allowable passwords on a computer system, and the different orders in which the
runners in a race can finish. Another important combinatorial tool is the pigeonhole
principle. This states that when objects are placed in boxes and there are more objects
than boxes, then there is a box containing at least two objects. For instance, we can use
this principle to show that among a set of 15 or more students, at least 3 were born on the
same day of the week.
Objectives
After successfully completing this lesson, the students should be able to:
• Identify the counting principles and rules that can be applied to a certain problem.
• Solve discrete mathematics problems that involve: computing permutations and
combinations of a set, and fundamental enumeration principle
• Apply counting principles to real life scenarios.
Course Materials
Sum Rule
If the task cannot be performed simultaneously, that means the first task can only
be performed in n1 ways and the second task can be performed in n2 ways. Then doing
whichever order task can be done in n1 + n2 ways. In simple terms, it states that the
number of ways either task 1 or task 2 can be done but strictly not both.
Here, we are generalizing the ways on how to define: n (A) +n (B) +n(C) or simply
A or B or C
Product Rule
If we can separate a procedure into two tasks and there are n1 ways to finish the
first task and n2 ways to finish the second after completing the first task. There should be
For this scenario we generalizing that there are n(A)×n(B)×n(C) ways to do A and
B and C
Suppose the Procedure consists sequential tasks: T1, T2, T3, T4, T5...Tm, it can
be done by n1, n2, n3, n4, n5, ways, respectively.
EXERCISE
1. Haniemay wants to try all the 23 dishes and 6 desserts in offered in PUP lagoon
but she is limited to 1 meal/dessert per day fortunately. How many days would It
take for her to try every meal/dessert in PUP lagoon?
4. If there were 2 team leaders are to be chosen, how many male & female pairs are
possible
5. If there were 2 team leaders are to be chosen again but this time there should be
always 1 male team leader, how many mixed pairs are possible?
This will be the easiest to calculate because we can repeat the choice and the
calculation is straightforward.
Example:
If you choose 3 objects with those of the same kind, your equation would be:
n×n×n (n multiplied 3 times)
Thus,
Example: 4 × 4 × 4 = 64
Now if you choose 3(r) objects out of 5(n) types, your equation would be:
n × n × ... (r number of times)
thus,
Example: 5 × 5 × 5 = 125
Where we can derive this equation:
n × n × ... (r number of times) = nr
When we’re looking for an outcome without repetition, here, we have to use the
factorial (!) where n will be multiplied to n-1, n-2 and so on in decreasing order (ex.
5x4x3x2x1).
Example:
In how many ways can you put 64 candidates in order?
EXERCISE
4. In a men's volleyball team, there are 4 spikers. A team of nerds were used as
targets. For every successful spike, the team scores 1 point and for every hit in the
face, the team scores 3 points. The team needs at least 25 points to end the
training session. In how many ways can the team end the training?
5. An 8 digit password is made of digits 91235564. How many possible passwords
are there?
Mathematicians and other people started to derive new formula instead of sticking
with the whole formula:
Example: P (10,2) = 90
Combination
𝑛!
𝐶 = (𝑛−𝑘)!𝑘!
(𝑘 + 𝑛 − 1)!
𝐶∗ =
(𝑛 − 1)𝑘!
1. How many different committees of five (k) people can be appointed from
ten (n) people?
2. How many possible combinations can a lottery ticket of 6 (k) numbers have
from a lottery that consists of 64 (n) balls?
So, in order to find k from n, you must first know that k is the number of
combinations from an n number of elements. In other words, k is most probably
the smaller number and n is the bigger number.
• This is how lotteries work. First, the numbers are drawn one at a time. Second,
after drawing a certain pick of numbers, doesn’t matter what order they are
drawn, we win.
Example:
How many possible groups of four members can you create from a
selection of 15 people?
15 15! 15 ∗ 14 ∗ 13 ∗ 12
= = = 𝟏𝟑𝟔𝟓
4 4! 11! 4∗3∗2∗1
Repetition Is Allowed
• When given a set of n elements, the combinations with repetition are different
groups formed by k elements of a subset so that the order of elements will not
matter and the elements are repeated
(𝑘 + 𝑛 − 1)!
𝐶=
(𝑛 − 1)𝑘!
Example: Ma’am Dastas asked you to add statement labels on your program.
How many labels can you form if you can only use a 3-letter statement or a 2-letter
statement followed by a number?
(5 + 4 − 1)! 8!
𝐶(5,4) = = = 70
(5 − 1)! 4! (4!)4!
Example: How many different ways can we have 3 scoops from 5 different flavors
of ice cream?
(3 + 5 − 1)!
𝐶= = 35
3! (5 − 1)!
2. 15 participants have written their names on small sheets of paper for a raffle. Show
different ways on how the three names will be chosen.
3. School is over, your family is planning a vacation somewhere outside the city, and
your mom is letting you bring your five favorite books. Suppose there are 12 total
books (including academic books, history books), how many different ways can
you choose the five books?
4. On a circle there are 24 points selected. How many squares with edges in these
points exist?
5. On the plane there are 6 different points (no 3 of them are lying on the same line).
By joining all the points, how many segments do you get?
1. A registration code begins with three numbers. If the possible numbers are 1, 2, 7, 9 and
0, how many different permutations of these numbers can be made if no number is used
more than once?
2. In how many ways can a fragger, a sniper and a medic be chosen from among 7 soldiers?
3. Suppose a landline number contains 5 digits. How many different landline numbers can
be made with the digits 0–9 if no digit is used more than once and the first digit is not 0?
4. How many words can be formed with the letters of the word "IZOLA" with or without
meaning?
5. In the confectioners 5 different sundae are sold. A father would like to buy 15 cups of
sundae for his family. In how many different ways can he buy the sundaes?
6. Ino Til wants to go countryside. The schedule for that day is 33 jeepney trips or 22 UV
services to head from home to AraAra Station. From the station, he can choose from 2
jeepney trips or 3 UV services to head to the countryside. This time, he has to purchase
a jeepney fee, or a UV Fee. If he only has money for 11 fees, how many ways are there
for him to get to the countryside?
7. Six friends Evan, Elijah, Miguel, Leo, Francis and Caev want to sit in a row at the cinema.
If only six cinema seats available, how many ways can we seat them?
8. How many positive divisors does 2000= (2^4)(5^3) have?
9. in a 5-digit numeric password, how many possible combinations are there if a digit cannot
be repeated?
10. In Classmate club, secret codes consisted of two letters followed by 3 digits. How many
possible secret codes are there?
Pierce, Rod. (30 Sep 2018) “Combinations and Permutations.” Math is Fun. Retrieved 17 Mar
2020 from
http://www.mathisfun.com/combinatorics/combinations-permutations.html
Overview
Sequences are ordered lists of elements, used in discrete mathematics in many
ways. For example, they can be used to represent solutions to certain counting problems.
They are also an important data structure in computer science. We will often need to work
with sums of terms of sequences in our study of discrete mathematics. A "series" is what
you get when you add up all the terms of a sequence; the addition, and the resulting value,
are called the "sum" or the "summation". Summation notation (or sigma notation) allows
us to write a long sum in a single expression.
Objectives
After successfully completing this lesson, the students should be able to:
• Apply different techniques used to find formula and terms in a series
• Solve discrete mathematics problems that involves summation series.
• Use mathematical induction in solving summation and series.
Course Materials
Sequences
Definition (1): Sequence is an ordered list of numbers, containing any set of positive or
natural numbers. It may appear as a finite sequence or as an infinite sequence.
Notation: where an is the nth term of the sequence and a1, a2, a3, … is the first, second,
third term and so on ...
Arithmetic Progression
Example (1): The sequence {2, 5, 8, 11, 14, ...} has a common difference of what?
Example (2): The sequence {15, 10, 5, 0, -5, -10, ...} has a common difference of
what?
= a2 = 10, a1 =15;
= 10– 15;
d = -5;
Definition (1): A recursive formula allows finding any term of an arithmetic progression by
multiplying the common difference d to (n-1) and adding it to the first or initial term of the
sequence.
an = a1 + d(n-1)
EXERCISE
Example (1):
a = 15, r = 3; 5th =?
15, 15 x 3, 15 x 32, 15 x 33, 15x 34
(15, 45, 135, 405, 1 215)
5th = 1 215
Example (2):
a = 30, r = 2; 4th =?
30, 30 x 2, 30 x 22, 30 x 23
(30, 60, 120, 240)
4th = 240
Example (1):
a = 15, r = 3
5th term: a5 = 15 x 3(5-1) = 15 x 34
= 15 x 81
= 1 215
Example (2):
a = 30, r = 2
4th = a4 = 30 x 2(4-1) = 30 x 23
= 30 x 8
4th term = 240
EXERCISE
A. Answer the following questions.
1) Find the terms a2, a3, a4 and a5 in geometric sequence, if a1 = 10 and the
common ratio is
r = - 1.
2) Find the 10th term of the geometric sequence, if a1 = 45 and the common ration
r = 5.
=
5) Find the common ratio for the sequence given by 1, 3/4, 9/16, …
=
Definition (1): A series of numbers that starts with a zero followed by a one and two
previous numbers is added up to find the next sequence of numbers (0, 1, 1, 2, 3, 5, 8,
13, 21, 34, ...).
xn = xn-1 + xn-2
Notation: where xn is the nth term and xn-1 is the previous term and xn-2 is the term before
the previous term.
Example (1): x8 =?
x8 = x7 + x6
= 13+ 8
x8 = 21
EXERCISE
B. Fill in the blanks of the missing corresponding values in the Fibonacci sequence.
4) 21, 34, 55, 89, ____, ____
Example (1):
5
∑ (3(n)-1) = (3(3) -1 + 3(4) -1 + 3(5)-1)
j=3
= 8 + 11 + 14
= 33
Example (2):
4
∑ 10k = 10(1) + 10(2) + 10(3) + 10(4)
k=1
= 10 + 20 + 30 + 40
= 100
Arithmetic Series
Definition (1): An arithmetic series is the sum of the terms of an arithmetic sequence. It
is equal to n multiplied by the total average of the 1st and last term.
S = n (a1+an / 2)
Theorem:
Proof:
Example (1):
100 100 100
∑ (2 + 2i) = ∑ 2 + ∑ 2i
i =1 i=1 i=1
100 100
∑ 1 = n;
𝑖=1
𝑛
𝑛(𝑛 + 1)
∑= ;;
2
𝑖=1
EXERCISE
1.
5
∑ 2i =
𝑖=1
2.
10
∑ 6i =
𝑖=1
3.
5
∑(4(i) − 1) =
𝑖=0
4.
50
∑(−5i + 12) =
𝑖=1
5.
∑(−5i + 12) =
𝑖=1
Definition (1): The sum of all the terms of a geometric progression is called geometric
series.
Theorem:
𝑛
𝑟𝑛 − 1
∑(𝑎𝑟 𝑘 ) = 𝑎 [ ]
𝑟−1
𝑘=0
Example (1):
3
𝑘
𝑟𝑛 − 1
∑ 2(7) = 𝑎 [ ]
𝑟−1
𝑘=0
𝑘
74 − 1
∑ 2(7) = 2 [ ]
7−1
𝑘=0
2401 − 1 2400
=2 [ ]= 2 [ ] = 2 ∗ 400 = 𝟖𝟎𝟎
7−1 6
= 800
EXERCISE
A. Evaluate the given Geometric Series.
1.
7
∑ 2𝑗−1
𝑗=1
2.
10
∑ 8𝑗−1
𝑗=1
3.
5
∑ 2(10) 𝑗
𝑗=0
∑ 5𝑗−1
𝑗=1
5.
7
∑ 2(8)𝑗
𝑗=0
Definition (1): The infinite geometric series is the total sum of terms inside of an infinite
geometric sequence.
Example (1):
3 + 2 + 4/3 + 8/9 + 16/27 + …
To get the common ratio we divide the second term by the first term:
r = a2/a1 in this case this is represented by:
r = 2/3
r = a3/a2;
r = 4/3 / 2
= (4/3 / 2) 3
= 4/6 or 2/3
r = 2/3
S = a1 / 1 – r
(Note: You can only use this method if r is < 1 but not equals to 0)
S = 3 / 1 – 2/3
= (3) 3 / (1 – 2/3) 3
= 9 / 3 – 2; 9/1
S = 9;
(S = is the sum of the infinite geometric sequence)
In Sigma notation or summation, the Infinite geometric series is presented
like this:
∞
𝑎
∑ 𝑎𝑟 𝑛−1 =
1−𝑟
𝑛=1
Example (2):
∞
4 4 16 64
∑( )𝑛−1 = 1 + ( ) + ( ) + ( )+⋯
5 5 25 125
𝑛=1
Listing of terms:
Where:
a = 1 and r = 4/5
0th term = (4/5 )1-1 = (4/5)0 = 1;
1st term = (4/5)2-1 = (4/5)1 = 4/5
2nd term = (4/5)3-1 = (4/5)2 = 16/25
3rd term = 64/125;
Because r is less than 1:
1.
∞
2
∑(8 ( ))𝑛−1
3
𝑛=1
2.
∞
2
∑(4 ( ))𝑛
5
𝑛=0
3.
∞
2
∑(8 ( ))𝑛−1
3
𝑛=1
4.
∞
8 𝑛
∑(5 ( ))
25
𝑛=1
1
5. 8+4+2+1+ +
2
1
+⋯
4
A. Determine whether the sequences below form an Arithmetic progression. If they do,
identify its common difference (d).
3) an = 2 x (5) n+1
=
4) an = -5 x (3) n-1
=
5) an = -10 x (-5) n-1
=
10)
∞
𝑝𝑛
∑ 𝑛−2
3
𝑛=1
Lumen Learning (2020, March). Explicit Formulas for Arithmetic Sequences. Retrieved from
https://courses.lumenlearning.com/waymakercollegealgebra/chapter/formulas-for-
arithmetic-sequences/
Overview
Proofs using mathematical induction have two parts. First, they show that the
statement holds for the positive integer 1. Second, they show that if the statement holds
for a positive integer then it must also hold for the next larger integer. Mathematical
induction is based on the rule of inference that tells us that if P(1) and ∀k(P(k) → P(k + 1))
are true for the domain of positive integers, then ∀nP (n) is true. Mathematical induction
can be used to prove a tremendous variety of results. Understanding how to read and
construct proofs by mathematical induction is a key goal of learning discrete mathematics.
Objectives
After successfully completing this lesson, the students should be able to:
• Apply mathematical induction and other techniques to prove mathematical
results.
• Construct induction proofs involving summations, inequalities, and divisibility
arguments.
Course Material
Mathematical Induction
For example,
1 + 3 + 5 … + (2𝑛 − 1) = 𝑛2
This formula affirms that the sum of consecutive numbers from 1 to 2n-1 is equal
to the square root of n (√𝒏). We want to prove that this will be true for n = 1, n = 2, n =
3, and so on. So now we can test the formula for any given number, let n = 3:
1 + 3 + 5 = 32
9=9
1 + 3 + 5 + (2(4) − 1) = 42
16 = 16
But how do we prove that this technique is true for every value of n?
In order to prove that P(n) is true for every natural numbers n, where P(n) is a
propositional function, we complete two (2) steps:
1.) Basis step – in this step, we determine if the first iteration P(1) is true.
2.) Inductive step – in this step, for every natural numbers k, if P(k) is true,
then P(k+1) is also true. The inductive step can be represented as P(k) →
P(k+1).
For instance,
3 + 7 + 11 … (4𝑛 − 1) = 𝑛(2𝑛 + 1)
As shown above, we are asserting that the sum of consecutive numbers from 1
to n. We want to prove that this will be true for n = 1, n = 2, n = 3, and so on.
Now we can test the formula for any given number, let n = 1:
3 = 1(2(1) + 1)
3 = 1(2 + 1)
3 = 1(3)
3=3
3 = 3 is TRUE.
Now, let’s try n = 3:
3 + 7 + 11 = 3(2(3) + 3)
21 = 3(6 + 3)
21 = 3(9)
21 = 21
21 = 21 is TRUE.
1.) First, we’ll see if the statement is TRUE for any specific number k (e.g. 104).
2.) And then, we’ll see if it is ALSO TRUE for k+1 (e.g. 105).
3.) If statement k and k+1 are both TRUE, therefore, it will ALSO BE TRUE for
the term after k+1. It will be TRUE for any natural number we choose.
NOTE: Mathematical induction is not applicable for finding a new formulae or theorems.
It is only used to prove the results obtained in the same way.
2.) We have only one (1) step that we may utilize in Mathematical induction – the
Inductive step. Is this statement TRUE or FALSE?
a. Underline only the PART that makes the following statement erroneous:
“The Basis step helps in determining whether the first iteration of the
statement, which is P(k+10), is TRUE.”
4.) We use k and k+1 for the Inductive step and Basis step respectively.
Is this statement TRUE or FALSE?
𝟏 𝟏 𝟏 𝟏 𝒏
7.) + + + …+ = , given that any integer for n is positive.
𝟏(𝟐) 𝟐(𝟑) 𝟑(𝟑) 𝒏(𝒏+𝟏) 𝒏+𝟏
8.) Write the formal proof that 𝟐𝒏+𝟐 + 𝟑𝟐𝒏+𝟏 is divisible by 7 for all positive integers.
1.) Mathematical induction is useful in knowing whether a statement remains _____ for
every ______ ________.
3.) We use the ______ step in instances where we need to test if P(k) is TRUE with every
______ ________ as k. For instance, to see if both P(k) and P(k+1) are TRUE.
4.) We use the __________ when we need to determine only the first iteration of P(k).
5.) Mathematical induction MAY be used for finding new formulae and theorems. Write T if
the statement is FALSE, otherwise write F.
𝑛2 (𝑛+1)2
6.) 13 + 23 + … + 𝑛3 =
4
𝑛2 (𝑛+1)2
7.) 13 + 23 + … + 𝑛3 =
4
8.) 1 + 2 + 22 + … + 2𝑛−1 = 2𝑛 − 1
(𝑛)(𝑛+1)(𝑛+2)
9.) 1(2) + 2(3) + 3(4) + (𝑛)(𝑛 + 1) =
3
𝑛(𝑛+1)(2𝑛+1)
10.) 12 + 22 + … + 𝑛 2 = 6
Overview
Graphs are discrete structures consisting of vertices and edges that connect these
vertices. There are different kinds of graphs, depending on whether edges have directions,
whether multiple edges can connect the same pair of vertices, and whether loops are
allowed. Problems in almost every conceivable discipline can be solved using graph
models. Using graph models, we can determine whether it is possible to walk down all
the streets in a city without going down a street twice, and we can find the number of
colors needed to color the regions of a map. Graphs can be used to determine whether a
circuit can be implemented on a planar circuit board. We can distinguish between two
chemical compounds with the same molecular formula but different structures using
graphs. We can determine whether two computers are connected by a communications
link using graph models of computer networks. This lesson will introduce the basic
concepts of graph theory and present many different graph models. To solve the wide
variety of problems that can be studied using graphs, we will introduce many different
graph algorithms. We will also study the complexity of these algorithms.
Objectives
After successfully completing this lesson, the students should be able to:
• Identify different types of graphs and its applications.
• Illustrate different traversal methods for trees and graphs.
• Model problems in Computer Science using graphs and trees.
Course Materials
Graph
A graph is made up of points and lines between those points. These points are
also called as nodes or vertices, and the lines between them are called as edges.
Edges connect the endpoints of these vertices.
NOTE: A graph can be identified as an infinite graph or finite graph.
Infinite Graph - a graph is said to be an infinite graph if it consists of an infinite or
set of vertices and edges.
Finite Graph - on the other hand, a graph is finite if it consists of a finite or defined
set of vertices and edges.
The origin of a vertex is the first endpoint of a directed edge and the other end is
its destination.
An edge of a vertex is described as incoming edges if they are directed and its
destination is that vertex.
Two vertices are described as adjacent and neighbors if the endpoints of an edge
are those two vertices.
In degree of vertex 2: 2
Out degree of vertex 2: 3
∑ deg(𝑣)
𝑣∈𝑉
NOTE: This applies even if multiple edges and loops are present.
Example on theorem 1:
How many edges are there in a graph with 10 vertices each of degree six?
Solution: because the sum of the degrees of the vertices is 6*10 = 60, it follows
that 2m = 60 where m is the number of edges. Therefore, m = 30.
Proof: Let V1 and V2 be the set of vertices of even degree and the set of vertices of odd
degree, respectively, in an undirected graph G = (V, E) with m edges. Then:
The first term in the right-hand side of the last equality is even, because deg(v) is
even for v∈ V1. Furthermore, because this sum is 2m, the sum of the two terms on the
right-hand side of the last equality is even. Hence, the second term in the sum is also
even. There must be an even number of such terms, because all the terms in this sum are
odd. Thus, there are an even number of vertices of odd degree.
Path = { 1, 2, 4, 5, 4 }
Simple Path = { 1, 2, 4, 5 }
Circuit = { 1, 2, 4, 5, 4, 1 }
We will use the graph below to show the different ways in representing a graph.
Adjacency Matrix is used to represent a finite graph and its element is used to
indicate whether the pairs of vertices are adjacent or not. We use the formula n x n (n is
the number of vertex) to determine the number of elements in the matrix. If there is an
edge from vertex i to vertex j, we represent it using 1, but if none, we use 0. The source
vertices are represented by row, while column represents the destination vertices.
Adjacency List
In the adjacency list, each vertex is associated with its neighboring vertices or
edges (all the vertex stores a list of adjacent vertices). In other words, in this
representation, a vertex contains a pointer to a linked list of all the out-neighbors of that
vertex.
Adjacency Array
Using adjacency array, the given graph will look like this:
1. For each of the following, try to give two different unlabeled graphs with the given
properties, or explain why doing so is impossible.
a. Two different trees with the same number of vertices and the same number
of edges. A tree is a connected graph with no cycles.
b. Two different graphs with 8 vertices all of degree 2.
c. Two different graphs with 5 vertices all of degree 4.
d. Two different graphs with 5 vertices all of degree 3.
3. You are a city engineer tasked to graph a model that represents the proposed
subway system in a large city. Should edges be directed or undirected? Should multiple
edges be allowed? Should loops be allowed? Explain.
4. In a round-robin tournament the SKT T1 beat the Invictus Gaming, the SKT T1
beat the TSM, the SKT T1 beat the Fnatic, the Invictus Gaming beat the TSM, the Invictus
Gaming beat the Fnatic, and the TSM beat the Fnatic. Model this outcome with a directed
graph.
Trees are connected and acyclic graphs that contain no simple circuits is called a
tree. This graph was first used by the English mathematician Arthur Cayley in 1857 to
count certain types of chemical compounds.
Application Of Trees
Trees are used to construct efficient algorithms for locating items in a list.
Trees can be used to study games such as checkers and chess and can help to
determine winning strategies for playing these games. It can also be used to model
procedures carried out using a sequence of decisions.
General Trees
General trees consist of vertices and each vertex can have a minimum degree of
1 and maximum degree n. We use the formula n+1 to partition it into subsets wherein the
root of the tree is the first subset.
A rooted tree is a directed tree with exactly one node (root) that has incoming
degree of 0 while all other vertices have incoming degree of 1.
Application Of Graph
There are various applications of graphs, but here are some of the common
applications.
Social Network
This graph shows who
communicates with whom. Social
networks are a representation of your
twitter followers, Facebook friends, G-
mail etc. and how you connect with
each other. Vertices represent the
sender or receiver of information and
the edges represent the network.
In transportation networks,
the stops or destinations are
represented by vertices, and the
edges represent the link between
them. This can be observed when
you use Google Maps.
This graph is used to identify legal or illegal activity for network security of a
computer. The IP or internet protocol addresses are represented by vertices, while the
edges represent the packets.
This graph is used in visualizing and analyzing data flow. It can also be used I n
other processes in optimizing database languages.
In this graph, the vertices represent the state or stages a robot must undergo, while
3. A _____________ is a tree the vertices of which are assigned unique numbers from 1
to n
A. Unlabeled Tree
B. Labeled Tree
C. Direct Tree
D. Indirect Tree
5. An email with malicious content starts to spread when a person opens the email and
it automatically sends a letter to five others.
Each person who receives the email either opens it and emails are sent again to
5 persons who have never received it or marks it as spam. Suppose that 10,000 people
send out the email before the chain ends and that no one receives more than one email.
How many people receive the email, and how many marks it as spam?
1. The vertex set and the edge set are finite sets in a ______
a) finite graph
b) bipartite graph
c) infinite graph
d) connected graph
3. In a directed graph modeling a round-robin tournament, what do the in-degree and the out-
degree of a vertex represent?
4. If a full binary tree has 1000 internal vertices, how many edges does it have?
6. If a tree has 10,000 vertices, how many edges does the tree have?
8. Suppose 1000 people enter a Tekken tournament. Use a rooted tree model of the tournament
to determine how many games must be played to determine a champion, if a player is eliminated
after one loss and games are played until only one entrant has not lost.
9. For each course at a university, there may be one or more other courses that are its
prerequisites. How can a graph be used to model these courses and which courses are
prerequisites for which courses?
Should edges be directed or undirected? Looking at the graph model, how can we find
courses that do not have any prerequisites and how can we find courses that are not the
prerequisite for any other courses?
10. Describe a graph model that represents whether each employee at a company gathering
knows the name of each other person at the event.
Should the edges be directed or undirected?
Should multiple edges be allowed?
Should loops be allowed?