Study Notes for Discrete Mathematics Course
Course Overview
Course Title: Discrete Mathematics for Computer Science
Course Code: CSE1101
Credits: 5
Prerequisites: Intermediate level mathematics
Lecture-Tutorial-Practical-Credits (L-T-P-C): 3-1-2-5
Course Objectives
Foundation in Mathematical Logic
Understanding the principles of logic that serve as the basis for reasoning.
Learn to analyze complex problems mathematically.
Graph Theory and Algebraic Structures
Introduce essential concepts that serve as computational tools in computer science.
Formal Mathematical Proofs
Develop skills in constructing proofs using induction and logical reasoning.
Able to articulate and validate mathematical arguments.
Application of Discrete Structures
Represent and resolve real-world computational problems using discrete mathematics.
Course Syllabus
Module I: Logic and Proof Techniques
Topics Covered:
Propositions
Logical connectives
Truth tables
Conditional statements: converse, contrapositive, and inverse
Logical equivalence
Tautology and contradiction
Contingency
Normal forms: conjunctive and disjunctive
Translating English sentences into logical expressions
Predicate logic
Universal and existential quantifiers
Methods of proof, including mathematical induction
Module II: Sets, Functions, and Relations
Topics Covered:
Sets and Venn diagrams
Set operations, subsets, and identities
Cartesian products and power sets
Cardinality of sets
Counting techniques and the principle of inclusion-exclusion
Functions: injections, surjections, and bijections
Relations and their properties
Equivalence relations, equivalence classes, partitions
Partially ordered sets (Posets) and lattices
Module III: Graph Theory
Topics Covered:
Definition and types of graphs
Basic terminology in graph theory
Handshaking lemma
Paths, cycles, and trees in graphs
Complete graphs and regular graphs
Bipartite and k-partite graphs
Graph representations and connectivity
Euler and Hamiltonian paths
Graph coloring and determining chromatic numbers
Module IV: Algebraic Structures
Topics Covered:
Semigroups and monoids
Groups and abelian groups
Subgroups and cyclic groups
Group homomorphism and isomorphism
Rings and fields
Laboratory Practices
Generate truth tables for simple and compound propositions.
Determine logical equivalence using truth tables.
Perform set operations on finite sets.
Compute the Cartesian product of sets, determining its cardinality.
Verify whether a relation is an equivalence relation.
Construct a graph from an edge list and extract its adjacency matrix.
Verify the Handshaking Lemma in a graph.
Create a Cayley table for a finite set under a defined binary operation.
Course Outcomes
By the end of the course, students will be able to:
Utilize rules of propositional logic, predicate logic, and mathematical induction in verifying mathematical arguments and proofs.
Solve problems related to sets, functions, counting, and relations to explore partitions and equivalences.
Analyze graph structures, evaluating connectivity, paths, trees, and coloring for modeling purposes.
Implement algebraic structures like groups, rings, and fields in appropriate mathematical or computational contexts.
Textbooks
K. H. Rosen
Title: Discrete Mathematics and its Applications
Edition: 7th, Year: 2012
Publisher: McGraw-Hill
Swapan K. Sarkar
Title: Textbook of Discrete Mathematics
Edition: 1st, Year: 2015
B. Kolman, R. C. Busby, S. C. Ross
Title: Discrete Mathematical Structures
Edition: 6th, Year: 2008
Publisher: Pearson
C. L. Liu, D. P. Mohapatra
Title: Elements of Discrete Mathematics: A Computer Oriented Approach
Edition: 4th, Year: 2012
Publisher: Tata McGraw-Hill
References
NPTEL
Course: “Discrete Mathematics for CS”
Instructor: Prof. Nitin Saxena, IIT Kanpur
MIT OpenCourseWare
Course: “Mathematics for Computer Science”, 6.042J
Coursera
Specialization: “Introduction to Discrete Mathematics for Computer Science.”
Evaluation Scheme
Theory Assessment (60%)
Continuous Assessment: 25%
Mid-term: 25%
End-term: 50%
Total: 100%
Note: Continuous Assessment includes four quizzes, one per module, contributing to the overall theory assessment.
Practical Assessment (40%)
Continuous Assessment: 10%
End-term Practical: 30%
Total: 100%
Special Notes
Students must read the ‘Student Examination Handbook (2025–2026)’ thoroughly.
All lectures, tutorials, and study materials are accessible in the JUNO ERP system.
It is important to maintain a dedicated notebook for the course materials and practice regularly. Be ready to present when requested.
Office Hours:
For Division C: Tuesday 09:00 - 10:00
For Division D: Monday 09:00 - 10:00
Office Location: Room 521
Module I: Logic and Proof Techniques
Topics for This Lecture
Propositions
Logical Connectives
Truth Tables
What is Logic?
Logic is the study of the methods and principles used to distinguish correct reasoning from incorrect reasoning.
Focus: Propositional Logic
Definitions:
Proposition: A declarative sentence with a truth value of either True (T) or False (F), but never both.
Propositional Logic (Propositional Calculus): The branch of logic that studies the properties and relationships of propositions and how they combine using logical connectives.
Examples of Propositions
Each proposition must have a definite truth value:
True Examples:
“New Delhi is the capital of India.”
“7 is an even number.”
“The sun rises in the east.”
Each of these statements hold a definitive truth value (true or false).
Not Propositions
Some sentences lack a definitive truth value and are not classified as propositions.
Examples Not Propositions:
“Close the door.” (command)
“What time is it?” (question)
(contains an unknown variable)
“Study harder!” (advice)
Propositional Variables and Truth Values
Propositional Variables: Represented by letters like p, q, r, s, etc.
Each variable has a truth value assigned:
Example:
: “2 is an even number.” (True)
: “5 is a prime number.” (True)
: “3 + 4 = 10.” (False)
Compound Propositions
Definition: Propositions can be combined to create compound propositions using logical connectives.
Example Statement:
Let = “It is raining”
Let = “I am carrying an umbrella”
Compound proposition:
: “It is raining and I am carrying an umbrella.”
The truth of a compound proposition is conditional upon the truth values of its constituent propositions.
Logical Connectives and Precedence
Logical Connectives: Symbols used to connect propositions to form compound propositions.
Precedence Table:
Symbol
Meaning
¬p
Negation: not p
p ∧ q
Conjunction: p and q
p ∨ q
Disjunction (inclusive): p or q (or both)
p ⊕ q
Exclusive or (XOR): exactly one of p, q is true
p → q
Implication: if p, then q
p ↔ q
Biconditional: p if and only if q
Parentheses can be used to avoid ambiguity in interpretations.
Truth Tables
Definition: A truth table displays the truth value of a compound proposition for every possible combination of truth values of its variables.
Example for Negation:
p
¬p
T
F
F
T
means “not p,” which reverses the truth value of .
Truth Table Example with OR
Truth Table for OR ():
p
q
p ∨ q
T
T
T
T
F
T
F
T
T
F
F
F
Observation: is only false when both and are false.
Truth Table Example with AND
Truth Table for AND ():
p
q
p ∧ q
T
T
T
T
F
F
F
T
F
F
F
F
Observation: is true only when both and are true.
Truth Table Example with Exclusive OR (XOR)
Truth Table for XOR ():
p
q
p ⊕ q
T
T
F
T
F
T
F
T
T
F
F
F
Observation: is true only when either or is true, but not both.
Implication
Definition: The implication is represented as , read as “If p, then q.”
It is false only when is true and is false.
Truth Table for Implication:
p
q
p → q
T
T
T
T
F
F
F
T
T
F
F
T
Biconditional
Definition: Biconditional is expressed as meaning “p if and only if q.”
It holds true when both and have the same truth value.
Truth Table for Biconditional:
p
q
p ↔ q
T
T
T
T
F
F
F
T
F
F
F
T
Example for Logical Statements
Let “It is raining”
Let “I carry an umbrella”
Expressions Using Logical Connectives:
“It is not raining.”
“It is raining and I am carrying an umbrella.”
“It is raining or I carry an umbrella.”
“Either it is raining or I carry an umbrella, but not both.”
“If it is raining, then I carry an umbrella.”
“I carry an umbrella if and only if it is raining.”
Exercises
Propositions
Decide whether the following sentences are propositions, and if they are, specify the truth value:
“Close the window.”
“Every prime number is odd.”
“Paris is the capital of France.”
Negation
Write the negation of the following statements:
“The class starts at 9:00.”
“The student submitted the assignment.”
“The number 7 is even.”
“All computers in the lab are working.”
Conjunction and Disjunction
Express and evaluate the following sentences using symbols:
“It is raining and it is cold.”
“She is a teacher or she is a doctor.”
“The bus is late and the road is empty.”
“He will pass the exam or he will repeat the course.”
Exclusive OR
Rewrite the following sentences using exclusive or (⊕):
“You can choose tea or coffee, but not both.”
“The room will be locked by Alice or Bob, but not both.”
“The light is on in exactly one of the two rooms.”
Implication
Translate the following into symbolic form:
“If it rains, the match will be canceled.”
“If a number is even, then it is divisible by 2.”
“If the student studies, then the student passes.”
Biconditional
Write each sentence as a biconditional statement:
“A figure is a square if and only if it has four equal sides and four right angles.”
“You may enter the lab if and only if you have your ID card.”
“A number is even if and only if it is divisible by 2.”
Module I: Logic and Proof Techniques
Topics for This Lecture
Conditional statements
Converse
Contrapositive
Inverse
Conditional Statements
Definition: A conditional statement takes the form and is read as “If p, then q.”
Here, is called the hypothesis (antecedent) and is the conclusion (consequent).
Example Statement:
“If a number is divisible by 4, then it is even.”
Truth of a Conditional
Truth Value Condition: The conditional is false only when is true and is false.
Truth Table for Conditional:
p
q
p → q
T
T
T
T
F
F
F
T
T
F
F
T
Converse, Inverse, Contrapositive
For a given conditional statement :
Converse:
Inverse:
Contrapositive:
Important: The statements and share the same truth value.
Example — Converse, Inverse, Contrapositive
Original Statement: “If it is raining, then the ground is wet.”
Converse: “If the ground is wet, then it is raining.”
Inverse: “If it is not raining, then the ground is not wet.”
Contrapositive: “If the ground is not wet, then it is not raining.”
Logical Equivalence
Definition: Two compound propositions are logically equivalent if they have the same truth value in every possible scenario.
Symbol for Logical Equivalence:
means “p and q are logically equivalent.”
Example: (This is one of De Morgan’s laws.)
Truth Table: Conditional, Converse, Inverse, Contrapositive
Truth Table Format:
p
q
p → q
q → p
¬p → ¬q
¬q → ¬p
T
T
T
T
T
T
T
F
F
T
T
F
F
T
T
F
T
T
F
F
T
T
T
T
Observation:
and .
Logical Equivalence Using Truth Tables
Example Volume:
Truth Table Format:
p
q
p → q
¬p
¬p ∨ q
T
T
T
F
T
T
F
F
F
F
F
T
T
T
T
F
F
T
T
T
Conclusion: Both columns are identical, hence statements are logically equivalent.
Module I: Logic and Proof Techniques
Topics for This Lecture
Tautology
Contradiction
Contingency
Tautology, Contradiction, and Contingency
Definitions:
Tautology: A statement that is always true.
Contradiction: A statement that is always false.
Contingency: A statement that can be either true or false.
Examples:
: Tautology
: Contradiction
Logical Equivalence
Definition: Two propositions are logically equivalent if they always possess the same truth value expressed as
which means: “these two statements have identical truth tables.”Another Formulation:
is a tautology.
Example:
Logical Equivalences
Identity Laws
Domination Laws
Idempotent Laws
Double Negation Laws
More Logical Equivalences
Commutative Laws
Associative Laws
Distribution of Logical Equivalences
Distributive Laws
De Morgan Laws
Final Logical Equivalences
Absorption Laws
Negation Laws
Logical Equivalences Involving Conditionals
Equivalences Involving Biconditionals
Exercises on Logical Equivalence
Avoid using truth tables; use logical equivalence laws to demonstrate the following:
Show that is logically equivalent to .
Demonstrate that is logically equivalent to by constructing a series of logical equivalences.
Prove that is a tautology.
Building Blocks in Logic
Literals: A propositional variable or its negation, e.g., ,
Conjunction: An AND of literals, e.g.,
Disjunction: An OR of literals, e.g.,
A conjunction or disjunction may contain one or many literals.
Disjunctive Normal Form (DNF)
Definition: A formula is in disjunctive normal form if it is a disjunction of one or more conjunctions of literals.
General Form:
Each conjunction represents a complete condition for the formula to hold true.
Examples of DNF
Examples include:
Each expression is an OR of one or more AND-clauses.
Conjunctive Normal Form (CNF)
Definition: A formula is in conjunctive normal form if it is a conjunction of one or more disjunctions of literals.
General Form:
Each disjunction reduces one way in which a formula could be false.
Examples of CNF
Examples include:
Each expression is an AND of one or more OR-clauses.
Example: Converting to DNF
Conversion Example: Convert to DNF.
Apply Distribution:
Result: DNF is satisfied as a disjunction of conjunctions of literals.
Example: Converting to CNF
Conversion Example: Convert to CNF.
Apply Distribution:
Result: Expressed as a conjunction of disjunctions of literals.
Exercises: Identification
Classify each expression as CNF, DNF, both, or neither:
Exercises: Conversion
Convert each expression as required:
Convert to DNF:
Convert to CNF:
Rewrite in both CNF and DNF:
Module I: Logic and Proof Techniques
Topics for This Lecture
Predicates
Quantifiers
Predicate Logic
Definition: Propositional logic cannot adequately describe statements involving variables.
Predicate Logic extends propositional logic by introducing variables, predicates, and quantifiers:
Predicate Example:
Predicates and Domains
A predicate becomes a proposition when a value is assigned to its variable.
Domain: The set from which variables take their values.
Example Predicates:
Domain: Integers
Domain: Real numbers
Universal Quantifier
Symbol:
Meaning: For all x, is true.
Example:
Universal Quantifier — Examples
More examples:
(domain: real numbers)
(domain: integers)
Dependence: The truth of hinges on the domain chosen.
Existential Quantifier
Symbol:
Meaning: There exists an x such that is true.
Example:
Existential Quantifier — Examples
More examples:
(domain: real numbers)
Translating English Sentences
Quantifier Words:
Universal: all, every
Existential: some, there exists
None: translates to negation of existential quantifier
Translation Examples
Let the domain be integers:
“Every integer is even or odd” translates to
“There exists an integer that is even and prime” translates to
More Translation Examples
Let the domain be students:
“Every student has an ID card” translates to
“Some student has not submitted the assignment” translates to
Exercises — Predicate Logic and Quantifiers
Translate into logical expressions (and state the domain clearly):
“Every real number has a square greater than or equal to zero.”
“There exists an integer that is divisible by both 2 and 3.”
“Every student in the class has submitted the assignment.”
“Some student in the class has not attended the lecture.”
Exercises — Truth and Meaning
Determine whether is true for the domains:
Integers
Real Numbers
Determine whether is true for integers.
Provide an instance where is false, but is true.
Module I: Logic and Proof Techniques
Topics for This Lecture
Methods of Proof
Mathematical Induction
Methods of Proof
In mathematics, statements are established using logical arguments called proofs.
Common methods include:
Direct proof
Proof by contrapositive
Proof by contradiction
Proof by cases
Disproof by counterexample
Mathematical induction
Direct Proof
Definition: A direct proof assumes the hypothesis is true and provides logical reasoning to show the conclusion follows.
Typical Form Format:
Example:
If is an even integer, then is also even.
Direct Proof — Example
Assumption: Let be even, meaning for some integer .
Proof Steps:
Conclusion: Hence, is even.
Proof by Contrapositive
Definition: To prove , instead prove the logically equivalent statement . This is useful when the contrapositive is easier to prove.
Example: “If is odd, then is odd.”
Proof by Contrapositive — Example
Contrapositive Proof: Show that “If is even, then is even.”
Assumption: . Then - thus, is even. Therefore, if is odd, then must be odd.
Proof by Contradiction
Definition: To prove , assume is true, deriving a contradiction must show .
Example Statement: “There is no smallest positive rational number.”
Proof by Contradiction — Example
Assumption: Assume there exists a smallest positive rational number, .
If we examine , it remains a positive rational number which contradicts being the smallest. Hence, such a smallest positive rational number cannot exist.
Proof by Cases
Definition: A statement proved by categorizing the argument into finite cases, and proving each case’s validity.
Example: “For every integer , .”
Proof by Cases — Example
Cases:
Case 1: - So,
Case 2: - Hence,
Case 3: - Then,
Conclusion: Thus, for all integers .
Disproof by Counterexample
Definition: A universal statement negated by a single counterexample.
Example Statement: “All prime numbers are odd.”
Counterexample: 2 is both prime and even.
Mathematical Induction
Description: A method to prove statements of the form holds for all integers .
Consists of Two Steps:
Base Step: Verify is true.
Inductive Step: Assume is true, then show follows.
Principle of Mathematical Induction
Requirements:
Base step: Show is true.
Inductive hypothesis: Assume is true.
Inductive step: Prove is valid.
If both conditions hold, then is valid for all .
Induction — Example
Statement: Prove that for all integers .
Base step (n = 1):
Inductive hypothesis: Assume true for
Inductive step:
Show for
Exercises: Methods of Proof
Directly prove that the sum of two even integers is even.
Contrapositive: If is divisible by 3, then is divisible by 3.
Prove by contradiction that .
Disprove the statement: For all integers , is prime.
Prove by cases that for all real numbers .
Exercises: Mathematical Induction
Prove that for all using induction.
Prove for integers using induction.
Show: for all integers .
Module I: Logic and Proof Techniques
Tutorial
Exercises: Propositions
Determine which sentences are propositions, and justify the answer.
“The sum of two even integers is even.”
“There are infinitely many prime numbers.”
Give two different propositions that share the same truth value.
Exercises: Logical Connectives
Let p: “The server is running.”
Let q: “The network is available.”
Let r: “The website is accessible.”
Write the following statements using symbols:
“The server is running and the network is available.”
“The website is accessible only if the server is running.”
“Either the network is available or the website is accessible, but not both.”
Write an English sentence corresponding to: .
Exercises: Truth Tables
Construct the truth table for:
Construct the truth table for:
From the truth table, assess whether is a tautology.
Exercises: Conditional Statements
Write the converse, inverse, and contrapositive of: “If a function is differentiable, then it is continuous.”
Identify which of the four statements (original, converse, inverse, contrapositive) are logically equivalent.
Exercises: Logical Equivalence
Avoid truth tables; use logical equivalence laws to show:
Determine if is logically equivalent to .
Exercises: Logical Equivalence
Avoid truth tables; apply logical equivalence laws only:
Prove that .
Show that .
Prove that .
Assess whether is a tautology.
Prove that .
Test whether is a tautology.
Exercises: Tautology, Contradiction, Contingency
Classify these propositions:
Provide a proposition with two variables neither classified as a tautology nor contradiction.
Exercises: CNF and DNF
Rewrite the following propositions in the required normal form:
Convert to disjunctive normal form:
Convert to conjunctive normal form:
Rewrite the following in disjunctive normal form: .
Exercises: CNF and DNF
Rewrite as indicated:
Convert to conjunctive normal form:
Convert into both CNF and DNF:
Classify the expression as CNF, DNF, both, or neither.
Exercises: Translating English Sentences
Translate into logical notation. Specify the domain:
“Every rational number has a decimal expansion.”
“There exists a natural number that is divisible by every natural number.”
“No employee in the company works on all days of the week.”
“There is a machine that can perform every assigned task.”
Exercises: Predicate Logic and Quantifiers
Let “x is divisible by 3.”
Write in symbols: “Every integer greater than 6 is divisible by 3.”
“Some integer greater than 6 is divisible by 3.”
Write the negation of: .
Establish whether the following statement is true or false; justify:
.
Exercises: Direct Proof
Prove directly that the sum of two odd integers is even.
Prove: if is an integer divisible by 6, then is also divisible by 3.
Prove the product of two consecutive integers is even.
Exercises: Proof by Contrapositive
Prove by contrapositive: if is even, then is even.
Prove by contrapositive: if is irrational, then at least one of or is irrational.
Prove by contrapositive: if is not divisible by 3, then is not divisible by 3.
Exercises: Proof by Contradiction
Prove by contradiction that .
Show there is no smallest positive real number.
Prove that there exists an infinite number of prime numbers.
Exercises: Proof by Cases
Prove by cases that for every integer , .
Prove that if and if .
Prove by cases that is either even or odd for every integer .
Exercises: Disproof by Counterexample
Disprove: “All integers of the form are prime.”
Disprove: “For all real numbers , .”
Disprove: “Every continuous function is differentiable.”
Exercises: Mathematical Induction
Prove using induction that for all integers .
Prove using induction that for all integers .
Prove that for all integers .