0% found this document useful (0 votes)
102 views

DS - Basic Set Theory and Logic

The document provides information about the Discrete Structure course for the S.Y. B.Tech semester IV (CSE) program. It includes details like the teaching scheme, examination scheme, topics to be covered, references/books, and examples/concepts from discrete mathematics like sets, operations on sets, inclusion-exclusion principle, and cardinality. The course aims to teach logical and mathematical thinking which is useful for understanding areas like algorithms, programming languages, and cryptography.

Uploaded by

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

DS - Basic Set Theory and Logic

The document provides information about the Discrete Structure course for the S.Y. B.Tech semester IV (CSE) program. It includes details like the teaching scheme, examination scheme, topics to be covered, references/books, and examples/concepts from discrete mathematics like sets, operations on sets, inclusion-exclusion principle, and cardinality. The course aims to teach logical and mathematical thinking which is useful for understanding areas like algorithms, programming languages, and cryptography.

Uploaded by

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

Discrete Structure

(BT 12405)

S.Y. B. Tech. Semester IV (CSE)


by
Dr Anagha U. Khiste
Department of Applied Mathematics and Data Science
Indian Institute of Information Technology, Pune
Email: anaghakhiste@iiitp.ac.in

2022-2023
Discrete Structure
_____________________________
 Teaching Scheme:
Lectures : 3 hrs/week
 Examination Scheme:
Term 1: 20 marks
Term 2: 20 marks
End Term Exam: 60 marks

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
 Books and references:
 C. L. LIU, “Elements of Discrete Mathematics”, 2nd
Edition, Tata McGraw-Hill, 2002, ISBN: 0-07-043476-X.
 Kenneth H. Rosen, Discrete Mathematics and Its
Appications, Tata McGraw-Hill Edition, 2015
 G. Shanker Rao, "Discrete Mathematical Structures”,
New Age International, 2002, ISBN: 81-224-1424-9.
 Bernanrd Kolman, Robert C Busby, S.Ross, Discrete
Mathematical Structures, PHI Learning, 2008

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

Topics to be covered:
 Unit 1: Set Theory and Logic, Relations, Recurrence
Relations
 Unit 2: Number Theory, Introduction to Counting
 Unit 3: Graphs & Trees
 Unit 4: Algebraic Systems

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
 Discrete structure is the study of mathematical structures
that are fundamentally discrete (i.e. the study of discrete
objects).
 An object is discrete if it is not continuous.
 Discrete mathematics is something that is countable.
 This course helps to start thinking logically and
mathematically, also it helps to teach you how to
understand and how to construct correct mathematical
arguments.
 Knowledge of discrete structures helps in analyzing
algorithms, and understanding different areas of
computer science like programming languages and
cryptography.
anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
 Examples of discrete object:
 People, books, computers, transistor, computer programs and so
on.
 Set of natural numbers N, integers Z, rationals Q
 Finite sets
 {f | f : {1,2,…,n}→{0,1}}
 𝑥, 𝑦 ∈ 𝑍 × 𝑍 𝑦 = 𝑥 2 +

 Examples of non-discrete object:


 Set of all real numbers R
 Continuous functions
 𝑥, 𝑦 ∈ 𝑅 × 𝑅 𝑦 = 𝑥 2 +

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
 Basic Set Theory:
 Set: A set S is the collection of discrete objects.
 Elements: The objects in the set is called the elements or the
members of the set.
 Generally, in a set, the elements are not ordered in any
fashion and no elements are repeated.
 Multisets: A set in which repetition of an elements are
allowed. Ex. The multiset {1,1,2,3,3} is different from
{1,2,3}.
 Ordered set: A set in which order of an elements is important.
It is also called as list or string or vector. Ex. The ordered set
{1,2,3} is different from {2,1,3}.
 We can also have ordered multisets.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Notations:
∅ or {}: Empty set, i.e., set containing no elements.
U : Universal set, i.e., set of all elements under consideration.
𝑎 ∈ 𝑆 : 𝑎 is an element of the set S and read as 𝑎 belongs to S.
𝑎 ∉ 𝑆 : 𝑎 is not an element of S and read as 𝑎 does not belongs to S.
𝑆 ⊆ 𝑇 : Every element of S is in T and read as S is a subset of T.
𝑆 ⊂ 𝑇 : S is a proper subset of T, i.e., there is an element in T not in S.
𝑆 = 𝑇 : 𝑆 ⊆ 𝑇 and 𝑇 ⊆ 𝑆 .

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
A set S is said to be
• finite set if is either empty or it has n number elements, 𝑛 ∈ 𝑁.
• infinite set if it is not finite.
• countably infinite set if there exists a bijection from the set N
onto S.
• countable if it is either finite or countably infinite.
• uncountable if is not countable.

Cardinality: A set S is said to have finite cardinality, denoted |S|, if


the number of distinct elements in S is finite, else the set S is said to
have infinite cardinality.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Operations on sets:
 Union: 𝑆 ∪ 𝑇 = *𝑥 ∈ 𝑈: 𝑥 ∈ 𝑆 𝑜𝑟 𝑥 ∈ 𝑇+.
 Intersection: S ∩ 𝑇 = *𝑥 ∈ 𝑈: 𝑥 ∈ 𝑆 𝑎𝑛𝑑 𝑥 ∈ 𝑇+.
 Complement: S c = *𝑥 ∈ 𝑈 ∶ 𝑥 ∉ 𝑆+.
 Difference: S\𝑇 = *𝑥 ∈ 𝑈 ∶ 𝑥 ∈ 𝑆 𝑎𝑛𝑑 𝑥 ∉ 𝑇+.
 Symmetric difference: S⨁𝑇 = 𝑆 ∪ 𝑇 \(𝑆 ∩ 𝑇).
 Cartesian product: 𝑆 × 𝑇 = 𝑥 , 𝑦 : 𝑥 ∈ 𝑆 𝑎𝑛𝑑 𝑦 ∈ 𝑇 .
Disjoint sets: S ∩ 𝑇 = ∅.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Let P and Q be multisets.
 The union of the multisets P and Q is the multiset where
the multiplicity of an element is the maximum of its
multiplicities in P and Q.
 The intersection of P and Q is the multiset where the
multiplicity of an element is the minimum of its
multiplicities in P and Q.
 The difference of P and Q is the multiset where the
multiplicity of an element is the multiplicity of the
element in P less its multiplicity in Q unless this
difference is negative, in which case the multiplicity is 0.
 The sum of P and Q is the multiset where the
multiplicity of an element is the sum of multiplicities in
P and Q. anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
 The union, intersection, and difference of P and Q are denoted
by P ∪ Q, P ∩ Q, and P − Q, respectively (where these
operations should not be confused with the analogous
operations for sets). The sum of P and Q is denoted by P + Q.

Ex. Let A= {3. a, 2. b, 1.c} and B = {2.a, 3.b, 4.d} be the given
multisets. Find
 a) A ∪ B. b) A ∩ B. c) A − B. d) B − A. e) A + B.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

For any sets S and T, we have:


• ∅⊆𝑆⊆𝑈
• 𝑆⊆𝑆
• If 𝑆 ⊆ 𝑇 and 𝑇 ⊆ 𝑊, then 𝑆 ⊆ 𝑊
• 𝑆 ∩ 𝑇 ⊆ 𝑆, 𝑇 and S, 𝑇 ⊆ 𝑆 ∪ 𝑇

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Algebra of sets:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Power set:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Principle of inclusion and exclusion:
It is used in various counting problems.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

Proof: We will prove the formula by showing that, each element


