0% found this document useful (0 votes)
9 views24 pages

Study Material Unit-01 - Set Theory & Logic - Part-02-Logic - SY B.Tech Comp

The document is a study material for a Discrete Mathematics course focusing on propositional logic, including logical operators, truth tables, and methods of proving theorems. It covers the importance of logic in mathematical reasoning and computer science, as well as the translation of English sentences into logical expressions. Additionally, it discusses logical equivalences, tautologies, contradictions, and various laws related to logical operations.
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)
9 views24 pages

Study Material Unit-01 - Set Theory & Logic - Part-02-Logic - SY B.Tech Comp

The document is a study material for a Discrete Mathematics course focusing on propositional logic, including logical operators, truth tables, and methods of proving theorems. It covers the importance of logic in mathematical reasoning and computer science, as well as the translation of English sentences into logical expressions. Additionally, it discusses logical equivalences, tautologies, contradictions, and various laws related to logical operations.
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/ 24

Vishwakarma University

Faculty of Science &Technology Engineering


Department of Computer Engineering
S.Y.B.Tech Computer Engg
_Sem-III A.Y.2022-23
Study Material_Unit No.1 Sets and Logics
Course Name: Discrete Mathematics Topic: Propositional Logics
Course Instructor: Jameel Ahmad Ansari
Topics:
Propositional Logic: Logical Operators and precedence, Truth Table.
Propositional Equivalences – Laws of equivalence, Propositional Satisfiability, Basic
Rules of inference, Resolution.
Predicate Logic: Predicates and Quantifiers, Pre-conditions and Post-conditions,
Application of Predicate logic, Translating English Sentences
Proof: Theorem, Axiom, Lemma, Corollary, Conjecture. Valid Arguments, Theorems.
Methods of Proving Theorems – Direct proof, Proof by counter positioning, proof by
contradiction, proof by mathematical induction.

Propositional Logic:
The rules of logic give precise meaning to mathematical statements. These rules
are used to distinguish between valid and invalid mathematical arguments. Because a
major goal of this topic is to teach, how to understand and how to construct correct
mathematical arguments, the importance of logic in understanding mathematical
reasoning, 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. Furthermore, software systems
have been developed for constructing some, but not all, types of proofs automatically.
Remark relate to Logic:
• Crucial for mathematical reasoning
• Used for designing electronic circuitry
• Logic is a system based on propositions.
Propositions:
A proposition is a declarative sentence (that is, a sentence that declares a fact)
that is either true or false, but not both.
• A proposition is a statement that is either true or false (not both).
• We say that the truth value of a proposition is either true (T) or false (F),
Corresponds to 1 and 0 in digital circuits.
e.g. i) “Elephants are bigger than dogs.” Truth value-T
ii)“520 < 111” , Truth value-F
iii) “y > 5” Truth value- Its truth value depends on the value of y, but this value is not
specified.
Statement no. iii) called as a propositional function or open sentence. Denoted by P(x), P(y)
Consider the following sentences.
1. What time is it?
2. Read this carefully
Sentences 1 and 2 are not propositions because they are not declarative sentences.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Combining Propositions:
One or more propositions can be combined to form a single compound
proposition. We formalize this by denoting propositions with letters such as p, q, r, s,
and introducing several logical operators.

Logical Operators/Connectives:
• Negation (NOT, ∼ 𝑜𝑟)
• Conjunction (AND, ⋀)
• Disjunction (OR, ⋁)
• Implication (if – then, ⟶ 𝑜𝑟 ⟹)
• Biconditional (if and only if, ↔ 𝑜𝑟 ⇔)
Truth tables can be used to show how these operators can combine propositions to
compound propositions.

Truth tables:
1) Negation (NOT):Unary Operator, Symbol-  or ~

P P

true (T) false (F)

false (F) true (T)

2) Conjunction (AND):Binary Operator, Symbol- 

P Q P Q

T T T

T F F

F T F

F F F

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
3) Disjunction (OR):Binary Operator, Symbol- 

P Q PQ

T T T

T F T

F T T

F F F

4) Implication (if - then):Binary Operator, Symbol: →

P Q P→Q

T T T

T F F

F T T

F F T

5) Biconditional (if and only if):Binary Operator, Symbol: 

P Q PQ

T T T

T F F

F T F

F F T

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Compound Statements (Statements and Operators):
Statements and operators can be combined in any way to form new statements.
For e.g.1)

P Q P Q (P)(Q)

T T F F F

T F F T T

F T T F T

F F T T T

2)

P Q P Q (PQ) (P) (Q)

T T T F F

T F F T T

F T F T T

F F F T T

CONVERSE, CONTRAPOSITIVE, AND INVERSE:


We can form some new conditional statements starting with a conditional statement
p → q. In particular, there are three related conditional statements that occur so often
that they have special names. The proposition q → p is called the converse of p→ q. The
contrapositive of p → q is the proposition ¬q →¬p. The proposition ¬p →¬q is
called the inverse of p → q. These three conditional statements formed from p → q, only
the contrapositive always has the same truth value as p → q.

Q) What are the contrapositive, the converse, and the inverse of the conditional
statement“The home team wins whenever it is raining?”

