You are on page 1of 9

PROPOSITIONAL LOGIC

 A proposition is a declarative statement that is, by


itself, either true or false but not both.
Examples:
JAVA is a low level programming language – FALSE
2 + 5 = 7 - TRUE
What is an algorithm? – This is a question not a
statement

𝑥 is an integer – It depends on the value of 𝑥


Do your assignments - This is a command and commands
cannot be true or false.

 Propositional Logic is a mathematical system for


reasoning about propositions and how they relate to one
another.
 A simple or primitive statement is a statement which
cannot be broken down into anything simpler.
 Each simple or primitive statement will be represented by
a proposition variable. Propositional variables are
usually represented as lower-case letters, such as p, q,
r, s, etc.
 Each variable can take one of two values: True or False.

Example 1:
p: There are seven days in a week. - p is a simple
statement
Example 2:
q: 2 + 3 = 6. - q is a simple statement

 New propositions, called compound propositions, are


formed from 2 or more simple propositions using logical
operators or connectives.
 A compound statement is denoted by use of letters P, Q,
R...
Example:
p: There are seven days in a week
q: There twelve months in a year
Connective: and
There are seven days in a week and twelve months in a
year. Is a compound statement.

 A compound statement can hold one of two truth values,


true or false. These are denoted “T” and “F”
respectively.
Note: Some books may use “1” for true and “0” for false.
 When determining the truth value of a compound statement
all possible combinations of the truth values of the
statements comprising it must be considered.
 This is done systematically by the use of truth tables.
Each connective is defined by its own unique truth table.

Truth Table Construction

 Construct columns for the propositional variables that


form the compound proposition.
 Rows in the table should allow for all possible
combinations of T and F for these variables. In general,
for n variables, 2n rows are required.
 Make a column for each “elementary” stage of the
construction of the proposition, the truth value at each
step being determined from the previous stages by the
definitions of the connectives.
 Finally we obtain the truth value of the proposition,
which appears in the last column.

Logical Operators/ Connectives


1. Negation, “not”
 If p is a statement, the negation of p is “not p” or “it
is not the case that p” and is denoted ~p.
Example:
p: It is raining outside.
~p: ~( It is raining outside.)
It is not raining outside.
Truth table for negation:
The negation of p has the opposite truth value from p,
~p is false when p is true; ~p is true when p is false.
p ~p
F T
T F

2. Disjunction, “or”
 If p and q are statements the disjunction of p and q is
“p or q”, denoted p ∨ q.
Example 1:
Given p: 2 + 3 = 5
q: 2 + 3 = 6

p ∨ q: 2 + 3 = 5 or 2 + 3 = 6
Alternatively: 2 + 3 = 5 or 6
Example 2:

Write the following statements using “∨”


I am catching the bus or train home.

(I am catching the bus home) ∨ (I am catching the train


home)
Truth Table for Disjunction

 The disjunction of p and q is true when at least one of p


or q is true and false otherwise.
p q p ∨ q
F F F
F T T
T F T
T T T

3. Conjunction, “and”

 If p and q are statements the conjunction of p and q is


“p and q”, denoted p ∧ q.
Example 1:

Given p: It is hot, q: It is sunny, write down p ∧ q.

p ∧ q: (It is hot) ∧ (It is sunny)


Simplified: It is hot and sunny
Truth Table for Conjunction

 The conjunction of p and q is true when, and only when,


both p and q are true and false otherwise.
p q p ∧ q
F F F
F T F
T F F
T T T

4. Conditional, “If … then”, “implies”


 If p and q are statements the conditional of p by q is
“If p then q” or “p implies q”, and is denoted p → q.
Example:

Given p: It is raining, q: I will go home, write down p →


q.

p → q: (It is raining) → (I will go home)


Simplified: If it is raining then I will go home
Truth Table for Conditional

 The conditional of p by q is false when p is true and q


false, otherwise it is true.
 We call p the hypothesis (or antecedent) of the
conditional and q the conclusion (or consequent).
 A useful way to understand the truth value of a
conditional statement is to think of an obligation or a
contract.
Example:
The promise many politicians make when running for office
is “If I am elected, then I will increase employment.”
It is false when the politician gets elected and he/she
does not increase employment.
p q p → q
F F T
F T T
T F F
T T T

Some terminology is used to express p → q:

 “if p, then q”
 “p implies q”
 “if p, q”
 “p only if q”
 “p is sufficient for q”
 “a sufficient condition for q is p”
 “q if p”
 “q whenever p”
 “q when p”
 “q is necessary for p”
Converse of a Conditional Proposition

 The converse of a conditional proposition p → q is the


