SlideShare a Scribd company logo
Discrete Mathematics
(22MAT121)
Dr. Sayantan Mandal
Department of Mathematics
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
Few Rules to remember:
•Always ask me if you do not understand a single thing
that has been taught (Even if it is very silly or
common).
•Do not be afraid or shy to ask questions. If you are,
you may not learn the subject properly.
•Never miss your homework. Try to do it on the same
day.
•Never miss an assignment. This will contribute to your
final grade.
How to contact me:
• Email Id: m_sayantan@av.amrita.edu
• WhatsApp No: +91 9493595817
What is Discrete Mathematics?
• Consider an analog clock (One with hands that continuously rotate and
show time in a continuous fashion)
• A digital clock (It shows time in discrete fashion).
• The former one gives the idea of Continuous Mathematics whereas the
later one gives the idea of Discrete Mathematics.
• Thus, Continuous Mathematics deals with continuous functions,
differential and integral calculus etc.
• Discrete mathematics deals with mathematical topics in the sense that it
analyzes data whose values are separated (such as integers: Number line
has gaps)
What is Discrete Mathematics?
• Example of continuous math – Given a fixed surface area, what are the
dimensions of a cylinder that maximizes volume?
• Example of Discrete Math – Given a fixed set of characters, and a
length, how many different passwords can you construct? How many
edges in graph with n vertices? How many ways to choose a team of
two people from a group of n?
Why do you learn Discrete Mathematics?
• This course provides some of the mathematical foundations and skills
that you need in your further study of Information Technology and
Computer Science & Engineering.
• These topics include Logic, Counting Methods, Relation and Function,
Recurrence Relation and Generating Function, Number theory etc.
Unit I:
Propositional logic and counting theory
Logic
• Every statement in Mathematics must be precise.
• There can‟t be Mathematics without proofs and each proof needs proper
reasoning.
• Proper reasoning involves logic.
• The dictionary meaning of „Logic‟ is the science of reasoning.
• The rules of logic give precise meaning to mathematical statements.
• These rules are used to distinguish between valid & invalid mathematical
arguments.
• In addition to its importance in mathematical reasoning, logic has numerous
applications in computer science to verify the correctness of programs,
• to prove the theorems in natural & physical sciences to draw conclusion from
experiments,
• in social sciences & in our daily lives to solve a great number of problems.
Proposition (Or Statement)
•A proposition (or a statement) is a declarative
sentence (that is, a sentence that declares a fact) that is
either true or false, but not both.
Examples: For Example, consider, the
following sentences:
1. Vijayawada is in Andhra Pradesh.
2. Do your homework.
3. What is your age?
4. 2+4 = 6.
5. 2+4 = 9.
6. 7>9.
7. The square of 5 is 25.
8. May God Bless you!
9. Read this carefully.
Which of the above sentences are propositions?
Examples: Consider the following sentences:
1. Vijayawada is in Andhra Pradesh (It is a proposition) (True)
2. Vijayawada is in Kerala (It is a proposition) (False)
3. Do your homework. (Not a proposition) (It is a Command)
4. What is your age? (Not a proposition)
5. 2+4 = 6. (It is a Proposition) (True)
6. 2+4 = 9 (It is a Proposition) (False)
7. 7>9. (It is a Proposition) (False)
8. The square of 5 is 25. (It is a proposition) (True)
9. May God Bless you! (Not a proposition)
10. Read this carefully. (Not a proposition)
Examples: Consider the following:
Is this a proposition?
Examples: For Example, consider the
following:
Is this a proposition?
Not a proposition because this is neither true nor false. Note
that it can be turned into a proposition if we assign values to
the variables.
Examples: For Example, consider the
following:
Is this a proposition?
Notations:
• We use letters to denote propositional variables (or statement
variables), that is, variables that represent propositions, just as letters
are used to denote numerical variables.
• The conventional letters used for propositional variables are p, q , r, s,
. . . .
• The truth value of a proposition is true, denoted by T , if it is a true
proposition and false, denoted by F, if it is a false proposition.
Propositional logic
• The area of logic that deals with propositions is called the
propositional calculus or propositional logic.
• It was first developed systematically by the Greek philosopher
Aristotle more than 2300 years ago.
Compound Propositions
• We now turn our attention to methods for producing new propositions
from those that we already have.
• These methods were discussed by the English mathematician George
Boole in 1854 in his book The Laws of Thought.
• Many mathematical statements are constructed by combining one or
more propositions.
• New propositions, called compound propositions, are formed from
existing propositions using logical operators.
Logical operations: Negation (NOT)
1-Discrete Mathematics - 1 - Unit - 1.pdf
Example
Find the negation of the proposition
"At least 10 inches of rain fell today in Amaravati."
and express this in simple English.
Example
Find the negation of the proposition
"At least 10 inches of rain fell today in Amaravati."
and express this in simple English.
Solution: The negation is
"It is not the case that at least 10 inches of rain fell today in
Amaravati."
This negation can be more simply expressed by
"Less than 10 inches of rain fell today in Amaravati."
Truth Table:
• The truth table for Negation is as follows:
• The negation of a proposition can
also be considered the result of the
operation of the negation operator
on a proposition.
• The negation operator constructs
a new proposition from a single
existing proposition.
• We will now introduce the logical operators that are used to form
new propositions from two or more existing propositions. These
logical operators are also called CONNECTIVES.
Logical operations: Conjunction (AND)
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
Truth Table:
Logical operations: Disjunction (OR)
Logical operations: Disjunction (OR)
Remark:
• The use of the connective OR in a disjunction corresponds to one of the two
ways the word OR is used in English, namely, in an inclusive way.
• A disjunction is true when at least one of the two propositions is true. For
instance, the inclusive OR is being used in the statement..
• "Students who have taken calculus OR differential equation can take this
class."
• Here, we mean that students who have taken both calculus and computer
science can take the class, as well as the students who have taken only one of
the two subjects.
Remark:
• On the other hand, we are using the exclusive OR when we say
• "Students who have taken calculus OR computer science, but not both, can enroll in
this class."
• Here, we mean that students who have taken both calculus and a computer science
course cannot take the class. Only those who have taken exactly one of the two courses
can take the class.
• Similarly, when a menu at a restaurant states, "Soup OR salad comes with an entree"
• The restaurant almost always means that customers can have either soup or salad, but not
both.
• Hence, this is an exclusive, rather than an inclusive, OR.
Truth Table:
Logical operations: Exclusive OR
Logical Connective: Conditional Statements
Remark:
Truth Table:
Variety of terminology for conditional
statements:
Example:
• For example, the pledge many politicians make when running for
office is
"If I am elected, then I will lower taxes."
• If the politician is elected, voters would expect this politician to
lower taxes.
• Furthermore, if the politician is not elected, then voters will not have
any expectation that this person will lower taxes, although the person
may have sufficient influence to cause those in power to lower taxes.
• It is only when the politician is elected but does not lower taxes that
voters can say that the politician has broken the campaign pledge.
• This last scenario corresponds to the case when p is true, but q is false
in p --> q .
Remark:
1-Discrete Mathematics - 1 - Unit - 1.pdf
Converse, Inverse and Contra positive of a
conditional statement :
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
Logical Connective: Biconditionals
Write the truth table for Biconditionals.
Logical Connective: Biconditionals
Write the truth table for Biconditionals.
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
Implicit use of biconditionals:
• Be aware that biconditionals are not always explicit in natural language.
• In particular, the "if and only if" construction used in biconditionals is
rarely used in common language.
• Instead, biconditionals are often expressed using an "if, then" or an "only
if" construction.
• The other part of the "if and only if" is implicit. That is, the converse is
implied, but not stated.
• For example, consider the statement in English "If you finish your meal,
then you can have dessert."
• What is really meant is "You can have dessert if and only if you finish
your meal."
Implicit use of biconditionals
• This last statement is logically equivalent to the two statements "If you
finish your meal, then you can have dessert" and "You can have
dessert only if you finish your meal."
• Because of this imprecision in natural language, we need to
make an assumption whether a conditional statement in natural language
implicitly includes its converse.
• Because precision is essential in mathematics and in logic, we will
always distinguish between the conditional statement p --> q and the
biconditional statement p <-->q .
Truth Tables of Compound Propositions
• We have now introduced four important logical connectives--conjunctions,
disjunctions, conditional statements, and biconditional statements-as well as
negations.
• We can use these connectives to build up complicated compound propositions
involving any number of propositional variables.
• We can use truth tables to determine the truth values of these compound
propositions
1-Discrete Mathematics - 1 - Unit - 1.pdf
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.
1-Discrete Mathematics - 1 - Unit - 1.pdf
Propositional Equivalences
• An important type of step used in a mathematical argument is the
replacement of a statement with another statement with the same truth
value.
• Because of this, methods that produce propositions with the same truth
value as a given compound proposition are used extensively in the
construction of mathematical arguments.
• Because of this, methods that produce propositions with the same
truth value as a given compound proposition are used extensively in
the construction of mathematical arguments.
Tautology, Contradiction, Contigency
• A compound proposition that is always true, no matter what the truth
values of the propositions that occur in it, is called a tautology.
• A compound proposition that is always false is called a contradiction.
• A compound proposition that is neither a tautology nor a contradiction
is called a contingency.
Example:
Logical Equivalences
• Compound propositions that have the same truth values in all possible
cases are called logically equivalent. We can also define this notion as
follows.
Definition:
Logical Equivalences
• One way to determine whether two compound propositions are
equivalent is to use a truth table.
• In particular, the compound propositions p and q are equivalent if and
only if the columns giving their truth values agree.
• Find the truth table for
• Find the truth table for
• What do you observe?
• What do you conclude?
Example:
Example:
• Find the truth table for
• Find the truth table for
• What do you observe?
• What do you conclude?
De Morgan's Laws:
Example:
• Find the truth table for
• Find the truth table for
• Are they logically equivalent?
1-Discrete Mathematics - 1 - Unit - 1.pdf
Example:
• Find the truth table for
• Find the truth table for
• Are they logically equivalent?
1-Discrete Mathematics - 1 - Unit - 1.pdf
• In these
equivalences, T
denotes the
compound propo
sition that is
always true and
• F denotes the
compound
proposition that
is always false.
• In these
equivalences, T
denotes the
compound propo
sition that is
always true and
• F denotes the
compound
proposition that
is always false.
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
Example:
Example:
Example:
Example:
Homework:
1.
2.
3.
4.
Homework:
5.
6.
Homework:
7.
8.
Homework:
Homework:
1.
2.
3.
4.
5.
6.
Predicate:
• Statements involving variables, such as
"𝑥 > 3", "𝑥 = 𝑦 + 3", "𝑥 + 𝑦 = 𝑧",
“Computer 𝑥 is under attack by an intruder”
are often found in mathematical assertions, in computer programs, and in system
specifications.
• These statements are neither true nor false when the values of the variables are not
specified.
• The statement "𝒙 is greater than 𝟑" has two parts.
• The first part, the variable 𝑥, is the subject of the statement.
• The second part-the predicate, "is greater than 3"-refers to a property that the subject
of the statement can have.
• We can denote the statement "𝒙 is greater than 3" by 𝑷(𝒙), where 𝑷 denotes the
predicate "is greater than 3" and 𝒙 is the variable.
• The statement 𝑷 𝒙 is also said to be the value of the propositional function P at 𝑥.
• the statement 𝑷 𝒙 becomes a proposition and has a truth value.
Predicate:
Propositional function with more than one variable:
EXAMPLE:
EXAMPLE:
Predicate:
EXAMPLE:
EXAMPLE:
Predicate:
Predicate:
Quantifiers:
• When the variables in a propositional function are assigned values, the resulting
statement becomes a proposition with a certain truth value.
• However, there is another important way, called quantification, to create a
proposition from a propositional function.
• Quantification expresses the extent to which a predicate is true over a range of
elements.
• In English, the words all, some, many, none, and few are used in quantifications.
• Two types of quantifications:
 Universal quantification (which tells us that a predicate is true for every element
under consideration)
 Existential quantification (which tells us that there is one or more element under
consideration for which the predicate is true)
• The area of logic that deals with predicates and quantifiers is called the predicate
calculus
The Universal Quantifier:
• Many mathematical statements assert that a property is true for all values of
a variable in a particular domain, called the domain of discourse (or the
universe of discourse), often just referred to as the domain.
• Such a statement is expressed using universal quantification.
• The universal quantification of 𝑷(𝒙) for a particular domain is the
proposition that asserts that 𝑷(𝒙) is true for all values of 𝒙 in this
domain.
• Note that the domain specifies the possible values of the variable 𝑥.
• The meaning of the universal quantification of 𝑃(𝑥) changes when we
change the domain.
• The domain must always be specified when a universal quantifier is used;
without it, the universal quantification of a statement is not defined.
Definition:
The universal quantification of 𝑃(𝑥) is the statement
“𝑷(𝒙) for all values of 𝒙 in the domain.”
• The notation ∀𝒙 𝑷(𝒙) denotes the universal quantification of P(x).
• Here ∀ is called the universal quantifier.
• We read ∀𝑥 𝑃(𝑥) as “for all 𝑥𝑃(𝑥)” or “for every 𝑥𝑃(𝑥).”
• An element for which P(x) is false is called a counterexample to ∀xP(x).
The Universal Quantifier:
Example: Let 𝑃(𝑥) be the statement “𝑥 + 1 > 𝑥. ”
What is the truth value of the quantification ∀𝑥 𝑃(𝑥), where the domain
consists of all real numbers?
Solution: Because P(x) is true for all real numbers x,
the quantification ∀𝑥 𝑃(𝑥) is true.
• Remark: Generally, an implicit assumption is made that all domains of
discourse for quantifiers are non-empty. Note that if the domain is empty,
then ∀x P(x) is true for any propositional function P(x) because there are
no elements x in the domain for which P(x) is false.
The Universal Quantifier:
Remark:
• A statement ∀x P(x) is false, where P(x) is a propositional function, if and
only if P(x) is not always true when x is in the domain.
• One way to show that P(x) is not always true when x is in the domain is to
find a counterexample to the statement ∀x P(x).
• Note that a single counterexample is all we need to establish that ∀x P(x)
is false.
The Universal Quantifier:
The Universal Quantifier:
The Universal Quantifier:
The Universal Quantifier:
Definition:
The existential quantification of 𝑃(𝑥) is the proposition
“There exists an element x in the domain such that P(x).”
• We use the notation ∃x P(x) for the existential quantification of P(x).
• Here ∃ is called the existential quantifier.
The Existential Quantifier:
Remark:
• A domain must always be specified when a statement ∃x P(x) is used.
• Furthermore, the meaning of ∃x P(x) changes when the domain
changes.
• Without specifying the domain, the statement ∃x P(x) has no meaning.
The Existential Quantifier:
The Existential Quantifier:
Remark:
The Existential Quantifier:
• Remark: Generally, an implicit assumption is made that all domains of
discourse for quantifiers are nonempty. If the domain is empty, then
∃𝑥 𝑄(𝑥) is false whenever 𝑄(𝑥) is a propositional function because
when the domain is empty, there can be no element 𝑥 in the domain
for which 𝑄(𝑥) is true.
• There is no limitation on the number of different quantifiers we can define,
such as “there are exactly two,” “there are no more than three,” “there are at
least 100,” and so on.
• The one that is most often seen is the uniqueness quantifier, denoted by ∃!
• The notation ∃!x P(x) states “There exists a unique x such that P(x) is
true.”
• For instance, ∃! 𝑥 (𝑥 − 1 = 0), where the domain is the set of real
numbers, states that there is a unique real number x such that x − 1 = 0. This
is a true statement, as x = 1 is the unique real number such that x − 1 = 0.
The Uniqueness Quantifier:
Quantifiers over Finite Domains:
• When the domain of a quantifier is finite, that is, when all its elements can be listed,
quantified statements can be expressed using propositional logic.
• In particular, when the elements of the domain are 𝑥1, 𝑥2 , … , 𝑥𝑛, where 𝑛 is a positive
integer, the universal quantification ∀x P(x) is the same as the conjunction
𝑷 𝒙𝟏 ∧ 𝑷 𝒙𝟐 ∧ ⋯ ∧ 𝑷(𝒙𝒏),
because this conjunction is true if and only if 𝑃(𝑥1), 𝑃(𝑥2), … , 𝑃(𝑥𝑛) are all true.
Quantifiers over Finite Domains:
• Similarly, when the elements of the domain are 𝑥1, 𝑥2, … , 𝑥𝑛, where n is a
positive integer, the existential quantification ∃𝑥 𝑃(𝑥) is the same as the
disjunction
𝑷 𝒙𝟏 ∧ 𝑷 𝒙𝟐 ∧ ⋯ ∧ 𝑷 𝒙𝒏
because this disjunction is true if and only if at least one of
𝑃(𝑥1), 𝑃(𝑥2), … , 𝑃(𝑥𝑛) is true.
Quantifiers with Restricted Domains:
• An abbreviated notation is often used to restrict the domain of a quantifier.
• In this notation, a condition a variable must satisfy is included after the quantifier.
Example: What do the statements ∀𝑥 < 0 𝑥2 > 0 mean, where the domain in each
case consists of the real numbers?
Solution: The statement ∀𝑥 < 0 (𝑥2
> 0) states that for every real number 𝑥 with
𝑥 < 0, 𝑥2 > 0.
Example: What do the statements ∀𝑦 ≠ 0 (𝑦3 ≠ 0) mean, where the domain in each
case consists of the real numbers?
Solution:
• The statement ∀𝑦 ≠ 0 (𝑦3 ≠ 0) states that for every real number 𝑦 with 𝑦 ≠ 0, we
have 𝑦3 ≠ 0.
• That is, it states “The cube of every nonzero real number is nonzero.” This statement is
equivalent to ∀𝑦(𝑦 ≠ 0 → 𝑦3 ≠ 0).
Quantifiers with Restricted Domains:
Example: What do the statements ∃𝑧 > 0 (𝑧2
= 2) mean, where the domain in each case
consists of the real numbers?
Solution:
• The statement ∃𝑧 > 0 (𝑧2
= 2) states that there exists a real number 𝑧 with 𝑧 > 0 such that
𝑧2
= 2.
• That is, it states “There is a positive square root of 2.”
• This statement is equivalent to ∃𝑧(𝑧 > 0 ∧ 𝑧2
= 2).
Remark:
• Note that the restriction of a universal quantification is the same as the universal quantification
of a conditional statement.
• For instance, ∀𝑥 < 0 (𝑥2
> 0) is another way of expressing ∀𝑥(𝑥 < 0 → 𝑥2
> 0).
• On the other hand, the restriction of an existential quantification is the same as the existential
quantification of a conjunction.
• For instance, ∃𝑧 > 0 (𝑧2
= 2) is another way of expressing ∃𝑧(𝑧 > 0 ∧ 𝑧2
= 2).
Precedence of Quantifiers:
• The quantifiers ∀ and ∃ have higher precedence than all logical
operators from propositional calculus.
• For example, ∀𝑥𝑃(𝑥) ∨ 𝑄(𝑥) is the disjunction of ∀𝑥 𝑃(𝑥) and 𝑄(𝑥).
• In other words, it means (∀𝑥𝑃(𝑥)) ∨ 𝑄(𝑥) rather than ∀𝑥(𝑃(𝑥) ∨
𝑄(𝑥)).
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 or set equal to a
particular value is said to be free.
• All the variables that occur in a propositional function must be bound or set
equal to a particular value to turn it into a proposition.
• This can be done using a combination of universal quantifiers, existential
quantifiers, and value assignments.
• The part of a logical expression to which a quantifier is applied is called the
scope of this quantifier. Consequently, a variable is free if it is outside the
scope of all quantifiers in the formula that specify this variable.
Example:
• In the statement ∃𝑥 𝑃 𝑥 ∧ 𝑄 𝑥 ∨ ∀𝑥 𝑅(𝑥), all variables are bound.
• The scope of the first quantifier, ∃𝑥, is the expression 𝑃(𝑥) ∧ 𝑄(𝑥), because ∃𝑥 is applied
only to 𝑃(𝑥) ∧ 𝑄(𝑥) and not to the rest of the statement.
• Similarly, the scope of the second quantifier, ∀𝑥, is the expression 𝑅(𝑥). That is, the
existential quantifier binds the variable 𝑥 in 𝑃(𝑥) ∧ 𝑄(𝑥) and the universal quantifier ∀𝑥
binds the variable 𝑥 in 𝑅 𝑥 .
• Observe that we could have written our statement using two different variables x and y, as
∃𝑥(𝑃(𝑥) ∧ 𝑄(𝑥)) ∨ ∀𝑦𝑅(𝑦), because the scopes of the two quantifiers do not overlap.
Example:
• In the statement ∃𝑥(𝑥 + 𝑦 = 1), the variable 𝑥 is bound by the existential
quantification ∃𝑥,
• but the variable 𝑦 is free because it is not bound by a quantifier and no value is
assigned to this variable.
• This illustrates that in the statement ∃𝑥(𝑥 + 𝑦 = 1), 𝑥 is bound, but 𝑦 is free.
Negating Quantified Expressions
• We will often want to consider the negation of a quantified expression. For instance,
consider the negation of the statement
• “Every student in your class has taken a course in calculus.”
• This statement is a universal quantification, namely, ∀𝑥𝑃(𝑥),
• where 𝑃(𝑥) is the statement Assessment “𝑥 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, ∃𝑥 ≦𝑃(𝑥).
• This example illustrates the following logical equivalence:
≦∀𝒙𝑷(𝒙) ≡ ∃𝒙 ≦𝑷(𝒙).
Example: Show that ≦∀𝑥 𝑃 𝑥 and ∃𝑥 ≦𝑃(𝑥) are logically equivalent.
Solution:
≦∀𝑥 𝑃(𝑥) is true if and only if ∀𝑥𝑃(𝑥) is false.
∀𝑥 𝑃(𝑥) is false if and only if there is an element x in the domain for which 𝑃(𝑥) is
false.
There is an element x in the domain for which 𝑃(𝑥) is false if and only if
there is an element x in the domain for which ¬𝑃(𝑥) is true.
∃𝑥 ≦𝑃(𝑥) is true.
Example: Show that ≦∃𝑥 𝑄 𝑥 and ∀𝑥 ≦𝑄(𝑥) are logically equivalent.
Solution:
≦∃𝑥 𝑄 𝑥 is true if and only if ∃𝑥 𝑄 𝑥 is false.
∃𝑥 𝑄 𝑥 is false if and only if no 𝑥 exists in the domain for which 𝑄(𝑥) is true.
No 𝑥 exists in the domain for which 𝑄(𝑥) is true if and only if
𝑄(𝑥) is false for every 𝑥 in the domain.
𝑄(𝑥) is false for every 𝑥 in the domain if and only if ≦𝑄(𝑥) is true for all x in the
domain,
∀𝑥 ≦𝑄(𝑥) is true.
De Morgan’s Laws for Quantifiers.
Example: What is the negation of the statement ∀𝑥 𝑥2 > 𝑥 ?
Solution:
• The negation of ∀𝑥(𝑥2 > 𝑥) is the statement ≦∀𝑥(𝑥2 > 𝑥), which is
equivalent to ∃𝑥≦(𝑥2 > 𝑥).
• This can be rewritten as ∃𝑥(𝑥2 ≤ 𝑥).
Example: What is the negation of the statement ∃𝑥 𝑥2 = 2 ?
Solution:
• The negation of ∃𝑥(𝑥2 = 2) is the statement ≦∃𝑥(𝑥2 = 2), which is
equivalent to ∀𝑥 ≦(𝑥2 = 2).
• This can be rewritten as ∀𝑥(𝑥2
≠ 2).
Example: Show that ≦∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(𝑃(𝑥) ∧ ≦𝑄(𝑥)) are
logically equivalent.
Solution:
By De Morgan‟s law for universal quantifiers, we know that,
≦∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(≦(𝑃(𝑥) → 𝑄(𝑥))) are logically equivalent.
We also know that ≦(𝑃(𝑥) → 𝑄(𝑥)) and 𝑃(𝑥) ∧ ≦𝑄(𝑥) are logically
equivalent for every x.
• Because we can substitute one logically equivalent expression for another in
a logical equivalence, it follows that
≦∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(𝑃(𝑥) ∧ ≦𝑄(𝑥)) are logically equivalent.
Translating from English into Logical Expressions
• Translating sentences in English (or other natural languages) into logical
expressions is a crucial task in mathematics, logic programming, artificial
intelligence, software engineering, and many other disciplines
Example: Express the statement “Every student in this class has studied
calculus” using predicates and quantifiers.
Solution:
We introduce C(x), which is the statement “x has studied calculus.”
Consequently, if the domain for x consists of the students in the class, we can
translate our statement as ∀𝑥 𝐶(𝑥).
Translating from English into Logical Expressions
Example: Express the statement “Some student in this class has visited
Mexico” using predicates and quantifiers.
Solution: 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 ∃𝑥 𝑀(𝑥).
Example: Express the statement “Every student in this class has visited either
Canada or Mexico” using predicates and quantifiers. (Note that we are assuming the
inclusive, rather than the exclusive, or here.)
Solution: We let C(x) be “x has visited Canada.” and M(x) be “x has visited
Mexico.” If the domain for 𝑥 consists of the students in this class, this statement
can be expressed as ∀𝑥(𝐶(𝑥) ∨ 𝑀(𝑥)).
Nested Quantifiers:
• When one quantifier is within the scope of another, is called nested
quantifiers.
Example: ∀x ∃y (x + y = 0).
• Note that everything within the scope of a quantifier can be thought of as a
propositional function.
Example: ∀𝑥 ∃𝑦(𝑥 + 𝑦 = 0) is the same thing as ∀𝑥 𝑄(𝑥), where 𝑄(𝑥) is
∃𝑦 𝑃(𝑥, 𝑦), where 𝑃(𝑥, 𝑦) is 𝑥 + 𝑦 = 0.
• Nested quantifiers commonly occur in mathematics and computer science.
• Although nested quantifiers can sometimes be difficult to understand, the rules
we have already studied till now can help us use them.
Understanding Statements Involving Nested Quantifiers
• Example: Assume that the domain for the variables x and y consists of all real
numbers. The statement ∀x∀y(x + y = y + x) says that x + y = y + x for all real
numbers x and y. This is the commutative law for addition of real numbers.
• Example: Likewise, the statement ∀x∃y(x + y = 0) says that for every real
number x there is a real number y such that x + y = 0. This states that every
real number has an additive inverse.
• Example: Similarly, the statement ∀x∀y∀z (x + (y + z) = (x + y) + z) is the
associative law for addition of real numbers.
Understanding Statements Involving Nested Quantifiers
Example: Translate into English the statement
∀𝑥 ∀𝑦 𝑥 > 0 ∧ 𝑦 < 0 → 𝑥𝑦 < 0 ,
where the domain for both variables consists of all real numbers.
Solution:
• This statement says that for every real number x and for every real number y, if x >
0 and y < 0, then xy < 0.
• That is, this statement says that for real numbers x and y, if x is positive and y
is negative, then xy is negative.
• This can be stated more succinctly as “The product of a positive real number
and a negative real number is always a negative real number.”
The Order of Quantifiers
• It is important to note that the order of the quantifiers is important, unless all the quantifiers are
universal quantifiers or all are existential quantifiers.
• Example: Let P(x, y) be the statement “x + y = y + x.”
∀𝑥∀𝑦 𝑃(𝑥, 𝑦) and ∀𝑦 ∀𝑥 𝑃(𝑥, 𝑦) have the same meaning.
• Example: Let Q(x, y) denote “x + y = 0.”
Are the quantifications ∃y ∀x Q(x, y) and ∀x ∃y Q(x, y) same?
Solution:
∃y ∀x Q(x, y) : “There is a real number y such that for every real number x, Q(x, y).”
Because there is no real number y such that x + y = 0 for all real numbers x, the
statement ∃𝑦 ∀𝑥 𝑄(𝑥, 𝑦) is false.
∀x ∃y Q(x, y) : “For every real number x there is a real number y such that Q(x, y).”
Given a real number x, there is a real number y such that x + y = 0; namely, y = −x.
Hence, the statement ∀x ∃y Q(x, y) is true.
Quantifications of Two Variables:
Example: Let Q(x, y, z) be the statement “x + y = z.”
What are the truth values of the statements ∀𝑥 ∀𝑦 ∃𝑧 𝑄(𝑥, 𝑦, 𝑧) and
∃𝑧 ∀𝑥 ∀𝑦 𝑄(𝑥, 𝑦, 𝑧), where the domain of all variables consists of all real
numbers?
Solution:
• Suppose that x and y are assigned values. Then, there exists a real number z
such that x + y = z. Consequently, the quantification ∀x ∀y ∃z Q(x, y, z),
which is the statement “For all real numbers x and for all real numbers y there
is a real number z such that x + y = z,” is true.
• ∃z ∀x ∀y Q(x, y, z), which is the statement “There is a real number z such that
for all real numbers x and for all real numbers y it is true that x + y = z,” is
false, because there is no value of z that satisfies the equation x + y = z for all
values of x and y.
Translating Mathematical Statements into Statements
Involving Nested Quantifiers
Example: Translate the statement “The sum of two positive integers is always positive” into a
logical expression.
Solution: To translate this statement into a logical expression, we first :
Step-1 (Rewrite so that the implied quantifiers and a domain are shown): “For every two integers,
if these integers are both positive, then the sum of these integers is positive.”
Step-2: Next, we introduce the variables x and y to obtain “For all positive integers x and y, x + y is
positive.” Consequently, we can express this statement as ∀𝑥 ∀𝑦 ((𝑥 > 0) ∧ (𝑦 > 0) → (𝑥 +
𝑦 > 0)), where the domain for both variables consists of all integers.
Alternate: Note that we could also translate this using the positive integers as the domain.
Then the statement “The sum of two positive integers is always positive” becomes “For
every two positive integers, the sum of these integers is positive.”
We can express this as ∀x ∀y (x + y > 0), where the domain for both variables consists of
all positive integers.
Translating Mathematical Statements into Statements
Involving Nested Quantifiers
Example: Translate the statement “Every real number except zero has a multiplicative
inverse.” (A multiplicative inverse of a real number x is a real number y such that xy = 1.)
Solution:
• We first rewrite this as “For every real number x except zero, x has a multiplicative
inverse.”
• We can rewrite this as “For every real number x, if x ≠ 0, then there exists a real number y
such that xy = 1.”
• This can be rewritten as ∀𝑥((𝑥 ≠ 0) → ∃𝑦(𝑥𝑦 = 1)).
Translating from Nested Quantifiers into English
Example: Translate the statement ∀𝑥(𝐶(𝑥) ∨ ∃𝑦(𝐶(𝑦) ∧ 𝐹(𝑥, 𝑦))) into
English, where C(x) is “x has a computer,” F(x, y) is “x and y are friends,” and
the domain for both x and y consists of all students in your school.
Solution:
The statement says that for every student x in your school, x has a computer or
there is a student y such that y has a computer and x and y are friends. In other
words, every student in your school has a computer or has a friend who has a
computer.
Example: Translate the statement ∃x∀y∀z((F(x, y) ∧ F(x, z) ∧ (y ≠ z)) → .F(y, z)) into
English, where F(a, b) means a and b are friends and the domain for x, y, and z consists of
all students in your school.
Solution:
• We first examine the expression (F(x, y) ∧ F(x, z) ∧ (y ≠ z)) → .F(y, z).
• This expression says that if students x and y are friends, and students x and z are friends,
and furthermore, if y and z are not the same student, then y and z are not friends.
• It follows that the original statement, which is triply quantified, says that there is a student
x such that for all students y and all students z other than y, if x and y are friends and x and
z are friends, then y and z are not friends.
• In other words, there is a student none of whose friends are also friends with each other.
Translating from Nested Quantifiers into English
Translating English Sentences into Logical Expressions
Example: Express the statement “If a person is female and is a parent, then this person is
someone’s mother” as a logical expression involving predicates, quantifiers with a domain
consisting of all people, and logical connectives.
Solution:
• “For every person x, if person x is female and person x is a parent, then there exists a
person y such that person x is the mother of person y”
• We introduce the propositional functions F(x) to represent “x is female,” P(x) to represent
“x is a parent,” and M(x, y) to represent “x is the mother of y.”
• The original statement can be represented as
∀𝑥((𝐹(𝑥) ∧ 𝑃(𝑥)) → ∃𝑦 𝑀(𝑥, 𝑦)).
• ∀𝑥 ∃𝑦 ((𝐹(𝑥) ∧ 𝑃(𝑥)) → 𝑀(𝑥, 𝑦)).
Translating English Sentences into Logical Expressions
• Example: Express the statement “Everyone has exactly one best friend” as a
logical expression involving predicates, quantifiers with a domain consisting of all
people, and logical connectives.
Solution:
• “Everyone has exactly one best friend”
• “For every person x, person x has exactly one best friend.”
• “∀x (person x has exactly one best friend),” where the domain consists of all
people.
• To say that x has exactly one best friend means that there is a person y who is the
best friend of x, and furthermore, that for every person z, if person z is not person y,
then z is not the best friend of x.
• When we introduce the predicate B(x, y) to be the statement “y is the best friend of
x,” the statement that x has exactly one best friend can be represented as
∃𝑦(𝐵(𝑥, 𝑦) ∧ ∀𝑧((𝑧 ≠ 𝑦) → ≦𝐵(𝑥, 𝑧))).
Translating English Sentences into Logical Expressions
Example: Use quantifiers to express the statement “There is a woman who
has taken a flight on every airline in the world.”
Solution:
• Let P(w, f) be “w has taken f ” and Q(f, a) be “f is a flight on a.” We can
express the statement as
∃𝒘 ∀𝒂 ∃𝒇 (𝑷(𝒘, 𝒇 ) ∧ 𝑸(𝒇, 𝒂)), where
• w consist of all the women in the world,
• f consist of all airplane flights, and all airlines
• a consist of all airlines
Negating Nested Quantifiers
Example: Express the negation of the statement ∀x ∃y (xy = 1) so that no
negation precedes a quantifier.
Solution:
• ¬∀𝑥 ∃𝑦 (𝑥𝑦 = 1) is equivalent to ∃𝑥 ≦∃𝑦 (𝑥𝑦 = 1),
• which is equivalent to ∃𝑥 ∀𝑦 ≦ 𝑥𝑦 = 1 ,
• which is equivalent to ∃𝑥 ∀𝑦 𝑥𝑦 ≠ 1 .
Problems on Nested Quantifiers: Home works
1.
Nested Quantifiers: Home works:
1.
Solution:
Problems on Nested Quantifiers: Home works
2.
Problems on Nested Quantifiers: Home works
2.
Solution:
Problems on Nested Quantifiers: Home works
3.
Problems on Nested Quantifiers: Home works
3.
Solution:
Problems on Nested Quantifiers: Home works
4.
Problems on Nested Quantifiers: Home works
4.
Solution:
Problems on Nested Quantifiers: Home works
5.
Solution:
Problems on Nested Quantifiers: Home works
6.
Solution:
Problems on Nested Quantifiers: Home works
7.
Problems on Nested Quantifiers: Home works
7.
Solution:
Problems on Nested Quantifiers: Home works
8.
Problems on Nested Quantifiers: Home works
8.
Solution:
Problems on Nested Quantifiers: Home works
9.
Problems on Nested Quantifiers: Home works
9.
Solution:
Problems on Nested Quantifiers: Home works
10.
Problems on Nested Quantifiers: Home works
10.
Solution:
Rules of Inference:
• Argument: argument is a sequence of statements ending in a conclusion.
• All but the final proposition in the argument are called premises
• the final proposition is called the conclusion.
• An argument is valid if the truth of all its premises implies that the conclusion is true.
• An argument form in propositional logic is a sequence of compound propositions
involving propositional variables. An argument form is valid if no matter which
particular propositions are substituted for the propositional variables in its premises,
the conclusion is true if the premises are all true.
Remark:
• From the definition of a valid argument form we see that the argument form with
premises 𝑝1, 𝑝2, … , 𝑝𝑛 and conclusion 𝑞 is valid exactly when (𝑝1 ∧ 𝑝2 ∧ ⋯ ∧
𝑝𝑛) → 𝑞 is a tautology.
• The key to showing that an argument in propositional logic is valid is to show that its
argument form is valid.
Rules of Inference:
• We can always use a truth table to show that an argument form is valid.
• We do this by showing that whenever the premises are true, the conclusion must
also be true.
• However, this can be a tedious approach.
• For example, when an argument form involves 10 different propositional
variables, to use a truth table to show this argument form is valid requires
210 = 1024 different rows.
• Fortunately, we do not have to resort to truth tables. Instead, we can first
establish the validity of some relatively simple argument forms, called rules of
inference.
• These rules of inference can be used as building blocks to construct more
complicated valid argument forms.
Rules of Inference for Propositional Logic
• Find the truth table for (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒 .
• Is it a contradiction, a tautology or contingency?
Rules of Inference for Propositional Logic
• Find the truth table for (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒 .
• Is it a contradiction, a tautology or contingency?
• The tautology (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒 is the basis of the rule of inference called modus
ponens, or the law of detachment. (Modus ponens is Latin for mode that affirms.)
• This tautology leads to the following valid argument form
• Modus ponens tells us that if a conditional statement and the hypothesis of this
conditional statement are both true, then the conclusion must also be true.
Modus Ponens
• 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.
1-Discrete Mathematics - 1 - Unit - 1.pdf
1-Discrete Mathematics - 1 - Unit - 1.pdf
Rules of Inference:
Example: State which rule of inference is used in the argument:
If it rains today, then we will not have a barbecue today.
If we do not have a barbecue today, then we will have a barbecue tomorrow.
Therefore, if it rains today, then we will have a barbecue tomorrow.
Solution:
• Let p be the proposition “It is raining today,”
• q be the proposition “We will not have a barbecue today,” and
• r be the proposition “We will have a barbecue tomorrow.”
• Then this argument is of the form
Hypothetical Syllogism.
Introduction to Proofs
Introduction to Proofs:
• A proof is a valid argument that establishes the truth of a mathematical statement.
• A proof can use the hypotheses of the theorem, if any, axioms assumed to be true, and
previously proven theorems.
• Using these ingredients and rules of inference, the final step of the proof establishes the
truth of the statement being proved.
Some Terminology:
• Formally, a theorem (facts/results) is a statement that can be shown to be true.
• In mathematical writing, the term theorem is usually reserved for a statement that is
considered at least somewhat important. Less important theorems sometimes are called
propositions.
• A proof is a valid argument that establishes the truth of a theorem.
• The statements used in a proof can include axioms (or postulates), the premises, if any,
of the theorem, and previously proven theorems.
• A less important theorem that is helpful in the proof of other results is called a lemma.
• A corollary is a theorem that can be established directly from a theorem that has been
proved.
• A conjecture is a statement that is being proposed to be a true statement, usually on the
basis of some partial evidence, a heuristic argument, or the intuition of an expert.
• When a proof of a conjecture is found, the conjecture becomes a theorem. Many times
conjectures are shown to be false, so they are not theorems.
Methods of Proof:
• There are different methods of proof as follows:
Direct method
Indirect method.
Contradiction method.
Vacuous method.
Method of induction etc.
Direct Proofs:
A direct proof of a conditional statement 𝑝 → 𝑞 is constructed when the first step is the
assumption that 𝑝 is true; subsequent steps are constructed using rules of inference, with
the final step showing that q must also be true.
Example: Give a direct proof of the theorem
“If n is an odd integer, then 𝑛2 is odd.”
Let 𝑃 𝑛 : “𝑛 is an odd integer” and Q(n): “𝑛2 is odd.”
We will prove: ∀𝑛 (𝑃(𝑛) → 𝑄(𝑛)), where the domain is the set of all integers.
Direct Proof:
• We assume that 𝑛 is odd, hence by definition 𝑛 = 2𝑘 + 1, for some integer 𝑘.
• 𝑛2 = 2𝑘 + 1 2 = 4𝑘2 + 4𝑘 + 1 = 2(2𝑘2 + 2𝑘) + 1
• By the definition of an odd integer, we can conclude that 𝑛2 is an odd integer.
Example: Give a direct proof that if 𝑚 and 𝑛 are both perfect squares, then 𝑛𝑚
is also a perfect square.
Direct Proof:
• Since m and n are perfect squares, 𝑚 = 𝑠2 and 𝑛 = 𝑡2 for some integers 𝑠
and 𝑡.
• Now using commutativity and associativity of multiplication, we have
𝑚𝑛 = 𝑠2
𝑡2
= 𝑠𝑠𝑡𝑡 = 𝑠𝑡𝑠𝑡 = 𝑠𝑡 2
.
• It follows that 𝑚𝑛 is also a perfect square.
Direct Proofs:
Problem: (Homework)
1) Use a direct proof to show that the sum of two even integers is even.
2) Use a direct proof to show that the product of two odd numbers is
odd.
3) Prove that if 𝑥 is rational and 𝑥 ≠ 0, then
1
𝑥
is rational.
Solution:
Proof by Contraposition (Indirect Proof):
• Conditional statement 𝑝 → 𝑞 can be proved by showing that its contrapositive,
≦𝑞 → ≦𝑝, is true.
• In a proof by contraposition of p → q, we take ≦𝑞 as a premise, and using axioms,
definitions, and previously proven theorems, together with rules of inference, we
show that ≦𝑝 must follow.
Example: Prove that if n is an integer and 3n + 2 is odd, then n is odd.
Proof:
• Assume that n is even,
• n = 2k for some integer k.
• 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1).
• This tells us that 3n + 2 is even
• Hence the theorem.
Should we have tried direct proof?
Proof by Contraposition (Indirect Proof):
• Conditional statement 𝑝 → 𝑞 can be proved by showing that its contrapositive, ≦𝑞 → ≦𝑝,
is true.
• In a proof by contraposition of p → q, we take ≦𝑞 as a premise, and using axioms,
definitions, and previously proven theorems, together with rules of inference, we show that
≦𝑝 must follow.
Example: Prove that if 𝑛 = 𝑎𝑏, where a and b are positive integers, then 𝑎 ≤ √ 𝑛 𝑜𝑟 𝑏 ≤ √ 𝑛.
Proof:
• “If 𝑛 = 𝑎𝑏, where a and b are positive integers, then a ≤ √ n or b ≤ √ n” is false.
• That is,we assume that the statement (a ≤ √ n) ∨ (b ≤ √ n) is false.
• Using the meaning of disjunction together with De Morgan‟s law, we see that this implies
that both a ≤ √ n and b ≤ √ n are false.
• This implies that a > √ n and b > √ n.
• This implies that ab > √ n ⋅ √ n = n.
• This shows that ab ≠ n, which contradicts the statement n = ab.
Vacuous proofs:
Example: Prove that if 𝑛 is an integer with 10 ≤ 𝑛 ≤ 15 which is a perfect square,
then 𝑛 is also a perfect cube.
Solution:
• Note that there are no perfect squares 𝑛 with 10 ≤ 𝑛 ≤ 15, because 32 = 9 and
42 = 16.
• Hence, the statement that 𝑛 is an integer with 10 ≤ 𝑛 ≤ 15 which is a perfect
square is false for all integers 𝑛.
• Consequently, the statement to be proved is true for all integers 𝑛.
Proofs by Contradiction:
Example: Prove that √2 is irrational by giving a proof by contradiction.
Solution:
• Let √2 is rational.
• We will show that this assumption leads to a contradiction.
• If √2 is rational, there exist integers 𝑎 and 𝑏 with √2 =
𝑎
𝑏
where 𝑏 ≠ 0 and 𝑎 and
𝑏 have no common factors (so that the fraction
𝑎
𝑏
is in lowest terms).
• 2 =
𝑎
𝑏
⟹ 2𝑏2 = 𝑎2 ⟹ 𝑎2 is even ⟹ 𝑎 is even ⟹ 𝑎 = 2𝑐, for some integer 𝑐.
• Thus 2𝑏2 = 4𝑐2 ⟹ 𝑏2 = 2𝑐2 ⟹ 𝑏2 is even ⟹ 𝑏 is even
• Thus both 𝑎 and 𝑏 have a common factor which is a contradiction to our
assumption.
• Hence our assumption is wrong.
• Hence √2 is irrational.
Problem: (Homework)
1. Prove that if 𝑥, 𝑦, and 𝑧 are integers and 𝑥 + 𝑦 + 𝑧 is odd, then at
least one of 𝑥, 𝑦, and 𝑧 is odd. (Use method of contradiction)
2. Prove that if n is an integer and 3n + 2 is even, then n is even, using
i) a proof by contraposition, ii) a proof by contradiction.
Solutions:
1.
2.
Mistakes in Proofs:
Example:
Mistakes in Proofs:
Example:
Solution: Every step is valid except for step 5, where we divided both sides by a − b. The error
is that a − b equals zero; division of both sides of an equation by the same quantity is valid as long as this
quantity is not zero.
Mathematical Induction
Principle of mathematical induction
• In general, mathematical induction can be used to prove statements
that assert that 𝑃(𝑛) is true for all positive integers 𝑛, where 𝑃(𝑛) is a
propositional function.
• To prove that 𝑃(𝑛) is true for all positive integers 𝑛, where 𝑃(𝑛) is a
propositional function, we complete two steps:
• Basis Step: We verify that 𝑃(1) is true.
• Inductive Step: We show that the conditional statement 𝑃(𝑘) →
𝑃(𝑘 + 1) is true for all positive integers 𝑘.
Example: Show that if 𝑛 is a positive integer, then
𝟏 + 𝟐 + ⋯ + 𝒏 =
𝒏(𝒏 + 𝟏)
𝟐
.
Solution: Let 𝑃(𝑛) be the proposition that 𝟏 + 𝟐 + ⋯ + 𝒏 =
𝒏(𝒏 + 𝟏)
𝟐
for all positive integer 𝑛.
Basis Step: P(1) is true, because 1 = 1(1 + 1) 2.
Inductive Step:
• We assume that 𝑃(𝑘) holds for an arbitrary positive integer k.
• That is, we assume that 1 + 2 + ⋯ + 𝑘 =
𝑘(𝑘 + 1)
2
• Now 1 + 2 + ⋯ + 𝑘 + 𝑘 + 1 =
𝑘 𝑘 + 1
2
+ 𝑘 + 1 =
𝑘 + 1 𝑘+2
2
• i.e., 𝑃(𝑘 + 1) is true.
Example: Use mathematical induction to show that
𝟏 + 𝟐 + 𝟐𝟐
+ ⋯ + 𝟐𝒏
= 𝟐𝒏+𝟏
− 𝟏
for all nonnegative integers n.
Solution: Let 𝑃(𝑛) be the proposition that 𝟏 + 𝟐 + 𝟐𝟐 + ⋯ + 𝟐𝒏 = 𝟐𝒏+𝟏 −
𝟏 for all nonnegative integers n.
Basis Step: 𝑃(0) is true because 20 = 1 = 21 − 1.
Inductive Step:
• We assume that P(k) holds for an arbitrary nonnegative integer k.
• That is, we assume that
1 + 2 + 22 + ⋯ + 2𝑘 = 2𝑘+1 − 1
• Now 𝟏 + 𝟐 + 𝟐𝟐 + ⋯ + 𝟐𝒌 + 𝟐𝒌+𝟏 = 1 + 2 + 22 + ⋯ + 2𝑘 +
2𝑘+1 = (2𝑘+1−1) + 2𝑘+1 = 2. 2𝑘+1 − 1 = 2𝑘+2 − 1 = 𝟐 𝒌+𝟏 +𝟏 − 𝟏.
• i.e., 𝑃(𝑘 + 1) is true.
Example: Use mathematical induction to show that
𝟏𝟐 + 𝟐𝟐 + 𝟑𝟐 + ⋯ + 𝒏𝟐 =
𝒏 𝒏 + 𝟏 𝟐𝒏 + 𝟏
𝟔
for all positive integers n.
Solution: Let 𝑃(𝑛) be the proposition that 𝟏𝟐
+ 𝟐𝟐
+ 𝟑𝟐
+ ⋯ + 𝒏𝟐
=
𝒏 𝒏+𝟏 𝟐𝒏+𝟏
𝟔
for
all positive integers n.
Basis Step: 𝑃(1) is true because 12 = 1 =
1 1+1 2+1
6
.
Inductive Step:
• We assume that P(k) holds for an arbitrary positive integer k.
• That is, we assume that
12
+ 22
+ 32
+ ⋯ + 𝑘2
=
𝑘 𝑘 + 1 2𝑘 + 1
6
• Now 𝟏𝟐
+ 𝟐𝟐
+ 𝟑𝟐
+ ⋯ + 𝒌𝟐
+ 𝒌 + 𝟏 𝟐
= 12
+ 22
+ 32
+ ⋯ + 𝑘2
+
𝑘 + 1 2 =
𝑘 𝑘+1 2𝑘+1
6
+ 𝑘 + 1 2 = 𝑘 + 1 *
𝑘 2𝑘+1
6
+ 𝑘 + 1 + =
𝒌+𝟏 𝒌+𝟐 𝟐𝒌+𝟑
𝟔
• i.e., 𝑃(𝑘 + 1) is true.
Example: Use mathematical induction to show that
𝟏𝟑 + 𝟐𝟑 + 𝟑𝟑 + ⋯ + 𝒏𝟑 = *
𝒏 𝒏 + 𝟏
𝟐
+𝟐
for all positive integers n.
Solution: Let 𝑃(𝑛) be the proposition that 13
+ 23
+ 33
+ ⋯ + 𝑛3
= *
𝑛 𝑛+1
2
+2
for all
positive integers n.
Basis Step: 𝑃(1) is true because 13 = 1 =
1 1+1
2
2
.
Inductive Step:
• We assume that P(k) holds for an arbitrary positive integer k.
• That is, we assume that
13 + 23 + 33 + ⋯ + 𝑘3 = *
𝑘 𝑘 + 1
2
+2
• Now 𝟏𝟑 + 𝟐𝟑 + 𝟑𝟑 + ⋯ + 𝒌𝟑 + 𝒌 + 𝟏 𝟑 = (13 + 23 + 33 + ⋯ + 𝑘3) +
𝑘 + 1 3 = *
𝑘 𝑘+1
2
+2 + 𝑘 + 1 3 = 𝑘 + 1 2*
𝑘2
4
+ 𝑘 + 1 + = *
𝒌+𝟏 (𝒌+𝟐)
𝟐
+𝟐
• i.e., 𝑃(𝑘 + 1) is true.
Example: Use mathematical induction to show that, for any positive integer 𝑛 ,
𝑛3
+ 2𝑛 is divisible by 3.
Solution:
Example: Use mathematical induction to show that, for any positive integer 𝑛 ,
𝑛3
− 𝑛 is divisible by 3.
Solution:
Example: Use mathematical induction to show that, for any nonnegative integer 𝑛 ,
𝑎𝑟𝑗 = 𝑎 + 𝑎𝑟 + 𝑎𝑟2 + ⋯ + 𝑎𝑟𝑛 =
𝑎𝑟𝑛+1
− 𝑎
𝑟 − 1
, 𝑟 ≠ 1
𝑛
𝑗=0
where 𝑛 is a nonnegative integer.
Solution:
Example: Use mathematical induction to show that, 𝑛 < 2𝑛
for all positive
integers 𝑛.
Solution:
Example: Use mathematical induction to show that, 2𝑛
< 𝑛! for all integers 𝑛 ≥ 4.
Solution:
• Example: Use mathematical induction to prove that 7𝑛+2
+ 82𝑛+1
is divisible by
57 for every nonnegative integer n..
Solution:
• Example: Use mathematical induction to prove that 7𝑛+2
+ 82𝑛+1
is divisible by
57 for every nonnegative integer n..
Solution:
Example:
Solution:
Example:
Solution:
Example:
Solution:
1-Discrete Mathematics - 1 - Unit - 1.pdf

More Related Content

PPT
Discrete Maths141 - Course Outline and Lecture Slides
PPTX
Foundation_Logic_1.pptx discrete mathematics
PPTX
DISCRETE MATHEMATICS for IT students.pptx
PPTX
DISCRETE MATHEMATICS Presenatation for IT
PPTX
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
PPTX
Mathematical Language Presentationn.pptx
PPTX
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
PPTX
Math in the modern world math as a language.pptx
Discrete Maths141 - Course Outline and Lecture Slides
Foundation_Logic_1.pptx discrete mathematics
DISCRETE MATHEMATICS for IT students.pptx
DISCRETE MATHEMATICS Presenatation for IT
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
Mathematical Language Presentationn.pptx
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Math in the modern world math as a language.pptx

Similar to 1-Discrete Mathematics - 1 - Unit - 1.pdf (20)

PPT
lectures in prolog in order to advance in artificial intelligence
PPT
Chapter 1: The Foundations: Logic and Proofs
PPTX
General concepts of digital electronics and
PPTX
DiscreteMathematicsfor btechAsWeProgress.pptx
PPT
lecture011712 (1).ppt
PDF
Computer Science Engineering: Discrete mathematics & graph theory, THE GATE A...
PPT
First order predicate logic - Artificial Intelligence
PPT
PPTX
PPTX
Boolean algebra
PPTX
LOGIC.pptx. To uphold certainty in validity of mathematical statements or to ...
PPTX
LECTURE 1: LOGICAL OPERATORS-A SIGNIFICANT PART OF MATHS.pptx
PDF
Discrete Mathematics Lecture Notes
PPTX
dicrete math engineering all over presentation
PDF
Lesson_-_1_Fundamentals_of_Logic_and_Equivalence
PPT
1019Lec1.ppt
PPTX
Rahul [Autosaveedgthhughouhjhhfdfd].pptx
PDF
maths module social science.pdf
PPTX
BOOLEAN ALGEBRA1.pptx
lectures in prolog in order to advance in artificial intelligence
Chapter 1: The Foundations: Logic and Proofs
General concepts of digital electronics and
DiscreteMathematicsfor btechAsWeProgress.pptx
lecture011712 (1).ppt
Computer Science Engineering: Discrete mathematics & graph theory, THE GATE A...
First order predicate logic - Artificial Intelligence
Boolean algebra
LOGIC.pptx. To uphold certainty in validity of mathematical statements or to ...
LECTURE 1: LOGICAL OPERATORS-A SIGNIFICANT PART OF MATHS.pptx
Discrete Mathematics Lecture Notes
dicrete math engineering all over presentation
Lesson_-_1_Fundamentals_of_Logic_and_Equivalence
1019Lec1.ppt
Rahul [Autosaveedgthhughouhjhhfdfd].pptx
maths module social science.pdf
BOOLEAN ALGEBRA1.pptx
Ad

Recently uploaded (20)

PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
RMMM.pdf make it easy to upload and study
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Introduction to Building Materials
PDF
advance database management system book.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Classroom Observation Tools for Teachers
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Indian roads congress 037 - 2012 Flexible pavement
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
A systematic review of self-coping strategies used by university students to ...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
A powerpoint presentation on the Revised K-10 Science Shaping Paper
RMMM.pdf make it easy to upload and study
Unit 4 Skeletal System.ppt.pptxopresentatiom
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Chinmaya Tiranga quiz Grand Finale.pdf
Introduction to Building Materials
advance database management system book.pdf
Weekly quiz Compilation Jan -July 25.pdf
Classroom Observation Tools for Teachers
LDMMIA Reiki Yoga Finals Review Spring Summer
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Digestion and Absorption of Carbohydrates, Proteina and Fats
Final Presentation General Medicine 03-08-2024.pptx
Indian roads congress 037 - 2012 Flexible pavement
Orientation - ARALprogram of Deped to the Parents.pptx
Ad

1-Discrete Mathematics - 1 - Unit - 1.pdf

  • 1. Discrete Mathematics (22MAT121) Dr. Sayantan Mandal Department of Mathematics
  • 7. Few Rules to remember: •Always ask me if you do not understand a single thing that has been taught (Even if it is very silly or common). •Do not be afraid or shy to ask questions. If you are, you may not learn the subject properly. •Never miss your homework. Try to do it on the same day. •Never miss an assignment. This will contribute to your final grade.
  • 8. How to contact me: • Email Id: m_sayantan@av.amrita.edu • WhatsApp No: +91 9493595817
  • 9. What is Discrete Mathematics? • Consider an analog clock (One with hands that continuously rotate and show time in a continuous fashion) • A digital clock (It shows time in discrete fashion). • The former one gives the idea of Continuous Mathematics whereas the later one gives the idea of Discrete Mathematics. • Thus, Continuous Mathematics deals with continuous functions, differential and integral calculus etc. • Discrete mathematics deals with mathematical topics in the sense that it analyzes data whose values are separated (such as integers: Number line has gaps)
  • 10. What is Discrete Mathematics? • Example of continuous math – Given a fixed surface area, what are the dimensions of a cylinder that maximizes volume? • Example of Discrete Math – Given a fixed set of characters, and a length, how many different passwords can you construct? How many edges in graph with n vertices? How many ways to choose a team of two people from a group of n?
  • 11. Why do you learn Discrete Mathematics? • This course provides some of the mathematical foundations and skills that you need in your further study of Information Technology and Computer Science & Engineering. • These topics include Logic, Counting Methods, Relation and Function, Recurrence Relation and Generating Function, Number theory etc.
  • 12. Unit I: Propositional logic and counting theory
  • 13. Logic • Every statement in Mathematics must be precise. • There can‟t be Mathematics without proofs and each proof needs proper reasoning. • Proper reasoning involves logic. • The dictionary meaning of „Logic‟ is the science of reasoning. • The rules of logic give precise meaning to mathematical statements. • These rules are used to distinguish between valid & invalid mathematical arguments. • In addition to its importance in mathematical reasoning, logic has numerous applications in computer science to verify the correctness of programs, • to prove the theorems in natural & physical sciences to draw conclusion from experiments, • in social sciences & in our daily lives to solve a great number of problems.
  • 14. Proposition (Or Statement) •A proposition (or a statement) is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both.
  • 15. Examples: For Example, consider, the following sentences: 1. Vijayawada is in Andhra Pradesh. 2. Do your homework. 3. What is your age? 4. 2+4 = 6. 5. 2+4 = 9. 6. 7>9. 7. The square of 5 is 25. 8. May God Bless you! 9. Read this carefully. Which of the above sentences are propositions?
  • 16. Examples: Consider the following sentences: 1. Vijayawada is in Andhra Pradesh (It is a proposition) (True) 2. Vijayawada is in Kerala (It is a proposition) (False) 3. Do your homework. (Not a proposition) (It is a Command) 4. What is your age? (Not a proposition) 5. 2+4 = 6. (It is a Proposition) (True) 6. 2+4 = 9 (It is a Proposition) (False) 7. 7>9. (It is a Proposition) (False) 8. The square of 5 is 25. (It is a proposition) (True) 9. May God Bless you! (Not a proposition) 10. Read this carefully. (Not a proposition)
  • 17. Examples: Consider the following: Is this a proposition?
  • 18. Examples: For Example, consider the following: Is this a proposition? Not a proposition because this is neither true nor false. Note that it can be turned into a proposition if we assign values to the variables.
  • 19. Examples: For Example, consider the following: Is this a proposition?
  • 20. Notations: • We use letters to denote propositional variables (or statement variables), that is, variables that represent propositions, just as letters are used to denote numerical variables. • The conventional letters used for propositional variables are p, q , r, s, . . . . • The truth value of a proposition is true, denoted by T , if it is a true proposition and false, denoted by F, if it is a false proposition.
  • 21. Propositional logic • The area of logic that deals with propositions is called the propositional calculus or propositional logic. • It was first developed systematically by the Greek philosopher Aristotle more than 2300 years ago.
  • 22. Compound Propositions • We now turn our attention to methods for producing new propositions from those that we already have. • These methods were discussed by the English mathematician George Boole in 1854 in his book The Laws of Thought. • Many mathematical statements are constructed by combining one or more propositions. • New propositions, called compound propositions, are formed from existing propositions using logical operators.
  • 25. Example Find the negation of the proposition "At least 10 inches of rain fell today in Amaravati." and express this in simple English.
  • 26. Example Find the negation of the proposition "At least 10 inches of rain fell today in Amaravati." and express this in simple English. Solution: The negation is "It is not the case that at least 10 inches of rain fell today in Amaravati." This negation can be more simply expressed by "Less than 10 inches of rain fell today in Amaravati."
  • 27. Truth Table: • The truth table for Negation is as follows: • The negation of a proposition can also be considered the result of the operation of the negation operator on a proposition. • The negation operator constructs a new proposition from a single existing proposition. • We will now introduce the logical operators that are used to form new propositions from two or more existing propositions. These logical operators are also called CONNECTIVES.
  • 35. Remark: • The use of the connective OR in a disjunction corresponds to one of the two ways the word OR is used in English, namely, in an inclusive way. • A disjunction is true when at least one of the two propositions is true. For instance, the inclusive OR is being used in the statement.. • "Students who have taken calculus OR differential equation can take this class." • Here, we mean that students who have taken both calculus and computer science can take the class, as well as the students who have taken only one of the two subjects.
  • 36. Remark: • On the other hand, we are using the exclusive OR when we say • "Students who have taken calculus OR computer science, but not both, can enroll in this class." • Here, we mean that students who have taken both calculus and a computer science course cannot take the class. Only those who have taken exactly one of the two courses can take the class. • Similarly, when a menu at a restaurant states, "Soup OR salad comes with an entree" • The restaurant almost always means that customers can have either soup or salad, but not both. • Hence, this is an exclusive, rather than an inclusive, OR.
  • 39. Logical Connective: Conditional Statements Remark:
  • 41. Variety of terminology for conditional statements:
  • 42. Example: • For example, the pledge many politicians make when running for office is "If I am elected, then I will lower taxes." • If the politician is elected, voters would expect this politician to lower taxes. • Furthermore, if the politician is not elected, then voters will not have any expectation that this person will lower taxes, although the person may have sufficient influence to cause those in power to lower taxes. • It is only when the politician is elected but does not lower taxes that voters can say that the politician has broken the campaign pledge. • This last scenario corresponds to the case when p is true, but q is false in p --> q .
  • 45. Converse, Inverse and Contra positive of a conditional statement :
  • 49. Logical Connective: Biconditionals Write the truth table for Biconditionals.
  • 50. Logical Connective: Biconditionals Write the truth table for Biconditionals.
  • 53. Implicit use of biconditionals: • Be aware that biconditionals are not always explicit in natural language. • In particular, the "if and only if" construction used in biconditionals is rarely used in common language. • Instead, biconditionals are often expressed using an "if, then" or an "only if" construction. • The other part of the "if and only if" is implicit. That is, the converse is implied, but not stated. • For example, consider the statement in English "If you finish your meal, then you can have dessert." • What is really meant is "You can have dessert if and only if you finish your meal."
  • 54. Implicit use of biconditionals • This last statement is logically equivalent to the two statements "If you finish your meal, then you can have dessert" and "You can have dessert only if you finish your meal." • Because of this imprecision in natural language, we need to make an assumption whether a conditional statement in natural language implicitly includes its converse. • Because precision is essential in mathematics and in logic, we will always distinguish between the conditional statement p --> q and the biconditional statement p <-->q .
  • 55. Truth Tables of Compound Propositions • We have now introduced four important logical connectives--conjunctions, disjunctions, conditional statements, and biconditional statements-as well as negations. • We can use these connectives to build up complicated compound propositions involving any number of propositional variables. • We can use truth tables to determine the truth values of these compound propositions
  • 57. 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.
  • 59. Propositional Equivalences • An important type of step used in a mathematical argument is the replacement of a statement with another statement with the same truth value. • Because of this, methods that produce propositions with the same truth value as a given compound proposition are used extensively in the construction of mathematical arguments. • Because of this, methods that produce propositions with the same truth value as a given compound proposition are used extensively in the construction of mathematical arguments.
  • 60. Tautology, Contradiction, Contigency • A compound proposition that is always true, no matter what the truth values of the propositions that occur in it, is called a tautology. • A compound proposition that is always false is called a contradiction. • A compound proposition that is neither a tautology nor a contradiction is called a contingency.
  • 62. Logical Equivalences • Compound propositions that have the same truth values in all possible cases are called logically equivalent. We can also define this notion as follows. Definition:
  • 63. Logical Equivalences • One way to determine whether two compound propositions are equivalent is to use a truth table. • In particular, the compound propositions p and q are equivalent if and only if the columns giving their truth values agree. • Find the truth table for • Find the truth table for • What do you observe? • What do you conclude?
  • 65. Example: • Find the truth table for • Find the truth table for • What do you observe? • What do you conclude?
  • 67. Example: • Find the truth table for • Find the truth table for • Are they logically equivalent?
  • 69. Example: • Find the truth table for • Find the truth table for • Are they logically equivalent?
  • 71. • In these equivalences, T denotes the compound propo sition that is always true and • F denotes the compound proposition that is always false.
  • 72. • In these equivalences, T denotes the compound propo sition that is always true and • F denotes the compound proposition that is always false.
  • 84. Predicate: • Statements involving variables, such as "𝑥 > 3", "𝑥 = 𝑦 + 3", "𝑥 + 𝑦 = 𝑧", “Computer 𝑥 is under attack by an intruder” are often found in mathematical assertions, in computer programs, and in system specifications. • These statements are neither true nor false when the values of the variables are not specified. • The statement "𝒙 is greater than 𝟑" has two parts. • The first part, the variable 𝑥, is the subject of the statement. • The second part-the predicate, "is greater than 3"-refers to a property that the subject of the statement can have. • We can denote the statement "𝒙 is greater than 3" by 𝑷(𝒙), where 𝑷 denotes the predicate "is greater than 3" and 𝒙 is the variable. • The statement 𝑷 𝒙 is also said to be the value of the propositional function P at 𝑥. • the statement 𝑷 𝒙 becomes a proposition and has a truth value.
  • 85. Predicate: Propositional function with more than one variable: EXAMPLE:
  • 89. Quantifiers: • When the variables in a propositional function are assigned values, the resulting statement becomes a proposition with a certain truth value. • However, there is another important way, called quantification, to create a proposition from a propositional function. • Quantification expresses the extent to which a predicate is true over a range of elements. • In English, the words all, some, many, none, and few are used in quantifications. • Two types of quantifications:  Universal quantification (which tells us that a predicate is true for every element under consideration)  Existential quantification (which tells us that there is one or more element under consideration for which the predicate is true) • The area of logic that deals with predicates and quantifiers is called the predicate calculus
  • 90. The Universal Quantifier: • Many mathematical statements assert that a property is true for all values of a variable in a particular domain, called the domain of discourse (or the universe of discourse), often just referred to as the domain. • Such a statement is expressed using universal quantification. • The universal quantification of 𝑷(𝒙) for a particular domain is the proposition that asserts that 𝑷(𝒙) is true for all values of 𝒙 in this domain. • Note that the domain specifies the possible values of the variable 𝑥. • The meaning of the universal quantification of 𝑃(𝑥) changes when we change the domain. • The domain must always be specified when a universal quantifier is used; without it, the universal quantification of a statement is not defined.
  • 91. Definition: The universal quantification of 𝑃(𝑥) is the statement “𝑷(𝒙) for all values of 𝒙 in the domain.” • The notation ∀𝒙 𝑷(𝒙) denotes the universal quantification of P(x). • Here ∀ is called the universal quantifier. • We read ∀𝑥 𝑃(𝑥) as “for all 𝑥𝑃(𝑥)” or “for every 𝑥𝑃(𝑥).” • An element for which P(x) is false is called a counterexample to ∀xP(x). The Universal Quantifier:
  • 92. Example: Let 𝑃(𝑥) be the statement “𝑥 + 1 > 𝑥. ” What is the truth value of the quantification ∀𝑥 𝑃(𝑥), where the domain consists of all real numbers? Solution: Because P(x) is true for all real numbers x, the quantification ∀𝑥 𝑃(𝑥) is true. • Remark: Generally, an implicit assumption is made that all domains of discourse for quantifiers are non-empty. Note that if the domain is empty, then ∀x P(x) is true for any propositional function P(x) because there are no elements x in the domain for which P(x) is false. The Universal Quantifier:
  • 93. Remark: • A statement ∀x P(x) is false, where P(x) is a propositional function, if and only if P(x) is not always true when x is in the domain. • One way to show that P(x) is not always true when x is in the domain is to find a counterexample to the statement ∀x P(x). • Note that a single counterexample is all we need to establish that ∀x P(x) is false. The Universal Quantifier:
  • 97. Definition: The existential quantification of 𝑃(𝑥) is the proposition “There exists an element x in the domain such that P(x).” • We use the notation ∃x P(x) for the existential quantification of P(x). • Here ∃ is called the existential quantifier. The Existential Quantifier:
  • 98. Remark: • A domain must always be specified when a statement ∃x P(x) is used. • Furthermore, the meaning of ∃x P(x) changes when the domain changes. • Without specifying the domain, the statement ∃x P(x) has no meaning. The Existential Quantifier:
  • 100. The Existential Quantifier: • Remark: Generally, an implicit assumption is made that all domains of discourse for quantifiers are nonempty. If the domain is empty, then ∃𝑥 𝑄(𝑥) is false whenever 𝑄(𝑥) is a propositional function because when the domain is empty, there can be no element 𝑥 in the domain for which 𝑄(𝑥) is true.
  • 101. • There is no limitation on the number of different quantifiers we can define, such as “there are exactly two,” “there are no more than three,” “there are at least 100,” and so on. • The one that is most often seen is the uniqueness quantifier, denoted by ∃! • The notation ∃!x P(x) states “There exists a unique x such that P(x) is true.” • For instance, ∃! 𝑥 (𝑥 − 1 = 0), where the domain is the set of real numbers, states that there is a unique real number x such that x − 1 = 0. This is a true statement, as x = 1 is the unique real number such that x − 1 = 0. The Uniqueness Quantifier:
  • 102. Quantifiers over Finite Domains: • When the domain of a quantifier is finite, that is, when all its elements can be listed, quantified statements can be expressed using propositional logic. • In particular, when the elements of the domain are 𝑥1, 𝑥2 , … , 𝑥𝑛, where 𝑛 is a positive integer, the universal quantification ∀x P(x) is the same as the conjunction 𝑷 𝒙𝟏 ∧ 𝑷 𝒙𝟐 ∧ ⋯ ∧ 𝑷(𝒙𝒏), because this conjunction is true if and only if 𝑃(𝑥1), 𝑃(𝑥2), … , 𝑃(𝑥𝑛) are all true.
  • 103. Quantifiers over Finite Domains: • Similarly, when the elements of the domain are 𝑥1, 𝑥2, … , 𝑥𝑛, where n is a positive integer, the existential quantification ∃𝑥 𝑃(𝑥) is the same as the disjunction 𝑷 𝒙𝟏 ∧ 𝑷 𝒙𝟐 ∧ ⋯ ∧ 𝑷 𝒙𝒏 because this disjunction is true if and only if at least one of 𝑃(𝑥1), 𝑃(𝑥2), … , 𝑃(𝑥𝑛) is true.
  • 104. Quantifiers with Restricted Domains: • An abbreviated notation is often used to restrict the domain of a quantifier. • In this notation, a condition a variable must satisfy is included after the quantifier. Example: What do the statements ∀𝑥 < 0 𝑥2 > 0 mean, where the domain in each case consists of the real numbers? Solution: The statement ∀𝑥 < 0 (𝑥2 > 0) states that for every real number 𝑥 with 𝑥 < 0, 𝑥2 > 0. Example: What do the statements ∀𝑦 ≠ 0 (𝑦3 ≠ 0) mean, where the domain in each case consists of the real numbers? Solution: • The statement ∀𝑦 ≠ 0 (𝑦3 ≠ 0) states that for every real number 𝑦 with 𝑦 ≠ 0, we have 𝑦3 ≠ 0. • That is, it states “The cube of every nonzero real number is nonzero.” This statement is equivalent to ∀𝑦(𝑦 ≠ 0 → 𝑦3 ≠ 0).
  • 105. Quantifiers with Restricted Domains: Example: What do the statements ∃𝑧 > 0 (𝑧2 = 2) mean, where the domain in each case consists of the real numbers? Solution: • The statement ∃𝑧 > 0 (𝑧2 = 2) states that there exists a real number 𝑧 with 𝑧 > 0 such that 𝑧2 = 2. • That is, it states “There is a positive square root of 2.” • This statement is equivalent to ∃𝑧(𝑧 > 0 ∧ 𝑧2 = 2). Remark: • Note that the restriction of a universal quantification is the same as the universal quantification of a conditional statement. • For instance, ∀𝑥 < 0 (𝑥2 > 0) is another way of expressing ∀𝑥(𝑥 < 0 → 𝑥2 > 0). • On the other hand, the restriction of an existential quantification is the same as the existential quantification of a conjunction. • For instance, ∃𝑧 > 0 (𝑧2 = 2) is another way of expressing ∃𝑧(𝑧 > 0 ∧ 𝑧2 = 2).
  • 106. Precedence of Quantifiers: • The quantifiers ∀ and ∃ have higher precedence than all logical operators from propositional calculus. • For example, ∀𝑥𝑃(𝑥) ∨ 𝑄(𝑥) is the disjunction of ∀𝑥 𝑃(𝑥) and 𝑄(𝑥). • In other words, it means (∀𝑥𝑃(𝑥)) ∨ 𝑄(𝑥) rather than ∀𝑥(𝑃(𝑥) ∨ 𝑄(𝑥)).
  • 107. 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 or set equal to a particular value is said to be free. • All the variables that occur in a propositional function must be bound or set equal to a particular value to turn it into a proposition. • This can be done using a combination of universal quantifiers, existential quantifiers, and value assignments. • The part of a logical expression to which a quantifier is applied is called the scope of this quantifier. Consequently, a variable is free if it is outside the scope of all quantifiers in the formula that specify this variable.
  • 108. Example: • In the statement ∃𝑥 𝑃 𝑥 ∧ 𝑄 𝑥 ∨ ∀𝑥 𝑅(𝑥), all variables are bound. • The scope of the first quantifier, ∃𝑥, is the expression 𝑃(𝑥) ∧ 𝑄(𝑥), because ∃𝑥 is applied only to 𝑃(𝑥) ∧ 𝑄(𝑥) and not to the rest of the statement. • Similarly, the scope of the second quantifier, ∀𝑥, is the expression 𝑅(𝑥). That is, the existential quantifier binds the variable 𝑥 in 𝑃(𝑥) ∧ 𝑄(𝑥) and the universal quantifier ∀𝑥 binds the variable 𝑥 in 𝑅 𝑥 . • Observe that we could have written our statement using two different variables x and y, as ∃𝑥(𝑃(𝑥) ∧ 𝑄(𝑥)) ∨ ∀𝑦𝑅(𝑦), because the scopes of the two quantifiers do not overlap. Example: • In the statement ∃𝑥(𝑥 + 𝑦 = 1), the variable 𝑥 is bound by the existential quantification ∃𝑥, • but the variable 𝑦 is free because it is not bound by a quantifier and no value is assigned to this variable. • This illustrates that in the statement ∃𝑥(𝑥 + 𝑦 = 1), 𝑥 is bound, but 𝑦 is free.
  • 109. Negating Quantified Expressions • We will often want to consider the negation of a quantified expression. For instance, consider the negation of the statement • “Every student in your class has taken a course in calculus.” • This statement is a universal quantification, namely, ∀𝑥𝑃(𝑥), • where 𝑃(𝑥) is the statement Assessment “𝑥 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, ∃𝑥 ≦𝑃(𝑥). • This example illustrates the following logical equivalence: ≦∀𝒙𝑷(𝒙) ≡ ∃𝒙 ≦𝑷(𝒙).
  • 110. Example: Show that ≦∀𝑥 𝑃 𝑥 and ∃𝑥 ≦𝑃(𝑥) are logically equivalent. Solution: ≦∀𝑥 𝑃(𝑥) is true if and only if ∀𝑥𝑃(𝑥) is false. ∀𝑥 𝑃(𝑥) is false if and only if there is an element x in the domain for which 𝑃(𝑥) is false. There is an element x in the domain for which 𝑃(𝑥) is false if and only if there is an element x in the domain for which ¬𝑃(𝑥) is true. ∃𝑥 ≦𝑃(𝑥) is true.
  • 111. Example: Show that ≦∃𝑥 𝑄 𝑥 and ∀𝑥 ≦𝑄(𝑥) are logically equivalent. Solution: ≦∃𝑥 𝑄 𝑥 is true if and only if ∃𝑥 𝑄 𝑥 is false. ∃𝑥 𝑄 𝑥 is false if and only if no 𝑥 exists in the domain for which 𝑄(𝑥) is true. No 𝑥 exists in the domain for which 𝑄(𝑥) is true if and only if 𝑄(𝑥) is false for every 𝑥 in the domain. 𝑄(𝑥) is false for every 𝑥 in the domain if and only if ≦𝑄(𝑥) is true for all x in the domain, ∀𝑥 ≦𝑄(𝑥) is true.
  • 112. De Morgan’s Laws for Quantifiers.
  • 113. Example: What is the negation of the statement ∀𝑥 𝑥2 > 𝑥 ? Solution: • The negation of ∀𝑥(𝑥2 > 𝑥) is the statement ≦∀𝑥(𝑥2 > 𝑥), which is equivalent to ∃𝑥≦(𝑥2 > 𝑥). • This can be rewritten as ∃𝑥(𝑥2 ≤ 𝑥). Example: What is the negation of the statement ∃𝑥 𝑥2 = 2 ? Solution: • The negation of ∃𝑥(𝑥2 = 2) is the statement ≦∃𝑥(𝑥2 = 2), which is equivalent to ∀𝑥 ≦(𝑥2 = 2). • This can be rewritten as ∀𝑥(𝑥2 ≠ 2).
  • 114. Example: Show that ≦∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(𝑃(𝑥) ∧ ≦𝑄(𝑥)) are logically equivalent. Solution: By De Morgan‟s law for universal quantifiers, we know that, ≦∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(≦(𝑃(𝑥) → 𝑄(𝑥))) are logically equivalent. We also know that ≦(𝑃(𝑥) → 𝑄(𝑥)) and 𝑃(𝑥) ∧ ≦𝑄(𝑥) are logically equivalent for every x. • Because we can substitute one logically equivalent expression for another in a logical equivalence, it follows that ≦∀𝑥(𝑃(𝑥) → 𝑄(𝑥)) and ∃𝑥(𝑃(𝑥) ∧ ≦𝑄(𝑥)) are logically equivalent.
  • 115. Translating from English into Logical Expressions • Translating sentences in English (or other natural languages) into logical expressions is a crucial task in mathematics, logic programming, artificial intelligence, software engineering, and many other disciplines Example: Express the statement “Every student in this class has studied calculus” using predicates and quantifiers. Solution: We introduce C(x), which is the statement “x has studied calculus.” Consequently, if the domain for x consists of the students in the class, we can translate our statement as ∀𝑥 𝐶(𝑥).
  • 116. Translating from English into Logical Expressions Example: Express the statement “Some student in this class has visited Mexico” using predicates and quantifiers. Solution: 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 ∃𝑥 𝑀(𝑥). Example: Express the statement “Every student in this class has visited either Canada or Mexico” using predicates and quantifiers. (Note that we are assuming the inclusive, rather than the exclusive, or here.) Solution: We let C(x) be “x has visited Canada.” and M(x) be “x has visited Mexico.” If the domain for 𝑥 consists of the students in this class, this statement can be expressed as ∀𝑥(𝐶(𝑥) ∨ 𝑀(𝑥)).
  • 117. Nested Quantifiers: • When one quantifier is within the scope of another, is called nested quantifiers. Example: ∀x ∃y (x + y = 0). • Note that everything within the scope of a quantifier can be thought of as a propositional function. Example: ∀𝑥 ∃𝑦(𝑥 + 𝑦 = 0) is the same thing as ∀𝑥 𝑄(𝑥), where 𝑄(𝑥) is ∃𝑦 𝑃(𝑥, 𝑦), where 𝑃(𝑥, 𝑦) is 𝑥 + 𝑦 = 0. • Nested quantifiers commonly occur in mathematics and computer science. • Although nested quantifiers can sometimes be difficult to understand, the rules we have already studied till now can help us use them.
  • 118. Understanding Statements Involving Nested Quantifiers • Example: Assume that the domain for the variables x and y consists of all real numbers. The statement ∀x∀y(x + y = y + x) says that x + y = y + x for all real numbers x and y. This is the commutative law for addition of real numbers. • Example: Likewise, the statement ∀x∃y(x + y = 0) says that for every real number x there is a real number y such that x + y = 0. This states that every real number has an additive inverse. • Example: Similarly, the statement ∀x∀y∀z (x + (y + z) = (x + y) + z) is the associative law for addition of real numbers.
  • 119. Understanding Statements Involving Nested Quantifiers Example: Translate into English the statement ∀𝑥 ∀𝑦 𝑥 > 0 ∧ 𝑦 < 0 → 𝑥𝑦 < 0 , where the domain for both variables consists of all real numbers. Solution: • This statement says that for every real number x and for every real number y, if x > 0 and y < 0, then xy < 0. • That is, this statement says that for real numbers x and y, if x is positive and y is negative, then xy is negative. • This can be stated more succinctly as “The product of a positive real number and a negative real number is always a negative real number.”
  • 120. The Order of Quantifiers • It is important to note that the order of the quantifiers is important, unless all the quantifiers are universal quantifiers or all are existential quantifiers. • Example: Let P(x, y) be the statement “x + y = y + x.” ∀𝑥∀𝑦 𝑃(𝑥, 𝑦) and ∀𝑦 ∀𝑥 𝑃(𝑥, 𝑦) have the same meaning. • Example: Let Q(x, y) denote “x + y = 0.” Are the quantifications ∃y ∀x Q(x, y) and ∀x ∃y Q(x, y) same? Solution: ∃y ∀x Q(x, y) : “There is a real number y such that for every real number x, Q(x, y).” Because there is no real number y such that x + y = 0 for all real numbers x, the statement ∃𝑦 ∀𝑥 𝑄(𝑥, 𝑦) is false. ∀x ∃y Q(x, y) : “For every real number x there is a real number y such that Q(x, y).” Given a real number x, there is a real number y such that x + y = 0; namely, y = −x. Hence, the statement ∀x ∃y Q(x, y) is true.
  • 121. Quantifications of Two Variables:
  • 122. Example: Let Q(x, y, z) be the statement “x + y = z.” What are the truth values of the statements ∀𝑥 ∀𝑦 ∃𝑧 𝑄(𝑥, 𝑦, 𝑧) and ∃𝑧 ∀𝑥 ∀𝑦 𝑄(𝑥, 𝑦, 𝑧), where the domain of all variables consists of all real numbers? Solution: • Suppose that x and y are assigned values. Then, there exists a real number z such that x + y = z. Consequently, the quantification ∀x ∀y ∃z Q(x, y, z), which is the statement “For all real numbers x and for all real numbers y there is a real number z such that x + y = z,” is true. • ∃z ∀x ∀y Q(x, y, z), which is the statement “There is a real number z such that for all real numbers x and for all real numbers y it is true that x + y = z,” is false, because there is no value of z that satisfies the equation x + y = z for all values of x and y.
  • 123. Translating Mathematical Statements into Statements Involving Nested Quantifiers Example: Translate the statement “The sum of two positive integers is always positive” into a logical expression. Solution: To translate this statement into a logical expression, we first : Step-1 (Rewrite so that the implied quantifiers and a domain are shown): “For every two integers, if these integers are both positive, then the sum of these integers is positive.” Step-2: Next, we introduce the variables x and y to obtain “For all positive integers x and y, x + y is positive.” Consequently, we can express this statement as ∀𝑥 ∀𝑦 ((𝑥 > 0) ∧ (𝑦 > 0) → (𝑥 + 𝑦 > 0)), where the domain for both variables consists of all integers. Alternate: Note that we could also translate this using the positive integers as the domain. Then the statement “The sum of two positive integers is always positive” becomes “For every two positive integers, the sum of these integers is positive.” We can express this as ∀x ∀y (x + y > 0), where the domain for both variables consists of all positive integers.
  • 124. Translating Mathematical Statements into Statements Involving Nested Quantifiers Example: Translate the statement “Every real number except zero has a multiplicative inverse.” (A multiplicative inverse of a real number x is a real number y such that xy = 1.) Solution: • We first rewrite this as “For every real number x except zero, x has a multiplicative inverse.” • We can rewrite this as “For every real number x, if x ≠ 0, then there exists a real number y such that xy = 1.” • This can be rewritten as ∀𝑥((𝑥 ≠ 0) → ∃𝑦(𝑥𝑦 = 1)).
  • 125. Translating from Nested Quantifiers into English Example: Translate the statement ∀𝑥(𝐶(𝑥) ∨ ∃𝑦(𝐶(𝑦) ∧ 𝐹(𝑥, 𝑦))) into English, where C(x) is “x has a computer,” F(x, y) is “x and y are friends,” and the domain for both x and y consists of all students in your school. Solution: The statement says that for every student x in your school, x has a computer or there is a student y such that y has a computer and x and y are friends. In other words, every student in your school has a computer or has a friend who has a computer.
  • 126. Example: Translate the statement ∃x∀y∀z((F(x, y) ∧ F(x, z) ∧ (y ≠ z)) → .F(y, z)) into English, where F(a, b) means a and b are friends and the domain for x, y, and z consists of all students in your school. Solution: • We first examine the expression (F(x, y) ∧ F(x, z) ∧ (y ≠ z)) → .F(y, z). • This expression says that if students x and y are friends, and students x and z are friends, and furthermore, if y and z are not the same student, then y and z are not friends. • It follows that the original statement, which is triply quantified, says that there is a student x such that for all students y and all students z other than y, if x and y are friends and x and z are friends, then y and z are not friends. • In other words, there is a student none of whose friends are also friends with each other. Translating from Nested Quantifiers into English
  • 127. Translating English Sentences into Logical Expressions Example: Express the statement “If a person is female and is a parent, then this person is someone’s mother” as a logical expression involving predicates, quantifiers with a domain consisting of all people, and logical connectives. Solution: • “For every person x, if person x is female and person x is a parent, then there exists a person y such that person x is the mother of person y” • We introduce the propositional functions F(x) to represent “x is female,” P(x) to represent “x is a parent,” and M(x, y) to represent “x is the mother of y.” • The original statement can be represented as ∀𝑥((𝐹(𝑥) ∧ 𝑃(𝑥)) → ∃𝑦 𝑀(𝑥, 𝑦)). • ∀𝑥 ∃𝑦 ((𝐹(𝑥) ∧ 𝑃(𝑥)) → 𝑀(𝑥, 𝑦)).
  • 128. Translating English Sentences into Logical Expressions • Example: Express the statement “Everyone has exactly one best friend” as a logical expression involving predicates, quantifiers with a domain consisting of all people, and logical connectives. Solution: • “Everyone has exactly one best friend” • “For every person x, person x has exactly one best friend.” • “∀x (person x has exactly one best friend),” where the domain consists of all people. • To say that x has exactly one best friend means that there is a person y who is the best friend of x, and furthermore, that for every person z, if person z is not person y, then z is not the best friend of x. • When we introduce the predicate B(x, y) to be the statement “y is the best friend of x,” the statement that x has exactly one best friend can be represented as ∃𝑦(𝐵(𝑥, 𝑦) ∧ ∀𝑧((𝑧 ≠ 𝑦) → ≦𝐵(𝑥, 𝑧))).
  • 129. Translating English Sentences into Logical Expressions Example: Use quantifiers to express the statement “There is a woman who has taken a flight on every airline in the world.” Solution: • Let P(w, f) be “w has taken f ” and Q(f, a) be “f is a flight on a.” We can express the statement as ∃𝒘 ∀𝒂 ∃𝒇 (𝑷(𝒘, 𝒇 ) ∧ 𝑸(𝒇, 𝒂)), where • w consist of all the women in the world, • f consist of all airplane flights, and all airlines • a consist of all airlines
  • 130. Negating Nested Quantifiers Example: Express the negation of the statement ∀x ∃y (xy = 1) so that no negation precedes a quantifier. Solution: • ¬∀𝑥 ∃𝑦 (𝑥𝑦 = 1) is equivalent to ∃𝑥 ≦∃𝑦 (𝑥𝑦 = 1), • which is equivalent to ∃𝑥 ∀𝑦 ≦ 𝑥𝑦 = 1 , • which is equivalent to ∃𝑥 ∀𝑦 𝑥𝑦 ≠ 1 .
  • 131. Problems on Nested Quantifiers: Home works 1.
  • 132. Nested Quantifiers: Home works: 1. Solution:
  • 133. Problems on Nested Quantifiers: Home works 2.
  • 134. Problems on Nested Quantifiers: Home works 2. Solution:
  • 135. Problems on Nested Quantifiers: Home works 3.
  • 136. Problems on Nested Quantifiers: Home works 3. Solution:
  • 137. Problems on Nested Quantifiers: Home works 4.
  • 138. Problems on Nested Quantifiers: Home works 4. Solution:
  • 139. Problems on Nested Quantifiers: Home works 5.
  • 141. Problems on Nested Quantifiers: Home works 6.
  • 143. Problems on Nested Quantifiers: Home works 7.
  • 144. Problems on Nested Quantifiers: Home works 7. Solution:
  • 145. Problems on Nested Quantifiers: Home works 8.
  • 146. Problems on Nested Quantifiers: Home works 8. Solution:
  • 147. Problems on Nested Quantifiers: Home works 9.
  • 148. Problems on Nested Quantifiers: Home works 9. Solution:
  • 149. Problems on Nested Quantifiers: Home works 10.
  • 150. Problems on Nested Quantifiers: Home works 10. Solution:
  • 151. Rules of Inference: • Argument: argument is a sequence of statements ending in a conclusion. • All but the final proposition in the argument are called premises • the final proposition is called the conclusion. • An argument is valid if the truth of all its premises implies that the conclusion is true. • An argument form in propositional logic is a sequence of compound propositions involving propositional variables. An argument form is valid if no matter which particular propositions are substituted for the propositional variables in its premises, the conclusion is true if the premises are all true. Remark: • From the definition of a valid argument form we see that the argument form with premises 𝑝1, 𝑝2, … , 𝑝𝑛 and conclusion 𝑞 is valid exactly when (𝑝1 ∧ 𝑝2 ∧ ⋯ ∧ 𝑝𝑛) → 𝑞 is a tautology. • The key to showing that an argument in propositional logic is valid is to show that its argument form is valid.
  • 152. Rules of Inference: • We can always use a truth table to show that an argument form is valid. • We do this by showing that whenever the premises are true, the conclusion must also be true. • However, this can be a tedious approach. • For example, when an argument form involves 10 different propositional variables, to use a truth table to show this argument form is valid requires 210 = 1024 different rows. • Fortunately, we do not have to resort to truth tables. Instead, we can first establish the validity of some relatively simple argument forms, called rules of inference. • These rules of inference can be used as building blocks to construct more complicated valid argument forms.
  • 153. Rules of Inference for Propositional Logic • Find the truth table for (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒 . • Is it a contradiction, a tautology or contingency?
  • 154. Rules of Inference for Propositional Logic • Find the truth table for (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒 . • Is it a contradiction, a tautology or contingency? • The tautology (𝒑 ∧ (𝒑 → 𝒒)) → 𝒒 is the basis of the rule of inference called modus ponens, or the law of detachment. (Modus ponens is Latin for mode that affirms.) • This tautology leads to the following valid argument form • Modus ponens tells us that if a conditional statement and the hypothesis of this conditional statement are both true, then the conclusion must also be true.
  • 155. Modus Ponens • 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.
  • 158. Rules of Inference: Example: State which rule of inference is used in the argument: If it rains today, then we will not have a barbecue today. If we do not have a barbecue today, then we will have a barbecue tomorrow. Therefore, if it rains today, then we will have a barbecue tomorrow. Solution: • Let p be the proposition “It is raining today,” • q be the proposition “We will not have a barbecue today,” and • r be the proposition “We will have a barbecue tomorrow.” • Then this argument is of the form Hypothetical Syllogism.
  • 160. Introduction to Proofs: • A proof is a valid argument that establishes the truth of a mathematical statement. • A proof can use the hypotheses of the theorem, if any, axioms assumed to be true, and previously proven theorems. • Using these ingredients and rules of inference, the final step of the proof establishes the truth of the statement being proved.
  • 161. Some Terminology: • Formally, a theorem (facts/results) is a statement that can be shown to be true. • In mathematical writing, the term theorem is usually reserved for a statement that is considered at least somewhat important. Less important theorems sometimes are called propositions. • A proof is a valid argument that establishes the truth of a theorem. • The statements used in a proof can include axioms (or postulates), the premises, if any, of the theorem, and previously proven theorems. • A less important theorem that is helpful in the proof of other results is called a lemma. • A corollary is a theorem that can be established directly from a theorem that has been proved. • A conjecture is a statement that is being proposed to be a true statement, usually on the basis of some partial evidence, a heuristic argument, or the intuition of an expert. • When a proof of a conjecture is found, the conjecture becomes a theorem. Many times conjectures are shown to be false, so they are not theorems.
  • 162. Methods of Proof: • There are different methods of proof as follows: Direct method Indirect method. Contradiction method. Vacuous method. Method of induction etc.
  • 163. Direct Proofs: A direct proof of a conditional statement 𝑝 → 𝑞 is constructed when the first step is the assumption that 𝑝 is true; subsequent steps are constructed using rules of inference, with the final step showing that q must also be true. Example: Give a direct proof of the theorem “If n is an odd integer, then 𝑛2 is odd.” Let 𝑃 𝑛 : “𝑛 is an odd integer” and Q(n): “𝑛2 is odd.” We will prove: ∀𝑛 (𝑃(𝑛) → 𝑄(𝑛)), where the domain is the set of all integers. Direct Proof: • We assume that 𝑛 is odd, hence by definition 𝑛 = 2𝑘 + 1, for some integer 𝑘. • 𝑛2 = 2𝑘 + 1 2 = 4𝑘2 + 4𝑘 + 1 = 2(2𝑘2 + 2𝑘) + 1 • By the definition of an odd integer, we can conclude that 𝑛2 is an odd integer.
  • 164. Example: Give a direct proof that if 𝑚 and 𝑛 are both perfect squares, then 𝑛𝑚 is also a perfect square. Direct Proof: • Since m and n are perfect squares, 𝑚 = 𝑠2 and 𝑛 = 𝑡2 for some integers 𝑠 and 𝑡. • Now using commutativity and associativity of multiplication, we have 𝑚𝑛 = 𝑠2 𝑡2 = 𝑠𝑠𝑡𝑡 = 𝑠𝑡𝑠𝑡 = 𝑠𝑡 2 . • It follows that 𝑚𝑛 is also a perfect square. Direct Proofs:
  • 165. Problem: (Homework) 1) Use a direct proof to show that the sum of two even integers is even. 2) Use a direct proof to show that the product of two odd numbers is odd. 3) Prove that if 𝑥 is rational and 𝑥 ≠ 0, then 1 𝑥 is rational.
  • 167. Proof by Contraposition (Indirect Proof): • Conditional statement 𝑝 → 𝑞 can be proved by showing that its contrapositive, ≦𝑞 → ≦𝑝, is true. • In a proof by contraposition of p → q, we take ≦𝑞 as a premise, and using axioms, definitions, and previously proven theorems, together with rules of inference, we show that ≦𝑝 must follow. Example: Prove that if n is an integer and 3n + 2 is odd, then n is odd. Proof: • Assume that n is even, • n = 2k for some integer k. • 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1). • This tells us that 3n + 2 is even • Hence the theorem. Should we have tried direct proof?
  • 168. Proof by Contraposition (Indirect Proof): • Conditional statement 𝑝 → 𝑞 can be proved by showing that its contrapositive, ≦𝑞 → ≦𝑝, is true. • In a proof by contraposition of p → q, we take ≦𝑞 as a premise, and using axioms, definitions, and previously proven theorems, together with rules of inference, we show that ≦𝑝 must follow. Example: Prove that if 𝑛 = 𝑎𝑏, where a and b are positive integers, then 𝑎 ≤ √ 𝑛 𝑜𝑟 𝑏 ≤ √ 𝑛. Proof: • “If 𝑛 = 𝑎𝑏, where a and b are positive integers, then a ≤ √ n or b ≤ √ n” is false. • That is,we assume that the statement (a ≤ √ n) ∨ (b ≤ √ n) is false. • Using the meaning of disjunction together with De Morgan‟s law, we see that this implies that both a ≤ √ n and b ≤ √ n are false. • This implies that a > √ n and b > √ n. • This implies that ab > √ n ⋅ √ n = n. • This shows that ab ≠ n, which contradicts the statement n = ab.
  • 169. Vacuous proofs: Example: Prove that if 𝑛 is an integer with 10 ≤ 𝑛 ≤ 15 which is a perfect square, then 𝑛 is also a perfect cube. Solution: • Note that there are no perfect squares 𝑛 with 10 ≤ 𝑛 ≤ 15, because 32 = 9 and 42 = 16. • Hence, the statement that 𝑛 is an integer with 10 ≤ 𝑛 ≤ 15 which is a perfect square is false for all integers 𝑛. • Consequently, the statement to be proved is true for all integers 𝑛.
  • 170. Proofs by Contradiction: Example: Prove that √2 is irrational by giving a proof by contradiction. Solution: • Let √2 is rational. • We will show that this assumption leads to a contradiction. • If √2 is rational, there exist integers 𝑎 and 𝑏 with √2 = 𝑎 𝑏 where 𝑏 ≠ 0 and 𝑎 and 𝑏 have no common factors (so that the fraction 𝑎 𝑏 is in lowest terms). • 2 = 𝑎 𝑏 ⟹ 2𝑏2 = 𝑎2 ⟹ 𝑎2 is even ⟹ 𝑎 is even ⟹ 𝑎 = 2𝑐, for some integer 𝑐. • Thus 2𝑏2 = 4𝑐2 ⟹ 𝑏2 = 2𝑐2 ⟹ 𝑏2 is even ⟹ 𝑏 is even • Thus both 𝑎 and 𝑏 have a common factor which is a contradiction to our assumption. • Hence our assumption is wrong. • Hence √2 is irrational.
  • 171. Problem: (Homework) 1. Prove that if 𝑥, 𝑦, and 𝑧 are integers and 𝑥 + 𝑦 + 𝑧 is odd, then at least one of 𝑥, 𝑦, and 𝑧 is odd. (Use method of contradiction) 2. Prove that if n is an integer and 3n + 2 is even, then n is even, using i) a proof by contraposition, ii) a proof by contradiction.
  • 174. Mistakes in Proofs: Example: Solution: Every step is valid except for step 5, where we divided both sides by a − b. The error is that a − b equals zero; division of both sides of an equation by the same quantity is valid as long as this quantity is not zero.
  • 176. Principle of mathematical induction • In general, mathematical induction can be used to prove statements that assert that 𝑃(𝑛) is true for all positive integers 𝑛, where 𝑃(𝑛) is a propositional function. • To prove that 𝑃(𝑛) is true for all positive integers 𝑛, where 𝑃(𝑛) is a propositional function, we complete two steps: • Basis Step: We verify that 𝑃(1) is true. • Inductive Step: We show that the conditional statement 𝑃(𝑘) → 𝑃(𝑘 + 1) is true for all positive integers 𝑘.
  • 177. Example: Show that if 𝑛 is a positive integer, then 𝟏 + 𝟐 + ⋯ + 𝒏 = 𝒏(𝒏 + 𝟏) 𝟐 . Solution: Let 𝑃(𝑛) be the proposition that 𝟏 + 𝟐 + ⋯ + 𝒏 = 𝒏(𝒏 + 𝟏) 𝟐 for all positive integer 𝑛. Basis Step: P(1) is true, because 1 = 1(1 + 1) 2. Inductive Step: • We assume that 𝑃(𝑘) holds for an arbitrary positive integer k. • That is, we assume that 1 + 2 + ⋯ + 𝑘 = 𝑘(𝑘 + 1) 2 • Now 1 + 2 + ⋯ + 𝑘 + 𝑘 + 1 = 𝑘 𝑘 + 1 2 + 𝑘 + 1 = 𝑘 + 1 𝑘+2 2 • i.e., 𝑃(𝑘 + 1) is true.
  • 178. Example: Use mathematical induction to show that 𝟏 + 𝟐 + 𝟐𝟐 + ⋯ + 𝟐𝒏 = 𝟐𝒏+𝟏 − 𝟏 for all nonnegative integers n. Solution: Let 𝑃(𝑛) be the proposition that 𝟏 + 𝟐 + 𝟐𝟐 + ⋯ + 𝟐𝒏 = 𝟐𝒏+𝟏 − 𝟏 for all nonnegative integers n. Basis Step: 𝑃(0) is true because 20 = 1 = 21 − 1. Inductive Step: • We assume that P(k) holds for an arbitrary nonnegative integer k. • That is, we assume that 1 + 2 + 22 + ⋯ + 2𝑘 = 2𝑘+1 − 1 • Now 𝟏 + 𝟐 + 𝟐𝟐 + ⋯ + 𝟐𝒌 + 𝟐𝒌+𝟏 = 1 + 2 + 22 + ⋯ + 2𝑘 + 2𝑘+1 = (2𝑘+1−1) + 2𝑘+1 = 2. 2𝑘+1 − 1 = 2𝑘+2 − 1 = 𝟐 𝒌+𝟏 +𝟏 − 𝟏. • i.e., 𝑃(𝑘 + 1) is true.
  • 179. Example: Use mathematical induction to show that 𝟏𝟐 + 𝟐𝟐 + 𝟑𝟐 + ⋯ + 𝒏𝟐 = 𝒏 𝒏 + 𝟏 𝟐𝒏 + 𝟏 𝟔 for all positive integers n. Solution: Let 𝑃(𝑛) be the proposition that 𝟏𝟐 + 𝟐𝟐 + 𝟑𝟐 + ⋯ + 𝒏𝟐 = 𝒏 𝒏+𝟏 𝟐𝒏+𝟏 𝟔 for all positive integers n. Basis Step: 𝑃(1) is true because 12 = 1 = 1 1+1 2+1 6 . Inductive Step: • We assume that P(k) holds for an arbitrary positive integer k. • That is, we assume that 12 + 22 + 32 + ⋯ + 𝑘2 = 𝑘 𝑘 + 1 2𝑘 + 1 6 • Now 𝟏𝟐 + 𝟐𝟐 + 𝟑𝟐 + ⋯ + 𝒌𝟐 + 𝒌 + 𝟏 𝟐 = 12 + 22 + 32 + ⋯ + 𝑘2 + 𝑘 + 1 2 = 𝑘 𝑘+1 2𝑘+1 6 + 𝑘 + 1 2 = 𝑘 + 1 * 𝑘 2𝑘+1 6 + 𝑘 + 1 + = 𝒌+𝟏 𝒌+𝟐 𝟐𝒌+𝟑 𝟔 • i.e., 𝑃(𝑘 + 1) is true.
  • 180. Example: Use mathematical induction to show that 𝟏𝟑 + 𝟐𝟑 + 𝟑𝟑 + ⋯ + 𝒏𝟑 = * 𝒏 𝒏 + 𝟏 𝟐 +𝟐 for all positive integers n. Solution: Let 𝑃(𝑛) be the proposition that 13 + 23 + 33 + ⋯ + 𝑛3 = * 𝑛 𝑛+1 2 +2 for all positive integers n. Basis Step: 𝑃(1) is true because 13 = 1 = 1 1+1 2 2 . Inductive Step: • We assume that P(k) holds for an arbitrary positive integer k. • That is, we assume that 13 + 23 + 33 + ⋯ + 𝑘3 = * 𝑘 𝑘 + 1 2 +2 • Now 𝟏𝟑 + 𝟐𝟑 + 𝟑𝟑 + ⋯ + 𝒌𝟑 + 𝒌 + 𝟏 𝟑 = (13 + 23 + 33 + ⋯ + 𝑘3) + 𝑘 + 1 3 = * 𝑘 𝑘+1 2 +2 + 𝑘 + 1 3 = 𝑘 + 1 2* 𝑘2 4 + 𝑘 + 1 + = * 𝒌+𝟏 (𝒌+𝟐) 𝟐 +𝟐 • i.e., 𝑃(𝑘 + 1) is true.
  • 181. Example: Use mathematical induction to show that, for any positive integer 𝑛 , 𝑛3 + 2𝑛 is divisible by 3. Solution:
  • 182. Example: Use mathematical induction to show that, for any positive integer 𝑛 , 𝑛3 − 𝑛 is divisible by 3. Solution:
  • 183. Example: Use mathematical induction to show that, for any nonnegative integer 𝑛 , 𝑎𝑟𝑗 = 𝑎 + 𝑎𝑟 + 𝑎𝑟2 + ⋯ + 𝑎𝑟𝑛 = 𝑎𝑟𝑛+1 − 𝑎 𝑟 − 1 , 𝑟 ≠ 1 𝑛 𝑗=0 where 𝑛 is a nonnegative integer. Solution:
  • 184. Example: Use mathematical induction to show that, 𝑛 < 2𝑛 for all positive integers 𝑛. Solution:
  • 185. Example: Use mathematical induction to show that, 2𝑛 < 𝑛! for all integers 𝑛 ≥ 4. Solution:
  • 186. • Example: Use mathematical induction to prove that 7𝑛+2 + 82𝑛+1 is divisible by 57 for every nonnegative integer n.. Solution:
  • 187. • Example: Use mathematical induction to prove that 7𝑛+2 + 82𝑛+1 is divisible by 57 for every nonnegative integer n.. Solution: