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

Propositional Logic

The document covers propositional logic including propositions, connectives like negation, conjunction, disjunction, implication, biconditional, and truth tables. It defines these concepts and provides examples to illustrate their meaning and use in evaluating compound propositions.

Uploaded by

taraweeh32
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)
32 views

Propositional Logic

The document covers propositional logic including propositions, connectives like negation, conjunction, disjunction, implication, biconditional, and truth tables. It defines these concepts and provides examples to illustrate their meaning and use in evaluating compound propositions.

Uploaded by

taraweeh32
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/ 35

Chapter 1, Part I: Propositional Logic

With Question/Answer Animations

Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Chapter Summary
 Propositional Logic
 The Language of Propositions
 Applications
 Logical Equivalences
 Predicate Logic
 The Language of Quantifiers
 Logical Equivalences
 Nested Quantifiers
 Proofs
 Rules of Inference
 Proof Methods
 Proof Strategy
Propositional Logic Summary
 The Language of Propositions
 Connectives
 Truth Values
 Truth Tables
 Applications
 Translating English Sentences
 System Specifications
 Logic Puzzles
 Logic Circuits
 Logical Equivalences
 Important Equivalences
 Showing Equivalence
 Satisfiability
Section 1.1
Section Summary
 Propositions
 Connectives
 Negation
 Conjunction
 Disjunction
 Implication; contrapositive, inverse, converse
 Biconditional
 Truth Tables
Propositions
 A proposition is a declarative sentence that is either true or false.
 Examples of propositions:
a) London is in Denmark.
b) 9<6.
c) Islamabad is the capital of Pakistan.
d) 1 + 0 = 1
e) 0 + 0 = 2
 Examples that are not propositions.
a) Sit down!
b) What time is it?
c) x+1=2
d) x + y = z
Propositional Variable
 Variables that represent propositions are called
propositional variables. We typically use lower case
alphabets or letters such as p, q and r to denote
propositions.
 p: 4 is an integer. p:T
 q: 5 is less than 3 (5<3) q:F
 r: Islamabad is capital of Pakistan. r: T
Propositional Logic
 Constructing Propositions
 Propositional Variables: p, q, r, s, …
 The proposition that is always true is denoted by T and
the proposition that is always false is denoted by F.
 Compound Propositions; constructed from logical
connectives and other propositions
 Negation ¬
 Conjunction ∧
 Disjunction ∨
 Implication →
 Biconditional ↔
Negation: Symbols ¬, ~.

If p is true then ¬p is false and if p is false then


¬p is true
Compound Propositions: Negation
 The negation of a proposition p is denoted by ¬p and
has this truth table:
p ¬p
T F
F T

 Example: If p denotes “The earth is round.”, then ¬p


denotes “It is not the case that the earth is round,” or
more simply “The earth is not round.”
Conjunction: (AND)(∧)
Let p and q be the propositions, if p and q are true then
p∧q is true, otherwise p∧q is false.
Examples:
 Paris is in France AND 2+2=4. True (T)
 Paris is in France AND 2+2=5. False (F)
 Paris is in England AND 2+2=4. False (F)
 Paris is in England AND 2+2=5. False (F
Conjunction
 The conjunction of propositions p and q is denoted
by p ∧ q and has this truth table:
p q p∧q
T T T
T F F
F T F
F F F

 Example: If p denotes “I am at home.” and q denotes


“It is raining.” then p ∧q denotes “I am at home and it
is raining.”
Disjunction: (OR)(V)
 Let P and q be the propositions, if p and q are false,
then p∨q is false, otherwise p∨q is true.
Examples:
 Paris is in France OR 2+2=4. True (T)
 Paris is in France OR 2+2=5. True (T)
 Paris is in England OR 2+2=4. True (T)
 Paris is in England OR 2+2=5. False (F)
Disjunction
 The disjunction of propositions p and q is denoted
by p ∨q and has this truth table:

p q p ∨q
T T T
T F T
F T T
F F F

 Example: If p denotes “I am at home.” and q denotes


“It is raining.” then p ∨q denotes “I am at home or it is
raining.”
Exclusive OR: (XOR)(⨁)
Let p & q be propositions, p⊕q is the proposition that is
true, when exactly one of p and q is true and is false
otherwise.
Example:
 Student who has taken Calculus OR computer science
can take this (INCLUSIVE SENCE )
 Student who has taken Calculus OR computer science
BUT NOT both can take this (EXCLUSIVE SENCE)
Exclusive OR: (XOR)(⨁)

p q p ⊕q
T T F
T F T
F T T
F F F
Conditional Statement (→)
(Implication)

 Let p and q be propositions, The conditional statement


p → q is false when p is true and q is false, and true
otherwise. In the conditional statement, p is called the
hypothesis (or antecedent or premise)and q is called
the conclusion (or consequence).
Implication
 If p and q are propositions, then p →q is a conditional statement or
implication which is read as “if p, then q ” and has this truth table:
p q p →q
T T T
T F F
F T T
F F T

 Example: If p denotes “I am at home.” and q denotes “It is


raining.” then p →q denotes “If I am at home then it is raining.”
 In p →q , p is the hypothesis (antecedent or premise) and q is
the conclusion (or consequence).
Understanding Implication (cont)
 One way to view the logical conditional is to think of
an obligation or contract.
 “If I am elected, then I will lower taxes.”
 “If you get 100% on the final, then you will get an A.”
 If the politician is elected and does not lower taxes,
then the voters can say that he or she has broken the
campaign pledge. Something similar holds for the
professor. This corresponds to the case where p is true
and q is false.
Understanding Implication
 If you get 100% on the final, then you will get an A.
 If he wastes time, then he will fail.
 If x=2 then x2=4.
 If it rains, then I will take umbrella.
Understanding Implication (cont)
What is the value of the variable x after the statement
if 2 + 2 = 4 then x := x + 1
if x = 0 before this statement is encountered?
(The symbol := stands for assignment)
Solution: Because 2 + 2 = 4 is true, the assignment
statement x := x + 1 is executed. Hence,
x has the value 0 + 1 = 1 after this statement is
encountered.
Different Ways of Expressing p →q
if p, then q p implies q
if p, q p only if q
q unless ¬p q when p
q if p
q whenever p p is sufficient for q
q follows from p q is necessary for p

a necessary condition for p is q


a sufficient condition for q is p
Converse, Inverse & Contrapositive of
Condition Statement:
Let p & q be propositions, Suppose we have conditional
statement p→ q.
Converse:-
The statement q→ p is called converse of the conditional
statement.
Inverse:-
The statement ¬p→¬q is called Inverse of the conditional
statement.
Contrapositive:-
The statement ¬q →¬p is called Contrapositive of the
conditional statement.
Converse, Inverse & Contrapositive of
Condition Statement:
Example:-
p: It is raining.
q: There are clouds on sky.
Conditional:-
p → q:IF it is raining THEN there are clouds on sky.
Converse:-
q→ p:IF there are clouds on sky THEN it is raining.
Converse, Inverse & Contrapositive of
Condition Statement:
Inverse:
¬p→¬q:IF it is not raining THEN there are no clouds on
sky.
Contra-positive:-
¬q →¬p:IF there are no clouds on sky THEN it is not
raining.
Biconditional
Let p and q be propositions, the biconditional
statement p⟷q is true when p and q have the same
truth values, and is false otherwise. Biconditional
statements are also called bi-implications.
Biconditional
 If p and q are propositions, then we can form the biconditional
proposition p ↔q , read as “p if and only if q .” The biconditional
p ↔q denotes the proposition with this truth table:

p q p ↔q
T T T
T F F
F T F
F F T

 If p denotes “I am at home.” and q denotes “It is raining.” then


p ↔q denotes “I am at home if and only if it is raining.”
Expressing the Biconditional
 Some alternative ways “p if and only if q” is expressed
in English:

 p is necessary and sufficient for q


 if p then q , and conversely
 p iff q
Truth Tables For Compound
Propositions
 Construction of a truth table:
 Rows
 Need a row for every possible combination of values for
the propositions.
 Columns
 Need a column for the compound proposition (usually
at far right)
 Need a column for the truth value of each expression
that occurs in the compound proposition as it is built
up.
Problem
 How many rows are there in a truth table with n
propositional variables?

Solution: 2n
 Note that this means that with n propositional
variables, we can construct 2n distinct (i.e., not
equivalent) propositions.
Precedence of Logical Operators
Operator Precedence
 1
 2
 3
 4
 5

p q  r is equivalent to (p q)  r
If the intended meaning is p (q  r )
then parentheses must be used.
Example Truth Table
 Construct a truth table for
p q r r pq p  q → r
T T T F T F
T T F T T T
T F T F T F
T F F T T T
F T T F T F
F T F T T T
F F T F F T
F F F T F T
Example Truth Table
 Construct a truth table for p (q  r)
 p q r r q → r p  (q → r)

T T T F F T
T T F T T T
T F T F T T
T F F T T T
F T T F F F
F T F T T T
F F T F T T
F F F T T T
Equivalent Propositions
 Two propositions are equivalent if they always have the
same truth value.
 Example: Show using a truth table that the
conditional is equivalent to the contrapositive.
Solution:
p q ¬p ¬q p →q ¬q → ¬ p
T T F F T T
T F F T F F
F T T F T T
F F T T T T
Using a Truth Table to Show Non-
Equivalence
Example: Show using truth tables that neither the
converse nor inverse of an implication are not
equivalent to the implication.
Solution:
p q ¬p ¬q p →q ¬ p →¬ q q→p
T T F F T T T
T F F T F T T
F T T F T F F
F F T T T T T

You might also like