proposition q → p.
Contrapositive of a Conditional Proposition

 The contrapositive of a conditional proposition 𝐩 → 𝐪 is


the proposition ~𝐪 → ~𝐩

 The contrapositive, ~𝐪 → ~𝐩, of a conditional statement


𝐩 → 𝐪 always has the same truth values as 𝐩 → 𝐪 -(logical
equivalence).
Inverse of a Conditional Proposition

 The proposition ~𝐩 → ~𝐪 is called the inverse of 𝐩 → 𝐪.

 The converse and the inverse of a conditional statement


are also equivalent.
5. Biconditional, “If and only if”

 If p and q are statements the biconditional of p and q is


“p if, and only if q” and is denoted p ↔ q.

Example:
Given p: Water boils, q: Water temperature is over 100°C
write down p ↔ q.
p ↔ q: “Water boils if, and only if, it’s temperature is
100°C.

Truth Table for Biconditional

 The biconditional of p and q is true if both p and q have


the same truth value, and is false if p and q have
opposite truth values.

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

Some common ways to express p ↔ q :


 “p is necessary and sufficient for q”
 “if p then q, and conversely”
 “p iff q”
 “p implies and is implied by q”
 “p is equivalent to q”

Order of Operation for Logical Operators:

 The order of operation for logical operators is as


follows:
1. Evaluate negations first
2. Evaluate ∨ and ∧ second. When both are present,
parenthesis may be needed, otherwise work left to right.
3. Evaluate → and ↔ third. When both are present,
parenthesis may be needed, otherwise work left to right.

Note: Use of parenthesis will determine order of


operations which override the above order.
 The main connective is the operation which “binds” the
statement together. It is the final operation performed.

Examples: Indicate the order of operations and the main


connective in the following:

~ p ˅ q

~ p ˅ (q ˄ r)

~(p ˅ q)

~ p → q ˄ r
Tautologies, Contradictions and Contingencies

 A compound proposition is said to be a tautology if its


truth value is true for any truth values of its
components.
Example: p ∨ ~ p

 A proposition is said to be a contradiction if its truth


value is F for any assignment of truth values to its
components.
Example: p ∨ ~ p

 A proposition that is neither a tautology nor a


contradiction is called a contingency.
Logical Equivalence

 The compound propositions P and Q are called logically


equivalent when they have the same truth values in all
possible cases.- identical truth tables.

 This is denoted by writing P ≡ Q.

 If two statements P and Q are logically equivalent then


P ↔ Q is a tautology

Example: Show that 𝐩 → 𝐪 and ~𝐩 ∨ 𝐪 are logically


equivalent
p q ~ p p → q ~ p ˅ q
F F T T T
F T T T T

T F F F F
T T F T T

Laws

 The following logical equivalences hold:

1. Commutative Laws:

(p ˅ q) ≡ (q ˅ p)
(p ˄ q) ≡ (q ˄ p)
(p ↔ q) ≡ (q ↔ p)

2. Associative Laws:
((p ˅ q) ˅ r) ≡ (p ˅ (q ˅ r))
((p ˄ q) ˄ r) ≡ (p ˄ (q ˄ r))
((p ↔ q) ↔ r) ≡ (p ↔ (q ↔ r))

3. Distributive Laws:

(p ˅ (q ˄ r)) ≡ ((p ˅ q) ˄ (p ˅ r))


(p ˄ (q ˅ r)) ≡ ((p ˄ q) ˅ (p ˄ r))

4. Double Negation (Involution) Law:


~ ~ p ≡ p

5. De Morgan’s Laws:

~(p ˅ q) ≡ ( ~ p ˄ ~ q)
~(p ˄ q) ≡ ( ~ p ˅ ~ q)

6. Implication Laws:

p → q ≡ ~p ˅ q
(p ↔ q) ≡ ( p → q) ˄ ( q → p)

7. Identity Laws:

p ˅ F ≡ p
p ˄ T ≡ p
8. Negation (Complement) Laws:
(p ˅ ~ p ) ≡ T
(p ˄ ~ p ) ≡ F

9. Dominance Laws:

p ˅ T ≡ T
p ˄ F ≡ F

10.Idempotent Laws:

p ˅ p ≡ p
p ˄ p ≡ p

11.Absorption Laws:

(p ˅ (p ˄ q)) ≡ p
(p ˄ (p ˅ q)) ≡ p

12.Property of Implication:

(p → (q ˄ r)) ≡ ((p → q) ˄ (p → r))


((p ˅ q) → r) ≡ ((p → r) ˄ (q → r))

You might also like