Solution: Because “q whenever p” is one of the ways to express the conditional


statementp → q, the original statement can be rewritten as
“If it is raining, then the home team wins.”
Consequently, the contrapositive (¬q →¬p)of this conditional statement is
“If the home team does not win, then it is not raining.”
The converse (q → p) is
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
“If the home team wins, then it is raining.”
The inverse (¬p →¬q) is
“If it is not raining, then the home team does not win.”
Only the contrapositive is equivalent to the original statement.

Translating English Sentences:


There are many reasons to translate English sentences into expressions involving
propositional variables and logical connectives. In particular, English (and every other
human language) is often ambiguous. Translating sentences into compound statements
(and other types of logical expressions) removes the ambiguity. Note that his may
involve making a set of reasonable assumptions based on the intended meaning of the
sentence. Moreover, once we have translated sentences from English into logical
expressions we can analyze these logical expressions to determine their truth values,
we can manipulate them, and we can use rules of inference (which are discussed later)
to reason about them.

e.g: How can this English sentence be translated into a logical expression?
“If it is not raining, then the home team does not win.”

Solution: Let P - it is raining, q- the home team wins

Therefore the logic expression of “If it is not raining, then the home team does not win.”
is ~𝑝 → ~𝑞.

Equivalent Statements:
An important type of step used in a mathematical argument is the replacement of a
statement with another statement with the same truth value. Because of this, methods
that produce propositions with the same truth value as a given compound proposition
are used extensively in the construction of mathematical arguments. Note that we will
use the term “compound proposition” to refer to an expression formed from
propositional variables using logical operators, such as𝑝 ∧ 𝑞.
Compound propositions that have the same truth values in all possible cases are
called logically equivalent.
One way to determine whether two compound propositions are equivalent is to use a
truth table. In particular, the compound propositions p and q are equivalent if and only
if the columns giving their truth values agree.

Q) Show that ¬(p ∧ q) and ¬p ∨ ¬q are logically equivalent.


The truth tables for these compound propositions are displayed in following table.
Because the truth values of the compound propositions ¬(p ∨ q) and ¬p ∧¬q agree for
all possible combinations of the truth values of p and q, it follows that
¬(p ∨ q) ↔ (¬p ∧¬q) is a tautology and that these compound propositions are
logically equivalent.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
P Q P Q (PQ) (P) (Q) (PQ) (P) (Q)

T T T F F T

T F F T T T

F T F T T T

F F F T T T
The statements (PQ) and (P)  (Q) are logically equivalent,
since (PQ) (P)  (Q) is always true.

Q) Show that p∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent.


p q r q∧r p ∨ (q ∧ r) p ∨ q p∨q (p ∨ q) ∧ (p ∨ r)

T T T T T T T T

T T F F T T T T

T F T F T T T T

T F F F T T T T

F T T T T T T T

F T F F F T F F

F F T F F F T F

F F F F F F F F

In above truth table, from 5th and 8th column we have proved that p ∨ (q ∧ r) and (p ∨ q)
∧ (p ∨ r) are logically equivalent. This is the distributive law of disjunction over
conjunction.

Tautologies, Contradictions and Contingency:


A tautology is a statement that is always true.
Examples:
• R(R)
• (PQ)(P)(Q)
If S→T is a tautology, we write ST.
If ST is a tautology, we write ST.

A contradiction is a statement that is alwaysfalse.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Examples:
• R(R)
• ((PQ)(P)(Q))
Note: The negation of any tautology is a contradiction, and the negation of
any contradiction is a tautology.

We already know the following tautology, (From above e.g.)


(PQ) (P)(Q)
Similarly we can show that
(PQ) (P)(Q).
These two tautologies are known as De Morgan’s laws.

A contingency is a proposition which neither a tautology nor a contradiction.


Example: (P V Q) →R

Remark:
1) The symbol ≡ is not a logical connective, and p ≡ q is not a compound
proposition but rather is the statement that p ↔ q is a tautology. The symbol ⇔
is sometimes used instead of ≡ to denote logical equivalence.
2) The compound propositions p and q are called logically equivalent if p ↔ q is a
tautology. The notation 𝑝 ≡ 𝑞denotes that p and q are logically equivalent.
3) A compound proposition that is always true, no matter what the truth values of
the propositional variables that occur in it, is called a tautology. A compound
proposition that is always false is called a contradiction. A compound proposition
that is neither a tautology nor a contradiction is called a contingency.

Logical Equivalences:
Equivalence Name of Law/ Identity

• p∧T≡p Identity laws


• p∨F≡p
• p∨T≡T Domination laws
• p∧F≡F
• p∨p≡p Idempotent laws
• p∧p≡p
• ¬(¬p) ≡ p Double negation law
• p∨q≡q∨p Commutative laws
• p∧q≡q∧p
• (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) Associative laws
• (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
• p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) Distributive laws
• p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
• ¬(p ∧ q) ≡ ¬p ∨¬q De Morgan’s laws

• ¬(p ∨ q) ≡ ¬p ∧¬q
• p ∨ (p ∧ q) ≡ p Absorption laws
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
• p ∧ (p ∨ q) ≡ p
• p ∨¬p ≡ T Negation laws

• p ∧¬p ≡ F

