0% found this document useful (0 votes)
44 views32 pages

1 Formal Logic

1. The document discusses propositional logic and introduces basic logical operators such as negation, conjunction, disjunction, implication, bi-implication. 2. A proposition is a statement that is either true or false. Compound propositions are formed by combining existing propositions using logical operators. 3. Truth tables are provided to illustrate the truth values of compound propositions using different logical operators such as negation, conjunction, disjunction, and implication.

Uploaded by

Somaiah Sulaiman
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)
44 views32 pages

1 Formal Logic

1. The document discusses propositional logic and introduces basic logical operators such as negation, conjunction, disjunction, implication, bi-implication. 2. A proposition is a statement that is either true or false. Compound propositions are formed by combining existing propositions using logical operators. 3. Truth tables are provided to illustrate the truth values of compound propositions using different logical operators such as negation, conjunction, disjunction, and implication.

Uploaded by

Somaiah Sulaiman
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/ 32

1

Discrete Structures
Discrete Structures
L1

First Semester

College of Science and Computer Engineering


Taibah University
Yanbu
Saudi Arabian .
1440- 1441
2
Discrete Structures

Propositional Logic
• Propositional logic is the study of propositions
(true or false statements) and

The ways of combining them (logical operators)


to get new propositions.

It is effectively an algebra of propositions.


3
Discrete Structures

Propositional Logic
In this algebra,
❑ the variables stand for unknown propositions
(instead of unknown real numbers) and
❑ the operators are and, or, not, implies, and if
and only if (rather than plus, minus, negative,
times, and divided by).
❑Just as middle/high school students learn the
notation of algebra and how to manipulate it
properly, we want to learn the notation of
propositional logic and how to manipulate it
properly.
4
Discrete Structures

Propositional Logic
A proposition is a declarative statement that’s either true
(T) or false (F), but not both
Propositions
▪ Every cow has 4 legs
▪ Riyadh is the capital of Saudi Arabia
▪ 1+1=2
▪ 2+2=3
Not Propositions
▪ What time is it?
▪ X+1=2
▪ Answer this question
5
Discrete Structures

Propositional Logic
New propositions, called compound propositions are
formed from existing propositions using logical
Operators
6
Discrete Structures

Propositional Logic
negation
Suppose p is a proposition
The negation of p is written as p and
has meaning:
“It is not the case that p.”
The proposition p is read “not P”

Truth table for the negation of p p


proposition p F T
T F
7
Discrete Structures

Propositional Logic
negation

“ today is Friday”
“ it is not the case that today is Friday” or
“today is not Friday”
“it is not Friday today”
8
Discrete Structures

Propositional Logic
conjunction
Suppose p and q are propositions
The conjunction of p and q is written as pq

The proposition pq is read “p and q”

Truth table for the p q pq


Conjunction of two F F F
propositions
pq F T F
T F F
T T T
9
Discrete Structures

Propositional Logic
conjunction
p is the proposition “Today is Friday”
q is the proposition “It is raining today”

The conjunction of p and q is proposition


“ Today is Friday and it is raining today”

This proposition
Is true on rainy Fridays
Is false on any day that is not a Friday
on Fridays when it does not rain
10
Discrete Structures

Propositional Logic
disjunction
▪ Inclusive Or
Suppose p and q are propositions
The disjunction of p and q is written as pq

The proposition pq is read “p or q”


p q pq
Truth table for the F F F
Disjunction (Inclusive Or) of two F T T
propositions T F T
pq
T T T
11
Discrete Structures

Propositional Logic
disjunction
p is the proposition “Today is Friday”
q is the proposition “It is raining today”

The disjunction of p and q is proposition


“ Today is Friday or it is raining today”

This proposition
Is true on any day that is either a Friday
or a rainy day(including rainy Fridays)
Is false on days that are not Fridays when
it also does not rain
12
Discrete Structures

Propositional Logic
disjunction
▪ Exclusive Or
Suppose p and q are propositions
The Exclusive Or of p and q is written as pq

The proposition pq is read “p or q but not both”


p q pq
Truth table for the
Exclusive Or of two propositions F F F
pq F T T
(pq)  (pq) T F T
T T F
13
Discrete Structures

Propositional Logic
implication
Suppose p and q are propositions
The conditional statement (implication) p→q
The proposition p→q is read “ if p, then q”
P hypothesis – antecedent – premise
q conclusion -consequence
p q p→q
Truth table for the F F T
Implication F T T
p→q T F F
T T T
14
Discrete Structures

Propositional Logic
implication
Terminology used to express p→q
“if p, then q”
“p is sufficient for q”
“q if p” “q when p”
“a necessary condition for p is q”
“q unless p“
“p implies q”
“p only if q”
“a sufficient condition for q is p”
“q whenever p”
“q is necessary for p”
“q follows from p”
“if p, q”
15
Discrete Structures

Propositional Logic
implication
p is the proposition “Ahmed learns discrete structures”
q is the proposition “Ahmed will find a good job”
The p→q is proposition
“ if Ahmed learns discrete mathematics, then he will find a
good job”

This proposition
Is false when p is true and q is false
Otherwise it is true
16
Discrete Structures

