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

Propositional logic

This document introduces propositions and their logical connectives, including negation, conjunction, disjunction, implication, and biconditional. It explains how to construct truth tables for compound propositions and discusses the equivalence of propositions. Additionally, it covers the application of logical operators in computer bit operations.

Uploaded by

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

Propositional logic

This document introduces propositions and their logical connectives, including negation, conjunction, disjunction, implication, and biconditional. It explains how to construct truth tables for compound propositions and discusses the equivalence of propositions. Additionally, it covers the application of logical operators in computer bit operations.

Uploaded by

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

Introduction to Propositions – Section 1.

1
BRAIN TEASER: TORTOISE FARM
Backstory and Goal Clues
Drissel's Tortoise Farm is 1. Shelly is 32.
a refuge for tortoises 2. Methuselah is 50.
from all over the world, 3. The black neck
many of which can live tortoise is 18 years
to be well over 100 older than the swoop-
years of age. Using only backed tortoise.
the clues below, match 4. Of the 50-year-old
each tortoise on the one and the 14-year-
farm to its species and old tortoise, one is the
age. pitch belly tortoise and
the other is named
Chewie.
SECTION TOPICS

• 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 (but not both).
Examples:
• Ghana is in North America
• 1+1 = 2
• It is raining (here, now)

Not propositions:
• x+y=z
• Where is it?
COMPOUND PROPOSITIONS

A compound proposition is a proposition formed from existing


propositions using the logical operators
Not:  (also known as negation)
And:  (also known as conjunction)
Or:  (also known as disjunction)
Exclusive-Or: 
Implication: → (also known as if-then, implies, or conditional)
Bi-Conditional:  (also known as if-and-only-if)
PROPOSITIONAL LOGIC
• Constructing Propositions
• Propositional Variables: p, q, r, s, …
• T or F notations
• Compound Propositions; constructed from logical connectives and other
propositions
• Negation ¬
• Conjunction ∧
• Disjunction ∨
• Implication →
• Biconditional
TRUTH TABLE
A truth table displays the relationships between the truth values
of propositions. All possible truth values are displayed in a
truth table. They are especially used to determine the truth
values of compound propositions (propositions constructed from
simpler propositions)

p
T
F
COMPOUND PROPOSITIONS: NEGATION
• The negation of a proposition p is denoted by ¬p and has
this truth table:

p ¬p
T F
F T

• For instance: 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)
• The conjunction of propositions p and q denoted by p ∧ q is true when both p
and q are true, and false otherwise.
• Has this truth table: p q p∧q
T T T
T F F
F T F
F F F

• The four rows correspond to the pairs of truth values TT, TF, FT and FF
• 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)
• The disjunction of propositions p and q denoted by p ∨q is another
proposition (pq) that is true when either p or q (or both) are true, and false
otherwise.
• 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)
The exclusive-or of two propositions p, q, is another proposition
(pq) that is true when either p or q but not both are true, and
false otherwise.

p q p q
T T F
T F T
F T T
F F F
THE CONNECTIVE OR IN ENGLISH
• In English “or” has two distinct meanings.
• “Inclusive Or” - In the sentence “Students who have taken
CS202 or Math120 may take this class,” we assume that
students need to have taken one of the prerequisites but may
have taken both. This is the meaning of disjunction. For p ∨q
to be true, either one or both of p and q must be true.
• “Exclusive Or” - When reading the sentence “Soup or salad p q p ⊕q
T T F
comes with this entrée,” we do not expect to be able to get
T F T
both soup and salad. This is the meaning of Exclusive Or F T T
(Xor). In p ⊕ q , one of p and q must be true, but not both. F F F
IMPLICATION
• If p and q are propositions, then p →q is a conditional statement or
implication which is read as “if p, then q ” that is false when p is true
and q is false, and true otherwise
p q p →q
T T T
T F F

and has this truth table: 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).
IMPLICATION –CONT.
• In p →q there does not need to be any connection between the antecedent or
the consequent. The “meaning” of p →q depends only on the truth values of
p and q.
• These implications are perfectly fine but would not be used in ordinary
English.
• For instance: “If horses have wings, then elephants can dance” is true!!
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.
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
DIFFERENT WAYS OF EXPRESSING P →Q .

Express in different ways:


“It is necessary to wash the boss’s car to get promoted”
CONVERSE, CONTRAPOSITIVE, AND INVERSE
• From p →q we can form new conditional statements .
• q →p is the converse of p →q
• ¬q → ¬ p is the contrapositive of p →q
• ¬p→¬q is the inverse of p →q
Example: Find the converse, inverse, and contrapositive of “I go to the beach
whenever it is a sunny summer day.”
CONVERSE, CONTRAPOSITIVE, AND INVERSE
Example: Find the converse, inverse, and contrapositive of “I go to the beach
whenever it is a sunny summer day.”
Solution:
Converse (q →p):
“It is a sunny summer day whenever I go to the beach”
OR
“If I go to the beach then it is a sunny summer day”
Inverse (¬p → ¬ q): “I do not go to the beach whenever it is not a sunny
summer day.”
Contrapositive (¬q → ¬ p) : “It is not a sunny summer day whenever I don’t
go to the beach”
BICONDITIONAL
• If p and q are propositions, then we can form the biconditional proposition p q ,
read as “p if and only if q .” It is true when both p and q are true or both are
false, and false otherwise.
• 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 atomic
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.
• This includes the atomic propositions
EXAMPLE TRUTH TABLE
• Construct a truth table for (p ∨¬q) → (p ∧ q).

p q q p ∨¬q p∧q (p ∨¬q) → (p ∧ q)


T T F T T T
T F T T F F
F T F F F T
F F T T F F
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
EQUIVALENT PROPOSITIONS
• Two propositions are equivalent if they always have the same truth value.
• Example: Show using a truth table that the conditional (p→q ) is equivalent to
the contrapositive (¬q → ¬ p)
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 (q→p)
nor inverse (¬ p →¬ q) of an implication are not equivalent to the implication (p →q)

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
QUESTION
• How many rows are there in a truth table with n propositional variables?

Solution: 2n We will see how to do this in Chapter 6.

• Note that this means that with n propositional variables, we can construct 2n
distinct (i.e., not equivalent) propositions.
PRECEDENCE OF LOGICAL OPERATORS
ORDER OF OPERATIONS

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.
LOGIC AND BIT OPERATIONS
In computers, T and F are represented as 1 and 0 (bits) respectively.
A bit string is a sequence of bits (0’s and 1’s).
A binary number is a number in base 2, whose digits are 0 and 1. In
binary, the number
10101011 is the number:
1x27 + 0x26 + 1x25 + 0x24 + 1x23 + 0x22 + 1x21 + 1x20 =
128+32+8+2+1 = 171
LOGIC AND BIT OPERATIONS
Bitwise Not: complement of each bit
10110111=
Bitwise And: 11 = 1, all else equal 0
1011011111101101 =
Bitwise Or: 00 = 0, all else equal 1
1000100011101001 =
Bitwise Exclusive-Or, 11=0, 00=0, all else = 1
1001101100011001 =
LOGIC AND BIT OPERATIONS
Bitwise Not: complement of each bit
10110111= 01001000
Bitwise And: 11 = 1, all else equal 0
1011011111101101 = 10100101
Bitwise Or: 00 = 0, all else equal 1
1000100011101001 = 11101001
Bitwise Exclusive-Or, 11=0, 00=0, all else = 1
1001101100011001 = 10000010
TAKE HOME MESSAGE
Propositions- statements T or F
Operators: - Negation ¬ - opposite of truth values than the original proposition
- And ∧ - true when both p and q are true, and false otherwise.
- Or ∨ - true when either p or q (or both) are true, and false otherwise.
- Exclusive Or  - true when either p or q but not both are true, and false
otherwise.
- If-then → - false when p is true and q is false, and true otherwise
- Iff - is true when both p and q are true or both are false, and false
otherwise.
Truth tables: - Rows for every possible combination of values
- Columns for the truth value of each expression and one for the compound
proposition
Bits: In computers T and F are represented as 1 and 0 (bits) respectively, same operators
can be used

You might also like