You are on page 1of 65

Unit1: Logic

• Proposition
• Compound Proposition
• Negation of a Compound Proposition
• Conditional
• Biconditional
• Tautology and Contradiction
• Quantifiers
• Axiom, Theorem, Proof
Logic is often defined as the science of thinking and reasoning correctly.

In algebra, letters are used to present numbers.

In logic, letters are used to represent propositions.

Mathematical logic establishes the language for mathematics and


determines whether a given mathematical expression in true or not.
Propositon: A proposition is a declarative statement that is either true or false,
but not both.
Propositons are usually represented by the letters p, q, r.

p: Today is Saturday.

q:1 + 3 > 7
There are other types of sentences that cannot be
assigned a true or false value.
The sentence “I am lying to you” is one example.
This is known as paradox.
Ex: State whether the following statements are proposition or not.

a. Dogs have 6 legs Proposition


b. She is a beautiful girl. Not Proposition
c. Is this yours? Not Proposition
d. Come here. Not Proposition
e. 2 + 2 = 5 Proposition
Truth Value
The truth or falsity of a propostion is called the truth value of the
proposition.

If a proposition is
true, then its truth value is 1.
false, then its truth value is 0.
Equivalent Logical Statements: Logical statements are considered equivalent
if they have the same truth value.

Ex: Find the equivalent statements from the following statements. p and r

p: A quadrilateral has 4 sides True


q: 1+5=7 False
r: Pencil is used for writing True
Truth Table
The table on which all the truth values of the propositions are shown is
called the truth table.
p p q p q r
1 1 1 1 1 1

0 1 1 0
0 0

1 0 1 0 1

0 0 1 1
1
1 0 0

0 0 1

0 1 0

0 0 0
Challenge question: If there are n
propositions, then find the number of
rows on the truth table. n
2
Negatiton: the negation when applied to a proposition p, changes the truth
value of p. Denoted by 𝑝! 𝑜𝑟 ~𝑝, read by not 𝑝.

Ex: 𝑝 : 1+3=5 𝑝 𝑝!
1 0

𝑝! : 0 1
Ex: Write the negation of given symbols
Symbol Negation
= =


≤ bigger

≥ smaller

< equal or bigger than equal

∈ E

⊂ C
Compound Proposition: A proposition which is formed from two or
more propositions by using connective words.
(and, or, if then, if and only if)

and
Conjuction(and, ∧ ): A conjunction is a compound proposition formed by
combining two propositions using the word “and”.(and, ∧ )
Ex:
𝑝: Mom promises: I will take you to the cinema and I will buy a box of popcorn
Discuss its truth values for different cases. 4
𝒑 𝒒 𝒑L𝒒

1 1 1

0
1 0

0 1 0

0 0 0
Ex: Find 𝑝L𝑝! and 𝑝L𝑝 (make a truth table)
p p’ p^p’ p^p

1 0 0 1

0 1 0 0
Disjunction (or,v) : A disjunction is a compound proposition formed by
combining two propositions using the word “or”.(or,v)
Ex:
𝑝: Mom promises: I will take you to the cinema or I will buy a box of popcorn
Discuss its truth values for different cases.
𝒑 𝒒 𝒑v𝒒

1 0 1

1 1 1

0 1 1

0 0 0
Ex: Find 𝑝 v 𝑝! and 𝑝 v 𝑝 (make a truth table)

p p’ p v p’ pvp

1 0 1 1

0 1 1 0
Ex: Make a truth table for (𝑝 ∧ 𝑞)′ and p′v q′.

p q p’ q’ p^q (p^q)’ p’v q’ (p^q)’ ^p’vq’

1 0 0 1 0 1 1 1

0 1 1 0 0 1 1 1

1 1 0 0 1 0 0 0

0 0 1 1 0 1 1 1
Ex: Find the result of (1 ∧ 1) ∨ 0 ∧ 0 ∨ 1
Ex: Simplify
𝑝′ ∨ (𝑞 ∨ 𝑝)
Either or (⋁) :
Ex: Mom promises: I will either take you to the cinema or I will buy a box of
popcorn. I don’t have enough for both.
Discuss its truth values for different cases.
𝒑 𝒒 𝒑⋁𝒒

0 1 1

0 0 0

1 0 1

1 1 0
Ex: If 𝑝 ≡ 𝑞, 𝑝⋁ 𝑞′ ≡ 1, then find the truth value of

𝑝! ⋁𝑞 ! ∨ 𝑞′ ∧ 𝑝
Properties of ∧ and ∨
De Morgan’s Law: Prove each of the following properties by
constructing truth table.

!
𝑝∨𝑞 = 𝑝′ ∧ 𝑞′
!
𝑝∧𝑞 = 𝑝′ ∨ 𝑞′
Commutative Property

𝑝∨𝑞 ≡𝑞∨𝑝
𝑝∧𝑞 ≡𝑞∧𝑝
𝑝 ⋁ 𝑞 ≡𝑞⋁𝑝
Associative Property
(𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟)
𝑝∧𝑞 ∧𝑟 ≡𝑝∧ 𝑞∧𝑟
(𝑝 ⋁ 𝑞) ⋁ 𝑟 ≡ 𝑝 ⋁ (𝑞 ⋁ 𝑟)
Idempotent Property

𝑝∨𝑝 ≡𝑝
𝑝∧𝑝 ≡𝑝
Distributive Property
(𝑝 ∧ 𝑞 ∨ 𝑟 ) ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟)
Conditional(⇒): A conditional is a statement of the form ” if……. then…..” and often
read as “p implies q”
Ex: Mom promises
If I catch the early metrobus home, I’ll take you to shopping.
Discuss the truth values for different cases.
𝒑 𝒒 𝒑Þ𝒒

1 0 0

1 1 1

0 1 1

0 0 1
Ex: Prove p Þ q º p’ Ú q by using truth table.

p q p

1 1 0 1 1

0 1 1 1 1

1 0 0 0 0

0 0 1 1 1
Variations of Conditional

Conditional(original): 𝑝 ⇒ 𝑞 If x is divisible by two, then it is an even number.

Converse: q ⇒ 𝑝 If it is an even number., then x is divisible by two.

Inverse: 𝑝! ⇒ 𝑞 ! If x is not divisible by two, then it is not an even number.

Contrapositive:q′ ⇒ 𝑝′ If it is not an even number., then x is not divisible by two.


Ex: Write the converse, inverse and contrapositive statements of the give
their their truth values.
a. If x is divisible by 2 then it is an even number.
If a number ends in an even number, then the number itself is an even number.
If the number itself is an even number, then a number ends in an even number.
If a number doesn’t end in an even number, then the number itself is not an even number.
If the number itself is not an even number, then a number doesn’t end in an even number.
b. If a number ends in an even number then the number itself is an even
number.

If a number ends in an even number, then the number itself is an even number.

If the number itself is an even number, then a number ends in an even number.

If a number doesn’t end in an even number, then the number itself is not an even number.

If the number itself is not an even number, then a number doesn’t end in an even number.
Prove the following properties by constructing truth tables.
simplify

Properties
1. 𝑝 ⇒ 𝑞 ≡ 𝑝′ ∨ 𝑞

2. (𝑝 ⇒ 𝑞)′ ≡ 𝑝 ∧ 𝑞′
3. 𝑝 ⇒ 𝑞 ≡ 𝑞′ ⇒ 𝑝′
Tautology: If all results are ‘1’(all true), then it is called a tautology.

Contradiction: If all results are ‘0’(all false), then it is called a


contradiction.
Ex: Show that 𝑝 ⇒ 𝑞 ⇒ 𝑝 is a tautology by constructing a truth table .
Ex: Show that 𝑝 ⇒ 𝑞 ∧ 𝑝 ∧ 𝑞 ! is a contradiction by constructing a truth
table .
Ex: Prove that (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑞 ! ) ∨ 𝑝′ is tautology by applying the properties.
Ex: Prove that 𝑝 ∧ (𝑝! ∨ 𝑞) ∧ (𝑞 ∧ 𝑝)′ is a contradiction by applying the
properties.
Ex: If 𝑝! ∧ 𝑞 ∧ (𝑠 ∨ 𝑞 ! ) is true, then find the truth values of 𝑝, 𝑞, 𝑎𝑛𝑑 𝑠.
Ex: Simplify

a. 𝑝! !

b. 𝑝! ∧ 𝑝

c. 𝑝′ ∨ 𝑝
Ex: If 𝑝 ⇒ (𝑞 ! ∨ 𝑟) ≡ 0, then find the truth value of
𝑝 ∧ 𝑞 ⇒ 𝑟 ∨ (𝑝 ∧ 𝑞′)
Ex: Simplify the followings by using properties.
a. (p! ⇒ q) ∨ q!

b. (p! ⇒ q)! ⇒ p!
Ex: If (p ⇒ q)′ ∧ r′ ≡ 1 then find the truth value of (p ⇒ q) ⇒ (q ⇒ r)
Biconditional Statement(⇔): The statement “p if and only if q” is called the
biconditional.
p Û q º ( p Þ q)Ù (q Þ p)
𝒑 𝒒 𝒑Û𝒒
Ex: Find the truth values of the given compound propositions.

a. (0 ⟺ 1)! ⟺ 0!

b. (1 ⇒ 1)! ⟺ (0 ∨ 1)!
Mathematical Quantifiers
In our daily conversations we use some words such as some, all, every, each, at least,
there exists, etc. These are named as quantifiers because each indicates quantity.

Examples;
All insects have four legs.

Some turties live in the water.

Every triangle has three sides.


∀𝒙 ∃𝒙

ALL SOME

EVERY AT LEAST

EACH THERE EXISTS

FOR ALL
Ex: Find the truth value of each proposition.

a. Some apples are green

b. Every number is prime

c. All months have 30 days

d. Some prime numbers are odd


Open sentence: Statements containing one or more variable that become propositions
when the value of the variable is substituted are called open sentence.

Let P be an open proposition which contains one variable. If P becomes true when the
term x is substituted for the variable, then P can be denoted by P(x) or Px

𝑃𝑥: 𝑥 + 6 > 5, 𝑥 is a real number

𝑃𝑥: is ……(T/F) when x is replaced by 1


𝑃𝑥: is ……(T/F) when x is replaced by -10
Ex: Complete the following table

Using words Using Symbol

Square of some real numbers is positive

One more than a number greater than 2 or equals to 2 for all integer numbers. ∀𝑥 ∈ 𝑍, 𝑥 + 1 ≥ 2

4 more than twice of a number is less than six for all


natural numbers
One less than three times of a number is less than or equals to 0 for some natural ∃𝑥 ∈ 𝑁, 3𝑥 − 1 ≤ 0
numbers.
Ex: Discuss whether the following each proposition is true or false for the real
number x.

a. ∃𝑥 ∈ 𝑍, 𝑥 " < 18 Square of some integers is smaller than 18. True

b. ∀𝑥 ∈ 𝑅, (𝑥 − 1)" > 0 Square of one less than a number is greater than 0 for all the real numbers. False

c. ∃𝑥 ∈ 𝑅, 𝑥 " < 𝑥 Square of some real numbers is smaller than themselfs. True

#
d. ∀𝑥 ∈ 𝑅, # = 1 If we divided all real numbers by themselfs, it will equal 1. False
Negation of Quantifiers
Symbol Negation

∀ ∃

∃ ∀

∃𝑥, 𝑃(𝑥) ∀𝑥, 𝑃′(𝑥)

∀𝑥, 𝑃′(𝑥) ∃𝑥, 𝑃(𝑥)


Ex: Find the truth value and negate each of the following sentences
1. "𝑥 ∈ 𝑅 ; 𝑥2³ 0

2. ∀𝑥 ∈ 𝑍, 2𝑥 + 4 = 6

3. (∃𝑥 ∈ 𝑅 ; 𝑥 > 3) ∧ (∀𝑥 ∈ 𝑅 ; 𝑥 " + 1 ≤ 6)


4. ∀𝑥 ∈ 𝑁, ∃𝑦 ∈ 𝑍, 𝑦 " + 2𝑥 ≥ 0

5. (∃𝑥 ∈ 𝑅, 2𝑥 + 3 = 0) ∨ (∀𝑥 ∈ 𝑅, 𝑥 " ≥ 𝑥 ⇒ (∀𝑥 ∈ 𝑅, 𝑥 " − 𝑥 = 0)


Axiom, Theorem, Proof
Axiom is a proposition that is accepted as true without proof. An axiom is also
called a postulate.
Theorem is a statement whose truth can be proved on the basis of a given set of
axioms or assumptions.

In general, theorems are in the form of 𝑝 ⇒ 𝑞.


The first part of the theorem is known as hypothesis and the second part known as
conclusion.
Types of Proof
Direct Proof: We use it to prove statements in the form of 𝑝 ⇒ 𝑞

Direct proof has the following steps:


• Assume the statement 𝑝 is true.
• Use what we know about 𝑝 and other facts as necessary to deduce that another
statement 𝑞 is true, that shows 𝑝 ⇒ 𝑞
Ex: Prove that ”the sum of two odd integers is an even number”
Ex: Prove that if k is an odd integer then 𝑘 " + 𝑘 # − 𝑘 − 1 is divisible by 8.
Ex: Prove that (𝑎 + 𝑏)#− 𝑎 − 𝑏 # = 4𝑎𝑏

You might also like