• P → Q P V Q Implication Equivalence


• P → Q Q →P Contrapositive Law

Logical EquivalencesInvolving Conditional Statements:


• p → q ≡ ¬p ∨ q
• p → q ≡ ¬q →¬p
• p ∨ q ≡ ¬p → q
• p ∧ q ≡ ¬(p →¬q)
• ¬(p → q) ≡ p ∧¬q
• (p → q) ∧ (p → r) ≡ p → (q ∧ r)
• (p → r) ∧ (q → r) ≡ (p ∨ q) → r
• (p → q) ∨ (p → r) ≡ p → (q ∨ r)
• (p → r) ∨ (q → r) ≡ (p ∧ q) → r

LogicalEquivalences Involving Biconditional Statements:


• p ↔ q ≡ (p → q) ∧ (q → p)
• p ↔ q ≡ ¬p ↔¬q
• p ↔ q ≡ (p ∧ q) ∨ (¬p ∧¬q)
• ¬(p ↔ q) ≡ p ↔¬q

Note: equivalent expressions can always be substituted for each other in a more
complex expression - useful for simplification.

Q) Prove that (p  p)  (p → (q  q)) is equivalent to p  q.

Solution: (p  p)  (p → (q  q))  p  (p → q) (Idemp. Identity)


 p  (¬p q) (implic. Law)
 (p  ¬p) (p  q) (Distributive Law)
 F  (p  q) (Negation laws)
 (p  q)

Q)Show that p → (q → r) (p  q) → r


Solution: Let us explore the L.H.S first
p → (q → r) p  (q  r)
 (p q)  r
(p  q)  r
 (p  q) → r

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Q) Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧¬q are logically equivalent by developing a
series of logical equivalences.
Solution: We will use one of the equivalences from the Table at a time, starting with
¬(p ∨ (¬p ∧ q))and ending with ¬p ∧¬q.
(Note: we could also easily establish this equivalence using a truth table.)We have the
following equivalences.
¬(p ∨ (¬p ∧ q)) ≡ ¬p ∧¬(¬p ∧ q) (by the second De Morgan law)
≡ ¬p ∧ [¬(¬p)∨¬q] (by the first De Morgan law)
≡ ¬p ∧ (p ∨¬q) (by the double negation law)
≡ (¬p ∧ p) ∨ (¬p ∧¬q) (by the second distributive law)
≡ F ∨ (¬p ∧¬q) (because ¬p ∧ p ≡ F)
≡ (¬p ∧¬q) ∨ F (by the commutative law for disjunction)
≡ ¬p ∧¬q by the identity law for F
Consequently ¬(p ∨ (¬p ∧ q)) and ¬p ∧¬q are logically equivalent.

Q)Show that (p ∧ q) → (p ∨ q) is a tautology.


Solution:
To show that this statement is a tautology, we will use logical equivalences to
demonstrate that it is logically equivalent to T.
(Note: This could also be done using a truth table.)
(p ∧ q) → (p ∨ q) ≡ ¬(p ∧ q) ∨ (p ∨ q) (by implic. Law)
≡ (¬p ∨¬q) ∨ (p ∨ q) (by the first De Morgan law)
≡ (¬p ∨ p) ∨ (¬q ∨ q) (by the associative and commutative laws for disjunction)
≡T∨T (by Example 1 and the commutative law for disjunction)
≡T (by the domination law)

Predicates & Quantifiers(open sentences):


Statements involving variables, such as
“x >3,” “x = y + 3,” “x + y = z,”
And “computer x is under attack by a virus,”
And “computer x is functioning properly,” are often found in mathematical assertions, in
computer programs, and in system specifications.
These statements are neither true nor false when the values of the variables are not
specified. In this section, we will discuss the ways that propositions can be produced
from such statements.
The statement “x is greater than 3” has two parts. The first part, the variable x, is the
subject of the statement. The second part-the predicate, “is greater than 3”-refers to a
property that the subject of the statement can have. We can denote the statement “x is
greater than 3” by P(x),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

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
at x. Once a value has been assigned to the variable x, the statement P(x) becomes a
proposition and has a truth value.
A generalization of propositions –
Propositional functions or predicates: propositions which contain variables

Example:
Let Propositional function P(x), where P is the predicate and x is the variable.
P(x) = x-3 > 5
What is the truth value of P(2) ? F
What is the truth value of P(8) ? F
What is the truth value of P(9) ? T

Example: Let us consider the propositional function Q(x, y, z) defined as:


x + y = z.
Here, Q is the predicate and x, y, and z are the variables.
What is the truth value of Q(2, 3, 5) ?T
What is the truth value of Q(0, 1, 2) ? F
What is the truth value of Q(9, -9, 0) ? T

Q)Let P(x) denote the statement “x >3.” What are the truth values of P(4) and P(2)?
Solution:
We obtain the statement P(4) by setting x = 4 in the statement “x >3.” Hence,
P(4), which is the statement “4 >3,” is true. However, P(2), which is the statement
“2 >3,”is false.

Q) Let Q(x, y) denote the statement “x = y + 3.” What are the truth values of the
propositions Q(1, 2) and Q(3, 0)?
Solution: To obtain Q(1, 2), set x = 1 and y = 2 in the statement Q(x, y). Hence, Q(1, 2) is
the statement “1 = 2 + 3,” which is false. The statement Q(3, 0) is the proposition
“3 = 0 + 3,”which is true.

Note: Predicates become propositions once every variable is bound- by assigning it a


value from the Universe of Discourse U or quantifying it.
Let U = Z, the integers = {. . . -2, -1, 0 , 1, 2, 3, . . .}
P(x): x > 0 is the predicate. It has no truth value until the variable x is bound.

PRECONDITIONS AND POSTCONDITIONS:


Predicates are also used to establish the correctness of computer programs, that is, to
show that computer programs always produce the desired output when given valid
input. (Note that unless the correctness of a computer program is established, no
amount of testing can show that it produces the desired output for all input values,
unless every input value is tested.) The statements that describe valid input are known
as preconditions and the conditions that the output should satisfy when the program

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
has run are known as postconditions. we use predicates to describe both preconditions
and postconditions.

Universal Quantification:
Let P(x) be a propositional function.
Universally quantified sentence:
P(x) is true for every x in the universe of discourse (Domain).
Notation: universal quantifier
x P(x), ‘For all x, P(x)’, ‘For every x, P(x)’

Example:
Let S(x): x is a MBA student.
G(x): x is a genius.
What does x (S(x) → G(x)) mean ?
“If x is a MBA student, then x is a genius.” or
“All MBA students are geniuses.”

Note:1) x P(x) is either true or false, so it is a proposition, not a propositional function.


2) “for all” and “for every,” universal quantification can be expressed in many other
ways, including “all of,” “for each,” “given any,” “for arbitrary,” “for each,” and “for any.”
3)A statement ∀xP(x) is false, where P(x) is a propositional function, if and only if P(x) is
not always true when x is in the domain. One way to show that P(x) is not always true
when x is in the domain is to find a counterexample to the statement ∀xP(x). Note that a
single counterexample is allweneed to establish that ∀xP(x) is false.
For e.g.)Let Q(x) be the statement “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.

Existential Quantification:
Let P(x) be a propositional function.
Existentially quantified sentence:
There exists an x in the universe of discourse (domain) for which P(x) is true.
Notation: existential quantifierx P(x)
‘There is an x such that P(x),’ ‘For some x, P(x)’, ‘For at least one x, P(x)’, ‘I can find an x
such that P(x).’

Note:x P(x) is either true or false, so it is a proposition, but no propositional function.


Example:
Let P(x): x is a MBA professor.
G(x): x is a genius.
What does x (P(x)  G(x)) mean ?
“There is an x such that x is a MBA professor and x is a genius.”or
“At least one MBA professor is a genius.”
Example:
Let the universe of discourse be the real numbers.
What does xy (x + y = 320) mean?
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
“For every x there exists a y so that x + y = 320.”
Is it true? T
Is it true for the natural numbers? F

Note: A counterexample to x P(x) is an object c so that P(c) is false. Statements such as


x (P(x) → Q(x)) can be disproved by simply providing a counterexample.
Statement: “All birds can fly.”

Disproved by counterexample: Penguin.

Unique Existential Quantification:


P(x) is true for one and only one x in the universe of discourse(domain).
Notation: unique existential quantifier
!x P(x)
‘There is a unique x such that P(x),’ ‘There is one and only one x such that P(x),’ ‘One can
find only one x such that P(x).’
Remark: Converting from English (Can be very difficult!)
“Every student in this class has studied calculus”
transformed into:
“For every student in this class, that student has studiedcalculus”
C(x): “x has studied calculus” x C(x)
This is one way of converting from English!

Note:
Existence: We show that an element x with the desired property exists.
Uniqueness: We show that if 𝑦 ≠ 𝑥, then y does not have the desired property.
Equivalently, we can show that if x and y both have the desired property, then x = y.

Negation of Quantification:
(x P(x)) is logically equivalent to x (P(x)).
(x P(x)) is logically equivalent to x (P(x)).

Q) Let 𝑃(𝑚, 𝑛)be the statement “m divides n,” where the domain for both variables
consists of all positive integers. (By “m divides n” we mean that n = km for some integer
k.) Determine the truth values of each of these statements.
a) 𝑃(4, 5) b) 𝑃(2, 4)
c) ∀𝑚∀𝑛 𝑃(𝑚, 𝑛) d) ∃𝑚∀𝑛 𝑃(𝑚, 𝑛)
e) ∃𝑛 ∀𝑚𝑃(𝑚, 𝑛) f )∀𝑛𝑃(1, 𝑛)

Answer: a) F b)T c)F d)T e)F f)T

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Propositional Satisfiability:
A compound proposition is satisfiable if there is an assignment of truth values to its
variables that makes it true. When no such assignments exists, that is, when the
compound proposition is false for all assignments of truth values to its variables, the
compound proposition is unsatisfiable.
Note that a compound proposition is unsatisfiable if and only if its negation is true for
all assignments of truth values to the variables, that is, if and only if its negation is a
tautology.
we find a particular assignment of truth values that makes a compound proposition
true, we have shown that it is satisfiable; such an assignment is called a solution of this
particular satisfiability problem. However, to show that a compound proposition is
unsatisfiable, we needto show that every assignment of truth values to its variables
makes it false. Although we can always use a truth table to determine whether a
compound proposition is satisfiable, it is often more efficient not to, as following
example demonstrates.

