0% found this document useful (0 votes)
72 views64 pages

Discrete Mathematics and Graph Theory

This document provides an overview of discrete mathematics and graph theory (DMGT). It discusses why DMGT is important, noting that it develops mathematical thinking, improves problem solving abilities, and is important for fields like compiler design, databases, computer security, and operating systems. It allows one to find the shortest path, use combinations, and do cryptography. The document then discusses some key concepts in DMGT, including statements and notation, connectives, tautologies, implications, normal forms, and predicate calculus. It provides examples and references for further reading.

Uploaded by

Use Andthrow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views64 pages

Discrete Mathematics and Graph Theory

This document provides an overview of discrete mathematics and graph theory (DMGT). It discusses why DMGT is important, noting that it develops mathematical thinking, improves problem solving abilities, and is important for fields like compiler design, databases, computer security, and operating systems. It allows one to find the shortest path, use combinations, and do cryptography. The document then discusses some key concepts in DMGT, including statements and notation, connectives, tautologies, implications, normal forms, and predicate calculus. It provides examples and references for further reading.

Uploaded by

Use Andthrow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 64

Discrete Mathematics and Graph Theory

Why DMGT?
• Develop Mathematical thinking.
• Improve Problem solving ability
• Important to survive in subject like compiler design,
databases, computer security, operating system etc.
• Find the shortest path.
• Combination
• Cryptography
Module 1: Mathematical Logic

Statements and Notation-Connectives - Tautologies-Equivalence -


Implications - Normal forms - The Theory of Inference for the
Statement Calculus - Predicate Calculus - Inference Theory of the
Predicate Calculus
Books for References

BMAT205L_Module 1

3
Mathematical Logic and Statement Calculus

Logic
Science of reasoning
 It may be on legal argument
 Mathematical Proof
 Conclusion in Scientific theory based upon a set of hypothesis.
Statement Calculus
Area of logic deals with statement is called statement calculus.
Logical Statement: Using variable and connectives
Statement Or Proposition
It is a declarative sentence which is either true or false not both.
Example:
1. Delhi is the capital of Spain.
2. Canada is a country.
3. 7+8 = 10.
4. x is beautiful.
5. When did you come?
6. Open the box.
Note: Question, Command, Exclamation are not propositions.
Atomic/ Simple Statement
Which do not contain any logical operators and they can’t be broken further.

Example: 3 is a prime number.

Compound Statement:
Constructed by combining two or more atomic statement using connectives.

Example: It is raining and it is cold.

