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

Module 2_ MATHEMATICAL LOGIC

This document covers the fundamentals of mathematical logic, including propositional logic, connectives, tautologies, contradictions, and contingencies. It explains the rules of inference, normal forms, and the duality principle, along with definitions of predicates and quantifiers. Additionally, it provides examples and truth tables to illustrate key concepts in logical reasoning.

Uploaded by

sahanakm8867
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Module 2_ MATHEMATICAL LOGIC

This document covers the fundamentals of mathematical logic, including propositional logic, connectives, tautologies, contradictions, and contingencies. It explains the rules of inference, normal forms, and the duality principle, along with definitions of predicates and quantifiers. Additionally, it provides examples and truth tables to illustrate key concepts in logical reasoning.

Uploaded by

sahanakm8867
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

MODULE -2

MATHEMATICAL LOGIC
The rules of mathematical logic specify methods of reasoning mathematical statements. Greek
philosopher, Aristotle, was the pioneer of logical reasoning. Logical reasoning provides the
theoretical base for many areas of mathematics and consequently computer science. It has many
practical applications in computer science like design of computing machines, artificial
intelligence, definition of data structures for programming languages etc.

Propositional Logic is concerned with statements to which the truth values, “true” and “false”,
can be assigned. The purpose is to analyze these statements either individually or in a composite
manner.

Prepositional Logic – Definition

A proposition is a collection of declarative statements that has either a truth value "true” or a
truth value "false". A propositional consists of propositional variables and connectives. We
denote the propositional variables by capital letters (A, B, etc). The connectives connect the
propositional variables.

Some examples of Propositions are given below −

 "Man is Mortal", it returns truth value “TRUE”


 "12 + 9 = 3 – 2", it returns truth value “FALSE”

The following is not a Proposition −

 "A is less than 2". It is because unless we give a specific value of A, we cannot say
whether the statement is true or false.

Connectives

In propositional logic generally we use five connectives which are −

 OR (∨∨)
 AND (∧∧)
 Negation/ NOT (¬¬)
 Implication / if-then (→→)
 If and only if (⇔⇔).
OR (∨∨) − The OR operation of two propositions A and B (written as A∨B) is true if at least any
of the propositional variable A or B is true.

The truth table is as follows −

A B A∨B

True True True

True False True

False True True

False False False

AND (∧∧) − The AND operation of two propositions A and B (written as A∧B) is true if both
the propositional variable A and B is true.

The truth table is as follows −

A B A∧B

True True True

True False False

False True False

False False False

Negation (¬¬) − The negation of a proposition A (written as ¬A) is false when A is true and is
true when A is false.

The truth table is as follows −


A ¬A

True False

False True

Implication / if-then (→→) − An implication A→B is the proposition “if A, then B”. It is false
if A is true and B is false. The rest cases are true.

The truth table is as follows −

A B A→B

True True True

True False False

False True True

False False True

If and only if (⇔⇔) − A⇔B is bi-conditional logical connective which is true when p and q are
same, i.e. both are false or both are true.

The truth table is as follows −

A B A⇔B

True True True

True False False

False True False

False False True

Tautologies
A Tautology is a formula which is always true for every value of its propositional variables.

Example − Prove [(A→B)∧A]→B is a tautology

The truth table is as follows −

A B A→B (A → B) ∧ A [( A → B ) ∧ A] → B

True True True True True

True False False False True

False True True False True

False False True False True

As we can see every value of [(A→B)∧A]→B is "True", it is a tautology.

Contradictions

A Contradiction is a formula which is always false for every value of its propositional variables.

Example − Prove (A∨B)∧[(¬A)∧(¬B)] is a contradiction

The truth table is as follows −

A B A∨B ¬A ¬B (¬ A) ∧ ( ¬ B) (A ∨ B) ∧ [( ¬ A) ∧ (¬ B)]

True True True False False False False

True False True False True False False

False True True True False False False

False False False True True True False

As we can see every value of (A∨B)∧[(¬A)∧(¬B)] is “False”, it is a contradiction.

Contingency
A Contingency is a formula which has both some true and some false values for every value of
its propositional variables.

Example − Prove (A∨B)∧(¬A) a contingency

The truth table is as follows −

A B A∨B ¬A (A ∨ B) ∧ (¬ A)

True True True False False

True False True False False

False True True True True

False False False True False

As we can see every value of (A∨B)∧(¬A) has both “True” and “False”, it is a contingency.

Propositional Equivalences

Two statements X and Y are logically equivalent if any of the following two conditions hold −

 The truth tables of each statement have the same truth values.
 The bi-conditional statement X⇔Y is a tautology.
Example − Prove ¬(A∨B)and[(¬A)∧(¬B)] are equivalent
Testing by 1st method (Matching truth table)

A B A∨B ¬ (A ∨ B) ¬A ¬B [(¬ A) ∧ (¬ B)]

True True True False False False False

True False True False False True False

False True True False True False False

False False False True True True True


Here, we can see the truth values of ¬(A∨B)and[(¬A)∧(¬B)] are same, hence the statements are
equivalent.
Testing by 2nd method (Bi-conditionality)

A B ¬ (A ∨ B ) [(¬ A) ∧ (¬ B)] [¬ (A ∨ B)] ⇔ [(¬ A ) ∧ (¬ B)]

True True False False True

True False False False True

False True False False True

False False True True True

As [¬(A∨B)]⇔[(¬A)∧(¬B)] is a tautology, the statements are equivalent.

Inverse, Converse, and Contra-positive

Implication / if-then (→)(→) is also called a conditional statement. It has two parts −
 Hypothesis, p
 Conclusion, q
As mentioned earlier, it is denoted as p→q

Example of Conditional Statement − “If you do your homework, you will not be punished.”
Here, "you do your homework" is the hypothesis, p, and "you will not be punished" is the
conclusion, q.

Inverse − An inverse of the conditional statement is the negation of both the hypothesis and the
conclusion. If the statement is “If p, then q”, the inverse will be “If not p, then not q”. Thus the
inverse of p→q is ¬p→¬q

Example − The inverse of “If you do your homework, you will not be punished” is “If you do
not do your homework, you will be punished.”

Converse − The converse of the conditional statement is computed by interchanging the


hypothesis and the conclusion. If the statement is “If p, then q”, the converse will be “If q, then
p”. The converse of p→q is q→p
Example − The converse of "If you do your homework, you will not be punished" is "If you will
not be punished, you do your homework”.

Contra-positive − The contra-positive of the conditional is computed by interchanging the


hypothesis and the conclusion of the inverse statement. If the statement is “If p, then q”, the
contra-positive will be “If not q, then not p”. The contra-positive of p→q is ¬q→¬p

Example − The Contra-positive of " If you do your homework, you will not be punished” is "If
you are punished, you did not do your homework”.

Duality Principle

Duality principle states that for any true statement, the dual statement obtained by interchanging
unions into intersections (and vice versa) and interchanging Universal set into Null set (and vice
versa) is also true. If dual of any statement is the statement itself, it is said self-dual statement.

Example − The dual of (A∩B)∪C is (A∪B)∩C

Normal Forms

We can convert any proposition in two normal forms −

 Conjunctive normal form


 Disjunctive normal form
Conjunctive Normal Form

A compound statement is in conjunctive normal form if it is obtained by operating AND among


variables (negation of variables included) connected with ORs. In terms of set operations, it is a
compound statement obtained by Intersection among variables connected with Unions.

Examples

 (A∨B)∧(A∨C)∧(B∨C∨D)
 (P∪Q)∩(Q∪R)
Disjunctive Normal Form
A compound statement is in disjunctive normal form if it is obtained by operating OR among
variables (negation of variables included) connected with ANDs. In terms of set operations, it is
a compound statement obtained by Union among variables connected with Intersections.

Examples

 (A∧B)∨(A∧C)∨(B∧C∧D)
 (P∩Q)∪(Q∩R)

Predicate Logic – Definition

A predicate is an expression of one or more variables defined on some specific domain. A


predicate with variables can be made a proposition by either assigning a value to the variable or
by quantifying the variable.

The following are some examples of predicates −

 Let E(x, y) denote "x = y"


 Let X(a, b, c) denote "a + b + c = 0"
 Let M(x, y) denote "x is married to y"

Well Formed Formula

Well Formed Formula (wff) is a predicate holding any of the following −

 All propositional constants and propositional variables are wffs


 If x is a variable and Y is a wff, ∀xY and ∃xY are also wff
 Truth value and false values are wffs
 Each atomic formula is a wff
 All connectives connecting wffs are wffs

Quantifiers

The variable of predicates is quantified by quantifiers. There are two types of quantifier in
predicate logic − Universal Quantifier and Existential Quantifier.

Universal Quantifier
Universal quantifier states that the statements within its scope are true for every value of the
specific variable. It is denoted by the symbol ∀∀.
∀xP(x) is read as for every value of x, P(x) is true.
Example − "Man is mortal" can be transformed into the propositional form ∀xP(x) where P(x) is
the predicate which denotes x is mortal and the universe of discourse is all men.
Existential Quantifier
Existential quantifier states that the statements within its scope are true for some values of the
specific variable. It is denoted by the symbol ∃∃.
∃xP(x) is read as for some values of x, P(x) is true.
Example − "Some people are dishonest" can be transformed into the propositional form ∃xP(x)
where P(x) is the predicate which denotes x is dishonest and the universe of discourse is some
people.
Nested Quantifiers

If we use a quantifier that appears within the scope of another quantifier, it is called nested
quantifier.

Example

 ∀ a∃bP(x,y) where P(a,b) denotes a+b=0


 ∀ a∀b∀cP(a,b,c) where P(a,b) denotes a+(b+c)=(a+b)+c
Note − ∀a∃bP(x,y)≠∃a∀bP(x,y)

To deduce new statements from the statements whose truth that we already know, Rules of
Inference are used.

What are Rules of Inference for?

Mathematical logic is often used for logical proofs. Proofs are valid arguments that determine the
truth values of mathematical statements.

An argument is a sequence of statements. The last statement is the conclusion and all its
preceding statements are called premises (or hypothesis). The symbol “∴∴”, (read therefore) is
placed before the conclusion. A valid argument is one where the conclusion follows from the
truth values of the premises.
Rules of Inference provide the templates or guidelines for constructing valid arguments from the
statements that we already have.

Table of Rules of Inference

Rule of Name Rule of Inference Name


Inference

P∴P∨Q P∨Q¬P∴Q
Addition Disjunctive Syllogism

PQ∴P∧Q P→QQ→R∴P→R
Conjunction Hypothetical Syllogism

P∧Q∴P (P→Q)∧(R→S)P∨R∴Q∨S
Simplification Constructive Dilemma

P→QP∴Q (P→Q)∧(R→S)¬Q∨¬S∴¬P
Modus Ponens Destructive Dilemma
∨¬R

P→Q¬Q∴¬P
Modus Tollens

Addition

If P is a premise, we can use Addition rule to derive P∨Q


P∴P∨Q

Example

Let P be the proposition, “He studies very hard” is true


Therefore − "Either he studies very hard Or he is a very bad student." Here Q is the proposition
“he is a very bad student”.

Conjunction

If P and Q are two premises, we can use Conjunction rule to derive P∧Q
PQ∴P∧Q

Example

Let P − “He studies very hard”

Let Q − “He is the best boy in the class”

Therefore − "He studies very hard and he is the best boy in the class"

Simplification

If P∧Q is a premise, we can use Simplification rule to derive P.


P∧Q∴P

Example
"He studies very hard and he is the best boy in the class", P∧Q

Therefore − "He studies very hard"

Modus Ponens

If P and P→Q are two premises, we can use Modus Ponens to derive Q.
P→QP∴Q

Example
"If you have a password, then you can log on to facebook", P→Q

"You have a password", P

Therefore − "You can log on to facebook"

Modus Tollens
If P→Q and ¬Q are two premises, we can use Modus Tollens to derive ¬P
P→Q¬Q∴¬P

Example
"If you have a password, then you can log on to facebook", P→Q
"You cannot log on to facebook", ¬Q

Therefore − "You do not have a password "

Disjunctive Syllogism

If ¬P and P∨Q are two premises, we can use Disjunctive Syllogism to derive Q.
¬PP∨Q∴Q

Example
"The ice cream is not vanilla flavored", ¬P
"The ice cream is either vanilla flavored or chocolate flavored", P∨Q

Therefore − "The ice cream is chocolate flavored”

Hypothetical Syllogism

If P→Q and Q→R are two premises, we can use Hypothetical Syllogism to derive P→R
P→Q Q→R∴P→R

Example
"If it rains, I shall not go to school”, P→Q
"If I don't go to school, I won't need to do homework", Q→R

Therefore − "If it rains, I won't need to do homework"

Constructive Dilemma

If (P→Q)∧(R→S) and P∨R are two premises, we can use constructive dilemma to derive Q∨S
(P→Q)∧(R→S)P∨R∴Q∨S

Example
“If it rains, I will take a leave”, (P→Q)
“If it is hot outside, I will go for a shower”, (R→S)
“Either it will rain or it is hot outside”, P∨R

Therefore − "I will take a leave or I will go for a shower"

Destructive Dilemma

If (P→Q)∧(R→S) and ¬Q∨¬S are two premises, we can use destructive dilemma to
derive ¬P∨¬R
(P→Q)∧(R→S)¬Q∨¬S∴¬P∨¬R

Example
“If it rains, I will take a leave”, (P→Q)
“If it is hot outside, I will go for a shower”, (R→S)
“Either I will not take a leave or I will not go for a shower”, ¬Q∨¬S

Therefore − "Either it does not rain or it is not hot outside"

You might also like