Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views75 pages

Logic

Uploaded by

elonmagar6
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)
10 views75 pages

Logic

Uploaded by

elonmagar6
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/ 75

logic

logic

Introduction:
It is the science dealing with the method of reasoning the
mathematical models.
needs some rules associated with logic so that we can apply those
rules for mathematical reasoning.
It is defined as the representation language of knowledge.
It has practical applications to the design of computing machines, to
artificial intelligence, to computer programming, and to other areas
of computer science.
On the basis of its representation capability it is of two types:
a) propositional logic
b) predicate logic
Propositional Logic:
 A proposition is a declarative sentence (that is, a sentence that
declares a fact) that is either true or false, but not both.
 The truth value of a proposition is true, denoted by T, if it is a true
proposition, and the truth value of a proposition is false, denoted by
F, if it is a false proposition.
 All the following declarative sentences are propositions.
1. Washington, D.C., is the capital of the United States of America.
2. Toronto is the capital of Canada.
3. 1 + 1 = 2.
4. 2 + 2 = 3.
 Propositions 1 and 3 are true, whereas 2 and 4 are false.
Propositional logic is of two types
a) Simple propositional logic
b) Compound propositional logic
a) Simple: It express atomic propositions about the world.
Atomic sentence are either propositional symbols P, Q,
R, S…. Or logical constant ( true, false)
b) Compound: It can be formed by combining atomic
formulas with the following connectives not( ¬ ),
and(∧), or(∨), implication(->) and bi-conditional(<->).
Logical Operators/Connectives

Logical operators are used to construct mathematical


statements having one or more propositions by combining
the propositions.
Negation (not)
Let p be a proposition. The negation of p, denoted by ¬ p
(also denoted by p’), is the statement “It is not the case
that p.”
The proposition ¬ p is read as “not p.” The truth value of
the negation of p, ¬ p, is the opposite of the truth value of
p.
Find the negation of the proposition “Michael’s PC runs Linux” and
express this in simple English.
Solution:
The negation is
“It is not the case that Michael’s PC runs Linux.”
This negation can be more simply expressed as
“Michael’s PC does not run Linux.”
Conjunction (and):
Let p and q be propositions. The conjunction of p and q, denoted by p ∧
q, is the proposition “p and q.”
The conjunction p ∧ q is true when both p and q are true and is false
otherwise.
Example:
If we have propositions p = “Ram is intelligent” and q =
“Ram is diligent” the conjunction of p and q is Ram is
intelligent and diligent. This proposition is true only when
Ram is intelligent and he is diligent also, false otherwise.
Disjunction (or):
Let p and q be propositions. The disjunction of p and q,
denoted by p ∨ q, is the proposition “p or q.” The
disjunction p ∨ q is false when both p and q are false and
is true otherwise.
Example:
If we have propositions p = “Ram is intelligent” and q =
“Ram is diligent” the disjunction of p and q is
Ram is intelligent or he is diligent. This proposition is false
only when Ram is not intelligent and not diligent, true
otherwise.
Logical Operators/Connectives
Implication:
 Given two propositions p and q, the proposition implication p -> q is the proposition that is
false when p is true and q is false, true otherwise.
 Here p is called “hypothesis” or “antecedent” or “premise” and q is called “conclusion” or
“consequence”.
 We come across the implication in many places in mathematical reasoning and we use different
terminologies to express p-> q like:
 “if p, then q”,
 “q is consequence of p”,
 “p is sufficient for q”,
 “q if p”
 “q is necessary for p”,
 “q follows from p”,
 “if p, q”,
 “p implies q”,
 “p only if q”,
 “q whenever p”,
 “q provides p”
 “q when p”
Logical Operators/Connectives

Example: p = “today is Sunday” q = “it is hot” then the


implication can be “if today is Sunday then it is hot
today” or “today is Sunday only if it is hot today”.
Truth Table:
Contra-positive, Inverse and Converse:
Some of the related implications formed from p->q are:
Converse: q->p (if it is hot today then today is
Sunday).
Inverse: ¬p->¬q (if today is not Sunday then it is not
hot today).
Contra-positive: ¬q->¬p (if it is not hot then today is
not Sunday).
Example2:
What are the contrapositive, the converse, and the inverse of the conditional
statement “the home town wins whenever it is raining?”
Soln:
because “q whenever p” is one of the ways to express the conditional
statement p->q the original statement can be rewritten as
“ if it is raining, then the home team wins”
The contrapositive of this conditional statement is,
“ if the home team does not win, then it is not raining”
The converse is,
“ if the home team wins, then it is raining”
The inverse is,
“ if it is not raining, then the home team does not win”
Bi-conditional:
Given propositions p and q, the bi-conditional p<->q is a proposition
that is when p and q have same truth values. Alternatively p<->q
is true whenever both p-> q and q->p are true.
Some of the terminologies used for bi-conditional are:
“p if and only if q”
“if p then q, and conversely”
 “p is necessary and sufficient for q”

Example: For propositions given above in implication, “today is


Sunday if and only if it is hot today”.
Truth table:
Precedence of Logical Operators

We can construct compound propositions using the


negation operator and the logical operators defined so far.
We will generally use parentheses to specify the order in
which logical operators in a compound proposition are to
be applied.
For instance, (p ∨ q) ∧ ( ¬ r) is the conjunction of p ∨ q
and ¬ r.
The precedence levels of the logical operators, ¬ , ∧,
∨,→, and↔.
Logic and Bit Operations

A bit is a symbol with two possible values, namely, 0 (zero) and


1 (one).
A bit can be used to represent a truth value.
we will use a 1 bit to represent true and a 0 bit to represent false.
Find the bitwise OR, bitwise AND, and bitwise XOR of the bit
strings 01 1011 0110 and 11 0001 1101.
01 1011 0110
11 0001 1101
11 1011 1111 bitwise OR
01 0001 0100 bitwise AND
10 1010 1011 bitwise XOR
More Examples logical connectives:
1) Let, p = “it rained last night”
q = “the sprinkles came on last night”
r = “the lawn was wet this morning”
Translate the following into English ¬ p, r ∧ ¬ p and ¬ r ∨ p ∨ q.
 ¬ p = “ it didn’t rain last night”
 r ∧ ¬ p = “the lawn was wet this morning and it didn’t rain last
night”
 ¬ r ∨ p ∨ q = “either the lawn was not wet this morning or it
rained last night or the sprinkles came on last night”
Translating English Sentences

Representing the English sentence in propositional logic:


 Restate the given sentence into building block sentences i.e. into
atomic sentence.
 Give the symbol to each sentence and substitute the symbols
using connectives.
For e.g. “if it is snowing then I will go to the beach”
Restate into “it is snowing” give it symbol p and “I will go to the
beach” and give it symbol q then we can write it as
p -> q.
Translating English Sentences

Example1:
How can this English sentence be translated into a logical expression?
“You can access the Internet from campus only if you are a computer
science major or you are not a freshman.”
Solution: we will use propositional variables to represent each
sentence part and determine the appropriate logical connectives
between them.
let a, c, and f represent “You can access the Internet from campus,”
“You are a computer science major,” and “You are a freshman,”
respectively. Noting that “only if” is one way a conditional
statement can be expressed, this sentence can be represented as:
a → (c ∨ ¬ f ).
Translating English Sentences

Example2:
How can this English sentence be translated into a logical
expression?
“You cannot ride the roller coaster if you are under 4 feet tall
unless you are older than 16 years old.”
Solution:
Let q, r, and s represent “You can ride the roller coaster,” “You
are under 4 feet tall ,” and “You are older than 16 years old,”
respectively.
Then the sentence can be translated to
(r ∧ ¬ s)→ ¬ q.
Example3:
Express the specification “ the automated reply cannot be
sent when the file system is full” using logical connectives.
Soln:
Let p denote “ the automated reply can be sent”
q denote “ the file system is full”
Then, ¬ p represent “ the automated reply cannot be sent”
Now,
the conditional statement will be
q-> ¬ p
Tautology, Contradiction and Contingency:
 A compound proposition that is always true, no matter what the
truth values of the atomic propositions that contain in it, is called
a tautology. For e.g. p ∨ ¬ p is always true.
 A compound proposition that is always false is called
contradiction. For e.g. p ∧ ¬ p is always false
 A compound proposition that is neither a tautology nor a
contradiction is called a contingency.
Logical Equivalences

Logical Equivalences:
If two propositions are semantically identical then we say
those two propositions are “equivalent”.
The compound propositions p and q are
logically equivalent, denoted by p <-> q or p
≡ q,
If proposition p<-> q is a tautology.
The truth table of each statement have the
same truth values.
Logical Equivalences

a) Truth table:
Logical Equivalences

b) Symbolic Derivation:
Show that ¬ (p → q) and p ∧ ¬ q are logically equivalent.
solution:
¬ (p → q) ≡ ¬ ( ¬ p ∨ q) by implication law
≡ ¬ ( ¬ p)∧ ¬ q by the second De Morgan
law
≡ p ∧ ¬ q by the double negation law
Show that ¬ (p ∨ ( ¬ p ∧ q)) and ¬ p ∧ ¬ q are logically equivalent by
developing a series of logical equivalences.
¬ (p ∨ ( ¬ p ∧ q)) ≡ ¬ p ∧ ¬ ( ¬ p ∧ q) by the second De Morgan law
≡ ¬ p ∧ [ ¬ ( ¬ p)∨ ¬ q] by the first De Morgan law
≡ ¬ p ∧ (p ∨ ¬ q) by the double negation law
≡ ( ¬ p ∧ p) ∨ ( ¬ p ∧ ¬ q) by the second distributive
law
≡ F ∨ ( ¬ p ∧ ¬ q) because ¬ p ∧ p ≡ F
≡ ( ¬ p ∧ ¬ q) ∨ F by the commutative law for
disjunction
≡ ¬p∧¬q by the identity law for F
Show that (p ∧ q) → (p ∨ q) is a tautology.
Solution:
To show that this statement is a tautology, we will use logical
equivalences to demonstrate that it is logically equivalent to T.
(p ∧ q) → (p ∨ q) ≡ ¬ (p ∧ q) ∨ (p ∨ q) by implication law
≡ ( ¬ p ∨ ¬ q) ∨ (p ∨ q) by the first De Morgan law
≡ ( ¬ p ∨ p) ∨ ( ¬ q ∨ q) by the associative and
commutative laws for
disjunction
≡ T ∨ T by trivial tautology and the commutative law
for disjunction
≡T by the domination law
Predicate logic.

It deals with predicates, which are propositions containing


variables.
Lets take a statement “x > 5” is this statement a proposition?
The answer is no. Whenever the statements have variable(s)
in them we cannot say those statements as a proposition.
The question here is can we make such statements to
propositions? The answer here is yes.
In the above statement there are two parts one is the
variable part called “subject” and another is relation part
“>5” called “predicate”.
Predicate logic.

We can denote the statement “x>5” by P(x) where P is


predicate “>5” and x is the variable.
We also call P as a propositional function where P(x)
gives value of P at x.
Once value is assigned to the propositional function then
we can tell whether it is true or false i.e. a proposition.
For e.g. if we put the value of x as 3 and 7 then we can
conclude that P(3) is false since 3 is not greater than 5 and
p(7) is true since 7 is greater than 5.
Predicate logic.

Example: Let Q(x, y) denote the statement “x = y + 3.” What are


the truth values of the propositions Q(1, 2) and Q(3, 0)?
Solution:
To obtain Q(1, 2), set x = 1 and y = 2 in the statement Q(x, y).
Hence, Q(1, 2) is the statement “1 = 2 + 3,” which is false. The
statement Q(3, 0) is the proposition “3 = 0 + 3,” which is true.
Quantifiers

Quantifiers are the tools to make the propositional function


a proposition.
Construction of proposition from the predicates using
quantifier is called quantification.
The variables that appear in the statement can take different
possible values and all the possible values that the variable
can take forms a domain called “Universe of Discourse” or
“Universal set”.
We study two types of quantifier
1)Universal quantifier
2) Existential quantifier.
Quantifiers

1) Universal Quantifier:
 It state that the statements within its scope are true for every value of the
specific variable.
 It is denoted by the symbol ∀.
 The process of converting predicate into proposition using universal
quantifier is called universal quantification.
 The universal quantification of P(x) is the statement
“P(x) for all values of x in the domain.”
The notation ∀x P(x) denotes the universal quantification of P(x). Here ∀
is called the universal quantifier. We read ∀x P(x) as “for all x P(x)” or
“for every x P(x).”
 An element for which P(x) is false is called a counterexample of ∀x P(x).
Quantifiers

Example:
Let P(x) be the statement “x + 1 > x.” What is the truth
value of the quantification ∀x P(x), where the domain
consists of all real numbers?
Solution:
Because P(x) is true for all real numbers x, the
quantification ∀x P(x) is true.
Quantifiers

Example:
Let Q(x) be the statement “x <= 2.” What is the truth value
of the quantification ∀x Q(x), where the domain consists
of all real numbers?
Solution:
Q(x) is not true for every real number x, because, for
instance, Q(3) is false. That is, x = 3 is a counterexample
for the statement ∀x Q(x). Thus ∀x Q(x) is false.
Quantifiers

2) Existential Quantifier:
It state that the statements within its scope are true for
some value of the specific variable .
It is denoted by ∃.
The existential quantification of P(x), denoted by ∃x P(x),
is a proposition “P(x) is true for some values of x in the
universe of discourse”.
The other forms of representation include “there exists x
such that P(x) is true” or “ P(x) is true for at least one x”.
Quantifiers

Example:
Let P(x) denote the statement “x > 3.” What is the truth
value of the quantification ∃x P(x), where the domain
consists of all real numbers?
Solution:
Because “x > 3” is sometimes true—for instance, when x =
4 the existential quantification of P(x), which is ∃x P(x),
is true.
Quantifiers

Example:
Let Q(x) denote the statement “x = x + 1.”What is the truth
value of the quantification ∃x Q(x), where the domain
consists of all real numbers?
Solution:
Because Q(x) is false for every real number x, the existential
quantification of Q(x), which is ∃x Q(x), is false.
Quantifiers
Precedence of Quantifiers:
 The quantifiers ∀ and ∃ have higher precedence than all logical operators
from propositional calculus. For example, ∀x P(x) ∨ Q(x) is the
disjunction of ∀x P(x) and Q(x).
 In other words , it means (∀x P(x)) ∨ Q(x) rather than ∀x(P(x) ∨ Q(x)).
Binding Variables:
 When a quantifier is used on the variable , we say that this occurrence of
the variable is bound.
 An occurrence of a variable that is not bound by a quantifier is said to be
free.
Eg: In the statement ∃x(x + y = 1), the variable x is bound by the existential
quantification ∃x, but the variable y is free because it is not bound by a
quantifier and no value is assigned to this variable. This illustrates that in
the statement ∃x(x + y = 1), x is bound, but y is free.
Quantifiers

Scope: The part of a logical expression to which a quantifier is


applied is called the scope of this quantifier. We use parenthesis
to give scope of the quantifier.
Example:
In the statement ∃x(P(x) ∧ Q(x)) ∨ ∀x R(x), all variables are
bound. The scope of the first quantifier, ∃x, is the expression
P(x) ∧ Q(x) because ∃x is applied only to P(x) ∧ Q(x), and not
to the rest of the statement.
Similarly, the scope of the second quantifier, ∀x, is the
expression R(x). That is, the existential quantifier binds the
variable x in P(x) ∧ Q(x) and the universal quantifier ∀x binds
the variable x in R(x).
Nested quantifier:
If we use a quantifier that appears within the scope of
another quantifier then it is called nested quantifier.
Example:
∀x ∃y(x + y = 0) is the same thing as ∀x Q(x), where Q(x)
is ∃y P(x, y), where P(x, y) is x + y = 0.
Negating Quantified Expressions:
 We will often want to consider the negation of a quantified expression. For
instance, consider the statement “Every student in your class has taken a
course in calculus.”
 This statement is a universal quantification, namely, ∀x P(x), where P(x) is
the statement “x has taken a course in calculus” and the domain consists
of the students in your class. The negation of this statement is “It is not the
case that every student in your class has taken a course in calculus.”
 This is equivalent to “There is a student in your class who has not taken a
course in calculus.” And this is simply the existential quantification of the
negation of the original propositional function, namely,
∃x ¬ P(x).
This example illustrates the following logical equivalence:
¬∀ x P(x) ≡ ∃x ¬ P(x).
Translating the Sentences into Logical Expression

Example 1
Translate “not every integer is even” where the universe
of discourse is set of integers.
Solution:
Let E(x) denotes x is even.
¬∀ x E(x)
Translating the Sentences into Logical Expression

Express the statements “Some student in this class has visited Mexico”
and “Every student in this class has visited either Canada or Mexico”
using predicates and quantifiers.
Solution:
The statement “Some student in this class has visited Mexico” means that
“There is a student in this class with the property that the student has
visited Mexico.”
We can introduce a variable x, so that our statement becomes
“There is a student x in this class having the property that x has visited
Mexico.”
We introduce M(x), which is the statement “x has visited Mexico.” If the
domain for x consists of the students in this class, we can translate this
first statement as ∃x M(x).
Translating the Sentences into Logical Expression

However, if we are interested in people other than those in


this class, we look at the statement a little differently. Our
statement can be expressed as
“There is a person x having the properties that x is a student
in this class and x has visited Mexico.”
In this case, the domain for the variable x consists of all
people. We introduce S(x) to represent “x is a student in
this class.” M(x), which is the statement “x has visited
Mexico.”
Our solution becomes ∃x(S(x) ∧ M(x))
Translating the Sentences into Logical Expression

Similarly, the second statement can be expressed as


“For every x in this class, x has the property that x has
visited Mexico or x has visited Canada.”
let C(x) be “x has visited Canada.”
M(x), be “x has visited Mexico.”
∀x(C(x) ∨ M(x)).
Translating the Sentences into Logical Expression

However, if the domain for x consists of all people, our


statement can be expressed as
“For every person x, if x is a student in this class, then x has
visited Mexico or x has visited Canada.”
In this case, the statement can be expressed as
∀x(S(x) → (C(x) ∨ M(x))).
Mathematical Reasoning

Rules of Reasoning:
 To draw conclusion from the given premise we must be able to
apply some well defined steps that helps reaching the conclusion.
 These steps of reaching the conclusion are provided by rule of
inference.
Rule 1: modus ponens( law of detachment):
p→q

∴q
p

 when both p → q and p are true, we know that q must also be true.
 i.e (p ∧ (p → q)) → q is tautology.
Example:
Suppose that the conditional statement “If it snows today,
then we will go skiing” and its hypothesis, “It is snowing
today,” are true.
Then, by modus ponens, it follows that the conclusion of
the conditional statement, “We will go skiing,” is true.
Example:
State which rule of inference is the basis of the following
argument: “It is below freezing now . Therefore, it is
either below freezing or raining now.”
Solution: Let p be the proposition “It is below freezing
now” and q the proposition “It is raining now.” Then this
argument is of the form

∴p∨q
p

This is an argument that uses the addition rule.


Example :
State which rule of inference is the basis of the following
argument: “It is below freezing and raining now. Therefore, it
is below freezing now.”
Solution:
Let p be the proposition “It is below freezing now,” and let q be
the proposition “It is raining now.” This argument is of the
form

∴p
p∧q

This argument uses the simplification rule.


Using Rules of Inference to Build Arguments

When there are many premises, several rules of inference


are often needed to show that an argument is valid.
The steps of arguments are displayed on separate lines, with
the reason for each step explicitly stated.
Example:
Show that the premises “It is not sunny this afternoon and it is
colder than yesterday,” “We will go swimming only if it is
sunny,” “If we do not go swimming, then we will take a
canoe trip,” and “If we take a canoe trip, then we will be
home by sunset” lead to the conclusion “We will be home
by sunset.”
Using Rules of Inference to Build Arguments

Solution:
Let p be the proposition “It is sunny this afternoon,” q the
proposition “It is colder than yesterday,” r the proposition “We
will go swimming,” s the proposition “We will take a canoe
trip,” and t the proposition “We will be home by sunset.”
Then the premises become
¬ p ∧ q, r → p, ¬ r → s, and s → t . The conclusion is simply t.
We need to give a valid argument with premises ¬ p ∧ q, r →
p, ¬ r → s, and s → t and conclusion t .
We construct an argument to show that our premises lead to the
desired conclusion as follows.
Using Rules of Inference to Build Arguments

Step Reason
1. ¬ p ∧ q Premise/ Hypothesis
2. ¬ p Simplification using (1)
3. r → p Premise / Hypothesis
4. ¬ r Modus tollens using (2) and (3)
5. ¬ r → s Premise
6. s Modus ponens using (4) and (5)
7. s → t Premise
8. t Modus ponens using (6) and (7)
Using Rules of Inference to Build Arguments

Example:
Show that the premises “If you send me an e-mail message, then I will finish
writing the program,” “If you do not send me an e-mail message, then I will
go to sleep early,” and “If I go to sleep early, then I will wake up feeling
refreshed” lead to the conclusion “If I do not finish writing the program, then I
will wake up feeling refreshed.”
Solution:
Let p be the proposition “You send me an e-mail message,” q
the proposition “I will finish writing the program,” r the
proposition “I will go to sleep early,” and s the proposition “I
will wake up feeling refreshed.” Then the premises are p →
q , ¬ p → r, and r → s. The desired conclusion is ¬ q → s. We
need to give a valid argument with premises p → q, ¬ p → r,
and r → s and conclusion ¬ q → s.
Using Rules of Inference to Build Arguments

This argument form shows that the premises lead to the desired
conclusion.
Step Reason
1. p → q Premise
2. ¬ q → ¬ p Contra-positive of (1)
3. ¬ p → r Premise
4. ¬ q → r Hypothetical syllogism using (2) and (3)
5. r → s Premise
6. ¬ q → s Hypothetical syllogism using (4) and (5)
Rules of Inference for Quantified Statements

1)Universal instantiation: it is the rule of inference used to


conclude that P(c) is true, where c is a particular member of the
domain, given the premise ∀x P(x).
Universal instantiation is used when we conclude from the
statement “All women are wise” that “Lisa is wise,” where Lisa
is a member of the domain of all women.
2) Universal generalization: it is the rule of inference that states
that ∀x P(x) is true, given the premise that P(c) is true for all
elements c in the domain.
Universal generalization is used when we show that ∀x P(x) is
true by taking an arbitrary element c from the domain and
showing that P(c) is true.
Rules of Inference for Quantified Statements

3)Existential instantiation: it is the rule that allows us to


conclude that there is an element c in the domain for
which P(c) is true if we know that ∃x P(x) is true.
4) Existential generalization: it is the rule of inference that
is used to conclude that ∃x P(x) is true when a particular
element c with P(c) true is known.
That is, if we know one element c in the domain for which
P(c) is true, then we know that ∃x P(x) is true.
Rules of Inference for Quantified Statements
Example:
Show that the premises “Everyone in this discrete mathematics class has taken a
course in computer science” and “Marla is a student in this class” imply the
conclusion “Marla has taken a course in computer science.”
Solution:
Let D(x) denote “x is in this discrete mathematics class,” and let C(x) denote “x has
taken a course in computer science.” Then the premises are
∀x(D(x) → C(x)) and D(Marla). The conclusion is C(Marla).
The following steps can be used to establish the conclusion from the premises.
Step Reason
1. ∀x(D(x) → C(x)) Premise
2. D(Marla)→C(Marla) Universal instantiation from (1)
3. D(Marla) Premise
4. C(Marla) Modus ponens from (2) and (3)
Methods of Proving

1) Direct Proofs:
In a direct proof, we assume that p is true
and use axioms, definitions, and previously
proven theorems, together with rules of
inference, to show that q must also be true.
 It is quite straightforward, with a sequence
of steps leading from the hypothesis to the
conclusion.
Direct Proofs:
Give a direct proof of the theorem “If n is an odd integer, then n2 is odd.”
Solution:
To begin a direct proof of this theorem, we assume that the hypothesis of this
conditional statement is true, namely, we assume that n is odd.
By the definition of an odd integer, it follows that
n = 2k + 1, where k is some integer.
We want to show that n2 is also odd.
We can square both sides of the equation n = 2k + 1 to obtain a new equation that
expresses n2.
n2 = (2k + 1)2
= 4k2+ 4k + 1
= 2(2k2 + 2k) + 1.
By the definition of an odd integer, we can conclude that n2 is an odd integer (it is
one more than twice an integer).
Consequently, we have proved that if n is an odd integer, then n2 is an odd integer.
Eg: Give a direct proof that if m and n are both perfect squares, then nm
is also a perfect square.
Solution:
To produce a direct proof of this theorem, we assume that the hypothesis of
this conditional statement is true, namely, we assume that m and n are both
perfect squares.
By the definition of a perfect square, it follows that there are integers s and t
such that m = s2 and n = t2.
The goal of the proof is to show that mn must also be a perfect square when
m and n are; looking ahead we see how we can show this by substituting s2
for m and t2 for n into mn.
mn = s2t2.
= s2t2
= (ss)(t t)
= (st)(st) = (st)2
By the definition of perfect square, it follows that mn is also a perfect
square, because it is the square of st, which is an integer.
We have proved that if m and n are both perfect squares, then mn is also a
perfect square.
2.Indirect proofs

 Proofs of theorems of this type that are not direct proofs, that is,
it do not start with the premises and end with the conclusion.
 It is also known as proof by contraposition.
 Proofs by contraposition make use of the fact that the conditional
statement p → q is equivalent to its contra-positive, ¬ q → ¬ p.
 This means that the conditional statement p → q can be proved
by showing that its contra-positive, ¬ q → ¬ p, is true.
 In a proof by contraposition of p → q, we take ¬ q as a premise,
and using axioms, definitions, and previously proven theorems,
together with rules of inference, we show that ¬ p must follow.
Example: Prove that if n is an integer and 3n + 2 is odd, then n is
odd.
solution:
The first step in a proof by contraposition is to assume that the
conclusion of the conditional statement
“If 3n + 2 is odd, then n is odd” is false; namely, assume that n is
even. Then, by the definition of an even integer, n = 2k for some
integer k. Substituting 2k for n, we find that
3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1).
This tells us that 3n + 2 is even (because it is a multiple of 2), and
therefore not odd.
This is the negation of the premise of the theorem.
Because the negation of the conclusion of the conditional statement
implies that the hypothesis is false, the original conditional statement
is true.
Our proof by contraposition succeeded;
We have proved the theorem “If 3n + 2 is odd, then n is odd.”
Indirect method

Prove that if n is an integer and n2 is odd, then n is odd.

Solution:
Prove by contraposition. We take as our hypothesis the statement that
n is not odd. This means that n is even.
This implies that there exists an integer k such that n = 2k.
To prove the theorem,
we need to show that this hypothesis implies the conclusion that n2 is
not odd, i.e , that n2 is even.
Can we use the equation n = 2k to achieve this?
By squaring both sides of this equation, we obtain
n2= 4k2= 2(2 k2),
which implies that n2 is also even because n2 = 2t , where t = 2 k2.
We have proved that if n is an integer and n2 is odd, then n is odd.
Our attempt to find a proof by contraposition succeeded.
3.Proofs by Contradiction

The steps in proof of implication p->q by contradiction


are:
 assume (p ∧ ¬ q) is true.
 try to show the above assumption is false.
 If the assumption is found to be false then p->q is true.
Give a proof by contradiction of the theorem “If 3n + 2 is odd,
then n is odd.”
Solution:
Let p be “3n + 2 is odd” and q be “n is odd.” To construct a proof
by contradiction, assume that both p and ¬ q are true. That is,
assume that 3n + 2 is odd and n is not odd.
Because n is not odd, we know that it is even. Because n is even,
there is an integer k such that n = 2k.
This implies that,
3n + 2
= 3(2k) + 2
= 6k + 2
= 2(3k + 1).
=2t where t = 3k + 1,
3n + 2 is even.
So by contradiction, we can prove that if 3n + 2 is odd, then n is
odd.
If a2 is an even number, then a is an even number.
Solution:
Assume ‘a’ is an odd number and a2 is an even number.
a=2k+1 ( by definition of odd integers)
Then,
a2=(2k+1) 2
=4k2 + 4k +1
=2(2k2 + 2k )+1
=2m +1
where m= 2k2 + 2k , is any integer

a2 is odd
So by contradiction, we can prove that
If a is an even number, then a2 is an even number.
4.Proof by Cases

Sometimes we cannot prove a theorem using a single


argument that holds for all possible cases.
We now introduce a method that can be used to prove a
theorem, by considering different cases separately.
To prove a conditional statement of the form
(p1 ∨ p2 ∨ · · · ∨ pn) → q
Can prove by [(p1 → q) ∧ (p2 → q) ∧ · · · ∧ (pn → q)]
Prove that (n + 1) 3 ≥ 3n if n is a positive integer with n ≤ 4.
Solution:
We use a proof by cases. We only need verify the inequality
(n + 1) 3 ≥ 3n when n = 1, 2, 3, and 4.
For n = 1,
we have (n + 1) 3 = 23 = 8 and 3n = 3*1 = 3;
For n = 2,
we have (n + 1) 3 = 33 = 27 and 3n = 3*2 = 9;
For n = 3,
we have (n + 1) 3 = 43 = 64 and 3n = 3*3 = 27; and
For n = 4, we have (n + 1) 3 = 53 = 125 and 3n = 3*4 = 81.
In each of these four cases, we see that (n + 1) 3 ≥ 3n. We have used
the method of cases to prove that (n + 1)3 ≥ 3n if n is a positive
integer with n ≤ 4.
Prove that if n∈Z, then n2 + 3n +4 is even.
Solution: n ∈ Z ( integer) then there will be 2 case either n is odd or
even.
case 1: n is odd
since n is odd n will be equal to 2x+1
Now,
substitute the value of n in conclusion
n2 + 3n +4 = (2x + 1)2 +3(2x + 1) +4
= 4x2 +4x +1 +6x +3 +4
= 4x2 +10x +8
= 2 (2x2 +5x + 4)
=2t
By the definition of even integer it will be even.

case 2: n is even
since n is even n will be equal to 2x
Now,
substitute the value of n to the conclusion
n2 +3n + 4 = (2x)2 + 3(2x) +4
=2(2x2 +3x +2)
Which is also even.
So in both cases the conclusion is even i.e. true

You might also like