Connectives:
1. Negation (, ¬)
2. Conjunction (^)
3. Disjunction(∨)
4. Implication or Conditional (
5. Biconditional (
Connectives

Negation
Negation of the statement P is denoted by (p, ).
Example:
p: 7 is an even number.
p: It is not the case that 7 is an even number (or) 7 is not an even
number.
Truth Table
P p
T F
F T
Conjunction (and, but)

Conjunction of two variables p and q denoted by p∧q is true if both p and q


are true. If at least one is false then it is false. p q p∧q
Example T T T
T F F
1. p: It is raining.
F T F
q: It is cold. F F F
p∧q: It is raining and it is cold.
(p∧q): It is not the case that it is raining and it is cold.
(or)
It is not raining or it is not cold
2. Snoopy wears goggles and scarves
Disjunction (or)
Disjunction of two variables p and q denoted by p ∨ q is true if at least one of
them is true. If both are false then it is false.
p q p∨q
Example
1. p: It is cold.
T T T
q: It is sunny.
T F T
p ∨ q: It is cold or it is sunny. F T T
(p ∨ q): It is not the case that itFis cod
F orF it is sunny.
(or)
It is not cold and it is not sunny.
2. I will paint the room blue or green.
X OR (Exclusive or)
Truth Table
p q p⊕q
T T F
T F T
F T T
F F F

Example:
1. The circuit is either on or off.
2. Let ab < 0, then either a < 0 or b < 0.
Logical Implication or Conditional Statement
The implication p q is the proposition, that is false when p is true and q is false and
true otherwise. p q pq
p – Premise (Or) Hypothesis (or) Antecedent. T T T
q – Conclusion (or) Consequence T F F
F T T
Example:
F F T
1. p q: If you reach bus stop by 5 am then you will get the bus.(T
¬(p q): It is not the case that if you reach bus stop by 5 am then you will get the
bus. (Or) You reach bus stop by 5 am and you will not get the bus. (¬(p q) = (p ∧
¬q))
2. p q: If I am elected then I will lower the taxes.
Logical Implication
The implication p q is equivalent to
 If p then q
 p only if q
 q when p
 q whenever p
 q if p
 q unless not p
 q follows from p
 p is sufficient condition for q
 q is necessary condition for p
Biconditional
The biconditional pq is the proposition, that is true when p and q have the same truth value. It is
false otherwise.
Note: pq is equivalent to (p q) ∧ (q )
P q pq

T T T
T F F
F T f
Example: F F T
1. pq: The polygon is a quadrilateral iff the polygon has only four sides
¬(pq): It is not the case that the polygon is a quadrilateral iff the polygon has only four sides, (Or)
The polygon is a quadrilateral iff the polygon does not has only four sides (¬(pq) = (p ¬q))
2. pq: 8 is a even number iff 8 is a multiple of 2.
Biconditional

Equivalent statement for biconditional


p iff q
p is necessary and sufficient for q
 If p then q and conversely
Converse, Contrapositive and Inverse

Consider the implication p q then


 Converse : q
 Contrapositive: ¬q
 Inverse: ¬p
Truth Table
p q ¬q pq q ¬q ¬p
T T F F T T T T
T F F T F T F T
F T T F T F T F
F F T T T T T T
Problems

1. Construct the truth table for the following:


(i) ¬ (p ∧q) (¬p ∨ ¬q)
(ii) (p ∧q) ∨ r
(iii) ¬p ∨ (q ∧ ¬ r)
(iv) (q ∧ ¬ p)
(v) ¬p (q ∨ r)
Problems for Practice

18
The following are not well formed formula
• ¬p ∧ q
• (p q) (∧q)
• (p q.
• (p ∧ q) q)
Dual
Two formulas p and are said to duals of each other if either one can be
obtained by replacing ∨ by ∧, ∧ by ∨ and T by F and F by T.
Problem: Find the dual of (i) (p ∧q) ∨ T (ii) ¬(p ∨ q) ∧ (p ∨ ¬(q∧ ¬ r))
Contingency

A compound proposition that is neither a tautology nor a contradiction is called


a contingency.

20
Example:

𝑷 𝑸 𝑷∨𝑸 𝑷 ∨ ¬𝑷 𝑷 𝖠 ¬𝑷
1 1 1 1 0
1 0 1 1 0
0 1 1 1 0
0 0 0 1 0

Contingency

Tautology

Contradictio
n

21
Valid, Satisfiable and Unsatisfiable

BMAT205L_Module
22
1
Logical Equivalence (𝑃 ≡ 𝑄 or 𝑃 ⇔ Q)

 The two compound propositions 𝑃 and 𝑄 are called logically


equivalent if and only if the truth values of 𝑃 and 𝑄 are equal.
 Equivalently, two compound propositions 𝑃 and 𝑄 are called
logically equivalent if 𝑃 ↔ 𝑄 is a tautology.
 It is denoted by 𝑃 ≡ 𝑄 or 𝑃 ⇔ Q.

23
24
Negation
Law

BMAT205L_Module
25
1
BMAT205L_Module
26
1
Problems:
1. S.T p q ) is a tautology using T.T and logical laws.
2. Without using T.T, P.T p q ), p (¬q ∨ r), (p ∧ q) r are logically equivalent.
3. ¬p q ) q (p∨ r)
4. (¬p∨ q) ∧ (p ∧ (p ∧ q)) p ∧ q.

