Discrete Mathematics and Graph Theory
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
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.
Compound Statement:
Constructed by combining two or more atomic statement using connectives.
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)
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
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
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)
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.
29
Disjunctive Normal Form (DNF)
Sum of the elementary product
Eg: (p ∧ q) ∨ (¬p ∧ ¬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.
• 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
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.
𝑝→𝑞 𝑝→𝑞
𝑝 𝑞
∴𝑞 ∴𝑝
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
P∨Q
(¬ P ∨ R )
Q∨R
Example:
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