You are on page 1of 57

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


A proposition can contain variables.

Example:

If an integer x is a multiple of 6, then x is even.


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.

5. 5=2
Compound Statement

• The five connectives:


1. Negation (not …)
2. Conjunction (… and …)
3. Disjunction (… or …)
4. Implication / Conditional (if … then …)
5. Equivalence / Biconditional (… if and only if …)
Not/Negation ()
• Alters a single statement
• stand for “It’s not true that P”

Example:
P: The number 2 is even.
~P: It is not true that the number 2 is even.
~P: It is false that the number 2 is even.
~P: The number 2 is not even.
And / Conjunction (
• Used to combine 2 statements to form a new
statement.

Example:
P: The number 2 is even.
Q: The number 3 is odd.
R: The number 2 is even and the number 3 is odd.

Symbol:
Or / Disjunction(
• Used to combine 2 statements to form a new statement.
• means one or both P and Q is true
Can express in the form of:
• P or Q, but not both
• Either P or Q
• Exactly one of P or Q

Example:
P: The number 2 is even.
Q: The number 3 is odd.
R: The number 2 is even or the number 3 is odd.

Symbol:
Conditional statement/Implication (if … then …)

• Conditional statements created from 2 simpler


statements
• In the form of “If P, then Q” or “P implies Q”
• If statement P is true then Q must also be true.

Symbol: PQ
Example:
P: Ali pass the final exam.
Q: Ali pass the course.
If P then Q: If Ali pass the final exam then he pass
the course.
Other grammatical constructions mean exactly the
same thing as PQ:

• If P, then Q
• Q if P
• Q whenever P
• Q, provided that P
• Whenever P, then also Q
• P is a sufficient condition for Q
• For Q, it is sufficient that P
• Q is necessary condition for P
• For P, it is necessary that Q
• P only if Q
Biconditional statement (..if and
only if..)
• Biconditional statement follows (P Q) ˄ (Q P)
• (Q P) is read as P if Q and (P Q) as P only if Q
• mean P if and only if Q

Symbol
Example:
P: x is even
Q: x is divisible by 2
: Integer x is even if and only if x is divisible by
2.
There are many ways to say in English:

• P if and only if Q
• P is necessary and sufficient condition for Q
• For P it is necessary and sufficient that Q
• If P, then Q, and conversely
Hierarchy Among Logical Connectives
Example 1:
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.


Example 2:
Suppose that x is a particular real number. Let p,
q, and r symbolize , and , respectively. Write the
following inequality symbolically:
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 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
Truth Values: 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
Truth Values: 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:
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
Logical Equivalence
• The statements:
1) 6 is greater than 2
2) 2 is less than 6
are two different ways of saying the same thing.
• It has to do with the logical form of the
statements.
• Any two statements whose logical forms are
related in the same way as (1) and (2) would
either both be true or both be false.
Logical Equivalence

Example:
p: 6 is greater than 2
q: 2 is less than 6

• The statements forms


are logically equivalent or
we say that p and q are
logically equivalent
Statements.
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.
 If in each row the truth value of P is the same as the truth value of Q, the P
and Q are logically equivalent
 If in some row P has a different truth value from Q, the P and Q are not
logically equivalent.
Example 1:
Show that the statement forms and are logically equivalent

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 and are not logically equivalent

T T F F T F F
T F F T F T F
F T T F F T F
F F T T F T T
Logical Equivalence:
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.
Logical Equivalence:
De Morgan’s Laws

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

• Since the truth values are identical, are logically equivalent to .


Applying De Morgan’s Laws
• Write negations for each of the following
statements:

• John is 6 feet tall and he weighs at least 60 kg.


John is not 6 feet tall or he weighs less than 60
kg.

• The bus was late or Chan’s watch was slow.


The bus was not late and Chan’s watch was not
slow.
Neither was the bus late nor was Chan’s watch
slow.
Applying De Morgan’s Laws:
A Cautionary Example
• According to De Morgan’s Law the negation of
p: Chan is tall and Chan is an athlete.
~p : Chan is not tall or Chan is not an
athlete.

But, if statement p written as,


p’: Chan is tall and an athlete.
~(p’): Chan is not tall and an athlete.

Doesn’t this violate De Morgan’s Law??


Types of Compound Propositions
Tautology • Always true!

Contradiction • Always false!

• Neither a tautology
Contingency
nor a contradiction
Example 1:
Show that the statement forms is a tautology and the statement form
is a contradiction.

T F T F
F T T F

If t is a tautology and c is a contradiction, show that and

T T T T F F
F T F F F F
Summary of 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:
Simplifying Statement forms
Example 1:
• Using logical equivalences theorem verify:

by De Morgan’s Law
by Double Negative Law
by Distributive Law
by Commutative Law
by Negation Law
by Identity Law
Negation of Conditional Statements

Example:

Write negation for the following statement:

• If my car is in the workshop, then I cannot get to work.


 My car is in the workshop and I can get to work.
Contrapositive of Conditional Statements

Definition
The contrapositive of a conditional statement of the form
“If p then q” is

If then

Symbolically,

The contrapositive of is
Example:
Write each of the following statement in its
equivalent contrapositive form.
a) If it rains, then they cancel school.

If they do not cancel school, then it does not


rain.
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 .”

Symbolically,
The converse of is ,

The inverse of is

Both are not logically


equivalent to but logically
to each other.
Truth Tables of Conditional Statement and
its Contrapositive, Converse and Inverse
Example:
Write the converse and inverse of the following
statement:
a) If it rains, then they cancel school.

Converse: If they cancel school, then it rains.

Inverse: If it does not rain, then they do not cancel


school.
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.”

Example:

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.
Necessary and Sufficient Condition
• Necessary condition and Sufficient condition
used in formal English

• In other words, “r is a sufficient condition for s”


means the occurrence of r is sufficient to
guarantee the occurrence of s.
• For “r is necessary condition for s” means if r
does not occur then s cannot occur either.
• Since there is equivalence between a statement
and its contrapositive, so
Example:
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.
Example:

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
Rule of Inference
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.
Example:
• Using the Rule of Inference, to deduce
conclusion from given premises.
𝑝 ∧ 𝑞 , 𝑟 → 𝑝 , 𝑟 → 𝑠 , 𝑠 → 𝑡 , ∴𝑡

You might also like