Practice:
3. S.T (¬ p ∧ (¬q ∧ r)) ∨ (q ∧ r) ∨ (p ∧ r) r.
4. S.T ¬ (𝑝 ∧ 𝑞) → (¬𝑝˅(¬𝑝˅𝑞)) ¬𝑝˅q
5. [(𝑝˅𝑞) ∧ (𝑝˅¬𝑞)]˅𝑞 ⇔ 𝑝˅q
6. P.t [(p∨ q) ∧ ¬(¬p ∧(¬q ∨ ¬r))] ∨ (¬ p ∧ ¬q) ∨ (¬ p ∧ ¬r) is valid by
T.T.
7. Prove the following equivalence by proving the equivalence of the duals
(i) ¬((¬p ∧q) ∨(¬p ∧ ¬q)) ∨ (p ∧ q) p (ii) (p ∧ (p ↔ q)) T.
28
Normal Form
1. The problem of determining, in a finite number of steps,
whether a given statement formula is tautology or a
contradiction or contingency is known as a decision problem.

2. The solution of the decision problem may not be simple in


general. Also the construction of truth tables may not be
practical, even with the aid of a computer.

3. Therefore consider other procedures known as reduction to


normal forms.

29
Disjunctive Normal Form (DNF)
Sum of the elementary product
Eg: (p ∧ q) ∨ (¬p ∧ ¬q) ∨ p

Conjunctive Normal Form (CNF)


Product of of the elementary sum
Eg: (p ∨ q) ∧ (¬p ∨ ¬q) ∧ p ∧ (p ∨ ¬q)

Procedure for Reducing to Normal Form


 Replace implication by ∨, ∧ and ¬.
 Apply De Morgan’s law if required
 Apply distributive law repeatedly
Problems
DNF
1. p ∧ (p q)
2. p q (p ∧ q) ∨ (¬ p∧ ¬ q)
3. (¬ p q) ∧ (q p)

Practice
1. ¬(¬(p q ) ∧ r)
2. p ∧ ¬(q ∧ r) ∨ (p q)

CNF
4. ¬(p (q ∧ r))
5. (p ∧ ¬(q ∧ r)) ∨ (p q)
Practice
6. ¬(p ∨q) (p ∧ q) 2. (q ∨ (p ∧ q) ) ∧ ¬(p ∨r) ∧ q)
Minterm or Boolean conjunctions
Given a number of variable, the product or conjunction in
which each variable or its negation, occurs only once are
called the minterms.

Example: For a two variable p & q, the possible minterms


are (p ∧ q), (¬p ∧ q), (p ∧ ¬q), (¬ p ∧ ¬q).

Principal Disjunction Normal Form(PDNF)


Sum of the minterm is PDNF

Example: (p ∧ q) ∨ (¬p ∧ q) ∨ (p ∧ ¬q) ∨(¬ p ∧ ¬q).


Maxterm or Boolean disjunctions
Given a number of variable, the sum or disjunction in
which each variable or its negation, occurs only once are
called the maxterms.

Example: For a two variable p & q, the possible maxterms


are (p ∨ q), (¬p ∨ q), (p ∨ ¬q), (¬ p ∨ ¬q).

Principal Conjunction Normal Form(PCNF)


Product of the maxterm is PCNF

Example: (p ∨ q) ∧ (¬p ∨ q) ∧ (p ∨ ¬q).


• Each minterm has the truth value 𝑻 for exactly one combination
of the truth values of the variables 𝑃 and 𝑄.
• If the truth table of any formula containing only the variables 𝑃
and 𝑄 is known, then one can easily obtain an equivalent formula
which consists of a disjunction of some of the minterms.

