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

U-I-Logic and Proofs - Notes

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)
15 views

U-I-Logic and Proofs - Notes

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/ 29

DISCRETE MATHEMATICS

UNIT I
LOGIC AND PROOFS
 Propositional Logic
 Propositional equivalences
 Predicate and quantifiers
 Nested quantifiers
 Rules of inference
 Introduction to proof
 Methods and strategy
UNIT-I
LOGIC AND PROOFS
Logic is concerned with all kinds of reasoning, the rules of Logic give precise meaning to
mathematical statements, and these rules are used to distinguish between valid and invalid
mathematical arguments.

Propositions

A Proposition is a declarative sentence (that is, a sentence that declares a fact) that is
either true or false, but not both.

Example: All the following declarative sentences are propositions.

1. Washington is the capital of the United States of America(True)


2. Toronto is the capital of Canada(False)
3. 1+1=2(True)
4. 2+2=3( False)

The Following sentences are not Propositions

1. What is the height of Himalaya?(Interrogative sentences)

2. What a wonderful Joke this is (Exclamatory sentences)

3. Obey my orders (command)

4. x+5=3 is neither true nor false we can’t assign true or false.

Which of the following sentences are Propositions? Indicate the truth values

(a) 3+1=4(T) (b) 5-4=1(T) (c) 5+5=9(F)

(d) How old are you? (Not a Proposition)

(e) x+3=7(Not a Proposition)

(f) Peacock is very beautiful (Not a Proposition)

Connectives:

Connective is an operation which is used to connect 2 or more than 2 statements is called


sentential connectives or logical connectives or logical operators.
Compound Statement:

Statement which contains one or more primary statement and some connectives are called
compound or molecular or composite statements.

Five basic connectives

Logical Connectives Name Symbols Types of Operator


AND Conjunction  Binary
OR Disjunction  Binary
NOT Negation  Unary
If then Conditional or  Binary
Implication
Iff Biconditional  Binary

Truth Tables

Conjuction: The preposition P  Q is called conjuction Read as P and Q

P Q P Q
T F F
F T F
T T T
F F F

Disjunction :The disjunction of 2 statements, P & Q it denoted by P  Q Read as

P or Q

P Q P Q
T T T
T F T
F T T
F F F

Negation : If P is a statement then its negation is NP or  P read as not P

Truth table
P P
T F
F T

Condtitional Statement

Truth table

P Q P Q
T T T
T F F
F T T
F F T

Translate the fellow sentence into a logical Expression

“S. Pavithra can access the internet from campus only if she is a Computer
Science major or she is not a fresh girl”.

Solve:

P: S. Pavithra can accesses the internet from Campus

Q: S. Pavithra is a Computer Science major

R: S. Pavithra is a fresh girl

 P: S. Pavithra is not a fresh girl

Logical Expression: P  (Q  R)

2. “If Tigers have wings then the earth travels round the Sun”.

P: Tigers have wings (F)

Q: Earth travels round the Sun (F)

Expression: P  Q(T )
Construct the Truth Table

1. P  ( P  Q)

P Q Q P  Q P  ( P  Q)
T T F T T
T F T T T
F T F F F
F F T T F

2. S: ( P  Q)  (P  Q)  ( P  Q)

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


T T T F F F F F T
T F F F T F TQ T T
F T F T F T F T T
F F F T T F F F F

3. P  ( P   Q)

P Q Q P  Q P  ( P  Q)
T T F T T
T F T T T
F T F F F
F F T T F

4. ( P  Q)  (Q  P)

P Q ( P  Q) (Q  P) ( P  Q)  (Q  P)
T T T T T
T F F T F
F T T F F
F F T T T
5. ( P  Q)  (P  Q)  ( P  Q)  (P  Q)

Sol:

Let A = ( P  Q)  (P  Q)

B = ( P  Q)  (P  Q)

C = ( P  Q)  (P  Q)  ( P  Q)  (P  Q)

P Q P Q P  Q A P  Q P  Q) B C
T T F F F T F F F T
T F F T F F T F T T
F T T F T T F F F T
F F T T T F F T T T

6. (p  (q  r ))  ((q  r )  ( p  r ))

Let A= p  (q  r )

B= ((q  r )  ( p  r ))

C= (p  (q  r ))  ((q  r )  ( p  r ))

p q r p q q  r A qr pr B C
T T T F F F F T T T T
T T F F F F F F F F F
T F T F T T F F T T T
T F F F T F F F F F F
F T T T F F F T F T T
F T F T F F F F F F F
F F T T T T T F F F T
F F F T T F F F F F F
7. ( p  q)  (r  s)

Sol:

p q r s pq rs ( p  q)  ( r  s )
T T T T T T T
T T T F T F F
T T F T T F F
T T F F T T T
T F T T F T F
T F T F F F T
T F F T F F T
T F F F F T F
F T T T F T F
F T T F F F T
F T F T F F T
F T F F F T F
F F T T T T T
F F T F T F F
F F F T T F F
F F F F T T T

Prepositional Equivalence

Tautology and Contradiction:

Tautology : A compound preposition P is called a tautology, if it is true for every truth


assignment for p.

Contradiction : A compound preposition P is called a contradiction, if it is false for


every truth assignment for p.

Examples:

p P p  p p  p
T F T F
F T T F

 p  p is tautology & p  p is contradiction


Note: If a proposition is neither a tautology nor a contradiction, it is called a
contingency or fallacy.

Equivalence of Prepositions:

Two compound propositions A and B are said to be logically Equivalent or simply


equivalent, if they have identical truth tables.

It is denoted by A  B or A B

Read as “A is equivalent to B”

Note: p  q where p  q is tautology

p  q where p  q is tautology

Example:

p q pq p p  q ( p  q)  (p  q)
T T T F T T
T F F F F T
F T T T T T
F F F T T T

Here p  q  p  q

 ( p  q)  (p  r ) is tautology

p q r pq qr B pr A


T T T T T T T T
T T F T F F F T
T F T F T F T T
T F F F T F F T
F T T T T T T T
F T F T F F T T
F F T T T T T T
F F F T T T T T
1. S.T. [( p  q)  (q  r ))  ( p  r )] is a tautology

B A

 A is a tautology
Logical Equivalence:

Compound prepositions that have been the same truth values in all possible
cases are called logically equivalent.

DeMorgan’s Laws:

( p  q)  p  q
( p  q)  p  q

Logical Equivalences:

Equivalence Name

pI  p
1. Identity laws
pF  p
pI T
2. Domination laws
pF  F
p p  p
3. Idempotent laws
p p  p
4. (p)  p Double Negation laws
pq  q p
5. Commutative law
pq q p
( p  q)  r  p  (q  r )
6. Associative law
( p  q)  r  p  (q  r )
p  (q  r )  ( p  q)  ( p  r )
7. Distributive laws
p  (q  r )  ( p  q)  ( p  r )
p  ( p  q)  p
8. Absorption laws
p  ( p  q)  p
p  p  T
9. Negation laws
p  p  F
Logical Equivalences Involving Conditional state
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

Logical Equivalence Involving Biconditional

p  q  ( p  q)  (q  p)
p  q  p  q
p  q  ( p  q )  ( p   q )
( p  q)  p  q

Problems:

1. Show that ( p  (p  q) and p  q are logically equivalent by developing a


series of logically equivalence.

Sol:

( p  (p  q)  p  [(p  q)]

 p  [(p  q)] (Demorgan‟s law)

 p  ( p  q)] (Double Negation law)

 (p  p)  [(p  q)] (Distributive law)

 F  (p  q)] ( p  p  F

 (p  q)  F ] (Commutative law)

 p  q (Identity law)
2. S.T ( p  q)  ( p  q) is a tautology

Sol:

( p  q)  ( p  q)  ( p  q)  ( p  q) (Conditional law)

 (p  q)  ( p  q) (DeMorgaan‟s law)

 (p  p)  ((q)  q) (Associative & Commutative)

T T

T

 It is a tautology

Converse: q  p is a converse of p  q

Contra positive : q  p of p  q

Inverse: p  q is called inverse of p  q

Examples:

1. What are the contra positive, converse and inverse of the conditional statement
“The home team wins whenever it is raining:?

Sol:

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


p  q , the original statement can be rewritten as “If it is raining, then the home team
wins”.

Contra positive: q  p

“If the home team does not win, then it is not raining”.

Converse: q  p

“If the home team wins then it is not raining”.

Inverse: p  q
“If it s not raining, then the home team does not win”.

Only the contra positive is equivalent to the original statement.

2. If p is “you can take the flight” & q is “you buy a ticket:. Find p & q

Sol:

Given you can take the flight if you buy a ticket i.e p  q

This statement is true if p & q are either both true and both false i.e if you buy a
ticket and can take the flight or if you do not buy a ticket & you cannot take the flight.

If it is false when p & q have opposite truth values i.e when you do not buy a
ticket but you can take the flight and when you buy a ticket & cannot take the flight.

i.e

p q pq
T T T
T F F
F T F
F F T

3. “You cannot ride the roller coaster if you are under 4 feet tall undress you are
older than 16 years old”.

Sol:

p  (q  r )

Normal Forms:

There are two types of normal forms

i. Disjunctive normal form (DNF)


ii. Conjunctive normal form(CNF)
 A product of the variables and their negations is called an elementary
product.
 A sum of the variables and their negations is called an elementary sum.

Elementary products: p, p, p  p, p  q

Elementary Sum: q, q, p  q, p  q, p  q


DNF:

A compound preposition which consists of a sum of elementary products and


which is equivalent to a given preposition is called a DNF.

CNF:

A formula which consists of a product of elementary sums & which is equivalent


to a given formula is called a CNF of

Eg: obtain a DNF of [ p  (q  r )]  [( p  q)  r )  p

Sol: [ p  (q  r )]  [( p  q)  q]  (r  p)

= ( p  q  r )  ( p  q)  ( p  r )

DNF: [ p  (q  r )]  [(p  q)  r ]

CNF: p  [( p  q)  (q  p)]

Principal disjunctive normal form (PDNF)

A formula consisting of disjunctions of minterms in the Variables only &


equivalent to a given formula is known as its PDNF or its sum of products canonical
form of the given formula.

Principal conjunctive normal form (PCNF)

A formula consisting of conjunctions of maxterms in the variables only &


equivalent to given formula is known as its PCNF or its products of sum canonical form.

Problems

1. Without using truth tables, prove

i. ( p  q)  [ p  ( p  q)]  p  q

Solve:

 (p  q)  [( p  p)  q] Associative law

 (p  q)  [( p  q)] Idempotent law


 ( p  q)  [(p  q)] Commutative law
 ( p  q  p)  [( p  q  q)] Distributive law

 [p  ( p  q)  ( p  (q  q)] Commutative law

 [(p  p)  q)  ( p  q)] Complement &Idempotent

 ( F  q)  ( p  q)

 F  ( p  q) Dominant law

 ( p  q)

ii) p  (q  p)  p  ( p  q)

LHS p  (q  p)  p  (q  p)

 p  (q  p)

 (q  p)  p Commutative law

 q  ( p  p) Associative law

 q   Complement law

T Dominant law

RHS p  ( p  q)  p  (p  q)

 p  (p  q) Conditional law

 p  (q  p) Commutative law

 p   Complement law

T

2. Prove p  (q  r )  q  ( p  r )

Sol: p  (q  r )  p  (q  r )

 (p)  (q  r )
 p  (q  r )

 p  (r  q)

 ( p  r )  q

 q  ( p  r )

 q  ( p  r)

3. p  (q  r )  p  (q  r )  ( p  q)  r

Sol:

p  (q  r )  p  (q  r )

 p  (q  r )

 (p  q)  r

 ( p  q)  r

 ( p  q)  r

4. Using the laws of logic show that ( p  q)  ( p  q) is a tautology

Sol:

( p  q)  ( p  q )  T

( p  q)  ( p  q)  ( p  q)  ( p  q) Implication conversation

 (p  q)  ( p  q) DeMorgan‟s law

 p  (q  p)  q Associative law

 p  ( p  q)  q Commutative law

 (p  p)  (q  q) Associative law

T T By Negative law

T By dominant law

 given is a tautology
5. S.T. [p  (q  r )]  (q  r )  ( p  r )  r

Sol:

[p  (q  r )]  (q  r )  ( p  r )

 [(p  q)  r )]  (q  r )  ( p  r ) Associative

 [( p  q)  r ]  (q  r )  ( p  r ) Demorgan‟s law

 [( p  q)  r ]  (q  p)  r ) Distributive law

 (( p  q)  (q  p))  r

T r Complement law

r Identity law

6. Using laws of logic P.T ( p  q)  [p(p  q)]  pvq

LHS

 (( p  q))  (p  (p  q) Implication

 ( p  q)  ((p  p)  q) Double negation & Associative

 ( p  q)  (p  q) Idempotent law

 ( p  q)  (p  q)

 ( p  (p  q))  (q  (p  q) Distributive law

 (( p  p)  q)  ((q  q)  p) Associative law

 (T  q)  (q  p)

 T  (q  p)

 (q  p)

 p  q

Hence proved
Without constructing the truth tables, find the principal disjunctive normal forms
(pdnf) of the fello statements.

I) ( (p  q)  (q  p)
II) ( p  q)  ( p  q)  (q  r )

Solve:

1) (p  q)  (q  p)  ( p  q)  ((q  p)  (q  p))

 ( p  q)  (( p  q)  ( p  q))

 (( p  q)  ( p  q)  (( p  q)  ( p  q))

 ( p  q)  (( p  q)  F )

 ( p  q)  ( p  q )

 ( p  q)

2) ( p  q)  ( p  q)  (q  r )  (( p  q)  ((r  r )  (r  r ))  ((q  r )  ( p  p)

( Already given state is DNF, but not in PDNF)

 ( p  q  r )  ( p  q  r )  (p  q  r )  (p  q  r )  ( p  q  r )  ( p  q  r )

 ( p  q  r )  ( p  q  r )  (p  q  r )  (p  q  r )

(Deleting repetition of identical Minterms)

Predicates and Quantifiers

Introduction:

I) X>3, “The first part, the variable x is the subject of the statement. The
second part, the predicate is greater than 3”

Note:

A statement of the form P (x1, x2……xn) is the value of the prepositional function
P at the n tuple (x1, x2,……xn) and P is also called an predicate or a nary predicate.
Quantifiers:

Quantification

Universal Existential

The universal quantification of p(x) is the statement “ p(x) for all values of x in
the domain”

The notation xp (x) denotes the universal quantification. Here  is called
universal quantifier.

Quantifiers:

Statement When True? When False?

xp (x) p(x) ) is true for every x There is an x for which

p(x) is false

xp (x) p(x) is true of their exists p(x) is false for every x

an x

Essential Quantifiers:

Essential quantification of p(x) is the preposition “There exists an element x in the


domain such that p(x) .

We use the notation xp (x) . Here  is called the essential quantifier.

Translating from English into logical Expressions:


1. Express the statement „Ever student in this class has stuided calculus” using
predicates and quantifiers.

Solve:

Let c(x) denotes x has studied calculus where the domain consists of the
students in the class.

xc(x)

2. Consider these statements the first two called premises and the 3 rd is called the
conclusion. The entire set is called an argument.

“All lions are fierce”

“Some lions do not drink coffee”

“Some fierce creatures do not drink coffee”.

Solve:

Let P(x), Q(x) & R(x) be “x is a lion” “x is fierce”. “x drinks coffee” respectively.
Assuming that the domain consists of all creatures, express the statements in the
argument using quantifiers and P(x), Q(x) & R(x)

x( P( x)  Q( x))

x( P( x)  R( x))

x(Q( x)  R( x))

3. Consider these statement

“All huming birds are richly coloured”

“No large large birds live on honey”

“Birds that do not live on honey are dull in color”. “Huming birds are small”.

Let P(x)= x is a humming bird

Q(x = x is large
R(x)=x lives on honey

S(x)=x is richly coloured

x( P( x)  S ( x)

x(Q( x)  R( x))

x(R( x)  S ( x))

x( P( x)  Q( x))

4. What are the negations of the statements ?


 X(x2 >x) &  X(x2 =2) ?

Solve:

 X(x2 >x)  X(x2 >x) i.e  X(x2  x)

 X(x2 =2)  X(x2 =2) i.e x (x2  2)

Theory of Inference

Inference theory is concerned with the inferring of a conclusion from certain


hypothesis or basic assumptions, called premises by applying certain principles of
reasoning called rules of inference.

When a conclusion derived from a set of premises by using rules of inference,


such derivation is called formal proof.

The rules of inference are only means used to draw a conclusion from a set of
premises in a finite sequence of steps called argument.

Rule P: A premise may be introduced at any step in the direction.

Rule T:A formula S may be introduced in the derivation, If S is tautologyimplied by one


or more proceeding formulas in the derivative
Rule in Tautology form Name of the Rule

( p  q)  p
Simplication
( p  q)  q

p  ( p  q)
Addition
q  ( p  q)

(( p)  (q))  ( p  q) Conjuction

[ p  ( p  q)]  q Modus Ponens

[q  ( p  q)]  p Modus Tollens

[( p  q)  (q  r )]  ( p  r ) Hypothetical Syllogism

[( p  q)  p]  q Disjunctive Syllogism

[( p  q)  (p  r )]  (q  r ) Resolution

[( p  q)  ( p  r )  (q  r )]  r Dilemma

Rule CP:

If a formula S derived from another formula r and set of premises, then the
statement (r  s) can be derived from the set of premises alone.

Using Rules of Inference to build arguments

1. S.T the hypotheses “ It is not sunny this afternoon and it is colder than
yesterday”. We do not go swimming then we will take a canoe trip” and “If we
take a canoe trip, then we will be home by sunset” lead to the conclusion “ we will
go home by sunset”.

Sol:

Let p : It is sunny this afternoon

q : It is colder than yesterday


r : We will go swimming

s : We wil take a canoe trip

t : We will be home by sunset

Premises given in the statement are p  q, r  p, r  s, s  t  t

Steps Reason

r  s Premises

s t Premises

r  t Using (1) &(2) (hypo syllogism)

rp Rule P

p  r Using cantropositive rule T using (4)

p  q Rule P

p Rule T using(6) simplification

r Using (5) & (7) (Modus Ponens)

t Using (3) & (8)

Aliter :

Steps Reason

( p  q) Rule P

p Using (1) simplification

rp Rule P

r Using (2) & (3) Modus tollens

r  s Rule P

s Modus Ponens (Using 4 & 5)

s t Rule P

t Modus ponens using (6) & (7)


2. Give a direct proof for the implication

p  (q  s), (r  p), q  (r  s)

Solve:

Statement Reasons

p  (q  s) P

r p P

rp T, 2 & Equivalence

r  (q  s) T, 1,3 & (a  b) & (b  c)  (a  c)

r  (q  s) T, 4 & Equivalence

q P

(r  q  s)  q T, 5, 6 & conjunction

(r  q)  (q  q)  (s  q) T, 7 distributive law

(r  q)  F  (q  s) T, 8 Negation law

(r  q)  (q  s) T, 9 Identity law

(r  s)  q P

(r  s) T, 11, a  b  a

r s T,12, a  b  a  b

3.use the indirect proof method to show that r  q, r  s, s  q, p  q  p

Sol:

p  p is an additional rule


P rule p (additional)

r  q rule p

s  q rule p

(r  s)  q rule T (2&3)

rs rule p

q rule T,4,5 & p  q, p  q

pq rule p

q rule T,1,7,p, p  q  p  q

q  q rule T, 6,8, p, q  p  q

F rule T, 9 & Negation law

4.Show that a  b follows logically from the premises p  q


( p  q)  r, r  (s  t ) & (s  t )  (a  b)

Sol:

Statement Reasons

pq p

( p  q)  r p

r T ,using1,2 ( p  q)  p  q

r  (s  t ) p

s  t T ,using 3,4

(s  t )  (a  b) p, (( p  q)  p)  q

(a  b) T, using 5,6

5.Show that b can be derived from the premises a  b, c  b, d  (a  c) ,d by indirect


method.
Sol:

b is an additional premises

a b rule p

c b rule p

( a  c)  b rule T,1,2 p  q, r  q  ( p  r )  q

d  (a  b) rule p

d b rule T,3&4

d rule p

b rule T,5,6 & p  q, p  q

b rule p

b  b rule T ,7,8

F rule T, 9 Negation law

6.P.T the premises a  (b  c), d  (b  c) and a  d are inconsistent

Sol:

Statement Reasons

a  (b  c) rule p

ad rule p

a rule T,2 p  q  p

d rule T,3,1,p, p  q  q

bc rule T,3,1&p, p  q  q

b  c T,5 eqvalence law

d  (b  c) p

(b  c)  d T,7 Contrapositive


(b  c)  d 7,8

d T,6,9

d  d T,4,10

F T,11,& Negation

 given premises are inconsistent

Rules of Inference for Quantified statements

Rule of Inference Name


x p(x)
 p(c) Universal Instantiation
P( c ) for an arbitrary c
x p(x) Universal generalization

xp (x) Existential Instantiation


 p(c) for some element c

P ( c ) for some element c Existential generalization


xp (x)

PROBLEMS

1. S.T the premises “A student is this class has not read the book” and “Everyone in
this class passed the first exam” imply the conclusion “someone who passed the
first exam has not read the book”.

Sol

Consider c (x) denote x is in the class

B(x) denote x read the book

E(x) denote x passed the first exam

Where x is the domain of a student

x ( c(x)  B(x)) and x(c( x)  E ( x)

Conclusion is x( E( x)  B( x))

Steps Reason
x(c( x)  B( x)) Premises

c(a)  B(a) Existential Instantiation using(1)

x(c( x)  E ( x)) p

c( a )  E ( a ) Using 3 Universal Instantiation

C(a) simplification using(2)

E(a) Modus ponen using 4 &5

B(a) Simplification from (2)

E (a)  B(a) Conjunction using 6 & 7

x[ E( x)  B( x)] Existential generalization

2. Prove that : All men are mortal


Socrates is a men
 Socrates is a mortal.

Sol

Let M(x) : x is a man

T(x) : x is a mortal

S: x is Socrates

x(M ( x)  T ( x)) , M(S)

Statement Reason

x(M ( x)  T ( x)) p

M ( s)  T ( s) using 1

M(s) p

T(s) ( p  q)  p  q using 2,3.


3. Construct an argument “ If it does not rain or if there is no traffic dislocation, then
the sports day will be held and the cultural program will go on”, if the sports day
is held., the trophy will be awarded, the trophy was not awarded.

Sol:

P: It rains q: There is no traffic dislocation

r: Sports day will be held

s : The cultural program will go on

t : Trophy will be awarded

(p  q)  r  s, r  t , t  p

Introduction to proofs

Definition:

The integer n is even if  an integer k  n=2k and n is odd is  an integer k 


n=2k+1

Definition:

The real number r is rational if  integer p & q with q  0  r=p/q. A real number
that is not rational is called irrational.

Examples

1. Prove that if n is an integer and 3n+2 is odd , then n is odd.

Proof:

Direct proof:

Given n is an integer &3n+2 is odd


 3n+2=2k+1  3n+1  2k

We cannot continue with this condition to prove the given

So we can choose indirect proof

Proof by Contra positive:


Let us consider, the contradiction of n is odd ie n is even  n=2k

 3n+2=3(2k)+2=6k+2=2(3k+1)

Which shows that 3n+2 is even, But 3n+2 is odd as given premises

 It is contradiction to the given fact

 n is odd Hence the proof.

2.Prove that 2 is irrational by giving a proof by contradiction.

Proof:

By Contra positive

Let p be “ 2 is irrational”

p be 2 is rational

Here 2 is rational, so 2 =a/b where a&b are integers, both have no common
divisor (ie) 2 =a/b

 2 = a2/b2  2b2=a2---------------(1)

By the definition of integers , a2 is even   a must be even

(ie) a=2k
 (1)  2b2=4k2  b2=2k2

Which shows that b2 is even, b is even finally a & b both even. Common divisor 2

This is contradiction to one contradiction

 2 is not rational

 2 is irrational

You might also like