Q) Determine whether each of the compound propositions


i) (p ∨¬q) ∧ (q ∨¬r) ∧(r ∨¬p), ii) (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r), and
iii) (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) ∧(p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r) is satisfiable.

Solution: i) (p ∨¬q) ∧ (q ∨¬r) ∧(r ∨¬p)

p q r p ∨¬q q ∨¬r r ∨¬p (p ∨¬q) ∧ (q ∨¬r) ∧(r ∨¬p)

T T T T T T T

T T F T T F F

T F T T F T F

T F F T T F F

F T T F T T F

F T F F T T F

F F T T F T F

F F F T T T T

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
ii) (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r)

p q r p∨q∨r ¬p ∨¬q ∨¬r (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r) i) ∨ ii) i) ∧ ii)

T T T T F F T F

T T F T T T T F

T F T T T T T F

T F F T T T T F

F T T T T T T F

F T F T T T T F

F F T T T T T F

F F F F T F T F

Instead of using truth table to solve this problem, we will reason about truth values.
Note that (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) is true when the three variable p, q, and r have
the same truth value (see Truth table). Hence, it is satisfiable as there is at
least one assignment of truth values for p, q, and r that makes it true.
Similarly, note that (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r) is true when at least one of p, q, and r is
true and at least one is false (Make truth table). Hence, (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r) is
satisfiable, as there is at least one assignment of truth values for p, q, and r that makes it
true.
Finally, note that for (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) ∧ (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r)
to be true, (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) and (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r) must both
be true. For the first to be true, the three variables must have the same truth values, and
for the second to be true, at least one of three variables must be true and at least one
must be false. However, these conditions are contradictory. From these observations we
conclude that no assignment of truth values to p, q, and r makes
(p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) ∧(p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r) true. Hence, it is
unsatisfiable.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Mathematical Reasoning:
We need mathematical reasoning to determine whether a mathematical argument is
corrector incorrect

Argument: a sequence of statements that end with a conclusion.

Mathematical reasoning is important for artificial intelligence systems to reach a


conclusion from knowledge and facts.

We can use a proof to demonstrate that a particular statement is true. A proof consists
of a sequence of statements that form an argument.

Rules of Inference:
Inference is the act or process of deriving a conclusion based solely on what one
already knows. It uses hypotheses, axioms, definitions etc. to reach a conclusion.

The general form of a rule of inference is:

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Some valid arguments:

We say that an argument is valid, if whenever all its hypotheses are true,
its conclusion is also true.

Rule of Inference Tautology Name


𝑝 (p ∧ (p → q)) → q Modus ponens
𝑝 →𝑞
∴ 𝑞
¬𝑞 Modus tollens
(¬q ∧ (p → q))→¬p
𝑝 →𝑞
∴ ¬𝑝
𝑝 →𝑞 ((p → q) ∧ (q → r)) → (p → r) Hypothetical syllogism
𝑞 →𝑟
∴ 𝑝 →𝑟
𝑝 ∨𝑞 Disjunctive syllogism
((p ∨ q)∧¬p) → q
¬𝑝
∴ 𝑞
𝑝 p → (p ∨ q) Addition
∴ 𝑝∨𝑞
𝑝∧𝑞 (p ∧ q) → p Simplification
∴ 𝑃
𝑝 ((p) ∧ (q)) → (p ∧ q) Conjunction
𝑞
∴ 𝑃∧𝑞
𝑝∨𝑞 Resolution
((p ∨ q) ∧ (¬p ∨ r)) → (q ∨ r)
¬𝑝 ∨ 𝑟
∴ 𝑞∨𝑟

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Q1) check whether the following argument is valid or not.

“If it rains today, then we will not have a barbeque today. If we do not have a barbeque
today, then we will have a barbeque tomorrow.
Therefore, if it rains today, then we will have a barbeque tomorrow.”

Solution:
p: “It is raining today.”
q: “We will not have a barbeque today.”
r: “We will have a barbeque tomorrow.”
So the argument is of the following form:

𝑝 →𝑞
𝑞 →𝑟
∴ 𝑝 →𝑟

Q2) check whether the following argument is valid or not.

David is either intelligent or a good actor.


If David is intelligent, then he can count from 1 to 10.
David can only count from 1 to 3.
Therefore, David is a good actor.

Solution:Yes
A: “David is intelligent.”
B: “David is a good actor.”
C: “David can count from 1 to 10.”
Step 1:  C
Step 2: A → C
Step 3:  A
Step 4: B  A
Step 5: B Conclusion: a (“David is a good actor.”)

Q) State which rule of inference is the basis of the following argument: “It is below
freezing now.
Therefore, it is either below freezing or raining now.”
Solution: Let p be the proposition “It is below freezing now” and q the proposition
“It is rainingnow.” Then this argument is of the form
𝑝
∴ 𝑝∨𝑞
This is an argument that uses the addition rule.

Q) State which rule of inference is the basis of the following argument: “It is below
freezing andraining now. Therefore, it is below freezing now.”
Solution: Let p be the proposition “It is below freezing now,” and let q be the proposition
“It israining now.” This argument is of the form
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
𝑝∧𝑞
∴ 𝑃
This argument uses the simplification rule.

Q) Show that the premises “If you send me an e-mail message, then I will finish writing
theprogram,” “If you do not send me an e-mail message, then I will go to sleep early,”
and “If I goto sleep early, then I will wake up feeling refreshed” lead to the conclusion “If
I do not finishwriting the program, then I will wake up feeling refreshed.”

Solution:Let p be the proposition “You send me an e-mail message,” q the proposition “I


willfinish writing the program,” r the proposition “I will go to sleep early,” and s the
proposition “Iwillwake up feeling refreshed.” Then the premises are p → q,¬p → r, and r
→ s. The desiredconclusion is ¬q → s.We need to give a valid argument with premises p
→ q, ¬p → r, andr → s and conclusion ¬q → s.
This argument form shows that the premises lead to the desired conclusion.
Step Reason
1. p → q Premise
2. ¬q →¬p Contrapositive of (1)
3. ¬p → rPremise
4. ¬q → rHypothetical syllogism using (2) and (3)
5. r → s Premise
6. ¬q → s Hypothetical syllogism using (4) and (5)

Rules of Inference for Quantified Statements:


We have discussed rules of inference for propositions. We will now describe some
important rules of inference for statements involving quantifiers. These rules of
inference are used extensively in mathematical arguments, often without being
explicitly mentioned.
Universal instantiation is the rule of inference used to conclude that P(c) is true,
where cis a particular member of the domain, given the premise ∀xP(x). Universal
instantiation is used when we conclude from the statement “All men are hard worker”
that “Raju is hard worker,” where Raju is a member of the domain of all men.

Rules of Inference for Quantified Statements:

Rule of Inference Name


∀𝑥𝑃(𝑥) Universal instantiation
∴ 𝑃(𝑐)
𝑃(𝑐) for an arbitrary 𝑐 Universal generalization
∴ ∀𝑥 𝑃(𝑥)
∃𝑥 𝑃(𝑥) Existential instantiation
∴ 𝑃(𝑐)for some element 𝑐
𝑃(𝑐)for some element 𝑐 Existential generalization
∴ ∃𝑥 𝑃(𝑥)

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Resolution:
Computer programs have been developed to automate the task of reasoning and
proving theorems. Many of these programs make use of a rule of inference known as
resolution. This ruleof inference is based on the tautology
((p ∨ q) ∧ (¬p ∨ r)) → (q ∨ r)(this is a tautology)
The final disjunction inthe resolution rule, q ∨ r, is called the resolvent. When we let q =
r in this tautology, we obtain(p ∨ q) ∧ (¬p ∨ q) → q. Furthermore, when we let r = F, we
obtain (p ∨ q) ∧ (¬p) → q(because q ∨ F ≡ q), which is the tautology on which the rule
of disjunctive syllogism is based.
Resolution plays an important role in programming languages based on the rules of
logic,such as Prolog (where resolution rules for quantified statements are applied).
Furthermore, itcan be used to build automatic theorem proving systems. To construct
proofs in propositional logic using resolution as the only rule of inference, the
hypotheses and the conclusion must beexpressed as clauses, where a clause is a
disjunction of variables or negations of these variables.
We can replace a statement in propositional logic that is not a clause by one or more
equivalentstatements that are clauses. For example, suppose we have a statement of the
form p ∨ (q ∧ r). Because p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r), we can replace the single
statement p ∨ (q ∧ r) by two statements p ∨ q and p ∨ r, each of which is a clause. We can
replace a statement of the form ¬(p ∨ q)by the two statements ¬pand ¬q because
De Morgan’s law tells us that¬(p ∨ q) ≡ ¬p ∧ ¬q.We can also replace a conditional
statement p → q with the equivalent disjunction ¬p ∨ q.

Normal or Canonical Forms:


Some important points to remember here are,
1.An atomic proposition is a proposition containing no logical connectives.
Eg: p, q, r etc.

2.A literal is either an atomic proposition or a negation of an atomic proposition.


Eg:p, q, r etc.

3.A conjunctive clause is a proposition that contains only literals and the connective .
Eg: (p  q r).

4. A disjunctive clause is a proposition that contains only literals and the connective .
Eg: (p  q r)

Disjunctive Normal form(DNF):


A proposition in said to be in disjunctive normal form (DNF) if it is a disjunction of
conjunctive clauses and literals.
Eg:(p  q r)  q  (q  r).

A proposition in said to be in principaldisjunctive normal form if it is a disjunction of


conjunctive clauses only.
Eg: (p  q r)  (q  r)
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
OR A disjunction of conjunctions whereevery variable or its negation is represented
once in each conjunction (a minterm)each minterms appears only once.

Method: To find the minterms of the DNF.


Use the rows of the truth table where the proposition is 1 or ‘True’
i) If a F appears under a variable, use the negation of the propositional
variable in the minterm.
ii) If a T appears, use the propositional variable.

Example: Find the DNF of (P V Q)→R


P Q R (P V Q)→R

F F F T
F F T T
F T F T
F T T F
T F F T
T F T F
T T F T
T T T F

There are 5 cases where the proposition is true, hence 5 minterms. Rows 1,2,3, 5 and 7
produce the following disjunction of minterms:
(P V Q)→R
 (P Q R) V (P Q  R) V (P  Q R)V (P Q R) V (P  Q R)

Conjunctive Normal form(CNF):


A proposition in said to be in conjunctive normal form (CNF) if it is a conjunction of
disjunctive clauses and literals.
Eg: (p  q r)  r  (q  r).

A proposition in said to be in principal conjunctive normal form if it is a conjunction of


disjunctive clauses only.
Eg: (p  q r)  (q  r).

Q1) What is the disjunctive normal form of p  (p → q) ?


Answer: (p p)  (p  q)

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Q2) What is the principal disjunctive normal form ofp  q?
Solution: A proposition in said to be in principal disjunctive normal form if it is a
disjunction of conjunctive clauses only.
We can write,
p  q  (p  T)  (q  T)
(p  (q q))  (q  (p p))
(p  q)  ( p q)  (p  q)  ( p  q)
(p  q)  ( p q)  (p  q)

Note: Note that we get a Conjunctive Normal Form (CNF) if we negate a


DNF and use De-Morgan’s Laws.
Method:
1. Find .
2. Find the DNF of .
3. Then, use De Morgan’s law to get the CNF of  (i.e. () )

Converting Expressions to DNF or CNF:


The following procedure converts an expression to DNF or CNF:
1. Remove all  and .
2. Move  inside. (Use De Morgan’s law.)
3. Use distributive laws to get proper form.
Simplify using logiclas. (e.g. double-neg., idemp., comm., assoc.)

PROOFS:
Proofs in mathematics are valid arguments that establish the truth of mathematical
statements.

Argument: A sequence of statements that end with a conclusion.

Premise: A statement, in an argument, or argument form, other than the final one

Theorem: A theorem is a statement that can be shown to be true. In mathematical


writing, the term theorem is usually reserved for a statement that is considered at least
somewhat important.

Note: Less important theorems sometimes are called propositions. (Theorems can
also be referred to as facts or results.)

A theorem may be the universal quantification of a conditional statement with one or


more premises and a conclusion.

Lemma: A less important theorem that is helpful in the proof of other results is called
a lemma. Complicated proofs are usually easier to understand when they are proved
using a series of lemmas, where each lemma is proved individually.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Corollary: A corollary is a theorem that can be established directly from a theorem
that has been proved.

Conjecture: A conjecture is a statement that is being proposed to be a true


statement, usually on the basis of some partial evidence, a heuristic argument, or the
intuition of an expert. When a proof of a conjecture is found, the conjecture becomes a
theorem. Many times conjectures are shown to be false, so they are not theorems.

axiom: A statement that is assumed to be true and that can be used as a basis for
proving theorems.

Trivial proof: A proof that p → q is true based on the fact that q is true.

Direct proof: A proof that p → q is true that proceeds by showing that q must be true
when p is true.

Proof by contraposition: a proof that p → q is true that proceeds by showing that


p must be false when q is false. Or ¬p is true whenever ¬q is true.

Proof by contradiction: a proof that q is true based on the truth of the conditional
statement p → ¬q, where p is a contradiction.

Proof by mathematical induction:

Let P(n) be a statement about a positive integer n such that


i) To show P(1) is true, and
ii) Assume P(n) is true for n=K i.e P(k) is true
iii) P(k + 1) is true whenever one assumes that P(k) is true.
Then P(n) is true for all positive integer n.

Counterexample: an element x such that P(x) is false.

In this section we will discuss on direct poof, proof by contraposition, proof by


contradiction and proof by mathematical induction.

Q) Give a direct proof of the theorem “If n is an odd integer, then 𝑛2 is odd.”
Proof:
Note that this theorem states ∀n(P (n) → Q(n)), where P(n) is “n is an odd integer”
and Q(n) is “𝑛2 is odd.” As we have said, we will follow the usual convention in
mathematical proofs by showing that P(n) implies Q(n), and not explicitly using
universal instantiation.
To begin a direct proof of this theorem, we assume that the hypothesis of this
conditional statement is true, namely, we assume that n is odd. By the definition of an
odd integer, it follows that n = 2k + 1, where k is some integer. We want to show that 𝑛2
is also odd. We can square both sides of the equation n= 2k + 1 to obtain a new equation
that expresses 𝑛2 . When we do this, we find that 𝑛2 = (2𝑘 + 1)2 = 4𝑘 2 + 4𝑘 + 1 =
2(2𝑘 2 + 2𝑘) + 1 = 2𝑘1 + 1 .
Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48
Prepared by Jameel A. Ansari
By the definition of an odd integer, we can conclude that 𝑛2 is an odd integer (it is one
more than twice an integer).Consequently, we have proved that if n is an odd integer,
then 𝑛2 is an odd integer.

Q.) Use a proof by contradiction to prove that the sum of an irrational number and a
rational number is irrational.

Proof:
The proposition to be proved here is as follows: If 𝑟is a rational number and i is an
irrational number, then 𝑠 = 𝑟 + 𝑖 is an irrational number.
So suppose that 𝑟is rational, i is irrational, and s is rational.
We know that the sum of the rational numbers 𝑠and −𝑟must be rational. (Indeed, if 𝑠 =
𝑎/𝑏 𝑎𝑛𝑑 𝑟 = 𝑐/𝑑,
where a, b, c, and d are integers, with 𝑏 ≠ 0 and 𝑑 ≠ 0, then by algebra we see that
𝑠 + ( −𝑟) = (𝑎𝑑 − 𝑏𝑐)/ (𝑏𝑑) ,
so that patently 𝑠 + ( −𝑟) is a rational number. But 𝑠 + ( −𝑟) = 𝑟 + 𝑖 − 𝑟 = 𝑖,
forcing us to the conclusion that i is rational. This contradicts our hypothesis that i is
irrational. Therefore the assumption that s was rational was incorrect, and we conclude,
as desired, that s is irrational.

Q.) Show that if n is an integer and 𝑛3 + 5 is odd, then n is even using


a) a proof by contraposition.
b) a proof by contradiction.
Proof: a) We must prove the contrapositive: If n is odd, then 𝑛3 + 5 is even. Assume
that n is odd. Then we can write 𝑛 = 2𝑘 + 1 for some integer 𝑘. Then
𝑛3 + 5 = (2𝑘 + 1)3 + 5 = 8𝑘 3 + 12𝑘 2 + 6𝑘 + 6 = 2(4𝑘 3 + 6𝑘 2 + 3𝑘 + 3) Thus 𝑛3 + 5
is two times some integer, so it is even.

b) Suppose that 𝑛3 + 5 is odd and that n is odd. Since n is odd, and the product of odd
numbers is odd, in two steps we see that 𝑛3 is odd. But then subtracting we conclude
that 5, being the difference of the two odd numbers 𝑛3 + 5 and 𝑛3 , is even. This is not
true. Therefore our supposition was wrong, and the proof by contradiction is complete.

Q) Prove by using principle of mathematical induction.

𝑛(𝑛+1)
i) 1 + 2 + 3 + ⋯……..+ 𝑛 = 2
𝑛(3𝑛+1)
ii) 2 + 5 + 8+. . . . . . . . . . +(3𝑛 − 1) = 2

Proof:i) Let
𝑛(𝑛+1)
𝑝(𝑛) ≡ 1 + 2 + 3 + ⋯ … … . . + 𝑛 = 2 ...........(1)

To prove P(1) is true.

L.H.S. of (1) at n=1 is equal to 1 and R.H.S = (1) (1+1)/2 = 1

Therefore P(1) is true.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari
Let P(k) is true. (1 < 𝑘 < 𝑛)
𝑘(𝑘+1)
1 + 2 + 3 + ⋯……..+ 𝑘 = ...........(2)
2
𝐼𝑛𝑑𝑢𝑐𝑡𝑖𝑜𝑛 𝑆𝑡𝑒𝑝:

To show p(k+1) is true.

Let L.H.S of (1) at 𝑛 = 𝑘 + 1, we have

L.H.S = 1 + 2 + 3 + ⋯ … … . . +𝑘 + (𝑘 + 1)

𝑘(𝑘+1) 𝑘(𝑘+1)+2(𝑘+1) (𝑘+1)(𝑘+2) (𝑘+1)((𝑘+1)+1)


= + (𝑘 + 1) = = = = R.H.S
2 2 2 2

Therefore 𝑝(𝑘 + 1) is true. Hence P(n) is true for all natural/Positive integers numbers.

Proof: ii) Let


𝑛(3𝑛 + 1)
𝑃(𝑛) ≡ 2 + 5 + 8+. . . . . . . . . . +(3𝑛 − 1) =
2

To prove P(1) is true.

L.H.S. of (1) at n=1 is equal to 2 and R.H.S = (1) (3+1)/2 = 4/2 = 2

Therefore P(1) is true.

Let P(k) is true. (1 < 𝑘 < 𝑛)


𝑘(3𝑘+1)
2 + 5 + 8+. . . . . . . . . . +(3𝑘 − 1) = ...........(1)
2

𝐼𝑛𝑑𝑢𝑐𝑡𝑖𝑜𝑛 𝑆𝑡𝑒𝑝:

To show p(k+1) is true.

Let L.H.S of (1) at 𝑛 = 𝑘 + 1, we have


𝑘(3𝑘+1)
L.H.S = 2 + 5 + 8+. . . . . . . . . . +(3𝑘 − 1) + (3(𝑘 + 1) − 1) = + (3𝑘 + 2)...From (1)
2
4
𝑘(3𝑘+1)+2(3𝑘+2) 3𝑘 2 +7𝑘+4 (𝑘+1)(𝑘+ ) (𝑘+1)(3𝑘+4)
3
= = = =
2 2 2 2
(𝑘+1)(3(𝑘+1)+1)
= = R.H.S
2

Therefore 𝑝(𝑘 + 1) is true. Hence P(n) is true for all natural/Positive integers numbers.

Discrete Mathematics, Unit-01_Sets & Logics Vishwakarma University, Pune-48


Prepared by Jameel A. Ansari

You might also like