Propositional Logic
implication
p is the proposition “today is Friday”
q is the proposition “2+3=5”
The p→q is proposition
“ if today is Friday, then 2+3=5”

This proposition p q p→q


Is true because its F F T
Conclusion (q) is true “ F T T
T F F
T T T
17
Discrete Structures

Propositional Logic
implication
The conditional statement (implication) p→q
“if it is raining, then the home team wins”

q→ p is called contrapositive of p→q


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

The proposition q→p is called converse of p→q


“if the home team wins, then it is raining”

p→ q is called inverse of p→q


“if it is not raining, then the home team does not win”
18
Discrete Structures

Propositional Logic
bi-implication
Suppose p and q are propositions
The biconditional statement (bi-implication) pq
The proposition p  q is read “ p if and only if q”
p  q is true if both p→q  q→p are true
p→q  pq -------→ pq
p q pq
Truth table for the F F T
bi-implication F T F
pq T F F
(p  q )  ( p   q ) T T T
19
Discrete Structures

Propositional Logic
bi-implication
The proposition p  q has the same truth value as p→q 
q→p

p q p→q q→p p→q  q→p pq


F F T T T T
F T T F F F
T F F T F F
T T T T T T
20
Discrete Structures

Propositional Logic
bi-implication

p is the proposition “You can take the flight”


q is the proposition “You buy a ticket”

The p  q is proposition
“You can take the flight if and only if You buy a ticket”

This proposition
Is true if p and q are either both true or both false”
21
Discrete Structures

Exercise
1- Find the negation of the proposition
“Michael’s PC runs Linux”
and express this in simple English.

2- Write truth table for the Conjunction of two propositions pq

3- Write truth table for the Implication of two propositions p→q

4- Prove that the proposition p  q has the same truth value as p→q  q→p
22
Discrete Structures

Propositional Logic
Truth table of compound propositions
▪ Precedence of logical operators
→
Construct the Truth table of compound propositions

(p   q) → (p  q)
23
Discrete Structures

Propositional Logic
▪ Translating English sentence into a logical
expression
“You can access the internet from campus only if
you are a computer science major or you are not a
freshman”
a: “You can access the internet from campus”
b: “you are a computer science major”
c: “you are a freshman”
Where a,b,c are propositional variables
a → (b  c)
24
Discrete Structures
Propositional Equivalences

Logical equivalences
compound propositions that have the same
truth values in all possible cases are called
Logically equivalent
Compound propositions p and q are Logically
equivalent if pq is a tautology.

logical equivalence  
Note  and  are not logical
operators(connectives). Rather they indicate
a kind of logical equality.
25
Discrete Structures

Propositional Logic - 2 more defn…

A tautology is a proposition that’s always TRUE.

A contradiction is a proposition that’s always FALSE.

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

9/29/2021
26
Discrete Structures

Propositional Logic - logical equivalence

Challenge: Try to find a proposition that is equivalent


to p → q, but that uses only the connectives , ,
and .

p q p→q p q p q  p

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

9/29/2021
27
Discrete Structures

Propositional Logic - proof of 1 famous 


I could say “prove
a law of
Distributivity: p  (q  r)  (p  q)  (p  r) distributivity.”

p q r qr p  (q  r) pq pr (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
All truth
F F T
assignments F F F T F
for p,Fq, and
F F F F F F F
r.
9/29/2021
28
Discrete Structures
Propositional Equivalences
Identity laws pTp pFp
Domination laws pFF pTT
Idempotent laws ppp ppp
Double negation law (p)  p
Negation laws p p  T p  p  F
Absorption laws p(pq)  p p(p  q)  p
Commutative laws p  q  q  p pqqp
Associative laws (pq)r  p(qr) (pq)r  p(qr)
De Morgan’s laws (pq)  pq (pq)  pq
Distributive laws p(qr)  (pq)(pr)
p(qr)  (pq)(pr)
T denotes the compound proposition that is always true
F denotes the compound proposition that is always false
29
Discrete Structures
Propositional Equivalences
Use De Morgan’s law to express the negation of
“Ahmed has a mobile and he has a laptop”
p: “Ahmed has a mobile”
q: “Ahmed has a laptop”

pq
(pq)  p q
 p: “Ahmed has not a mobile”
 q: “Ahmed has not a laptop”
“Ahmed has not a mobile or he has not a laptop”
30
Discrete Structures

Propositional Logic - an unfamous 


if NOT (blue AND NOT red) OR red then…

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

(p  q)  q  (p  q)  q DeMorgan’s

 (p  q)  q Double negation

 p  (q  q) Associativity

 p  q Idempotent

9/29/2021
31
Discrete Structures

Propositional Logic - one last proof


⚫ Show that [p  (p → q)] → q is a tautology.
⚫ We use  to show that [p  (p → q)] → q  T.

[p  (p → q)] → q
 [p  (p  q)] → q substitution for →
 [(p  p)  (p  q)] → q distributive
 [ F  (p  q)] → q uniqueness
 (p  q ) → q identity
 (p  q)  q substitution for →
 (p  q)  q DeMorgan’s
 p  (q  q ) associative
 p  T excluded middle
T domination
9/29/2021
32
Discrete Structures

Exercise

Show that (p → q)  p  q

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

Show that (p  q) → (p  q) is a tautology

You might also like