Chapter-2 Foundation QuantifierProofsAlgorithm
Chapter-2 Foundation QuantifierProofsAlgorithm
EMath 1105
DISCRETE MATHEMATICS I for SE
Quantifications:
➢ all
➢ some
➢ many
➢ none
➢ few
1. Universal Quantification ∀
➢ tells us that a predicate is true for every element
under consideration
QUANTIFIERS
PROOF TECHNIQUES
PROOF TECHNIQUES
Recall:
Theorem – is a statement that can be shown to be true
(under certain conditions)
For example,
➢ If 𝑥 is an integer and 𝑥 is odd, then 𝑥 2 is odd,
or, equivalently,
PROOF TECHNIQUES
2) As Implications/conditional statement
▪ For all integers x, if x is even, then x + 1 is odd.
3) As bi-implications/biconditional statement
▪ For all integers x, x is even if and only if x is divisible by 2.
1. DIRECT PROOF
Example:
Prove that, for all integers 𝒙, if 𝒙 is odd, then
𝒙𝟐 is odd.
DIRECT PROOF
Example:
Prove that, for all integers 𝒂, if 𝒙 is odd, then 𝒂𝟐 is odd.
PROOF TECHNIQUES
2. INDIRECT PROOF
PROOF TECHNIQUES
3. PROOF BY CONTRADICTION
Thus, 𝑏 2 = 𝑎
Squaring both sides: 2𝑏² = 𝑎²
So 𝑎² is even, which implies that a must also be even
So we can write a = 2c, where c is also an integer
Substitution into the original equation: 2𝑏2 = 2𝑐 2 = 4𝑐2
Dividing both sides by 2 yields 𝑏2 = 2𝑐2
Solution:
To show that this statement is false, we look for a
counterexample, which is a particular integer that is not the
sum of the squares of two integers
3 – cannot be written as the sum of the squares of two
integers
Therefore, we have shown that “ Every positive integer is
the sum of the squares of two integers.” is false.
Example:
(1) Prove that the product of even integers is an even integer.
Solution:
Suppose: x & y are even integers
Then: x = 2m & y = 2n for some integers m & n
For example,
Every integer is a rational number.
3 is an integer.
Therefore, 3 is a rational number.
x is an integer.
P(x): x is an integer.
x is an integer.
Example:
P(x): x is an even integer,
Consider Q(2,3),
ALGORITHM
➢ An algorithm is a finite sequence of precise
instructions for performing a computation or
for solving a problem.
➢ The term algorithm is a corruption of the name
al-Khowarizmi, a mathematician of the ninth
century, whose book on Hindu numerals is the
basis of modern decimal notation.
➢ Originally, the word algorism was used for the
rules for performing arithmetic using decimal
notation.
ALGORITHM
PROPERTIES OF ALGORITHMS
There are several properties that algorithms generally share. They are
useful to keep in mind when algorithms are described. These properties
are:
1. Input. An algorithm has input values from a specified
set.
2. Output. From each set of input values an algorithm
produces output values from a specified set.
The output values are the solution to the
problem.
3.Definiteness. The steps of an algorithm must be
defined precisely.
ENGR. M.M. ALIMO-OT / ENGR. Y.S.SACRAMENTO
FACULTY – ECE DEPARTMENT
EMath 1105 - Discrete Mathematics I for SE
ALGORITHM
4. Correctness. An algorithm should produce the correct
output values for each set of input values.
5. Finiteness. An algorithm should produce the desired output
after a finite (but perhaps large) number of
steps for any input in the set.
6. Effectiveness. It must be possible to perform each step of
an algorithm exactly and in a finite amount of
time.
7. Generality. The procedure should be applicable for all
problems of the desired form, not just for a
particular set of input values.
GREEDY ALGORITHM
➢ One of the simplest approaches often leads to a solution
of an optimization problem.
➢ This approach selects the best choice at each step,
instead of considering all sequences of steps that may
lead to an optimal solution.
GREEDY ALGORITHM
➢ Note that we call the algorithm “greedy” whether or not it
finds an optimal solution.
REFERENCE: