0% found this document useful (0 votes)
69 views73 pages

Topic 1 Logic and Proof

This document provides an overview of logic and proofs. It defines statements as sentences that are either true or false. It discusses simple and compound statements. It introduces five common logical connectives - negation, conjunction, disjunction, implication, and equivalence. It explains how to construct truth tables and determine logical equivalence of statements. It also discusses quantifiers like universal and existential, and how to express statements using quantifiers. It provides examples of negating statements involving quantifiers. Finally, it includes some exercises for students to practice applying the concepts.

Uploaded by

Jocelinyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views73 pages

Topic 1 Logic and Proof

This document provides an overview of logic and proofs. It defines statements as sentences that are either true or false. It discusses simple and compound statements. It introduces five common logical connectives - negation, conjunction, disjunction, implication, and equivalence. It explains how to construct truth tables and determine logical equivalence of statements. It also discusses quantifiers like universal and existential, and how to express statements using quantifiers. It provides examples of negating statements involving quantifiers. Finally, it includes some exercises for students to practice applying the concepts.

Uploaded by

Jocelinyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 73

TOPIC 1: LOGIC

AND PROOF
Semester 1 Session 2020/2021
1.1 LOGIC
Objectives:
Students should be able to:

• Define statements (simple and compound statements)


• Construct truth tables of statements
• Determine whether two compound statements are logically
equivalent
• Negate a statement
What is a statement? (1/2)
A statement is a sentence that is either definitely true (T) or false (F).

Example 1: Decide whether or not the following are statements. In the


case of a statement, say if it is true or false.
a) Kuala Lumpur is the capital of Malaysia Statement. True.
b) 5>6 Statement. False.
c) x+1=2 Not a statement.
d) Hello! Not a statement.
What is a statement? (2/2)
A statement is divided into two types:

Simple Compound
A simple statement is A compound statement is
such as: a combination of two or
a) Kuala Lumpur is the more simple statements.
capital of Malaysia
b) 5>6
Connectives (1/5)
•There
  are five common connectives:

1. Negation (this symbol is called tilde) or or


2. Conjunction
3. Disjunction
4. Implication
5. Equivalence or
Connectives (2/5)
•1.  Negation
Example 2: Let p be the statement “I am 8 feet tall”. What is the negation of
p?
Solution: The negation of p (denoted by p) is “I am not 8 feet tall”.

2. Conjunction
Example 3: Let p be the statement “They are talking” and q be the statement
“The door is closed”. Write the conjunction statement.
Solution: The conjunction statement (denoted by p q) is “They are talking and
the door is closed”.
Connectives (3/5)
•  Disjunction
3.
Example 4: Let p be the statement “A policeman has to cross a river using a small boat”
and q be the statement “A thief has to cross a river using a small boat” Write the
disjunction statement.
Solution: The disjunction statement (denoted by p q) is “Either a policeman or a thief has
to cross a river using a small boat”.

4. Implication
Example 5: Let p be the statement “You participate in class” and q be the statement “You
will get extra points”. Write the implication statement p q.
Solution: The implication statement p q is “If you participate in class then you will get
extra points”.
Connectives (4/5)
The implication statement is also called the conditional statement. In
the “If…then” statements, the “if-part” is called the antecedent while
the “then-part’ is called the consequent. Other ways to say “If you
participate in class then you will get extra points” are

“You participate in class only if you will get extra points” or


“You will get extra points if you participate in class” or
“You participate in class implies you will get extra points”.
Connectives (5/5)
•5.  Equivalence
Example 6: Let p be the statement “He will push button A” and q be the
statement “The red light flashes”. Write the statement pq.
Solution: The statement pq is “He will push button A if and only if the
red light flashes”.

The statement pq is called equivalence or bi-conditional where it is a


combination of two conditionals: pq and qp. For example, the solution of
Example 6 is actually the same as saying “He will push button A if the red
light flashes and He will push button A only if the red light flashes”.
Note: The usage of “only if” is not the same as “if”. Do not confuse with English sentences.
Quantifiers (1/5)
Consider this sentence:
X plays the piano.
This sentence is not a statement because we cannot determine
whether it is true or false. This sentences has a variable and therefore it
is called a Predicate.
Let us denote the sentence “X plays the piano” as U(x).
Compare U(x) with this sentence:
Ahmad plays the piano.
Quantifiers (2/5)

That sentence is definitely a statement and it actually replaces “x” with


the word “Ahmad”. Hence we denote the statement as U(Ahmad). Note
that U(x) is not a statement but U(Ahmad) is.

A predicate is not a statement. If the variables in the predicate is


specified (being given a quantity or a name), then the predicate
becomes a statement. We can use quantifiers to specify the variables
in a predicate.
Quantifiers (3/5)
There are two types of quantifiers:

Universal Existential
“For
“For all”
all” or
or “There
“There exists
exists a”
a” or
or
“For every” ”There is a” or
“There
“There is
is at
at least
least one”
one”
Quantifiers (4/5)
•Universal
  •   symbols:
Some
N: Set of positive integers = {1, 2, 3, 4, 5, 6, …,
Example 7: Let P(x) be “x is even” 100, 101, 102, …}
Express the following statement in
symbolic form. R: Set of real numbers = ()
“For all integer x, x is even”
Z: Set of integers = {…, -2000, -1999, -1998,
-1997, -1996, …, 0, 1, 2, 3, 4, …, 1996, 1997, …}
Solution: x Z, P(x).
Q: Set of rational numbers = any numbers that
can be written as where and are integers with
.
Quantifiers (5/5)
•Existential
  •   symbols:
Some
N: Set of positive integers = {1, 2, 3, 4, 5, 6, …,
Example 8: Let Q(x) be “x < 4”. 100, 101, 102, …}
Express the following statement in
symbolic form. R: Set of real numbers = ()
“There is a real number x such
that x <4” Z: Set of integers = {…, -2000, -1999, -1998,
-1997, -1996, …, 0, 1, 2, 3, 4, …, 1996, 1997, …}

Solution: x R, Q(x). Q: Set of rational numbers = any numbers that


can be written as where and are integers with
.
Negation of a statement involving a quantifier
(1/4)
• 
Let say we have a statement:
All actress are singers.
The negation of the above statement is:
There is at least one actress who is not a singer.

What is the negation of x P(x)?


The negation of x P(x) is x P(x).
Negation of a statement involving a quantifier
(2/4)
• 
Example 9: Let P(x) be “x is even”. Express negation of x Z, P(x) in
sentence.
Solution: Negation of x Z, P(x) is x P(x).

In sentence, the negation is written as,


“There is an integer x such that x is not even (or x is odd)”.
Negation of a statement involving a quantifier
(3/4)
• 
Let say we have a statement:
There is at least one international undergraduate student in UKM Bangi
campus.
The negation of this statement is:
All international undergraduate students are not in UKM Bangi campus.

What is the negation of x Q(x)?


The negation of x Q(x) is x Q(x).
Negation of a statement involving a quantifier
(4/4)
• 

Example 10: Let Q(x) be “x0”. Express the negation of x N, Q(x) in


sentence.

Solution: Negation of x N, Q(x) is x N, Q(x). In sentence, the negation


is written as “For all integer positive x, x > 0”.
Exercises 1 (1/2)
•1.  Decide whether the following are statements. In the case of a
statement, say if it is true or false.

a) Today is raining Statement. The truth value depends on whether or not it is raining today.
b) For every real number x, x > 2  Statement. False. There exist a real number x such that x 2.
Not a statement
c) x 3
Not a statement
d) Please open that door
Statement. The truth value depends on whether you are a good student or
e) I am a good student not.
Statement. True.
f) There is a positive integer x such that x 2
Exercises 1 (2/2)
2. Express each statement in symbolic form.
 p q (p = my parents are out of town,
q = my parents are visiting my sick neighbor)
a) Either my parents are out of town or visiting my sick neighbour
b) If it rains, then he will not come  p q (p = it rains, q = he will come)
c) I will score A if and only if I study hard  p q (p = I will score A, q = I study hard)
d) For all integer a, 2a – 1 is odd  a Z, P(a) (P(a) = 2a - 1 is odd)
e) There is a real number y such that 2099 < y < 2100
 y R, Q(y) (Q(y) = 2099 < y < 2100)
Truth Tables

Truth tables are tables giving all possible truth values of statements.

Assertion
Proposition
Truth Tables - Negation
A statement and its negation have opposite truth values.

p p
T F
F T
Truth Tables - Conjunction
•A  conjunction p q is True only when p and q are both True.
2n=8
p q pq
T T TT=T
T F T=F
F T FT=F
F F F=F

p q r pqr
T T T T=T
T T F T=F
T F T T= F
T F F pqr
Truth Tables - Disjunction
•A  disjunction p q is False only when p and q are both False.

p q pq
T T T
T F T
F T T
F F F
Truth Tables - Implication
•Implication
  p q is only False when q is False given that p is True.
(pq) = pq
p q pq
T T T
T F F
F T T
F F T

p q p q (pq) pq
T T F F (T) =T FT=T
T F F T (T) = F F=F
F T T F (F) = T TT=T
F F T T (F) = T T=T
Truth Tables – Bi-conditional
•Bi-conditional
  p q is True when p and q are both True or are both False.

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

p q pq qp (pq) (qp)=
pq
TT TT TT TT T T=T
T F F T FT=F
T F F T
F T T F T =F
F T T F
Logically Equivalent (1/3)
• 
Two compound statements are called logically equivalent if they have
the same truth value every possible truth value assignment to the
component statements.

Example 11: Determine whether p q is logically equivalent to


q p.
Logically Equivalent (2/3)
Solution:
Step 1: Construct truth tables for each statement

p q p q pq 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
Logically Equivalent (3/3)
• 
Step 2: Compare the truth values

The statements pq and qp have the same truth values.

Therefore, pq is logically equivalent to qp.


Exercises 1.1
•1.  Determine whether pq is logically equivalent to p q.
 
pq is logically equivalent to p q (Follow steps as in Example 11)
2. Determine whether pq is logically equivalent to p q.
 
pq is not logically equivalent to p q (Follow steps as in Example 11)
3. Negate the following statements
a) For every positive integer r, r > 1  There exist a positive integer r such that r 1
b) There is a real number y such that 0 < y < 1 y is not in the interval (0, 1) for all real
c) 5 > 1 and 1 > 0  5 1 or 1 0 numbers y
p q q pq p q
T T F T T F=F
T F T F T T=T
1.2 PROOF
Objectives:
Students should be able to:

• State the differences between a theorem, a proof and a definition


• Construct simple proofs using direct proof method
• Construct simple proofs using contrapositive proof method
• Construct simple proofs using proof by contradiction method
• Construct simple proofs using proof by mathematical induction method
Mathematical terms that you should know
Theorem: A mathematical statement that is true and has been proved
to be true.

Proof a theorem: A written verification that shows that the theorem is


definitely true.

Definition: An exact, unambiguous (no double interpretations)


explanation of the meaning of a mathematical word or phrase.
Mathematical Proof

“It is an inferential argument for a mathematical statement, showing


that the stated assumptions logically guarantee the conclusion.”
 

Methods of Proving Imp


(an licatio
t
con ecede n
s eq n
uen t
t)
•  Many mathematical theorems are either conditional or bi-conditional
statements.
• This notes will cover only theorems in conditional (i.e. pq ) form. Bi-
conditionals can be proved by first prove pq and then prove qp.
• There are four methods of proving:
• Direct proof
• Contrapositive Proof  
• Proof by Contradiction (pq)(qp)

• Proof by Mathematical Induction


Implication statement is a
mathematical statement that

Direct Proof (1/4) is true and has been proved


to be true.

•   say we have theorem which is conditional form pq. Outline of direct proof is given
Let
by
Theorem: Statement “pq“
Proof: Suppose “p”
.  
Proposition p is a written
verification that shows that
.
the theorem pq is definitely
. true.
Therefore “q”.

From the outline, firstly we assume that p is True. By using this assumption and other
mathematical knowledge, we prove that q is also True.
Direct Proof (2/4)
•“It
  is a way of showing the truth or falsehood of a given statement by a
straightforward combination of established facts, usually axioms,
existing lemmas and theorems.”

“Assume the statement p is True.


Use what we know about p and other facts as necessary to deduce that
another statement q is True.
And that shows pq.”
Direct Proof (3/4)
•Example
  1: Prove that if x is odd then x2 is odd.
Solution:
Implication statement
Step 1: Write the statement in symbol.

p: x is odd
q: x2 is odd
Statement: “pq“

theorem
Direct Proof (4/4)
Step 2: Use Direct Proof outline to prove the statement.
Proof: Suppose “x is odd”. p
Since x is odd, x can be written as
x=2k+1 where k is an integer
x2=(2k+1)(2k+1)
= 4k2+4k+1
=2(2k2+2k)+1 m is an
integer
2k2+2k is an integer, say 2k2+2k=m.
x2 can also be written as x2=2m+1.
Therefore, “x2 is odd”.
Back to
Example 8
Contrapositive: negating

Contrapositive Proof (1/3) both statement & reversing


the direction of the
statements

•pq  is logically equivalent to q p. You may verify this by using a truth table.
Outline of contrapositive proof is given by
Theorem: Statement “pq”
Proof: Suppose “q” p q p q pq q p
T T F F TT=T FF=T
.
T F F T TF=F TF=F
. F T T F FT=T FT=T
. F F T T FF=T TT=T
Therefore “p”.
From the outline, firstly we assume that q is True. By using this assumption and
other mathematical knowledge, we prove that p is also True.
Contrapositive Proof (2/3)
•Example
  2: Prove that if x2-6x+5 is even then x is odd.
Solution:
Implication statement

Step 1: Write the statement in symbol.


p: x2-6x+5 is even
q: x is odd
Statement: “pq”
Contrapositive Proof (3/3)
Step 2: Use Contrapositive Proof outline to prove the statement.
Proof: Suppose ”x is even”. Negating q
: x is odd
Since x is even, x can be written as
x=2k, k is an integer
p x2-6x+5=(2k)2-6(2k)+5
=4k2-12k+4+1
=2(2k2-6k+2)+1
2k2-6k+2 is an integer, let say 2k2-6k+2=n.
x2-6x+5 can be written as x2-6x+5=2n+1.
Therefore, “x2-6x+5 is odd”. Negating p
  q p : x2-6x+5 is even
Proof by Contradiction (1/9)
•For
  proof by contradiction, the theorem is assumed to False which
means that the
p
statementq
pq is assumed
q
to be(pq)
False. pq
T pq T F F (pq) F
TT T FF TT TT F TT
F T F F F
F F T F F T F
F F T F F
F F T F F
From the above table (last row), pq False is the same as (pq)
True. (pq) is logically equivalent to pq. You may verify this using a truth
table.
  pq
(pq)
pq
Proof by Contradiction (2/9)
•Outline
  of proof by contradiction is given by
Theorem: Statement “pq”
Proof: Suppose “(pq)” (which is logically equivalent to “p q”)
.
Negation :
contradiction .
Contradiction.
From the outline, firstly we assume that pq is False which is the same as saying
that (pq) is True.
By using this assumption and other mathematical knowledge, we must get a
contradiction. The contradiction shows that the statement pq is indeed True.
Proof by Contradiction (3/9)
Example 3: Prove that if x2 – 6x + 5 is even then x is odd by using the
method of proof by contradiction.

Solution:
Step 1: Write the statement in symbol
p: x2 – 6x + 5 is even
q: x is odd
Statement: “p  q”
Proof by Contradiction (4/9)
Step 2: Use Proof by Contradiction outline to prove the statement.
Proof: Suppose the statement “if x2 – 6x + 5 is even then x is odd” is
False.
This is logically equivalent to x2 – 6x + 5 is even and x is even.
Since x is even, x can be written as
 
x = 2k, k is an integer pq pq

x2 – 6x + 5 = (2k)2 – 6(2k) + 5
= 4k2 – 12k + 4 + 1
= 2(2k2 – 6k + 2) + 1
Proof by Contradiction (5/9)

2k2 – 6k + 2 is an integer, let say 2k2 – 6k + 2 = n.


x2 – 6x + 5 can be written as x2 – 6x + 5 = 2n + 1.

This means that x2 – 6x + 5 is odd which contradicts the assumption


that x2 – 6x + 5 is even.
This contradiction shows that the statement “if x2 – 6x + 5 is even then
x is odd” is indeed True.
Proof by Contradiction (6/9)
Remark:
The method of proof by contradiction is not just limited to prove
conditional statement. It can be used to prove any kind of statement.
General outline for proof by contradiction is given by
Statement: “p”
Proof: Suppose “~p”.
:
Contradiction. 
Proof by Contradiction (7/9)
•Example
  4: Prove that the number is irrational.
Solution:
Step 1: Let p be the statement “ is irrational”.
Step 2: Use the General outline for Proof by Contradiction to prove the
statement.
Proof: Suppose “ is rational”.
Since is rational, we can write
where and are integers with 0.
Proof by Contradiction (8/9)
•Let
  us assume that a and b have no common factors other than 1, for if
they have, the factors will be cancelled out.
2=
2b2= a2 implies that a2 is even. Thus, a2 is even.

Since a is even, a can be written as


a = 2k where k is an integer.
Proof by Contradiction (9/9)
•So,
 
2b2=(2k)2
2b2=4k2
b2=2k2 implies that b2 is even. Thus, b is even.

Since a and b are even, they have a common factor is 2. This is a


contradiction to the fact that a and b have no common factors other
than 1. Hence, is indeed an irrational number.
Proof by Mathematical Induction (1/18)
•Principle
  of mathematical induction is used to prove the statement “x 
N, P(x)”. The outline of the principle of mathematical induction is given by
Statement: “x  N, P(x)”
Proof:
1. Basic step
Prove “P(1)” is True.

2. Inductive step
Prove “P(k)P(k+1)” is True using Direct Proof method.
Proof by Mathematical Induction (2/18)
•  2. Inductive step
Prove “P(k)P(k+1)” is True using Direct Proof method.
So, the outline is
Suppose “P(k)”
.
.
Therefore “P(k+1)”
P(1) is True.
P(k) P(k+1) is True.
Therefore P(x) is True for all x N.
Proof by Mathematical Induction (3/18)
•Example
  5: Prove that 1 + 3 + 5 + 7 + …+ (2n – 1) = n2 for all n  N.
Solution:
Step 1: Write the statement in symbol.
P(n):1+3+5+7+…+(2n-1)=n2
Statement: “n N, P(n)”

Note that the predicate P(n) is an equation where the left side of the
equation is a series, while the right side of the equation is the sum of
the series (i.e. n2).
Proof by Mathematical Induction (4/18)

P(n): 1+3+5+7+…+(2n-1) = n2

Left side (series) Right side (sum of series)

“1+3+5+7+…+(2n-1)” is an arithmetic series where the first term T1 is


“1”, the second term T2 is “3”, the third term T3 is “5” … and the nth
term Tn is “2n-1”.
Proof by Mathematical Induction (5/18)
Step 2: Use the outline of the principle of mathematical induction to prove the statement.
Proof:
1. P(1): 1 = 12 is a True statement.
2. P(k): “1+3+5+7+…+(2k-1) = k2”
P(k) P(k+1): 1+3+5+7+…+(2k-1)+(2(k+1)-1) = (k+1)2

Suppose “1+3+5+7+…+(2k-1)=k2”
1+3+5+7+…+(2k-1)+(2(k+1)-1) = k2+(2(k+1)-1)
P(k+1), left =k2+2k+2-1
side
=k2+2k+1
=(k+1)2
Therefore “1+3+5+7+…+(2k-1)+(2(k+1)-1) = (k+1)2
Proof by Mathematical Induction (6/18)
• 

P(1) is True.
P(k)P(k+1) is True.
Therefore P(n) is True for all n N.
Proof by Mathematical Induction (7/18)
•Example
  6: Concerning the Fibonacci sequence, prove that for all positive integers
n.
Solution:
The Fibonacci Sequence is the sequence of numbers:
1, 1, 2, 3, 5, 8, 13, 21, 34, …

First term is fixed to be 1.


Second term is also fixed to be 1.
Third term
=1+1=2
Proof by Mathematical Induction (8/18)
• 

Fourth term
=1+2=3
Fifth term
=2+3=5
So, nth term .
Proof by Mathematical Induction (9/18)
• 
Step 1: Write the statement in symbol.

P(n):
Predicate P(n) is
an equation with
left and right side
Statement: “”.
Proof by Mathematical Induction (10/18)
•Step
  2: of the principle of mathematical induction to prove the statement.
Proof:   P(n):

1. P(1):
To prove P(1) is True, we must show that the left side of P(1) is equal to the
right side of P(1).
Left side:
Right side:
1, 1, 2, 3, 5, 8, 13,
Therefore, Left side = Right side 21, 34, …
Hence, P(1) is True.
Proof by Mathematical Induction (11/18)
•2.  P(k):
P(k+1):
Predicate
P(k) Predicate
Suppose “” P(k+1)

To prove P(k+1), we must show that the left side of P(k+1) is equal to
the right side of P(k+1).
Left side:
Right side:
Proof by Mathematical Induction (12/18)
Fibonacci
concept
•Left
  side:

Factorise
Right side: & P(k)
Therefore, “”
Proof by Mathematical Induction (13/18)
•Example
  7: Prove that 1+22+32+4+ …+n2 = for all nN.
Solution:
Step 1: Write the statement in symbol

P(n): 1+22+32+4+ …+n2 =


Statement: “n N, P(n)”
Proof by Mathematical Induction (14/18)
•Step
  2: Use the outline of the principle of mathematical induction to
prove the statement.
 
Proof:
1. P(1): 1 = 1
P(1) is True

2. P(k): “1+22+32+4+ …+k2 = ”


P(k+1): 1+22+32+4+ …+k2+ (k+1)2 =
Proof by Mathematical Induction (15/18)
•  Suppose “1+22+32+4+ …+k2 = ”
Left side
1+22+32+4+ …+k2+ (k+1)2 = + (k+1)2
of P(k+1) = + (k2+ 2k +1)
=

Right side
of P(k+1)

  P(k)p(k+1) is True

  Therefore P(n) is true for all nN


Proof by Mathematical Induction (16/18)
•Example
  8: Prove that the integer n is odd if and only if n2 is odd.

Solution:
This statement is a bi-conditional.
Let p: n is odd
q: n2 is odd
The statement can be written as: pq
:pqq p
Proof by Mathematical Induction (17/18)
•Thus,
  we must prove
1. If n is odd then n2 is odd – using Direct Proof method
2. If n2 is odd then n is odd – using Contrapositive Proof method

Solution:
3. Refer to Example 1
4. Prove q p by using Contrapositive Proof method
Proof by Mathematical Induction (18/18)
•Step
  1: Write statement in symbol
Statement “q p ”
Step 2:   Negating p, p

Proof: Suppose “n is even”


Since n is even, n can be written as
From
n=2k, k is integer
statement q n2 = (2k)2
  Negation q, q
= 4k2
Therefore “n2 is even”.
Comparison of the 4 Basic Proof Methods

Direct Proof Contrapositive Proof by Proof by


Proof Contradiction Mathematical
Induction
Theorem: pq Theorem: pq Theorem: pq 1. Proof true for
Proof: p Proof: (pq) 1.
theProof true for
first time, P(1)
Therefore: q pq q p the
2. Then, proof P(1)
first time, true
2. Then, proof
for the next time,true
for
P(k)the next time,
& P(k+1)
P(k) & P(k+1)
Exercise 1.2 (1/4)
•1.  Prove that for all positive integers n.
Solution:
Use mathematical Induction Proof Method
Step 1: P(n):
Statement: “n N, P(n)”
Exercise 1.2 (2/4)
•Step
  2: Proof:

1. P(1): , is True
2. P(k):
P(k+1):
Suppose “” is True
Exercise 1.2 (3/4)
• 

P(k) P(k+1) is True.


Therefore P(n) is True for all n N.
Exercise 1.2 (4/4)
•  Prove by contradiction that, if for any integers a and b.
2.

Step 1: p:
q:  
(pq)pq
Statement: pq

  Which contradicts
Step 2: Proof pq is false the (pq)
Suppose “”

, is contradicts with
Therefore, is True.

You might also like