• Each maxterm has the truth value 𝑭 for exactly one combination
of the truth values of the variables 𝑃 and 𝑄.
• If the truth table of any formula containing only the variables 𝑃
and 𝑄 is known, then one can easily obtain an equivalent formula
which consists of a conjunction of some of the maxterms
BMAT205L_Module 45
1
Methods to find PDNF and PCNF

BMAT205L_Module
35
1
Problems

1.Find the PDNF and PCNF of the following using


Truth Table.
(i) (p ∨ q)
(ii)(p (q ∧ r)) ∧ (¬p (¬q ∧ ¬ r)
2. Find the PDNF using algebraic method
(p ∨ q)
3. Find the PCNF using algebraic method
¬(p q)
Problems for Practice:

37
38
Basic Terminologies
 Premise is a proposition on the basis of which we would able to
draw a conclusion.
 We can think of premise as an evidence or assumption.
Therefore, initially we assume something is true and on the
basis of that assumption we draw some conclusion.
 Conclusion is a proposition that is reached from the given set of
premises.
 We can think of it as the result of the assumptions that we
made in an argument.
If Premises then Conclusion
BMAT205L_Module
39
1
Argument – Valid and Invalid
 Argument is sequence of statements that ends with a conclusion or
it is a set of one(or more) premises and a conclusion.
 Valid Argument: An argument is said to be valid argument if and
only if it is not possible to make all premises true and a conclusion
false.

 Invalid Argument: An argument is said to be an invalid argument if


it is not a valid argument.
55
BMAT205L_Module
Valid Argument Invalid Argument

𝑝→𝑞 𝑝→𝑞
𝑝 𝑞
∴𝑞 ∴𝑝

or or
((𝑝 → 𝑞) 𝖠 𝑝) → 𝑞 ((𝑝 → 𝑞) 𝖠 𝑞) → 𝑝

BMAT205L_Module
41
1
Inference and Rules of Inference
 Inference is a conclusion(s) derived on the basis of
the evidence(s).
 Rules of Inference are the templates for constructing
valid arguments.

BMAT205L_Module
42
1
Resolution

If P ∨ Q and (¬ P ∨ R ) are two premises, we can use resolution rule


to drive Q ∨ R

P∨Q
(¬ P ∨ R )

Q∨R
Example:

Let P ∨ Q - “It is not snowing or Jasmine is skiing ”


Let (¬ P ∨ Q) – “It is snowing or Bart is playing hockey”
Therefore – “Jasmine is skiing or Bart is playing hockey”
52
Direct Proof

A direct proof of a conditional statement p q is


constructed when the first step is the assumption that p is
true; subsequent steps are constructed using rules of
inference, with the final step showing that q must also be
true.
 The combination p true and q false never occur.
Indirect Proof

BMAT205L_Module
54
1
BMAT205L_Module
55
1
BMAT205L_Module
56
1
BMAT205L_Module
57
1
4. Show that the hypotheses "If you send me an e-mail message,
then I will finish writing the program," "If you do not send me an e-
mail message, then I will go to sleep early," and "If I go to sleep
early, then I will wake up feeling refreshed" lead to the conclusion
"If I do not finish writing the program, then I will wake up feeling
refreshed.”

Solution:
P: "You send me an e-mail message“
Q: I will finish writing the program“
R: "I will go to sleep early”
S: "I will wake up feeling refreshed“.

Premises: P Q; ¬P ; R
Conclusion: ¬Q
Here, ¬(Conclusion) = ¬𝑟 leads to a contradiction.
Hence 𝑝 → 𝑞, q → 𝑟, ¬BMAT205L_Module
𝑝 𝖠 𝑟, 𝑝 ∨1 𝑟 ⟹ 𝑟 is valid. 70
Use the indirect method to show that r ¬ q, r ∨s, s ¬ q, p q ⇒ ¬ p

Solution:
Prove that the premises p q, q r, s ¬r and q s are
inconsistent
BMAT205L_Module
62
1
BMAT205L_Module
63
1
BMAT205L_Module
64
1

You might also like