# Lecture Week 1 ```Lecture 1: logic
Learning objectives:
• The student be able to determine the
propositional logic.
• The student be able to understand the logical
connectives.
• The student be able to construct the truth tables.
• The student will be able to validate the
arguments.
Proposition
A proposition (or a statement) is a
sentence that is true or false but not both.
Example 1:
1. “Two plus two equals four”
▫
– It is True
2. “Two plus two equals five”
▫
– It is False
BOTH ARE STATEMENTS
Are the following propositions?
1.
Sydney is the capital of Australia.
2. Do Tutorial 11 now.
3. Today is Wednesday.
4. x is a prime number.
Compound Proposition
• Three symbols that are used to build more
complicated logical expressions out of the
simplers ones.
∼
∧
∨
not
and
or
∼q
p∧q
p∨𝒒
negation of q
(not q)
p and q
p or q
Compound Statement
•
Create new (compound) propositions from
existing ones (elementary proposition)
•
The five connectives:
1.
2.
3.
4.
5.
Negation (not …)
Conjunction (… and …)
Disjunction (… or …)
Implication (if … then …)
Equivalence (… if and only if …)
Hierarchy Among Logical Connectives
Translating from English to Symbols:
But and Neither-Nor
• Write each of the following sentences
symbolically, letting h = “It is hot” and s = “It is
sunny.”
• It is not hot but it is sunny.
• It is neither hot nor sunny.
Suppose that x is a particular real number. Let p,
q, and r symbolize ′0 &lt; 𝑥′, ′x &lt; 3′, and ′x = 3′,
respectively. Write the following inequality
symbolically:
a. x ≤ 3
a. 0 &lt; x &lt; 3
a. 0 &lt; x ≤ 3
Truth Values - Negation
Definition
If p is a statement variable, the negation of p is “not p” or
“It is not the case that p” and is denoted by ∼ 𝑝. It has the
opposite truth value from p: if p is true, ∼ 𝑝 is false; if p is
false, ∼ 𝑝 is true.
𝒑
∼𝒑
T
F
F
T
Truth Values - Conjunction
Definition
If p and q are statement variables, the conjunction of p
and q is “ p and q” , denoted 𝑝 ∧ 𝑞. It is true when, and
only when, both p and q are true. If either p or q is false,
or if both are false, 𝑝 ∧ 𝑞 is false.
𝒑
𝒒
𝒑∧𝒒
T
T
T
T
F
F
F
T
F
F
F
F
Truth Values - Disjunction
Definition
If p and q are statement variables, the disjunction of p
and q is “ p or q” , denoted 𝑝 ∨ 𝑞. It is true when either p is
true, or q is true, or both p and q are true; it is false only
when both p and q are false.
𝒑
𝒒
𝒑∨𝒒
T
T
T
T
F
T
F
T
T
F
F
F
Truth Values – Exclusive Or
Truth Table for Exclusive Or
If p and q are statement variables, the Exclusive Or means ‘p or q but not
both” which translates into symbols as 𝑝 ∨ 𝑞 ∧ ~(𝑝 ∧ 𝑞). Also abbreviated
as p⨁𝑞 or 𝑝 𝑋𝑂𝑅 𝑞.
𝒑
𝒒
𝑝∨𝑞
𝑝∧𝑞
~ 𝑝∧𝑞
𝑝 ∨ 𝑞 ∧ ~(𝑝 ∧ 𝑞)
T
T
T
T
F
F
T
F
T
F
T
T
F
T
T
F
T
T
F
F
F
F
T
F
Logical Equivalence
Two statement forms are called logically equivalent if, and only if, they have
identical truth values for each possible substitution of statements variables.
The logical equivalence of statement forms P and Q is denoted by writing
𝑃≡𝑄
Test Whether Two Statement Form P and Q are Logically Equivalent
1. Construct a truth table with one column for the truth table values of P and
another column for the truth values of Q.
2. Check each combination of the statement variables to see whether the truth
value of P is the same as the truth value of Q.
Example 2:
Show that the statement forms ~
equivalent
𝒑∧𝒒
and
~𝒑 ∨ ~𝒒 are logically
𝑝
𝑞
~𝑝
~𝑞
𝑝∧𝑞
~ 𝑝∧𝑞
~𝑝 ∨ ~𝑞
T
T
F
F
T
F
F
T
F
F
T
F
T
T
F
T
T
F
F
T
T
F
F
T
T
F
T
T
Example 2:
Show that the statement forms ~
equivalent
𝒑∧𝒒
and ~𝒑 ∧
~𝒒 are not logically
𝑝
𝑞
~𝑝
~𝑞
𝑝∧𝑞
~ 𝑝∧𝑞
~𝑝 ∧ ~𝑞
T
T
F
F
T
F
T
F
F
T
F
T
≠
F
F
T
T
F
F
T
≠
F
F
F
T
T
F
T
F
T
De Morgan’s Law
De Morgan’s Laws
The negation of an and statement is
logically equivalent to the or statement
in which each component is negated.
The negation of an or statement is
logically equivalent to the and
statement in which each component is
negated.
~ 𝑝 ∧ 𝑞 ≡ ~𝑝 ∨ ~𝑞
~ 𝑝 ∨ 𝑞 ≡ ~𝑝 ∧ ~𝑞
De Morgan’s Laws
~ 𝑝 ∨ 𝑞 ≡ ~𝑝 ∧ ~𝑞
p
q
T
T
F
T
F
F
F
~𝑝 ~𝑞
𝑝∨𝑞
~(𝑝 ∨ 𝑞)
~𝑝 ∧ ~𝑞
F
T
F
F
F
T
T
F
F
T
T
F
T
F
F
F
T
T
F
T
T
Applying De Morgan’s Laws
• Write negations for each of the following
statements:
a. John is 6 feet tall and he weighs at least 200
pounds.
b. The bus was late or Tom’s watch was slow.
Solution:
a. John is not 6 feet tall or he weighs less than
200 pounds.
b. The bus was not late and Tom’s watch was not
slow.
Types of Compound Propositions
Tautology
• Always true!
• Always false!
Contingency
• Neither a tautology
Example 3:
Show that the statement forms p ∨ ~𝑝 is a tautology and the statement form p ∧
𝑝
~𝑝
p ∨ ~𝑝
p ∧ ~𝑝
T
F
T
F
F
T
T
F
If t is a tautology and c is a contradiction, show that p ∧ 𝑡 ≡ 𝑝 and p ∧ 𝑐 ≡ 𝑐
𝑝
𝒕
p∧𝑡
p
𝒄
p∧𝑐
T
T
T
T
F
F
F
T
F
F
F
F
Logical Equivalences
Commutative Law
Associative Laws
Distributive Laws
Identity Laws
Negation Laws
Double Negative Law
Idempotent Laws
Universal bound laws
De Morgan’s Laws
Absorption Laws
Negations of t and c:
Conditional Statements
Definition
If p and q are statement variables, the conditional of q by p is
“If p then q” or “p implies q” and is denoted by 𝑝 → 𝑞.
• It is false when p is true and q is false; otherwise it is true.
• We call p the hypothesis (or antecedent) of the
conditional and q the conclusion (or consequent)
𝒑
𝒒
𝒑→𝒒
T
T
T
T
F
F
F
T
T
F
F
T
𝒑 → 𝒒 ≡ ~p ∨ 𝑞
Negation of Conditional Statements
~(𝒑 → 𝒒)
≡
~(~𝒑 ∨ 𝒒)
≡
~(~𝒑) ∧ (~𝒒)
≡
𝒑 ∧ ~𝒒
~(𝒑 → 𝒒) ≡ 𝒑 ∧ ~𝒒
Contrapositive of Conditional Statements
Definition
The contrapositive of a conditional statement of the form “If
p then q” is
If ~𝑞 then ~𝑝
Or symbolically,
The contrapositive of 𝑝 → 𝑞 is ~𝑞 → ~𝑝
𝒑 → 𝒒 ≡ ~𝑞 → ~𝑝
Converse and Inverse of Conditional Statements
Definition
Suppose a conditional statement of the form “If p then q” is
given.
1. The converse is “ If q then p”
2. The inverse is “ If ~𝑝 then ~𝑞.”
Or symbolically,
The converse of p → q is q → p,
And,
The inverse of 𝑝 → 𝑞 is ~𝑝 → ~𝑞
Both are not logically
equivalent to 𝑝 → 𝑞 and to
each other!!!
Biconditional Statements
Definition
Given statement variable p and q, the biconditional of p and
q is “p if, and only if, q” and is denoted 𝑝 ↔ 𝑞.
•It is true if both p and q have the same truth values.
•It is false if p and q have opposite truth values.
•Note: 𝑝 ↔ 𝑞 is a short form for (𝑝 → 𝑞) ∧ (𝑞 → 𝑝)
•The word if and only if are sometimes abbreviated as iff.
𝒑
𝒒
𝒑↔𝒒
T
T
T
T
F
F
F
T
F
F
F
T
Example 4:
Given that the truth values for propositions P, Q and R are T, F and T respectively.
Determine the truth values of the following compound propositions:
(a) P  Q  ~ R
T  F ~ T  T  F  F  F  F  F
(b) ( P  Q)  (Q  R)
(T  F )  ( F  T )  F  T  F
(c) P  R  Q  R
T T  F T  T  T  T
Only If Statements
Definition
If p and q are statements,
p only if q means “if not q then not p”
Or equivalently,
“if p then q.”
John will break the world’s record for the mile run only if he
runs the mile in under four minutes.
• If John does not run the mile in under four minutes, then he will not
break the world’s record.
• If John breaks the world’s record, then he will have run the mile in under
four minutes.
Something to ponder…
p: It is a cat.
q: It is an animal.
Being an animal is a sufficient condition for being a cat.
NO
Being a cat is a sufficient condition for being an animal.
YES
𝑝→𝑞
If it is a cat then it is an animal
~𝑞 →~p
“p only if q”
If it is not an animal then it is not a cat
Being an animal is a necessary condition for being a cat.
Valid and Invalid Arguments
• An argument is a sequence of statements
• All statements in an argument, except the final one, are called
premises.
• The final statement is called the conclusion.
• The symbol ∴ which is read “therefore” is normally placed just
before the conclusion.
• To say that an argument form is valid means
• if the premises are all true,
• then the conclusion is also true.
An Invalid Argument Form
•
Solution:
T
T
T F
T
T
T
T
T
T
T
F T
T
F
T
F
F
T
F
T F
F
T
F
T
T
T
F
F T
T
F
T
T
F
F
T
T F
T
F
T
F
T
F
T
F T
T
F
T
F
T
F
F
T F
F
F
T
T
T
F
F
F T
T
F
T
T
T
Modus Ponens
If p then q.
p
∴q
If 4,686 is divisible by 6, then 4,686 is divisible by 3.
4,686 is divisible by 6.
∴ 4,686 is divisible by 3
Modus Tollens
If p then q.
~q
∴ ~p
If Zeus is human, then Zeus is mortal.
Zeus is not mortal.
∴ Zeus is not human.
Valid Argument Forms
--The End--
```