𝑎 ∈ 𝐴1 ∪ 𝐴2 ∪ ⋯ ∪ 𝐴𝑛 is counted exactly once by the RHS of the equation.
Suppose that a is a member of exactly r of the sets 𝐴1 , 𝐴2 , . . . , 𝐴𝑛 where
1 ≤ r ≤ n.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
This element is counted C(r, 1) times by | 𝐴𝑖 |.
It is counted C(r, 2) times by | 𝐴𝑖 ∩ 𝐴𝑗 |.
In general, it is counted C(r, m) times by the summation involving m of
the sets 𝐴𝑖 .
Thus, this element is counted exactly
C(r, 1) − C(r, 2) + C(r, 3)−· · ·+(−1)r+1C(r, r)
times by the expression on the RHS of this equation.
By Binomial Theorem, we have
C(r, 0) − C(r, 1) + C(r, 2)−· · ·+(−1)rC(r, r) = 0.
Hence, 1 = C(r, 0) = C(r, 1) − C(r, 2)+· · ·+(−1)r+1C(r, r).
Therefore, each element in the union is counted exactly once by the
expression on the RHS of the equation. This proves the principle of
inclusion–exclusion.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:

Count the number of elements in a set A that have none of


the properties 𝑃1 , 𝑃2 , … , 𝑃𝑛 .
 𝐴 =N
 𝐴𝑖 : Subset of elements with property 𝑃𝑖
 𝐴1 ∪ 𝐴2 ∪ ⋯ ∪ 𝐴𝑛 : Subset of elements with at least one of the properties
𝑃1 , 𝑃2 , … , 𝑃𝑛 .
 𝑁 − |𝐴1 ∪ 𝐴2 ∪ ⋯ ∪ 𝐴𝑛 |: number of elements with none of properties
𝑃1 , 𝑃2 , … , 𝑃𝑛 .

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:
Ex. 1) How many solutions does x1 + x2 + x3 = 11
have, where x1, x2, and x3 are nonnegative integers with x1 ≤ 3,
x2 ≤ 4, and x3 ≤ 6?
Solution: Here we need to count the number of solutions that
have none of the properties 𝑃1 , 𝑃2 , 𝑃3 ,
where a solution have property P1 if x1 > 3,
property P2 if x2 > 4,
and property P3 if x3 > 6.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:
|𝐴| = N = total number of solutions with no restrictions = C(3 + 11 − 1, 11) = 78,
|𝐴1 | = number of solutions with 𝑥1 ≥ 4 = C(3 + 7 − 1, 7) = C(9, 7) = 36,
|𝐴2 | = number of solutions with 𝑥2 ≥ 5 = C(3 + 6 − 1, 6) = C(8, 6) = 28,
|𝐴3 | = number of solutions with 𝑥3 ≥ 7 = C(3 + 4 − 1, 4) = C(6, 4) = 15,
|𝐴1 ∩ 𝐴2 | = number of solutions with 𝑥1 ≥ 4 and 𝑥2 ≥ 5 = C(3 + 2 − 1, 2) = 6,
|𝐴1 ∩ 𝐴3 | =number of solutions with 𝑥1 ≥ 4 and 𝑥3 ≥ 7 = C(3 + 0 − 1, 0) = 1,
|𝐴2 ∩ 𝐴3 | =number of solutions with 𝑥2 ≥ 5 and 𝑥3 ≥ 7 = 0,
|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | =number of solutions with 𝑥1 ≥ 4, 𝑥2 ≥ 5, and 𝑥3 ≥ 7 = 0.
|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = 36 + 28 + 15 − 6 − 1 − 0 + 0 = 72
Number of solutions that have none of the properties 𝑃1 , 𝑃2 , 𝑃3
= N − A1 ∪ 𝐴2 ∪ 𝐴3 = 78 − 72 = 6

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:
|𝐴| = N = 𝑋 = 𝑥1 , 𝑥2 , 𝑥3 ≥ 0 ∶ 𝑥1 + 𝑥2 + 𝑥3 = 11 = 1+2+…+12= 78
|𝐴1 | = 𝑋 ∈ 𝐴 ∶ 𝑥1 > 3 = 1 + 2 + ⋯ + 8 = 36
|𝐴2 | = 𝑋 ∈ 𝐴 ∶ 𝑥2 > 4 = 1 + 2 + ⋯ + 7 = 28
|𝐴3 | = 𝑋 ∈ 𝐴 ∶ 𝑥3 > 6 = 1 + 2 + 3 + 4 + 5 = 15
|𝐴1 ∩ 𝐴2 | = 𝑋 ∈ 𝐴 ∶ 𝑥1 > 3 & 𝑥2 > 4 = 1 + 2 + 3 = 6
|𝐴1 ∩ 𝐴3 | = 𝑋 ∈ 𝐴 ∶ 𝑥1 > 3 & 𝑥3 > 6 = 1
|𝐴2 ∩ 𝐴3 | = 𝑋 ∈ 𝐴 ∶ 𝑥2 > 4 & 𝑥3 > 6 = 0
|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 𝑋 ∈ 𝐴 ∶ 𝑥1 > 3, 𝑥2 > 4 & 𝑥3 > 6 = 0
|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = 36 + 28 + 15 − 6 − 1 − 0 + 0 = 72
Number of solutions that have none of the properties 𝑃1 , 𝑃2 , 𝑃3
= N − A1 ∪ 𝐴2 ∪ 𝐴3 = 78 − 72 = 6

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:
Ex. 2) How many onto functions are there from a set with six
elements to a set with three elements?
Solution: Suppose that the elements in the codomain are b1,
b2, and b3. Let P1, P2, and P3 be the properties that b1, b2, and
b3 are not in the range of the function, respectively.
Note that a function is onto if and only if it has none of the
properties P1, P2, or P3. By the inclusion–exclusion principle it
follows that the number of onto functions from a set with six
elements to a set with three elements is

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:

Therefore, the number of onto functions from a set with six elements to one
with three elements is

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Alternate form of Inclusion-Exclusion Principle:
• To count number of onto functions:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Mathematical Induction:
Theorem 1: (First version of Principle of Mathematical induction):
Let 𝑆 ⊆ 𝑁 that possesses two properties;
1. The number 1 ∈ 𝑆 …..(base step)
2. For every 𝑘 ∈ 𝑁, if 𝑘 ∈ 𝑆 then 𝑘 + 1 ∈ 𝑆 …..(bridge)
Then we have 𝑆 = 𝑁.
Proof: Follows by well-ordering property of N.

Well-ordering property of N:
Every non-empty subset of N has a least element.
(i.e., If 𝑆 ≠ ∅ ⊆ 𝑁, then ∃𝑚 ∈ 𝑆 such that 𝑚 ≤ 𝑘, ∀𝑘 ∈ 𝑆).

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Mathematical Induction:
Theorem 2: (Equivalent form of Theorem 1):
For each n ∈ 𝑁, let P(n) be a statement about n. Suppose that
1. 𝑃(1) is true. ...(base step)
2. For every 𝑘 ∈ 𝑁, if P(𝑘) is true, then P(𝑘 + 1) is true ...(bridge)
Then P(n) is true for all n ∈ 𝑁.
Proof: Let S = n ∈ 𝑁: P n 𝑖𝑠 𝑡𝑟𝑢𝑒 . Use Theorem 1.

Theorem 3: (Second version of Principle of Mathematical induction):


Let n0 ∈ 𝑁, let P(n) be a statement for each natural number n ≥ 𝑛𝑜 .
Suppose that
1. 𝑃(𝑛0 ) is true. …..(base step)
2. For every k ≥ 𝑛0 , if P(𝑘) is true, then P(𝑘 + 1) is true...(bridge)
Then P(n) is true for all n ≥ 𝑛0 .
anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
n n+1
Ex. 1. Prove that 1 + 2 + ⋯ + n = , for all n ∈ 𝑁.
2
n n+1
Solution: Let P n : 1 + 2 + ⋯ + n =
2

• Basic Step: Clearly, P(1) is true.


• Induction Step: Assume that P(k) is true.
k k+1
i.e., 1 + 2 + ⋯ + k =
2
k k+1
Consider 1 + 2 + ⋯ + k + k +1 = + (𝑘 + 1)
2
(k+1) k+2
=
2
i.e., P(k + 1) is true.
Thus by Theorem 2, P(n) is true ∀ n ∈ 𝑁.
n n+1
Hence we have 1 + 2 + ⋯ + n = , for all n ∈ 𝑁.
2

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Ex. 2. Use mathematical induction to prove that 2𝑛 < 𝑛! for every
integer 𝑛 with 𝑛 ≥ 4.
(Note that this inequality is false for 𝑛 = 1, 2, and 3).
Solution :
Let P(n) be the proposition that 2𝑛 < 𝑛!.
• Basic Step: Here base 𝑛0 = 4.
Since 24 = 16 < 24 = 4! , P(4) is true.
Induction Step: Assume that P(k) i.e.,2𝑘 < 𝑘! is true for each
integer 𝑘 ≥ 4. Now we have to show that P(k + 1) is also true.
As we have
2𝑘+1 = 2 · 2𝑘 by definition of exponent
< 2 · 𝑘! by the inductive hypothesis
< (𝑘 + 1)𝑘! because 2 < 𝑘 + 1
= (𝑘 + 1)! by definition of factorial function.
This shows that 𝑃(𝑘 + 1) is true when 𝑃(𝑘) is true.
Hence 2𝑛 < 𝑛! for every integer 𝑛 with 𝑛anaghakhiste@iiitp.ac.in
≥ 4.
Discrete Structure
_____________________________
Strong Induction:
Theorem 4: (Principle of strong induction):
Let 𝑆 ⊆ 𝑁 such that
1. The number 1 ∈ 𝑆
2. For every 𝑘 ∈ 𝑁, if 1,2, … , 𝑘 ⊆ 𝑆, then 𝑘 + 1 ∈ 𝑆
Then we have 𝑆 = 𝑁.
Ex 3. Use the principle of strong induction to prove that every natural
number 𝑛 ≥ 2 is either prime or product of primes.
Ex. 4. Let the number xn be defined as follows;
1
x1 = 1, x2 = 2, x𝑛+2 = 𝑥𝑛+1 + 𝑥𝑛 , ∀ 𝑛 ∈ 𝑁
2
Use the principle of strong induction to show that 1 ≤ x𝑛 ≤ 2, ∀𝑛 ∈ 𝑁.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Logic:
• It is the science of reasoning.

• It specify the meaning of mathematical statements. It is


used to distinguish between valid and invalid
mathematical arguments.

• Logic has numerous applications to computer science.


These rules are used in the design of computer circuits,
the construction of computer programs, the verification
of the correctness of programs, and in many other ways.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

Types of Logic:
• Propositional Logic: basic form of mathematical logic
• Predicate Logic: generalization of propositional logic

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Propositional Logic:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Examples:

1. Delhi is the capital of India.


2. Earth is triangular in shape.
3. What time is it?
4. Read this carefully.
5. 5 + 5 = 10
6. 1+1=0
7. 𝑥+1=2
8. 𝑥+𝑦 =𝑧

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Compound Proposition: constructed by
combining one or more propositions using the
following connectives (logical operators).

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective AND (𝐩 ∧ 𝒒) :

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective AND (𝐩 ∧ 𝒒) :

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective OR (𝐩 ∨ 𝒒) : (Inclusive OR)

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective OR (𝐩 ∨ 𝒒) :

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective OR (𝐩 ⊕ 𝒒) : (Exclusive OR)
The exclusive or of p and q, denoted by p ⊕ q, is the
proposition that is true when exactly one of p and q is
true and is false otherwise.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

For instance, the inclusive or is being used in the statement


“Students who have taken calculus or computer science,
can take this class.”
On the other hand, we are using the exclusive or when we say
“Students who have taken calculus or computer science,
but not both, can enroll in this class.”

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective Implies (𝒑 → 𝒒) or (𝒑 ⇒ 𝒒)

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

In the conditional statement p → q,


• p : hypothesis or antecedent or premise
• q : the conclusion or consequence.
• In logic, p and q need not be related to each other (unlike
English language)
• Ex. If sum of all angles of a triangle is 2000 , then every rabbit
can fly. (Logically true statement.)

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Different ways to express the conditional statement
(also called an implication):

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The connective IFF (𝐩 ↔ 𝒒) or (𝐩 ⇔ 𝒒)

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Different ways to express biconditional statement (also
called an bi-implication):

Ex. Let p : You can take the flight,


and let q : You buy a ticket.
Then p ↔ q is the statement
“You can take the flight if and only if you buy a ticket.”
This statement is true only if p and q are either both true
or both false.
anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
The negation of p is the statement“It is not the case that p.”

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Converse, Inverse and Contrapositive:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Example:
Consider 𝑝 : a polygon is a square and
𝑞 : it has four sides of equal length.
Conditional 𝑝 ⇒ 𝑞 : If a polygon is a square, then
it has four sides of equal length.
Converse 𝑞 ⇒ 𝑝 : If a polygon has four sides of equal
length, then it is a square.
Inverse ¬ 𝑝 ⇒ ¬ 𝑞 : If a polygon is not a square, then
it does not have four sides of equal length.
Contrapositive ¬ 𝑞 ⇒ ¬ 𝑝 : If a polygon does not
have four sides of equal length, then it is not a square.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• Logically Equivalent: When two compound propositions (p
and q) always have the same truth values in all possible cases.
The notation p ≡ q denotes that p and q are logically
equivalent.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
1. Construct the truth table of the compound proposition
a) (𝑝 ∨ ¬𝑞) → (𝑝 ∧ 𝑞).
b) (𝑞 → ¬𝑝) ↔ (𝑝 ↔ 𝑞).
c) (𝑝 ↔ 𝑞) ⊕ (¬𝑝 ↔ 𝑞).
d) (𝑝 ↔ 𝑞) ⊕ (¬𝑝 ↔ ¬𝑟)
2. Show that the following equivalence.
a) 𝑝 → 𝑞 ≡ ¬𝑝 ∨ 𝑞.
b) ¬𝑝 → 𝑞 → 𝑟 ≡ 𝑞 → (𝑝 ∨ 𝑟).
c) 𝑝 ∨ 𝑞 ∧ 𝑟 ≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟) (This is the distributive
law of disjunction over conjunction).

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Algebra of Propositions:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Normal Forms
1. Disjunctive Normal Forms (DNF)
2. Conjunctive Normal Forms (CNF)
1. Disjunctive Normal Forms: A propositional formula is in DNF
if it is the disjunction of conjunctions of literals. ( where literal is
a Boolean variable, or a negation of Boolean variable e.g., p, ~p)
A DNF formula is an OR of AND’s.
For example,

2. Conjunctive Normal Forms: A propositional formula is in


CNF if it is the conjunction of disjunctions of literals.
A CNF formula is an AND of OR’s.
For example,
anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
1. Converting to DNF:
Steps to convert any propositional formula X in to DNF :

1. Write the truth table of X.


2. Identify the rows that contains truth values of X as T.
3. Encode each row as a conjunction of the corresponding literals,
and the final result is the disjunction of these conjunctions.

We illustrate the procedure on the following example:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
1. Converting to DNF:
1. Write the truth table of

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
2. Identify the rows that contains truth values of X as T.
In this case, these rows are row 6, row 7 and row 8.
3. Encode each row as a conjunction of the corresponding literals,
and then take disjunction of these rows, hence the final result
is the DNF.
Here the encoding is as follows

where

Taking the disjunction of these conjunctions yields the following


DNF formula of X:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
2. Converting to CNF:
Similarly we can convert any propositional formula into CNF.
Steps to convert any propositional formula X in to CNF :
1. Write the truth table of X.
2. Identify the rows that contains truth values of X as F.
3. Negate each row and return the conjunction over these
negated rows, and the final result is the CNF.

We illustrate the procedure on the previous example:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
2. In this case, the rows that contains truth values of X as F
are row 1, row 2, row 3, row 4 and row 5.
3. Negate each row and return the conjunction over these negated
rows, Thus we have,

where

Note that we have applied De Morgan’s Law and the double


negation rule to produce a disjunction. This gives the following
CNF formula of X:

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Predicate Logic: Motivations
• Propositional logic does not represent all kinds of mathematical
statements. “x is greater than 3”
• This statement can be true or false depending on the values of x.
• The statement “x is greater than 3” has two parts.
1. the variable x: the subject of the statement.
2. “is greater than 3”: property of the subject x.
• P(x) : “x is greater than 3”
where P denotes the predicate “is greater than 3” and x is the
variable.
• The statement P(x) is also said to be the value of the propositional
function P at x. Once a value has been assigned to the variable x,
the statement P(x) becomes a proposition and has a truth value.
• Ex: P(4) is true, while P(3) is false.
anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Multi-valued Predicate:
• statements that involve more than one variable.
• consider the statement “x = y + 3.”
• This statement is represented by Q(x, y), where x
and y are variables and Q is the predicate. When
values are assigned to the variables x and y, the
statement Q(x, y) has a truth value.
• Ex: Q(1, 2) is false and Q(3, 0) is true.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Converting Predicates (Propositional functions) into
Propositions:
• Method of Quantification:
Quantification expresses the extent to which a
predicate is true over a range of elements.
• Two types of quantification:
1. Universal quantification
2. Existential quantification

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Universal quantification:
• declare that a property is true for all values of a variable in a
particular domain, called the domain of discourse (or the
universe of discourse).
• The universal quantification of P(x) is the statement
“P(x) for all values of x in the domain.”
• ∀xP(x): denotes the universal quantification of P(x).
• “for all xP(x)” or “for every xP(x).”
• Ex.: Let P(x): “x + 1 > x.” What is the truth value of the
quantification ∀ xP(x), where the domain consists of all real
numbers?
Solution: The quantification∀xP(x) is true, since P(x) is true
for all real numbers x.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• Counterexample of ∀xP(x): an element for which P(x) is false.
Ex.: Let Q(x) : “x < 2.” What is the truth value of the
quantification ∀xQ(x), where the domain consists of all real
numbers?
Solution: Q(x) is not true for every real number x, because, for
instance, Q(3) is false. That is, x = 3 is a counterexample for the
statement ∀xQ(x). Thus ∀xQ(x) is false.

• The domain must always be specified when a universal


quantifier is used; without it, the universal quantification of a
statement is not defined.
Ex. 𝑃 𝑥 ∶ 𝑥 2 > 0. Is ∀𝑥𝑃 𝑥 true?
Solution:
 Yes, provided domain does not include 0.
 No, if domain include 0. anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• Let domain = 𝑥1 , 𝑥2 , … , 𝑥𝑛
∀𝑥𝑃 𝑥 = 𝑃 𝑥1 ∧ 𝑃 𝑥2 ∧ ⋯ ∧ 𝑃(𝑥𝑛 )
because this conjunction is true iff P 𝑥1 , 𝑃 𝑥2 , . . . , 𝑃 𝑥𝑛 are all true.

Ex.: What is the truth value of ∀𝑥𝑃(𝑥), 𝑃(𝑥) is as follows and the
domain consists of the positive integers not exceeding 4?
i. 𝑃(𝑥) : “𝑥 2 < 10”
ii. 𝑃(𝑥) : “𝑥 2 ≤ 16”

Solution: Here the domain = 𝐷 = *1, 2, 3, 4+ and


∀𝑥𝑃 𝑥 = 𝑃 1 ∧ 𝑃 2 ∧ 𝑃 3 ∧ 𝑃 4
i. Since 𝑃(4), which is the statement “42 < 10,” is false, it follows
that ∀𝑥𝑃(𝑥) is false.
ii. Since 𝑃 𝑎 is true for all 𝑎 ∈ D, it follows that ∀𝑥𝑃(𝑥) is true.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
Existential quantification:
• declare that a property is true for at least one element of the domain.
• The existential quantification of P(x) is the statement
“P(x) for at least one element of the domain.”
• ∃xP(x): denotes the existential quantification of P(x).
“there exists xP(x).”

• Ex.: Let P(x) : “x > 3.” What is the truth value of the quantification
∃xP(x), where the domain consists of all real numbers?
Solution: Because “x > 3” is sometimes true.
for instance, when x = 4, the existential quantification of
P(x), which is ∃xP(x), is true.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• Let domain = 𝑥1 , 𝑥2 , … , 𝑥𝑛
∃𝑥𝑃 𝑥 = 𝑃 𝑥1 ∨ 𝑃 𝑥2 ∨ ⋯ ∨ 𝑃(𝑥𝑛 )
because this disjunction is true if and only if at least one of
P 𝑥1 , 𝑃 𝑥2 , . . . , 𝑃 𝑥𝑛 is true.

Ex.: What is the truth value of ∃𝑥𝑃(𝑥), where 𝑃(𝑥) is as follows and the
domain consists of the positive integers not exceeding 4?
i. 𝑃(𝑥) : “𝑥 2 > 10”
ii. 𝑃(𝑥) : “𝑥 2 = 10”

Solution: Here the domain = 𝐷 = 1, 2, 3, 4 and


∃𝑥𝑃 𝑥 = 𝑃 1 ∨ 𝑃 2 ∨ 𝑃 3 ∨ 𝑃(4),
i. Since 𝑃(4), which is the statement “42 > 10,” is true, it follows
that ∃𝑥𝑃(𝑥) is true.
ii. Since 𝑃(𝑎) is false for all 𝑎 ∈ 𝐷 , it follows that ∃𝑥𝑃(𝑥) is false.

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• De Morgan’s Laws for Quantifiers:
1. ¬ ∃𝑥𝑃 𝑥 ≡ ∀𝑥 ¬𝑃 𝑥
2. ¬ ∀𝑥𝑃 𝑥 ≡ ∃𝑥 ¬𝑃 𝑥

Ex. Show that ¬∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(𝑃(𝑥) ∧ ¬𝑄(𝑥)) are logically
equivalent.
Solution:
¬∀𝑥 𝑃 𝑥 → 𝑄 𝑥 ≡ ∃𝑥¬ 𝑃 𝑥 → 𝑄 𝑥 (by De morgan’s law)
≡ ∃𝑥¬ ¬𝑃 𝑥 ∨ 𝑄 𝑥 (by ex 2(a))
≡ ∃𝑥 ¬¬𝑃(𝑥) ∧ ¬𝑄 𝑥 (by De morgan’s law)
≡ ∃𝑥 𝑃(𝑥) ∧ ¬𝑄 𝑥 (by Double negation law)

anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• The Order of Quantifiers
Many mathematical statements involve multiple quantifications
of propositional functions involving more than one variable. It is
important to note that the order of the quantifiers is important, unless all
the quantifiers are universal quantifiers or all are existential quantifiers.

Ex. 1. Let 𝑃 𝑥, 𝑦 : “𝑥 + 𝑦 = 𝑦 + 𝑥”, where the domain for all


variables consists of all real numbers. What are the truth values of the
quantifications ∀𝑥∀𝑦𝑃(𝑥, 𝑦) and ∀𝑦∀𝑥𝑃(𝑥, 𝑦)?
Solution: Both are true.

Ex 2. Let 𝑄(𝑥, 𝑦): “𝑥 + 𝑦 = 0” where the domain for all variables


consists of all real numbers. What are the truth values of the
quantifications ∃𝑦∀𝑥𝑄(𝑥, 𝑦) and ∀𝑥∃𝑦𝑄 𝑥, 𝑦 ?
Solution: The quantification ∃𝑦∀𝑥𝑄(𝑥, 𝑦) is false, whereas the
quantification ∀𝑥∃𝑦𝑄(𝑥, 𝑦) is true. anaghakhiste@iiitp.ac.in
Discrete Structure
_____________________________
• Applications of Propositional Logic:
1. System Specifications
2. Boolean Searches
• Section no. 1.2 of the book : “Kenneth H. Rosen, Discrete
Mathematics and Its Appications, Tata McGraw-Hill Edition,
2015” to be referred.
This topic is for self study. Questions based on this topic will be
asked in the exams.

anaghakhiste@iiitp.ac.in

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy