Notes
Notes
Learning objectives
•
Module 01, MAT2002//Discrete Mathematics and Graph Theory
Mathematics Division//School of Advanced Sciences and Languages// VIT Bhopal University
1
1 Introduction
2
Solved Examples from Past Examinations
((p ∧ q) ∧ (p → r) ∧ (q → r)) → r
≡ (¬p ∨ ¬q) ∨ (p ∧ ¬r) ∨ (q ∧ ¬r) ∨ r (De Morgan’s law & Involution law ¬(¬a) ≡ a)
≡T ∨T ∨r (Tautology law)
≡T (Dominance law a ∨ T ≡ T )
Hence, ((p ∧ q) ∧ (p → r) ∧ (q → r)) → r is a tautology.
3
2. (a) Given the following two conditional statements:
1. “If a student studies hard, then they will pass the exam.”
2. “If a shape is a square, then it has four equal sides.”
For each statement, write the:
(i) Converse
(ii) Inverse
(iii) Contrapositive
Solution: 1. “If a student studies hard, then they will pass the exam."
Let, p: student studies hard, q: student passes exam. Then the given condi-
tional statement is written as p → q. Therefore,
(i) Converse q → p: If a student passes the exam, then they studied hard.
(ii) Inverse ¬p → ¬q: If a student does not study hard, then they will not
pass the exam.
(iii) Contrapositive ¬q → ¬p: If a student does not pass the exam, then they
did not study hard.
2. “If a shape is a square, then it has four equal sides."
Let, r: shape is square, s: shape has four equal sides. Then the given
conditional statement is written as r → s. Therefore,
(i) Converse s → r: If a shape has four equal sides, then it is a square.
(ii) Inverse ¬r → ¬s: If a shape is not a square, then it does not have four
equal sides.
(iii) Contrapositive ¬s → ¬r: If a shape does not have four equal sides, then
it is not a square.
(b) Use De Morgan’s law to find the negative of the following statement.
‘If it does not rain or if there is no traffic dislocation, then the sports day will
be held and the cultural program will go on.’
Solution: Let,
p : It rains
q : There is traffic dislocation
r : Sports day is held
s : Cultural program goes on
∴ Negation (¬p ∨ ¬q) ∧ (¬r ∨ ¬s): Either it does not rain or there is traffic
dislocation, and either the sports day is not held or the cultural program
does not go on.
4
3. (a) Prove that
(p → r) ∨ (q → r) ≡ (p ∧ q) → r.
(i) With truth table
(ii) Without truth table
Solution:
(i) Proof with truth table:
p q r p → r q → r LHS: (p → r) ∨ (q → r) p ∧ q RHS: (p ∧ q) → r
T T T T T T T T
T T F F F F T F
T F T T T T F T
T F F F T T F T
F T T T T T F T
F T F T F T F T
F F T T T T F T
F F F T T T F T
Since the truth values of LHS and RHS are same in all rows, the propo-
sitions are logically equivalent, i.e.,
(p → r) ∨ (q → r) ≡ (p ∧ q) → r
LHS = (p → r) ∨ (q → r)
≡ (¬p ∨ r) ∨ (¬q ∨ r) (Implication law)
≡ (¬p ∨ ¬q) ∨ (r ∨ r) (Associative & Commutative laws)
≡ (¬p ∨ ¬q) ∨ r (Idempotent law)
≡ ¬(p ∧ q) ∨ r (De Morgan’s law)
≡ (p ∧ q) → r (Implication law)
= RHS
Symbolic Representation:
Proposition X: “If Alice is both smart and honest, then she is not intelligent.”
X : (p ∧ q) → ¬r
5
Proposition Y : “If Alice either smart or not intelligent, then she is not hon-
est.”
Y : (p ∨ ¬r) → ¬q
Truth table comparison for propositions X and Y :
p q r p ∧ q ¬r X : (p ∧ q) → ¬r p ∨ ¬r ¬q Y : (p ∨ ¬r) → ¬q
T T T T F F T F F
T T F T T T T F F
T F T F F T T T T
T F F F T T T T T
F T T F F T F F T
F T F F T T T F F
F F T F F T F T T
F F F F T T T T T
Since the truth values of X and Y are not the same in all rows, the proposi-
tions are not logically equivalent, i.e.,
(p ∧ q) → ¬r 6≡ (p ∨ ¬r) → ¬q
1. L → ¬F
2. ¬F → ¬C
3. F → C
4. K → C
5. L ∧ K
6
6. L Using 5 and Simplification
7. ¬F Modus Ponens using 1 and 6
8. ¬C Modus Ponens using 2 and 7
9. K Using 5 and Simplification
10. C Modus Ponens using 4 and 9
11. C ∧ ¬C Conjunction using 8 and 10
12. F Using 11 and Contradiction
∴ The statements are inconsistent.
(b) Prove that the premises
p → q, q → r, s →∼ r, and q ∧ s
are inconsistent.
Solution: To prove that the given premises are inconsistent, we derive a
contradiction.
1. q ∧ s Premise (Given)
2. q Using 1 and Simplification
3. s Using 1 and Simplification
4. q → r Premise (Given)
5. r Modus Ponens using 2 and 4
6. s →∼ r Premise (Given)
7. ∼ r Modus Ponens using 3 and 6
8. r∧ ∼ r Conjunction using 5 and 7
9. F 8 and Contradiction
∴ The premises are inconsistent.
7
(b) Prove that the following arguments are valid without using truth tables:
(i) p →∼ q, r → q, r ∴ ∼ p
(ii) p ∨ (q → p), ∼ p ∧ r ∴ ∼ q
Solution:
(i) The valid argument for deducing ∼ p from the given premises is given as
a sequence.
1. p −→∼ q Premise (Given)
2. r −→ q Premise (Given)
3. r Premise (Given)
4. q Modus Ponens using 2 and 3
5. ∼∼ q Using 4 and Involution law
6. ∼ p Modus Tollens using 1 and 5
∴ The conclusion ∼ p is valid.
(ii) The valid argument for deducing ∼ q from the given premises is given as
a sequence.
1. p ∨ (q −→ p) Premise (Given)
2. ∼ p ∧ r Premise (Given)
3. ∼ p Using 2 and Simplification
4. q −→ p Disjunctive Syllogism using 1 and 3
5. ∼ q Modus Tollens using 4 and 3
∴ The conclusion ∼ q is valid.
6. (a) Examine the validity of the following argument: “If the market is free then
there is no inflation. If there is no inflation then there are price controls.
Since there are price controls, therefore market is free."
Solution: Let,
p : The market is free
q : There is inflation
r : There are price controls
Symbolic Representation:
Given premises: p −→∼ q, ∼ q −→ r, r
Conclusion: p
From the given premises, the following can be deduced.
1. p −→∼ q Premise (Given)
2. ∼ q −→ r Premise (Given)
3. r Premise (Given)
4. p −→ r Hypothetical Syllogism using 1 and 2
But from r and p −→ r, we cannot conclude p. This is the fallacy of Affirming
the Conclusion.
Therefore, the argument is invalid.
8
p r Premise 1: p −→ r Premise 2: r Conclusion: p
T T T T T
T F F F T
F T T T F (FAIL)
F F T F F
(b) You are about to leave for school in the morning and discover that you do
not have your glasses. You know the following statements are true:
a. If I was reading the newspaper in the kitchen, then my glasses are on
the kitchen table.
b. If my glasses are on the kitchen table, then I saw them at breakfast.
c. I did not see my glasses at breakfast.
d. I was reading the newspaper in the living room or I was reading the
newspaper in the kitchen.
e. If I was reading the newspaper in the living room, then my glasses are
on the coffee table.
Use the rules of inference to find where the glasses are.
Solution: Let,
Symbolic Representation:
Given statements: K −→ T , T −→ B, ∼ B, L ∨ K, L −→ C
Now apply rules of inference.
1. K → T Premise (Given)
2. T → B Premise (Given)
3. ∼ B Premise (Given)
4. L ∨ K Premise (Given)
5. L → C Premise (Given)
6. ∼ T Modus Tollens using 2 and 3
7. ∼ K Modus Tollens using 1 and 6
8. L Disjunctive Syllogism using 4 and 7
9. C Modus Ponens using 5 and 8
9
7. Show the validity of the following argument using the rule of conditional proof.
“If my program runs successfully then I will submit my project. I can appear
in the examination if I submit my project. Either my program runs successfully
or the computer crashes. Therefore, if the computer does not crash then I can
appear at the examination."
Solution: Let,
P : My program runs successfully
S : I submit my project
E : I can appear in the examination
C : The computer crashes
Symbolic Representation:
Given premises: P → S, S → E, (P ∧ ¬C) ∨ (¬P ∧ C)
Conclusion: ¬C → E
In conditional proof, we assume ¬C as an additional premise and try to derive
conclusion E.
Now apply rules of inference.
1. P → S Premise (Given)
2. S → E Premise (Given)
3. (P ∧ ¬C) ∨ (¬P ∧ C) Premise (Given)
4. ¬C Additional premise for conditional proof
5. P → E Hypothetical Syllogism using 1 and 2
6. ¬C ∨ P Using 4 and Addition
7. ¬(C ∧ ¬P ) Using 6, Involution law and De Morgan’s law
8. P ∧ ¬C Disjunctive Syllogism using 3 and 7
9. P Using 8 and Simplification
10. E Modus Ponens using 5 and 9
(i) Every street in the city has a house in which we can find a person who is
either rich or highly educated.
(ii) There is a room in Academic Building I where all the students of VIT Bhopal
can sing and dance.
(iii) Given any student in the campus, the student has a friend who has a job in
Pune.
Solution:
(i) Every street in the city has a house in which we can find a person who is
either rich or highly educated.
10
Let,
S(x) : x is a street in the city
H(y, x) : y is a house on street x
P (z, y) : z is a person in house y
R(z) : z is rich
E(z) : z is highly educated
Symbolic form: ∀x S(x) → ∃y (H(y, x) ∧ ∃z (P (z, y) ∧ (R(z) ∨ E(z))))
(ii) There is a room in Academic Building I where all the students of VIT Bhopal
can sing and dance.
Let,
R(x) : x is a room in Academic Building I
S(y) : y is a student of VIT Bhopal
C(y, x) : student y can sing and dance in room x
Symbolic form: ∃x R(x) ∧ ∀y (S(y) → C(y, x))
(iii) Given any student in the campus, the student has a friend who has a job in
Pune.
Let,
S(x) : x is a street in the campus
F (x, y) : y is a friend of x
J(y) : y has a job in Pune
Symbolic form: ∀x S(x) → ∃y (F (x, y) ∧ J(y))
(i) ∃x ∀y (x + y = y)
(ii) ∀x ∀y ((x ≥ 0) ∧ (y < 0)) → (x − y > 0)
(iii) ∃x ∃y ((x ≤ 0) ∧ (y ≤ 0)) ∧ (x − y > 0)
(iv) ∀x ∀y ((x 6= 0) ∧ (y 6= 0)) ↔ (xy 6= 0)
Solution:
(i) ∃x ∀y (x + y = y)
Translation: There exists a real number x such that for every real number
y, the sum of x and y equals y.
(Equivalently: There is a real number that is an additive identity in the set
of real numbers.)
(ii) ∀x ∀y ((x ≥ 0) ∧ (y < 0)) → (x − y > 0)
Translation: For every pair of real numbers x and y, if x is non-negative and
y is negative, then the difference x − y is positive.
11
(iii) ∃x ∃y ((x ≤ 0) ∧ (y ≤ 0)) ∧ (x − y > 0)
Translation: There exist non-positive real numbers x and y such that their
difference x − y is positive.
(iv) ∀x ∀y ((x 6= 0) ∧ (y 6= 0)) ↔ (xy 6= 0)
Translation: For all real numbers x and y, both x and y are non-zero if and
only if their product xy is non-zero.
10. Determine the truth value and negation of the following statements, where the
universal set is U = {1, 2, 3}:
Solution:
12
11. A doctor is analyzing a patient’s symptoms. Given the following premises:
Symbolic Representation:
Given premises : ∀x (F (x) → D(x)), ∀x (C(x) → F (x)), C(Alice), ∀x (D(x) → M (x)),
∀x (M (x) → ¬H(x))
Conclusion: ¬H(Alice)
Now apply rules of inference.
13
Solution: Let,
Symbolic Representation:
Given premises: ∀x ∀y [S(x, y) → W (x, y)], ¬W (j, p)
Conclusion: ¬S(j, p)
Now apply rules of inference.
14
Exercises
2. Test the validity of the following argument. If I will select in IAS examination,
then I will not be able to go to London. Since, I am going to London, I will not
select in IAS examination.
3. Prove the validity of the following argument "If I get the job and work hard, then
I will get promoted. If I get promoted, then I will be happy. I will not be happy.
Therefore, I will not get the job or I will not work hard".
7. (a) "If a number is divisible by 10 , then the number ends in zero". Write
the given statement into symbolic form and then write contrapositive of the
statement.
(b) Prove or Disprove: (p ∧ q) ∧ (∼ (p ∨ q)) is a tautology.
8. Verify the validity of the following argument using inference rules: "If I take the
day off, it either rains or snows." "I took Tuesday off or I took Thursday off." "It
was sunny on Tuesday." "It did not snow on Thursday." Therefore, "It rained on
Thursday."
9. (a) Using truth table find whether the following expression is a tautology, con-
tradiction, or contingency:
(p ∨ q) → (p ∧ ¬q) ↔ (¬p ∨ q)
(p → q) → (q → r) ≡ ¬q ∨ r
¬(q → r) ∧ r ∧ (p → q)
15
12. (a) A university database has a table Students (Name, Course, Grade), where
Name represents the student’s name, Course represents the course the stu-
dent is enrolled in, and Grade represents the student’s grade in that course.
The university has the following policies:
(A) Every student must pass at least one course.
(B) If a student passes a course, they are eligible for the next level of that
course.
(C) A student is placed on academic probation if they pass fewer than two
courses.
Answer the following:
(i) Express all policies in symbolic form.
(ii) Negate all policy statements and provide their symbolic notation.
(b) Given the following premises:
(i) If a student studies consistently, they will understand the material.
(ii) If a student understands the material, they will pass the exam.
(iii) If a student does not pass the exam, they must retake the course.
(iv) Sofia studied consistently.
Can we logically conclude that Sofia does not have to retake the course? Is
the conclusion valid? Justify your answer.
14. Show that the premises “It is not sunny this afternoon and it is colder than
yesterday," “We will go swimming only if it is sunny," “If we do not go swimming,
then we will take a canoe trip," and “If we take a canoe trip, then we will be home
by sunset" lead to the conclusion “We will be home by sunset."
15. (a) Show that ¬r is a valid conclusion from the premises p → ¬q, r → p, q
(i) with truth table
(ii) without truth table.
(b) Write the English sentence using the logical expression.
“You cannot ride the roller coaster if you are under 4 feet tall unless you are
older than 16 years old."
∼ (p ∨ q) ↔ (p ∧ q) ≡ (p ∨ q) ∧ (∼ p∨ ∼ q)
(b) Translate the statement ∀x (C(x) ∨ ∃y (C(y) ∧ F (x, y))) into English, where
C(x) : x has a computer and F (x, y) : x and y are friends, and the domain for
both x and y consists of all students in your school.
17. Determine the truth value of each of these statements, if the universe of dis-
course consists of all integers. In case of false value give a counter example.
16
(i) ∃n n = −n2
(ii) ∀n n3 ≥ n
(iii) ∃n (n + 3 = 3n)
18. (a) Using the vocabulary Q(x) : x is a rational number, R(x) : x is a real number,
and L(x) : x is less than 2 , translate the following into English sentences:
(i) ∀x (Q(x) → R(x))
(ii) ∃x (¬Q(x) ∧ R(x))
(iii) ∀x (Q(x) ∧ L(x) → R(x) ∧ L(x))
(iv) ∀x (Q(x) ∧ L(x)) → ∀x (R(x) ∧ L(x)).
(b) Translate into logical expressions:
(i) Each person in this room is either a BTech student or an MSc student.
(ii) There is a student in this class room who speaks Hindi or English.
20. Write the following statements using predicates and quantifiers also find their
negations
21. Let A = {1, 2, 3, 4, 5, 6}. Determine the truth value of each of the following:
22. Let the universe of discourse be the set of real numbers and define
x
P (x, y) : = 1.
y
What is the truth value of the following statements? Justify your answers.
(i) ∀x ∀y P (x, y)
(ii) ∀x ∃y P (x, y)
(iii) ∃x ∀y P (x, y)
(iv) ∃x ∃y P (x, y)
17
23. Let C(x, y) be the statement “x and y have chatted over the Internet,” where the
domain for the variables x and y consists of all students in your class. Use
quantifiers to express each of these statements.
(i) There are two students in your class who have not chatted with each other
over the Internet.
(ii) There is a student in your class who has chatted with everyone in your class
over the Internet.
(iii) There are at least two students in your class who have not chatted with the
same person in your class.
(iv) There are two students in the class who between them have chatted with
everyone else in the class.
24. Let C(x) be the statement “x has a cat,” let D(x) be the statement “x has a dog,”
and let F (x) be the statement “x has a ferret.” Express each of the following
statements in terms of C(x), D(x), F (x), quantifiers, and logical connectives.
Moreover, write the negative of each of the statements. Let the domain consist of
all students in your class.
25. Let P (x) be the statement “x can speak Russian” and let Q(x) be the statement
“x knows the computer language C++.” Express each of these sentences in terms
of P (x), Q(x), quantifiers, and logical connectives. The domain for quantifiers
consists of all students at your school.
(i) There is a student at your school who can speak Russian and who knows
C++.
(ii) There is a student at your school who can speak Russian but who doesn’t
know C++.
(iii) Every student at your school either can speak Russian or knows C++.
(iv) No student at your school can speak Russian or knows C++.
26. Use predicate calculus to prove the following agreement. "Students who pass the
course do the homework or attend lectures. Bob did not attend every lecture.
Bob passed the course. Therefore, Bob must have done the homework."
27. Verify the validity of the following argument. “Every living thing is a plant or an
animal. John’s goldfish is alive and it is not a plant. All animals have hearts.
Therefore, John’s goldfish has a heart."
28. Show that the following argument is valid “One student in the class knows JAVA."
“Everyone who knows JAVA can get a high-paying job." Therefore “Someone in
this class can get a high-paying job."
18
Module 2: Sets and Relations
• Relations
• Types of Relations
• Equivalence Relations
• POSET
• Hasse Diagram
Hasse Diagram
A Hasse diagram is a mathematical diagram used to represent a partially ordered set (poset).
It simplifies a directed graph by removing redundant information like reflexive loops and
transitive edges.
3. No Loops: Reflexive relations (where an element relates to itself) are not shown.
1
Example: Factors of 12
Consider the set
A = {1, 2, 3, 4, 6, 12}
ordered by the divisibility relation (a | b).
• 4 is placed above 2.
1 | 2 and 2 | 4
imply
1|4
2. Factors of 8:
D8 = {1, 2, 4, 8}
3. Factors of 12:
D12 = {1, 2, 3, 4, 6, 12}
4. Factors of 30:
D30 = {1, 2, 3, 5, 6, 10, 15, 30}
5. Factors of 60:
D60 = {1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60}
6.
{2, 4, 8, 16, 32}
7.
{2, 3, 6, 12, 18, 36}
2
8.
{2, 4, 5, 10, 12, 20, 25}
9. Factors of 24:
D24 = {1, 2, 3, 4, 6, 8, 12, 24}
2.
{0, 2, 5, 10, 11, 15}
3.
{−3, −1, 0, 4}
3
2. Lexicographical order on
{1, 2} × {1, 2}
where
(a, b) ≤ (c, d)
if
a<c
or
a = c and b ≤ d
3. Partitions of
{a, b, c}
4. Boolean Algebra B2
Key Definitions
• Maximal Element: An element x such that no element y exists with
x<y
y<x
4
Exercise Questions
1. Let
A = {1, 2, 3}, B = {a, b}
Write the Cartesian product
A×B
2. Let
A = {1, 2, 3}
and
R = {(1, 1), (1, 2), (2, 2), (3, 3)}
Determine whether R is:
• Reflexive
• Symmetric
• Transitive
4. If
A = {1, 2, 3, 4}
and
aRb ⇐⇒ a < b
write all ordered pairs of R.
5. On integers Z,
aRb ⇐⇒ a − b is divisible by 3
Show whether the relation is:
• Reflexive
• Symmetric
• Transitive
6. On
A = {1, 2, 3, 4}
define
R = {(1, 1), (2, 2), (3, 3), (4, 4), (1, 3), (3, 1)}
Determine whether R is an equivalence relation.
5
7. Let
aRb ⇐⇒ a − b is divisible by 4
Find:
[0], [1], [2], [3]
8. On
A = {1, 2, 3, 6}
define
aRb ⇐⇒ a | b
Check:
• Reflexive
• Antisymmetric
• Transitive
9. On
A = {1, 2, 3}
define
R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)}
Is R a partial order relation?
6
Lattices and Boolean algebra
• Distributive Lattice
Learning objectives
• Lattice as POSET & Core Structures Identify POSETs:
– Differentiate between partially ordered sets and totally ordered sets using
formal relational definitions.
– Construct Hasse Diagrams: Draw clear Hasse diagrams from a given partial
order relation without redundant transitive edges.
– Calculate Bounds: Find the maximal, minimal, greatest, least, upper, and
lower bounds of a subset within a POSET.
• Construct Truth Tables: Build accurate truth tables for any given Boolean func-
tion to evaluate all possible input combinations.
• Design Logic Gate Networks: Draw functional logic circuit diagrams using stan-
dard gates (AND, OR, NOT) directly from simplified Boolean functions.
1
1 Introduction
Lattices and Boolean algebra are mathematical frameworks used to analyze order,
logic, and relationships between sets.
• Lattices deal with how elements are ranked, ordered, or bounded relative to one
another.
• Boolean Algebra uses binary logic (True/False, 1/0) to calculate and simplify
logical reasoning and electronic systems.
[A] [B]
a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) (1)
• Complemented: The lattice has a distinct top element (1) and bottom element
(0). Every element a must have a unique opposite element a0 such that:
a ∧ a0 = 0 and a ∨ a0 = 1 (2)
3 Real-World Applications
2
3.2 Digital Electronics & Computing
Computer hardware processes data using switches that are either ON (1) or OFF (0).
Boolean algebra provides the mathematical language required to design, analyze, and
minimize these electronic circuits:
• A OR B =⇒ A ∨ b =⇒ OR Gate
Every Boolean algebra complies with the following foundational dual laws:
3
We considered some examples related to above these topics
Example 1. Find the complement of each element of (D42 , /). Also, prove that, in any
distributive lattice (S, ≤), the joint cancellation law holds, i.e., if a ∨ b = a ∨ c and
a ∧ b = a ∧ c then b = c. (VIT-2025-2026 MTE)
Solution: Complements in (D42 , /) and Cancellation Law
For complements of elements in D42 :
The set of divisors of 42 is D42 = {1, 2, 3, 6, 7, 14, 21, 42}. In the lattice (D42 , /), the meet
(∧) is defined as gcd(a, b) and the join (∨) is defined as lcm(a, b). An element b is a
complement of a if a ∧ b = 1 and a ∨ b = 42.
Thus, b = c.
Example 2. Express the following function into its Sum of Product (SOP) / pdnf with-
out using truth table. (VIT-2024-2025 TEE)
(b) x + yz + xyz
4
(c) xz 0 + y 0
Solution: Sum of Products (SOP) / PDNF
(c) Let F = xz 0 + y 0
= xz 0 (y + y 0 ) + y 0 (x + x0 )(z + z 0 )
= (xyz 0 + xy 0 z 0 ) + (xy 0 z + xy 0 z 0 + x0 y 0 z + x0 y 0 z 0 )
= xyz 0 + xy 0 z 0 + xy 0 z + x0 y 0 z + x0 y 0 z 0
P
PDNF: m6 + m4 + m5 + m1 + m0 = (0, 1, 4, 5, 6)
Example 3. Construct the tables for ∧ and ∨ for the set of all divisors of 36 under the
relation of divisibility. Also show that it forms a lattice. (VIT-2024-2025 TEE)
Solution: Let D36 = {1, 2, 3, 4, 6, 9, 12, 18, 36}. Here, a ∧ b = gcd(a, b) and a ∨ b = lcm(a, b).
Meet Table (∧ or gcd)
∧ 1 2 3 4 6 9 12 18 36
1 1 1 1 1 1 1 1 1 1
2 1 2 1 2 2 1 2 2 2
3 1 1 3 1 3 3 3 3 3
4 1 2 1 4 2 1 4 2 4
6 1 2 3 2 6 3 6 6 6
9 1 1 3 1 3 9 3 9 9
12 1 2 3 4 6 3 12 6 12
18 1 2 3 2 6 9 6 18 18
36 1 2 3 4 6 9 12 18 36
5
Join Table (∨ or lcm)
∨ 1 2 3 4 6 9 12 18 36
1 1 2 3 4 6 9 12 18 36
2 2 2 6 4 6 18 12 18 36
3 3 6 3 12 6 9 12 18 36
4 4 4 12 4 12 36 12 36 36
6 6 6 6 12 6 18 12 18 36
9 9 18 9 36 18 9 36 18 36
12 12 12 12 12 12 36 12 36 36
18 18 18 18 36 18 18 36 18 36
36 36 36 36 36 36 36 36 36 36
It forms a Lattice, since a set forms a lattice if every pair of elements has a unique
greatest lower bound (meet) and a unique least upper bound (join). Since for any
a, b ∈ D36 , the operations gcd(a, b) and lcm(a, b) yield distinct elements that are also
members of D36 , it satisfies the definition and forms a lattice.
Figure 1:
Solution: To determine which posets are lattices, we evaluate if every pair of elements
has a Least Upper Bound (LUB / Join) and a Greatest Lower Bound (GLB / Meet).
• II: Lattice. This is a chain (1 < 2 < 3 < 4). All finite chains are lattices because
for any two elements, the larger element is the LUB and the smaller element is
the GLB.
• III: Not a Lattice. Look at elements a and b. They have two upper bounds, d and
e, but neither d nor e is strictly "least" (they are incomparable). Thus, LUB(a, b)
does not exist.
• IV: Not a Lattice. Look at elements d and c. They have no common upper bound
(there is no element located "above" both). Thus, LUB(d, c) does not exist.
6
Example 5. (a) Find the complements in the Lattice of c and d from Figure 2. (VIT-
2024-2025 MTE )
Figure 2:
Figure 3:
Solution 5 (a): In a lattice with a total top element (e) and a bottom element (a), an
element x is a complement of y if:
Solution 5 (b): This is the standard Hasse diagram for the diamond lattice.
• Every pair from the incomparable middle elements {b, c, d} has e as their LUB
and a as their GLB. Since every possible pair has a unique LUB and GLB, it
satisfies the definition of a lattice.
7
The Hasse diagram represents the lattice L = D30 , which is the set of divisors of
30:
D30 = {1, 2, 3, 5, 6, 10, 15, 30}
under the partial order of divisibility (a | b).
For a subset S ⊆ L to be a sub-lattice, it must be closed under the meet and join
operations of the original lattice. In D30 , the operations are:
Figure 4:
• gcd(2, 3) = 1 ∈ L1
• lcm(2, 3) = 6 ∈ L1
• All other operations (e.g., between 1 or 6 and other elements) naturally yield
elements within the set.
2 ∨ 5 = lcm(2, 5) = 10
8
Since 10 ∈
/ L2 , the subset is not closed under the join operation.
Conclusion: L2 is not a sub-lattice.
Figure 5:
Solution 7 (a): Let us check the operations for the non-comparable elements 6 and
15:
All other operations between comparable elements yield elements already in the set
(e.g., gcd(3, 6) = 3, lcm(6, 30) = 30).
Since L1 is closed under both operations, L1 is a sub-lattice.
6 ∧ 15 = gcd(6, 15) = 3
Since 3 ∈
/ L2 , the subset is not closed under the meet operation.
Conclusion: L2 is not a sub-lattice.
Example 8. Construct an input/output table for the following Boolean function: f (A, B, C) =
(A + B)C̄, also find the disjunctive normal form of the Boolean function. Hence to rep-
resent the logical expressions with min term. (VIT-2024-2025 TEE)
Solution: Step 1:
9
A B C C̄ A+B f (A, B, C) = (A + B)C̄
0 0 0 1 0 0
0 0 1 0 0 0
0 1 0 1 1 1
0 1 1 0 1 0
1 0 0 1 1 1
1 0 1 0 1 0
1 1 0 1 1 1
1 1 1 0 1 0
Step 2: Disjunctive Normal Form (DNF): The Disjunctive Normal Form is the sum
of the minterms for which the output of the function is 1. From the truth table, the
function yields 1 for the following rows:
1. A = 0, B = 1, C = 0 =⇒ ĀB C̄
2. A = 1, B = 0, C = 0 =⇒ AB̄ C̄
3. A = 1, B = 1, C = 0 =⇒ AB C̄
Example 9. (a) Determine the complement of the elements a and c from the given
below Figure 6.
Figure 6:
(b) Find the Boolean function of the following circuit and find its equivalent sim-
plified circuit of the given below figure 7. Also draw the simplified circuit. (VIT-
2025-2026 MTE)
10
Figure 7:
Solution 9 (a):
In a bounded lattice, an element x is a complement of an element y if:
• a∧b=e
• a∨b=f
• c ∧ e = e, but c ∨ e = c 6= f .
Solution 9 (b): The given switching network consists of two main branches connected
in parallel between nodes B and L. We can represent parallel connections with addi-
tion (+) and series connections with multiplication (·).
11
– The sub-circuit expression: (p + q + t)
– Combined expression for bottom branch: t · (p + q + t)
Since the top and bottom branches are in parallel, we add their expressions. Thus,
the Boolean function representing the circuit is:
F = (p + q)(p + t) + t(p + q + t)
Apply the distributive law to the first term (p + y)(p + z) = p + yz, and distribute t in
the second term:
= (p + qt) + (tp + tq + t · t)
Since t · t = t:
= p + qt + pt + qt + t
= p + pt + qt + t
= p + t(p + q + 1)
Since 1 + anything = 1 in Boolean algebra, the entire term in the parentheses becomes
1:
= p + t(1)
=p+t
F =p+t (4)
+--- [ p ] ---+
B ----| |---- L
+--- [ t ] ---+
12
Example 10. Find the simpler network corresponding to the Boolean expression F (a, b, c) =
0 0 0 0
a.b.c + a.b .c + a .b .c (VIT-2022-2023 TEE)
Solution: The following steps are used
1. Observe that the first two terms (a · b · c and a · b0 · c) have common factors a and c.
F = (a · c)(b + b0 ) + a0 · b0 · c0
F = (a · c)(1) + a0 · b0 · c0
F (a, b, c) = ac + a0 b0 c0 (5)
13
Exercises: Lattices and Boolean Algebra
Lattice as POSET
1. Let S = {1, 2, 3, 6, 12} be a set ordered by the divisibility relation (a ≤ b if a divides
b). Draw the Hasse diagram for the partially ordered set (S, ≤) and determine
whether it forms a lattice.
2. Let X = {a, b, c} and consider its power set P(X) ordered by subset inclusion (⊆).
Find the infimum (meet) and supremum (join) for the elements {a} and {b, c}.
Distributive Lattice
3. Prove that every chain (a totally ordered set) is a distributive lattice.
4. Show that the diamond lattice M3 (the five-element lattice containing a top el-
ement, a bottom element, and three mutually incomparable elements between
them) is not distributive.
6. Let D30 = {1, 2, 3, 5, 6, 10, 15, 30} be the lattice of divisors of 30 under the divisibility
relation. Verify whether D30 constitutes a Boolean algebra.
A · (Ā + B) + B · (B + C)
X · Y + X̄ · Z + Y · Z = X · Y + X̄ · Z
f (X, Y, Z) = (X + Y ) · (X̄ + Z)
14
Problem 1:
Find the complement of each element of (D42 , /). Also, prove that, in any
distributive lattice (S, ≤), the joint cancellation law holds, i.e., if a ∨ b = a ∨ c
and a ∧ b = a ∧ c then b = c. (VIT-2025-2026 MTE)
Solution : Complements in (D42 , /) and Cancellation Law
For complements of elements in D42 :
The set of divisors of 42 is D42 = {1, 2, 3, 6, 7, 14, 21, 42}. In the lattice (D42 , /),
the meet (∧) is defined as gcd(a, b) and the join (∨) is defined as lcm(a, b). An
element b is a complement of a if a ∧ b = 1 and a ∨ b = 42.
Thus, b = c.
1
Problem 2:
Express the following function into its Sum of Product (SOP) / pdnf without
using truth table. (VIT-2024-2025 TEE)
(a) ((xy)0 z)0 ((x0 + z)(y 0 + z 0 ))0
(b) x + yz + xyz
(c) xz 0 + y 0
Solution: Sum of Products (SOP) / PDNF
(c) Let F = xz 0 + y 0
= xz 0 (y + y 0 ) + y 0 (x + x0 )(z + z 0 )
= (xyz 0 + xy 0 z 0 ) + (xy 0 z + xy 0 z 0 + x0 y 0 z + x0 y 0 z 0 )
= xyz 0 + xy 0 z 0 + xy 0 z + x0 y 0 z + x0 y 0 z 0
P
PDNF: m6 + m4 + m5 + m1 + m0 = (0, 1, 4, 5, 6)
2
Problem 3:
Construct the tables for ∧ and ∨ for the set of all divisors of 36 under the
relation of divisibility. Also show that it forms a lattice. (VIT-2024-2025
TEE)
Solution: Let D36 = {1, 2, 3, 4, 6, 9, 12, 18, 36}. Here, a ∧ b = gcd(a, b) and
a ∨ b = lcm(a, b).
Meet Table (∧ or gcd)
∧ 1 2 3 4 6 9 12 18 36
1 1 1 1 1 1 1 1 1 1
2 1 2 1 2 2 1 2 2 2
3 1 1 3 1 3 3 3 3 3
4 1 2 1 4 2 1 4 2 4
6 1 2 3 2 6 3 6 6 6
9 1 1 3 1 3 9 3 9 9
12 1 2 3 4 6 3 12 6 12
18 1 2 3 2 6 9 6 18 18
36 1 2 3 4 6 9 12 18 36
∨ 1 2 3 4 6 9 12 18 36
1 1 2 3 4 6 9 12 18 36
2 2 2 6 4 6 18 12 18 36
3 3 6 3 12 6 9 12 18 36
4 4 4 12 4 12 36 12 36 36
6 6 6 6 12 6 18 12 18 36
9 9 18 9 36 18 9 36 18 36
12 12 12 12 12 12 36 12 36 36
18 18 18 18 36 18 18 36 18 36
36 36 36 36 36 36 36 36 36 36
It forms a Lattice, since a set forms a lattice if every pair of elements has
a unique greatest lower bound (meet) and a unique least upper bound (join).
Since for any a, b ∈ D36 , the operations gcd(a, b) and lcm(a, b) yield distinct
elements that are also members of D36 , it satisfies the definition and forms a
lattice.
3
Problem 4:
Determine which of the following posets are lattice. (VIT-2024-2025 TEE)
Figure 1:
Problem 5:
(a) Find the complements in the Lattice of c and d from Figure 2. (VIT-
2024-2025 MTE )
Solution: In a lattice with a total top element (e) and a bottom element
(a), an element x is a complement of y if:
4
Figure 2:
Problem 5:
(b) Cheek it is lattice or not which is shown in Figure 3. (VIT-2024-2025
MTE )
Figure 3:
Solution: This is the standard Hasse diagram for the diamond lattice.
The Hasse diagram represents the lattice L = D30 , which is the set of divisors
of 30:
D30 = {1, 2, 3, 5, 6, 10, 15, 30}
under the partial order of divisibility (a | b).
For a subset S ⊆ L to be a sub-lattice, it must be closed under the meet
and join operations of the original lattice. In D30 , the operations are:
• Meet (∧): gcd(a, b)
5
Problem 6:
If L = D3 0 having the Hasse diagram which shown in figure 4.
(a) Check L1 = {1, 2, 3, 6} is sub-lattice or not.
(b) Check L2 = {1, 2, 5} is sub-lattice or not. (VIT-2024-2025 TEE)
Figure 4:
2 ∨ 5 = lcm(2, 5) = 10
Since 10 ∈
/ L2 , the subset is not closed under the join operation.
Conclusion: L2 is not a sub-lattice.
Problem 7:
If L = D3 0 having the Hasse diagram which shown in figure
(a) Check L1 = {3, 6, 15, 30} is sub-lattice or not.
(b) Check L2 = {6, 15, 30} is sub-lattice or not. (VIT-2025-2026 TEE)
Solution: (a) Let us check the operations for the non-comparable elements
6 and 15:
• Meet: 6 ∧ 15 = gcd(6, 15) = 3 ∈ L1
• Join: 6 ∨ 15 = lcm(6, 15) = 30 ∈ L1
6
Figure 5:
All other operations between comparable elements yield elements already in the
set (e.g., gcd(3, 6) = 3, lcm(6, 30) = 30).
Since L1 is closed under both operations, L1 is a sub-lattice.
(b) Let us check the meet of 6 and 15:
6 ∧ 15 = gcd(6, 15) = 3
Since 3 ∈
/ L2 , the subset is not closed under the meet operation.
Conclusion: L2 is not a sub-lattice.
Problem 8:
Problem: Construct an input/output table for the following Boolean function:
f (A, B, C) = (A + B)C̄, also find the disjunctive normal form of the Boolean
function. Hence to represent the logical expressions with min term. (VIT-
2024-2025 TEE)
Solution: Step 1:
A B C C̄ A+B f (A, B, C) = (A + B)C̄
0 0 0 1 0 0
0 0 1 0 0 0
0 1 0 1 1 1
0 1 1 0 1 0
1 0 0 1 1 1
1 0 1 0 1 0
1 1 0 1 1 1
1 1 1 0 1 0
7
1. A = 0, B = 1, C = 0 =⇒ ĀB C̄
2. A = 1, B = 0, C = 0 =⇒ AB̄ C̄
3. A = 1, B = 1, C = 0 =⇒ AB C̄
Step 3: Representation with Min terms Mapping the binary inputs to their
decimal equivalents (0102 = 2, 1002 = 4, and 1102 = 6), the expression can be
written in min term notation as:
X
f (A, B, C) = m(2, 4, 6)
Problem 9:
Determine the complement of the elements a and c from the given below Figure
6.
Figure 6:
(b) Find the Boolean function of the following circuit and find its equivalent
simplified circuit of the given below figure 7. Also draw the simplified circuit.
(VIT-2025-2026 MTE)
Figure 7:
8
Solution: (a) In a bounded lattice, an element x is a complement of an
element y if:
• a∧b=e
• a∨b=f
Thus, the complement of a is b.
For element c: We look for an element x such that c ∧ x = e and c ∨ x = f .
• c ∧ e = e, but c ∨ e = c 6= f .
• c ∧ b = e, but c ∨ b = f holds. However, this is not a distributive lattice
and b is already a complement of a. Looking closely at the connections,
there is no single element that satisfies both the greatest lower bound and
least upper bound properties strictly as a unique complement for c.
(b) The given switching network consists of two main branches connected
in parallel between nodes B and L. We can represent parallel connections with
addition (+) and series connections with multiplication (·).
Since the top and bottom branches are in parallel, we add their expressions.
Thus, the Boolean function representing the circuit is:
9
Simplifying the Boolean Function
We can simplify the function using the standard laws of Boolean algebra:
F = (p + q)(p + t) + t(p + q + t)
Apply the distributive law to the first term (p+y)(p+z) = p+yz, and distribute
t in the second term:
= (p + qt) + (tp + tq + t · t)
Since t · t = t:
= p + qt + pt + qt + t
= p + pt + qt + t
= p + t(p + q + 1)
= p + t(1)
=p+t
F =p+t (2)
+--- [ p ] ---+
B ----| |---- L
+--- [ t ] ---+
Problem 10:
Find the simpler network corresponding to the Boolean expression F (a, b, c) =
0 0 0 0
a.b.c + a.b .c + a .b .c (VIT-2022-2023 TEE)
Solution:
10
1. Observe that the first two terms (a · b · c and a · b0 · c) have common factors
a and c.
F = (a · c)(b + b0 ) + a0 · b0 · c0
F = (a · c)(1) + a0 · b0 · c0
F = a · c + a0 · b0 · c0
F (a, b, c) = ac + a0 b0 c0 (3)
11
Graphs and its Matrix
Representation
• Problem set and solutions
• Excercise
Learning objectives
• We will apply the concepts of graph theory to real-life problems.
Module 04, MAT2002//Discrete Mathematics and Graph Theory
Mathematics Division//School of Advanced Sciences and Languages// VIT Bhopal University
1
1 Problem set and solutions
Question-1
How many edges are there in an undirected graph with 10 vertices each of degree 6?
Solution: Let us consider that e be the number edges in the graph G = (V, E), where V
is the set of all vertices of the graph G and E be the set of all edges of the same graph
G.
Then, by using the Handshaking Theorem, we can write
X
2e = deg(v)
v∈V
Question-2
a b
f c
e d
2
2. Assign f ’s neighbors: Look at all the vertices connected to f . The graph shows
edges connecting f to a, b, e, and d. Because they share an edge with f , they
cannot be in the same set as f . Therefore, we place a, b, e, and d into Set 2.
• Set 1: {f, c}
• Set 2: {a, b, e, d}
Because every single edge in the graph runs only between a vertex in Set 1 and a
vertex in Set 2, we have successfully partitioned the graph. Therefore, the graph is
bipartite.
(Note: Because every vertex in Set 1 is connected to every single vertex in Set 2, this is
specifically known as a complete bipartite graph, denoted as K2,4 .)
Question-3
u2 v2
v1 v3
u9 v8
u1 u10 u8 u3
v10
u7
u6 v7 v9
v6 v4
u5 u4
v5
Solution: Based on a detailed structural analysis, the two graphs are isomorphic.
Before constructing a mapping, we first confirm that both graphs share identical
fundamental properties. Let the left graph be G1 and the right graph be G2 .
3
• Degrees: Every vertex in G1 has a degree of 3. By counting the connections
in G2 (including outer edges, straight spokes, curved edges, and inner central
connections), every vertex in G2 also has a degree of 3. Both are therefore 3-
regular (cubic) graphs.
f (u1 ) = v9 f (u6 ) = v5
f (u2 ) = v1 f (u7 ) = v7
f (u3 ) = v2 f (u8 ) = v8
f (u4 ) = v3 f (u9 ) = v6
f (u5 ) = v4 f (u10 ) = v10
Since every edge in G1 corresponds directly to a valid edge in G2 under the bijective
mapping f , the function is a valid isomorphism. Therefore, G1 ∼= G2 .
4
Question-4
u1 v1 v2
u6 u2
v5
v6
u5 u3
u4 v4 v3
Solution: Based on a detailed analysis of the two graphs, we can determine that the
given pair of graphs is indeed isomorphic.
Here is the rigorous step-by-step mathematical solution and the explicit isomor-
phism.
Let the left graph be G1 and the right graph be G2 .
Since the basic invariants match, we can proceed to look at the internal structure.
To find an isomorphism mapping, we need to identify unique structural features,
such as specific cycles (loops). Let’s look for triangles (3-cycles) in both graphs.
• Cycles in G1 : There are exactly two separate 3-cycles: the top triangle formed
by {u1 , u2 , u6 } and the bottom triangle formed by {u4 , u3 , u5 }.
• Cycles in G2 : Looking closely at G2 , there are also exactly two 3-cycles: the
top inner triangle formed by {v1 , v2 , v5 } and the bottom inner triangle formed by
{v4 , v3 , v6 }.
Furthermore, in both graphs, the two triangles are connected to each other by
exactly three independent edges (a perfect matching).
5
Because the structural anatomy of both graphs is identical (they are both repre-
sentations of the triangular prism graph), we can construct a one-to-one mapping
between them.
We will define a bijective function f : V (G1 ) → V (G2 ) by mapping the vertices of the
first triangle in G1 to the first triangle in G2 , and then following the connecting edges
to map the second triangle.
Let’s establish the following mapping:
• f (u1 ) = v1
• f (u2 ) = v2
• f (u3 ) = v3
• f (u4 ) = v4
• f (u5 ) = v6
• f (u6 ) = v5
To prove that f is a valid isomorphism, we must verify that for every edge (x, y) in
G1 , there is a corresponding edge (f (x), f (y)) in G2 .
Let’s test all 9 edges of G1 under our mapping function f :
Edges of the first triangle:
Since f is a bijection from the vertex set of G1 to the vertex set of G2 that preserves
all adjacency relationships perfectly, the function f is a valid isomorphism. Therefore,
the two graphs are mathematically identical.
6
Question-5
u1 u2 v1 v2
u3 u4 v3 v4
• u3 : (3, 1)
• u4 : (0, 2)
Graph G2 (vertices vi ):
• v1 : (1, 1)
• v2 : (3, 1)
• v3 : (1, 2)
3. Self-loop Properties: In G1 , the vertex with a self-loop (u2 ) has degrees (3, 2).
In G2 , the vertex with a self-loop (v4 ) has degrees (2, 3). For the graphs to be
isomorphic, these degree pairs must match.
Because the graphs do not share the same degree sequences and structural prop-
erties (such as sink nodes and maximum in-degrees), there is no bijection f : V1 → V2
that preserves adjacency.
Therefore, the two directed graphs are not isomorphic.
7
Question-6
u1 v1
u4 v4
u2 u3 v2 v3
Solution: To determine whether the two directed graphs are isomorphic, we can eval-
uate their graph invariants. Specifically, we will look at the out-degrees (the number
of directed edges originating from a vertex) for each node. For two directed graphs to
be isomorphic, their vertices must share the exact same out-degree sequence.
Let us calculate the out-degree, denoted as deg+ (x), for each vertex in the first
graph:
8
Question-7
e2
v1 v2 e4
v3
e1
e3
e7
e6 e5
v4
v5
e8
• mij = 0 otherwise.
Note: For loops, the edge is incident to only one vertex, resulting in a single 1 in that
edge’s column.
• Vertices (n = 5): v1 , v2 , v3 , v4 , v5
• Edges (m = 8): e1 , e2 , e3 , e4 , e5 , e6 , e7 , e8
• e1 : Loop at v1 =⇒ Incident to v1
9
• e7 : Connects v2 and v4 =⇒ Incident to v2 , v4
• e8 : Loop at v4 =⇒ Incident to v4
Putting it all together, we label the rows v1 . . . v5 and the columns e1 . . . e8 to yield
the final incidence matrix:
e1 e2 e3 e4 e5 e6 e7 e8
v1 1 1 1 0 0 0 0 0
v2
0 1 1 1 0 1 1 0
M = v3 0 0 0 1 1 0 0 0
v4 0 0 0 0 0 0 1 1
v5 0 0 0 0 1 1 0 0
Question-8
Find the adjacency matrix of the given directed multigraph with respect to the vertices
listed in alphabetic order.
a b
c d
• Vertex a: There are outgoing edges to a (loop), b (straight edge), c (curved edge),
and d (curved edge).
Therefore, the first row is 1, 1, 1, 1.
• Vertex b: There are outgoing edges to b (loop) and d (curved edge). There are no
arrows pointing from b to a or c.
Therefore, the second row is 0, 1, 0, 1.
10
• Vertex c: There are outgoing edges to a (curved edge) and c (loop). There are no
arrows pointing from c to b or d.
Therefore, the third row is 1, 0, 1, 0.
• Vertex d: There are outgoing edges to a (curved edge), b (curved edge), c (straight
edge), and d (loop).
Therefore, the fourth row is 1, 1, 1, 1.
Question-9
a j
e i
f
b h
d g
c k
Solution: To determine if a Hamiltonian circuit exists, we examine the degrees of the
vertices. A fundamental rule for finding Hamiltonian circuits is that if a vertex has a
degree of exactly 2, both of its incident edges must be included in any Hamiltonian
circuit.
Observe the outer vertices a, c, j, and k. They all have a degree of 2.
A vertex in a Hamiltonian circuit can only have exactly 2 incident edges used.
• Look at vertex b. In our circuit, we must use edges {a, b} and {c, b}. Since b’s
quota of 2 edges is full, the other edges connected to b (which are {b, e} and
{b, d}) cannot be part of the circuit.
11
• Similarly, look at vertex h. We must use edges {j, h} and {k, h}. Therefore, the
other edges connected to h ({h, i} and {h, g}) cannot be part of the circuit.
• Path 1: e → a → b → c → d
• Path 2: i → j → h → k → g
To form a full Hamiltonian circuit, we must connect these two paths along with
the only remaining unvisited vertex, f . The available open endpoints of our paths are
e, d and i, g.
• Now we must close the circuit by connecting the bottom endpoints d and g. The
edge {d, g} exists in the graph (it is the long bottom arc).
a→b→c→d→g→k→h→j→i→f →e→a
Checking this sequence, it visits all 11 vertices (a, b, c, d, e, f, g, h, i, j, k) exactly once and
returns to the starting vertex. All traversed edges exist in the original graph.
Yes, the graph contains a Hamiltonian Circuit (and consequently, it also contains
multiple Hamiltonian Paths).
Question-10
• Weighted Edges: Entry Mij (where i ̸= j) represents the weight of the single edge
between vi and vj . A non-zero entry Mii indicates a single self-loop with that
weight on vertex vi .
Here is the full list of vertices and edges with their weights, derived from the matrix:
12
• Vertex Set: V = {v1 , v2 , v3 , v4 , v5 }
v2
1
1
3
1 1
v51 3 v3
3 4
v4
Question-11
Determine whether the following graph has an Euler circuit? If not, find an Euler
path. For the same graph, find for Hamilton path or circuit.
13
a
f
e b
j g
i h
d c
Solution: The graph displays the classic Petersen graph. Let V be the set of vertices
and E be the set of edges. The graph has |V | = 10 vertices and |E| = 15 edges. By
observing the graph, we can see that every vertex is connected to exactly 3 edges.
Thus, it is a 3-regular (cubic) graph.
A connected graph contains an Euler circuit if and only if every vertex in the graph
has an even degree. In our graph, the degree of every vertex is 3 (an odd number).
Because there are vertices with an odd degree, the graph does not have an Euler
circuit.
A connected graph contains an Euler path if and only if it has exactly zero or
exactly two vertices of odd degree. As established, all 10 vertices in this graph have
a degree of 3. Since there are more than two vertices with an odd degree, the graph
does not have an Euler path.
A Hamilton circuit is a cycle that visits every vertex exactly once and returns to
the starting vertex. The Petersen graph is a famous example of a hypohamiltonian
graph, meaning it does not contain a Hamilton circuit. If you remove any single
vertex from it, the remaining graph becomes Hamiltonian, but the full 10-vertex graph
cannot form a complete cycle.
A Hamilton path is a path that visits every vertex in the graph exactly once without
needing to return to the origin. The Petersen graph does have a Hamilton path. To
find one, we can traverse the outer pentagon, cross over to the inner star, and trace
through the remaining vertices. A valid sequence of vertices for a Hamilton path is:
a→b→c→d→e→j→g→i→f →h
Question-12
Determine whether the following directed graph has an Euler circuit. Construct an
Euler circuit if one exists. If no Euler circuit exists, determine whether the directed
graph has an Euler path. Construct the Euler path if exists.
14
a b c
d e
Solution: To determine whether the given directed graph has an Euler circuit or an
Euler path, we must evaluate the in-degrees (deg− ) and out-degrees (deg+ ) of every
vertex. Let V = {a, b, c, d, e}.
By counting the incoming and outgoing arrows for each node, we get:
• Vertex a:
• Vertex b:
• Vertex c:
• Vertex d:
• Vertex e:
1. Exactly one vertex has deg+ (v) − deg− (v) = 1 (Start vertex).
2. Exactly one vertex has deg− (v) − deg+ (v) = 1 (End vertex).
15
3. All other vertices have equal in-degrees and out-degrees.
Since these conditions are met perfectly, an Euler path exists. It must start at vertex
a and end at vertex e.
Starting at vertex a and ending at vertex e, we can traverse all 12 distinct edges of
the graph exactly once. One such valid Euler path is:
a→d→b→a→e→d→e→b→c→b→e→c→e
This traverses the edges in the following order: (a, d), (d, b), (b, a), (a, e), (e, d), (d, e),
(e, b), (b, c), (c, b), (b, e), (e, c), (c, e).
Question-13
Consider the following directed graph. Find the shortest path between the vertices S
and T of the graph by Dijkstra’s algorithm.
2
1 2
E G
C
1
A
1
3 4
4 3
7 D
S 3
3
4 5 T
3 B
5
F
Solution: Let d(v) be the shortest distance from the source node S to node v. Initially,
d(S) = 0 and d(v) = ∞ for all other vertices.
The table below tracks the shortest distance to each node at every step. In each
row, the unvisited node with the smallest tentative distance is selected and its neigh-
bors are updated.
The shortest distance from S to T is 10.
Tracing back the distance updates reveals that there are three valid shortest paths
that all result in a total weight of 10:
16
Selected Node S A B C D E F G T
Initial 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
S (d = 0) – 4 3 ∞ 7 ∞ ∞ ∞ ∞
B (d = 3) – 4 – ∞ 7 ∞ ∞ ∞ ∞
A (d = 4) – – – 5 7 ∞ ∞ ∞ ∞
C (d = 5) – – – – 7 6 ∞ ∞ ∞
E (d = 6) – – – – 7 – ∞ 8 10
D (d = 7) – – – – – – 12 8 10
G (d = 8) – – – – – – 12 – 10
T (d = 10) – – – – – – 12 – –
F (d = 12) – – – – – – – – –
Question-14
Let G be the directed graph given below. Use Dijkstra’s algorithm to find the shortest
path between the vertices A and H.
4 4 6
A C E G I
6 2
3
1 5 7 1 9 2
2 0 7
B D F H J
Solution: To find the shortest path, we initialize the distance to the source node A as
d(A) = 0 and all other nodes as ∞. We then iteratively relax the edges.
The shortest path is determined by following the predecessors of the relaxed dis-
tances:
• Path: A → C → B → D → F → G → E → H
• Total Weight: 4 + 3 + 2 + 0 + 2 + 4 + 1 = 16
17
Step Node Neighbors Relaxed Distance Vector (A, B, C, D, E, F, G, H)
0 — — (0, ∞, ∞, ∞, ∞, ∞, ∞, ∞)
1 A C :0+4=4 (0, ∞, 4, ∞, ∞, ∞, ∞, ∞)
2 C B : 4 + 3 = 7, F : 4 + 6 = 10 (0, 7, 4, ∞, ∞, 10, ∞, ∞)
3 B D :7+2=9 (0, 7, 4, 9, ∞, 10, ∞, ∞)
4 D F :9+0=9 (0, 7, 4, 9, ∞, 9, ∞, ∞)
5 F G : 9 + 2 = 11 (0, 7, 4, 9, ∞, 9, 11, ∞)
6 G E : 11 + 4 = 15, H : 11 + 9 = 20 (0, 7, 4, 9, 15, 9, 11, 20)
7 E H : 15 + 1 = 16 (0, 7, 4, 9, 15, 9, 11, 16)
8 H Goal Reached (0, 7, 4, 9, 15, 9, 11, 16)
Question-15
a b c
f e d
Solution: A strongly connected component (SCC) of a directed graph is a maximal
subgraph in which for every pair of vertices u and v, there is a directed path from u to
v and a directed path from v to u.
To find the SCCs of the given digraph, we group the vertices into sets where all
vertices in a set are mutually reachable:
• Observe the vertices on the left. There is a two-way connection between a and b
(a → b and b → a), meaning they can reach each other.
• By transitivity, b can reach f (via a) and f can reach b (via a). Thus, a, b, and f
are all mutually reachable.
• We must check if this component can be expanded. The vertices b and f have
outgoing edges to the right side of the graph (b → c, b → e, f → e). However, there
are no returning edges from {c, d, e} back to {a, b, f }.
• Now look at the remaining vertices on the right. There is a two-way connection
between c and e (c → e and e → c).
18
• We also have a path passing through d. There is an edge c → d and an edge
d → e.
• Since there are no other vertices left in the graph to check, this forms our second
maximal strongly connected component.
C1 = {a, b, f }
C2 = {c, d, e}
2 Excercise
v1 v2 e6 v3
e3
e4
e1 e5
e2
v4 v5
Answer:
1 1 0 0 0 0
0 0 1 1 0 1
0 0 0 0 1 1
1 0 1 0 0 0
0 1 0 1 1 0
19
b
a c
e d
Answer:
0 1 1 0 1 1
0 1 0 1 1 0
1 0 1 0 0 1
0 0 0 0 0 0
0 1 1 1 1 0
3. Use paths either to show the following pair of graphs are not isomorphic or find
an isomorphism between them.
u1 u2 v1
u6 u7 v6
v5
v4 v2
v7
u8 u3 v8
u5 u4 v3
Answer: Isomorphic.
4. Determine whether the following graph has an Euler circuit? If not, find an Euler
path. For the same graph, find for Hamilton path or circuit.
20
a b c
j
i k
o p q
d h
n l
m
e f g
Answer: The graph has neither an Euler circuit nor an Euler path. This graph
has neither a Hamilton path nor a Hamilton circuit.
5. Using Dijkstra’s Algorithm, determine the shortest distance and the shortest
path between the vertices v1 to v16 .
21
4 2 7
v1 v2 v3 v4
5 8 3 10 1
10
4
v5 v6 v7 v8
2 2
5
15
1
6 9 3 12
1 2
v9 v10 v11 v12
4
3
2
20
4 7 6 5
5 2 1
Answer: The shortest distane is 15 amd the shortest path is v1 →
− v5 →
− v6 →
−
2 5
v11 →
− v12 →
− v16 .
22
Graphs and its Matrix
Representation
• Problem set and solutions
Learning objectives
• We will apply the concepts of graph theory to real-life problems.
Module 04, MAT2002//Discrete Mathematics and Graph Theory
Mathematics Division//School of Advanced Sciences and Languages// VIT Bhopal University
1
1 Problem set and solutions
Question-1
How many edges are there in an undirected graph with 10 vertices each of degree 6?
Solution: Let us consider that e be the number edges in the graph G = (V, E), where V
is the set of all vertices of the graph G and E be the set of all edges of the same graph
G.
Then, by using the Handshaking Theorem, we can write
X
2e = deg(v)
v∈V
Question-2
a b
f c
e d
2
2. Assign f ’s neighbors: Look at all the vertices connected to f . The graph shows
edges connecting f to a, b, e, and d. Because they share an edge with f , they
cannot be in the same set as f . Therefore, we place a, b, e, and d into Set 2.
• Set 1: {f, c}
• Set 2: {a, b, e, d}
Because every single edge in the graph runs only between a vertex in Set 1 and a
vertex in Set 2, we have successfully partitioned the graph. Therefore, the graph is
bipartite.
(Note: Because every vertex in Set 1 is connected to every single vertex in Set 2, this is
specifically known as a complete bipartite graph, denoted as K2,4 .)
Question-3
u2 v2
v1 v3
u9 v8
u1 u10 u8 u3
v10
u7
u6 v7 v9
v6 v4
u5 u4
v5
Solution: Based on a detailed structural analysis, the two graphs are isomorphic.
Before constructing a mapping, we first confirm that both graphs share identical
fundamental properties. Let the left graph be G1 and the right graph be G2 .
3
• Degrees: Every vertex in G1 has a degree of 3. By counting the connections
in G2 (including outer edges, straight spokes, curved edges, and inner central
connections), every vertex in G2 also has a degree of 3. Both are therefore 3-
regular (cubic) graphs.
f (u1 ) = v9 f (u6 ) = v5
f (u2 ) = v1 f (u7 ) = v7
f (u3 ) = v2 f (u8 ) = v8
f (u4 ) = v3 f (u9 ) = v6
f (u5 ) = v4 f (u10 ) = v10
Since every edge in G1 corresponds directly to a valid edge in G2 under the bijective
mapping f , the function is a valid isomorphism. Therefore, G1 ∼= G2 .
4
Question-4
u1 v1 v2
u6 u2
v5
v6
u5 u3
u4 v4 v3
Solution: Based on a detailed analysis of the two graphs, we can determine that the
given pair of graphs is indeed isomorphic.
Here is the rigorous step-by-step mathematical solution and the explicit isomor-
phism.
Let the left graph be G1 and the right graph be G2 .
Since the basic invariants match, we can proceed to look at the internal structure.
To find an isomorphism mapping, we need to identify unique structural features,
such as specific cycles (loops). Let’s look for triangles (3-cycles) in both graphs.
• Cycles in G1 : There are exactly two separate 3-cycles: the top triangle formed
by {u1 , u2 , u6 } and the bottom triangle formed by {u4 , u3 , u5 }.
• Cycles in G2 : Looking closely at G2 , there are also exactly two 3-cycles: the
top inner triangle formed by {v1 , v2 , v5 } and the bottom inner triangle formed by
{v4 , v3 , v6 }.
Furthermore, in both graphs, the two triangles are connected to each other by
exactly three independent edges (a perfect matching).
5
Because the structural anatomy of both graphs is identical (they are both repre-
sentations of the triangular prism graph), we can construct a one-to-one mapping
between them.
We will define a bijective function f : V (G1 ) → V (G2 ) by mapping the vertices of the
first triangle in G1 to the first triangle in G2 , and then following the connecting edges
to map the second triangle.
Let’s establish the following mapping:
• f (u1 ) = v1
• f (u2 ) = v2
• f (u3 ) = v3
• f (u4 ) = v4
• f (u5 ) = v6
• f (u6 ) = v5
To prove that f is a valid isomorphism, we must verify that for every edge (x, y) in
G1 , there is a corresponding edge (f (x), f (y)) in G2 .
Let’s test all 9 edges of G1 under our mapping function f :
Edges of the first triangle:
Since f is a bijection from the vertex set of G1 to the vertex set of G2 that preserves
all adjacency relationships perfectly, the function f is a valid isomorphism. Therefore,
the two graphs are mathematically identical.
6
Question-5
u1 u2 v1 v2
u3 u4 v3 v4
• u3 : (3, 1)
• u4 : (0, 2)
Graph G2 (vertices vi ):
• v1 : (1, 1)
• v2 : (3, 1)
• v3 : (1, 2)
3. Self-loop Properties: In G1 , the vertex with a self-loop (u2 ) has degrees (3, 2).
In G2 , the vertex with a self-loop (v4 ) has degrees (2, 3). For the graphs to be
isomorphic, these degree pairs must match.
Because the graphs do not share the same degree sequences and structural prop-
erties (such as sink nodes and maximum in-degrees), there is no bijection f : V1 → V2
that preserves adjacency.
Therefore, the two directed graphs are not isomorphic.
7
Question-6
u1 v1
u4 v4
u2 u3 v2 v3
Solution: To determine whether the two directed graphs are isomorphic, we can eval-
uate their graph invariants. Specifically, we will look at the out-degrees (the number
of directed edges originating from a vertex) for each node. For two directed graphs to
be isomorphic, their vertices must share the exact same out-degree sequence.
Let us calculate the out-degree, denoted as deg+ (x), for each vertex in the first
graph:
8
Question-7
e2
v1 v2 e4
v3
e1
e3
e7
e6 e5
v4
v5
e8
• mij = 0 otherwise.
Note: For loops, the edge is incident to only one vertex, resulting in a single 1 in that
edge’s column.
• Vertices (n = 5): v1 , v2 , v3 , v4 , v5
• Edges (m = 8): e1 , e2 , e3 , e4 , e5 , e6 , e7 , e8
• e1 : Loop at v1 =⇒ Incident to v1
9
• e7 : Connects v2 and v4 =⇒ Incident to v2 , v4
• e8 : Loop at v4 =⇒ Incident to v4
Putting it all together, we label the rows v1 . . . v5 and the columns e1 . . . e8 to yield
the final incidence matrix:
e1 e2 e3 e4 e5 e6 e7 e8
v1 1 1 1 0 0 0 0 0
v2
0 1 1 1 0 1 1 0
M = v3 0 0 0 1 1 0 0 0
v4 0 0 0 0 0 0 1 1
v5 0 0 0 0 1 1 0 0
Question-8
Find the adjacency matrix of the given directed multigraph with respect to the vertices
listed in alphabetic order.
a b
c d
• Vertex a: There are outgoing edges to a (loop), b (straight edge), c (curved edge),
and d (curved edge).
Therefore, the first row is 1, 1, 1, 1.
• Vertex b: There are outgoing edges to b (loop) and d (curved edge). There are no
arrows pointing from b to a or c.
Therefore, the second row is 0, 1, 0, 1.
10
• Vertex c: There are outgoing edges to a (curved edge) and c (loop). There are no
arrows pointing from c to b or d.
Therefore, the third row is 1, 0, 1, 0.
• Vertex d: There are outgoing edges to a (curved edge), b (curved edge), c (straight
edge), and d (loop).
Therefore, the fourth row is 1, 1, 1, 1.
Question-9
a j
e i
f
b h
d g
c k
Solution: To determine if a Hamiltonian circuit exists, we examine the degrees of the
vertices. A fundamental rule for finding Hamiltonian circuits is that if a vertex has a
degree of exactly 2, both of its incident edges must be included in any Hamiltonian
circuit.
Observe the outer vertices a, c, j, and k. They all have a degree of 2.
A vertex in a Hamiltonian circuit can only have exactly 2 incident edges used.
• Look at vertex b. In our circuit, we must use edges {a, b} and {c, b}. Since b’s
quota of 2 edges is full, the other edges connected to b (which are {b, e} and
{b, d}) cannot be part of the circuit.
11
• Similarly, look at vertex h. We must use edges {j, h} and {k, h}. Therefore, the
other edges connected to h ({h, i} and {h, g}) cannot be part of the circuit.
• Path 1: e → a → b → c → d
• Path 2: i → j → h → k → g
To form a full Hamiltonian circuit, we must connect these two paths along with
the only remaining unvisited vertex, f . The available open endpoints of our paths are
e, d and i, g.
• Now we must close the circuit by connecting the bottom endpoints d and g. The
edge {d, g} exists in the graph (it is the long bottom arc).
a→b→c→d→g→k→h→j→i→f →e→a
Checking this sequence, it visits all 11 vertices (a, b, c, d, e, f, g, h, i, j, k) exactly once and
returns to the starting vertex. All traversed edges exist in the original graph.
Yes, the graph contains a Hamiltonian Circuit (and consequently, it also contains
multiple Hamiltonian Paths).
Question-10
• Weighted Edges: Entry Mij (where i ̸= j) represents the weight of the single edge
between vi and vj . A non-zero entry Mii indicates a single self-loop with that
weight on vertex vi .
Here is the full list of vertices and edges with their weights, derived from the matrix:
12
• Vertex Set: V = {v1 , v2 , v3 , v4 , v5 }
v2
1
1
3
1 1
v51 3 v3
3 4
v4
Question-11
Determine whether the following graph has an Euler circuit? If not, find an Euler
path. For the same graph, find for Hamilton path or circuit.
13
a
f
e b
j g
i h
d c
Solution: The graph displays the classic Petersen graph. Let V be the set of vertices
and E be the set of edges. The graph has |V | = 10 vertices and |E| = 15 edges. By
observing the graph, we can see that every vertex is connected to exactly 3 edges.
Thus, it is a 3-regular (cubic) graph.
A connected graph contains an Euler circuit if and only if every vertex in the graph
has an even degree. In our graph, the degree of every vertex is 3 (an odd number).
Because there are vertices with an odd degree, the graph does not have an Euler
circuit.
A connected graph contains an Euler path if and only if it has exactly zero or
exactly two vertices of odd degree. As established, all 10 vertices in this graph have
a degree of 3. Since there are more than two vertices with an odd degree, the graph
does not have an Euler path.
A Hamilton circuit is a cycle that visits every vertex exactly once and returns to
the starting vertex. The Petersen graph is a famous example of a hypohamiltonian
graph, meaning it does not contain a Hamilton circuit. If you remove any single
vertex from it, the remaining graph becomes Hamiltonian, but the full 10-vertex graph
cannot form a complete cycle.
A Hamilton path is a path that visits every vertex in the graph exactly once without
needing to return to the origin. The Petersen graph does have a Hamilton path. To
find one, we can traverse the outer pentagon, cross over to the inner star, and trace
through the remaining vertices. A valid sequence of vertices for a Hamilton path is:
a→b→c→d→e→j→g→i→f →h
Question-12
Determine whether the following directed graph has an Euler circuit. Construct an
Euler circuit if one exists. If no Euler circuit exists, determine whether the directed
graph has an Euler path. Construct the Euler path if exists.
14
a b c
d e
Solution: To determine whether the given directed graph has an Euler circuit or an
Euler path, we must evaluate the in-degrees (deg− ) and out-degrees (deg+ ) of every
vertex. Let V = {a, b, c, d, e}.
By counting the incoming and outgoing arrows for each node, we get:
• Vertex a:
• Vertex b:
• Vertex c:
• Vertex d:
• Vertex e:
1. Exactly one vertex has deg+ (v) − deg− (v) = 1 (Start vertex).
2. Exactly one vertex has deg− (v) − deg+ (v) = 1 (End vertex).
15
3. All other vertices have equal in-degrees and out-degrees.
Since these conditions are met perfectly, an Euler path exists. It must start at vertex
a and end at vertex e.
Starting at vertex a and ending at vertex e, we can traverse all 12 distinct edges of
the graph exactly once. One such valid Euler path is:
a→d→b→a→e→d→e→b→c→b→e→c→e
This traverses the edges in the following order: (a, d), (d, b), (b, a), (a, e), (e, d), (d, e),
(e, b), (b, c), (c, b), (b, e), (e, c), (c, e).
Question-13
Consider the following directed graph. Find the shortest path between the vertices S
and T of the graph by Dijkstra’s algorithm.
2
1 2
E G
C
1
A
1
3 4
4 3
7 D
S 3
3
4 5 T
3 B
5
F
Solution: Let d(v) be the shortest distance from the source node S to node v. Initially,
d(S) = 0 and d(v) = ∞ for all other vertices.
The table below tracks the shortest distance to each node at every step. In each
row, the unvisited node with the smallest tentative distance is selected and its neigh-
bors are updated.
The shortest distance from S to T is 10.
Tracing back the distance updates reveals that there are three valid shortest paths
that all result in a total weight of 10:
16
Selected Node S A B C D E F G T
Initial 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞
S (d = 0) – 4 3 ∞ 7 ∞ ∞ ∞ ∞
B (d = 3) – 4 – ∞ 7 ∞ ∞ ∞ ∞
A (d = 4) – – – 5 7 ∞ ∞ ∞ ∞
C (d = 5) – – – – 7 6 ∞ ∞ ∞
E (d = 6) – – – – 7 – ∞ 8 10
D (d = 7) – – – – – – 12 8 10
G (d = 8) – – – – – – 12 – 10
T (d = 10) – – – – – – 12 – –
F (d = 12) – – – – – – – – –
Question-14
Let G be the directed graph given below. Use Dijkstra’s algorithm to find the shortest
path between the vertices A and H.
4 4 6
A C E G I
6 2
3
1 5 7 1 9 2
2 0 7
B D F H J
Solution: To find the shortest path, we initialize the distance to the source node A as
d(A) = 0 and all other nodes as ∞. We then iteratively relax the edges.
The shortest path is determined by following the predecessors of the relaxed dis-
tances:
• Path: A → C → B → D → F → G → E → H
• Total Weight: 4 + 3 + 2 + 0 + 2 + 4 + 1 = 16
17
Step Node Neighbors Relaxed Distance Vector (A, B, C, D, E, F, G, H)
0 — — (0, ∞, ∞, ∞, ∞, ∞, ∞, ∞)
1 A C :0+4=4 (0, ∞, 4, ∞, ∞, ∞, ∞, ∞)
2 C B : 4 + 3 = 7, F : 4 + 6 = 10 (0, 7, 4, ∞, ∞, 10, ∞, ∞)
3 B D :7+2=9 (0, 7, 4, 9, ∞, 10, ∞, ∞)
4 D F :9+0=9 (0, 7, 4, 9, ∞, 9, ∞, ∞)
5 F G : 9 + 2 = 11 (0, 7, 4, 9, ∞, 9, 11, ∞)
6 G E : 11 + 4 = 15, H : 11 + 9 = 20 (0, 7, 4, 9, 15, 9, 11, 20)
7 E H : 15 + 1 = 16 (0, 7, 4, 9, 15, 9, 11, 16)
8 H Goal Reached (0, 7, 4, 9, 15, 9, 11, 16)
Question-15
a b c
f e d
Solution: A strongly connected component (SCC) of a directed graph is a maximal
subgraph in which for every pair of vertices u and v, there is a directed path from u to
v and a directed path from v to u.
To find the SCCs of the given digraph, we group the vertices into sets where all
vertices in a set are mutually reachable:
• Observe the vertices on the left. There is a two-way connection between a and b
(a → b and b → a), meaning they can reach each other.
• By transitivity, b can reach f (via a) and f can reach b (via a). Thus, a, b, and f
are all mutually reachable.
• We must check if this component can be expanded. The vertices b and f have
outgoing edges to the right side of the graph (b → c, b → e, f → e). However, there
are no returning edges from {c, d, e} back to {a, b, f }.
• Now look at the remaining vertices on the right. There is a two-way connection
between c and e (c → e and e → c).
18
• We also have a path passing through d. There is an edge c → d and an edge
d → e.
• Since there are no other vertices left in the graph to check, this forms our second
maximal strongly connected component.
C1 = {a, b, f }
C2 = {c, d, e}
19