Discrete - Mathematics 2021 3
Discrete - Mathematics 2021 3
Contain:
1\ Logic
2\ Sets, Functions, Relations
3\ Induction, Recursion
4\ Counting
5\ Graph Theory and Trees
6\ Boolean Algebras
Text :
Kenneth H. Rosen, Discrete Mathematics and Its Applications, 7th- ed, McGraw-Hill (2012).
Reference:
1. Epp, S. S. , Discrete mathematics with applications, Cengage learning (2010).
2. Goodaire, E. , & Parmenter, M. M., Discrete mathematics with graph theory, Prentice Hall PTR (2002).
The Foundations: Logic and Proofs
Logic :
It is a formal language for representing knowledge and for making logical inferences.
By logic, we define:
1. Syntax of statements. 2. The meaning of statements. 3. The rules of logical inferences.
Proposition:
It is a declarative sentence that is either true or false, but not both.
Remark :
1. We will use the letters p; q; r; s; ……. for propositional variables.
2. The truth value of a proposition is true (T) if it is a true proposition, and the truth value is false (F) if it is a
false proposition.
For the following are propositions:
1. “Khartoum is in Sudan ” (true) 2.“London is in Denmark” (false)
3. “2 < 4” (true), 4. “4 = 7 (false)”.
However the following are not propositions:
1. “what is your name?” (this is a question) 2. “do your homework” (this is a command)
3. “this sentence is false” (neither true nor false)
4. “x is an even number” (it depends on what x represents), “
The truth or falsehood of a proposition is called its truth value.
Connectives, Truth Tables.:
Connectives are used for making compound propositions. The main ones are the following (p and q represent
given propositions):
Name Represented Meaning
Negation “ Not ”
Conjunction “ and ”
Disjunction “ or ”
Exclusive Or “either or , but not both”
Implication “if then ”
Biconditional “ if and only if ”
Example :
1. Prop. : Today is Friday. : It is not the case that today is Friday
2. Prop. : Ali eats ice-cream every day. : It is not the case that Ali eats ice-cream every day.
3. Prop. : 10 is prime number. : It is not the case that 10 is prime number.
Conjunction and Disjunction :
Let p and q be propositions.
1. The conjunction of and , denoted by , is the proposition " and ." The conjunction is true when
both and are true and is false otherwise.
2. The disjunction of and , denoted by , is the proposition "p or q." The disjunction is false when
both p and q are false and is true otherwise.
T T T T
T F F T
F T F T
F F F F
Example: Find the truth value of the following propositions:
1. 13 is a perfect square and 5 + 2 = 7. ( )
2. 9 is a prime number or 5 + 2 = 8. ( )
3 . 9 is perfect square and 13 is a prime number. ( )
Exclusive Or :
Let and be propositions. The proposition " exclusive or ", denoted by , is true when exactly one of
and is true and it is false otherwise.
T T F
T F T
F T T
F F F
T T T
T F F
F T T
F F T
Example :
1. Consider the two propositions: : "Ali studies hard" , : "Ali will get a good grade".
Express the statement as a statement in language.
2. Find the truth value of the statement: "if 10 is not prime numbers, then 2+3=6". ( )
3. Find the truth value of the statement: "if 9 is a perfect square, then 13 is a prime number". ( )
4. If = 3, what is the value of the variable x after the statement: "if 2 + 2 = 4, then ". ( )
T T F F T T T T
T F F T F T F T
F T T F T F T F
F F T T T T T T
The truth table of the contrapositive, and the truth table of the conditional statement are
same .
Note that the converse and the inverse are both same truth table also .
T T T
T F F
F T F
F F T
Remark:
1. From the truth table, note that the statement is true when both the conditional statements and
are true and is false otherwise. That is, is equivalent to ( ) ( ).
2. This illustrate why we express this logical connective by "if and only if" and why it is symbolically written
by combining the symbols and .
3. There are some other common ways to express :
(a) " is necessary and sufficient for ." (b) "if then , and conversely."
Tautology, Contradiction, Contingency.
1. A proposition is said to be a tautology if its truth value is T for any assignment of truth values to its
components.
For example: The proposition is a tautology.
2. A proposition is said to be a contradiction if its truth value is F for any assignment of truth values to its
components.
For example: The proposition is a contradiction.
3. A proposition that is neither a tautology nor a contradiction is called a contingency.
T F T F
F T T F
T T F T T
T F F F F
F T T T T
F F T T T
Note that the compound propositions and q have the same truth values then and q are
logically equivalent
Example : Show that ( ) :
Solution:
( ) ( )
( )
Exercise:
A) Construct the truth table of the compound proposition:
1. ( ) ( ) 2. ( ) ( ) 3. ( )
B) Prove that :
1. ( ) 2. ( ) 3. ( )
4. ( ) 5. ( ) ( ) is a tautology.
6. ( ) ( ) is a contradiction.
is invalid
Solution:
( ) ( ) ,( ) ( )- ( )
T T
T F
F T
F F
This argument is invalid because ,( ) ( )- ( ) is not a tautology.
Example : (Modus Ponens or the method of affirming)
a. Show that the argument
is valid.
b. Show that the argument
is valid.
Dr. Nader William Amin Page 7
Solution:
a)
( ) ,( ) -
T T
T F
F T
F F
This argument is valid because ,( ) - is a tautology.
b) Follows from (a) by replacing with and with .
Example : Show that the argument
is invalid.
Solution:
( ) ,( ) -
T T
T F
F T
F F
This argument is invalid because ,( ) - is not a tautology.
Remark: An argument of this form is referred to as converse error because the conclusion of the argument
would follows from the premises if is replaced by its converse .
Example: (Modus Tollens or the method of denial)
a) Show that the argument
is valid.
b) Show that the argument
is invalid
Solution:
a)
( ) ,( ) -
T T
T F
F T
F F
This argument is valid because ,( ) - is a tautology.
Remark: This is known as inverse error because the conclusion of the argument would follow from the
premises if is replaced by the inverse .
Dr. Nader William Amin Page 8
Example : (Disjunctive Addition)
a. Show that the argument
is valid.
b. Show that the argument
is valid.
Solution :
H.W.
Example : (Conjunctive addition)
Show that
is valid.
Solution :
H.W.
Example : (Conjunctive Simplification)
a) Show that the argument
is valid.
b) Show that the argument
is valid.
Solution :
H.W.
Example : (Disjunctive Syllogism)
a) Show that the argument
is valid.
b. Show that the argument
is valid.
Solution :
H.W.
Example : (Hypothetical Syllogism)
Show that the argument
is valid.
Solution :
H.W.
4) Use symbols to write the logical form of the given argument and then use a truth table to test the
argument for validity.
If Tom is not on team A, then Hua is on team B.
If Hua is not on team B, then Tom is on team A.
Tom is not on team A or Hua is not on team B.
5) Use the valid argument forms of this section to deduce the conclusion from the premises.
6) Use the valid argument forms of this section to deduce the conclusion from the premises.
Example:
Write in the form ; ( ) the proposition : “ every real number is either positive, negative or 0.”
Solution:
The notation ; ( ) is a proposition that is true if there is at least one value of where
( ) is true; otherwise it is false. The symbol is called the existential quantifier.
Example:
Let ( ) denote the statement: What is the truth value of the proposition ; ( ).
Solution:
Since and ; the given proposition is true.
The proposition ; ( ) ( ) is called the universal conditional proposition.
For example, the proposition ; if then is a universal conditional proposition.
Example:
Rewrite the proposition: „if a real number is an integer then it is a rational number” as a universal conditional
proposition.
Solution:
; if is an integer then is a rational number
( )
Example :
Use universal instantiation to fill in valid conclusion for the following argument.
All positive integers are greater than or equal to 1
3 is a positive integer
--------------------------------------------------------------------------------------------------------
Solution:
All positive integers are greater than or equal to 1
3 is a positive integer
---------------------------------------------------------------------------
Solution:
.
0 is an even number
Universal Modus Tollens:
( ) ( )
( )
( )
Example:
Use the rule of the universal modus tollens to fill in valid conclusion for the following argument.
All healthy people eat an apple a day.
Harry does not eat an apple a day.
---------------------------------------------------------------------------
Solution:
All healthy people eat an apple a day.
Harry does not eat an apple a day.
Harry is not healthy
Next, we discuss a couple of invalid arguments whose premises involve quantifiers.
The rule of converse error:
( ) ( )
( )
( )
( ) which is an even
Example:
Use the proof by cases to prove the triangle inequality: | | | | | |.
Solution:
Case 1: and : Then and so | | | | | |
Case 2: and : Then | | | | | |.
On the other hand, ( ) ( ) ( ) | | | | | |.
Thus, if | | then | | | | | | and if | | ( ) then | | | | | |.
Case 3: The case and is similar to case 2.
Case 4: Suppose and : Then and therefore
| | ( ) ( ) ( ) | | | |.
So in all four cases | | | | | | .
Exercise:
1) Prove that for any integer the product ( ) is even.
2) Prove that the square of any integer has the form or for some integer
3) Prove that ( )( ) is divisible by 4 ,for any integer .
Dr. Nader William Amin Page 17
Methods of Indirect Proofs: Contradiction and Contraposition :
Recall that in a direct proof one starts with the hypothesis of an implication and then proves that the
conclusion is true. Any other method of proof will be referred to as an indirect proof. In this section we study
two methods of indirect proofs, namely, the proof by contradiction and the proof by contrapositive.
- Proof by contradiction: We want to show that is true. We assume it is not and therefore is true and
then derive a contradiction.
- Proof by contrapositive: We already know that .So to prove we sometimes
instead prove .
Example:
Prove that: If is an even integer so is .
Proof:
Suppose the contrary. That is suppose that is odd. Then there is an integer such that . In
this case, ( ) ( is odd and this contradicts the assumption that is even. Hence,
must be even.
Example:
Prove that the number √ is irrational.
Proof:
Suppose √ is not irrational. That is, suppose that √ is rational. Then there exist two integers and
with no common divisors such that √ .
Squaring both sides of this equality we find that . Thus, is even. (By above example), m is even.
That is, divides : But then for some integer .
Taking the square we find that ; that is . This says that is even and (By above
example). is even.
We conclude that 2 divides both and and this contradicts our assumption that and have no common
divisors. Hence, √ is irrational.
Example:
Prove that he set of prime numbers is infinite.
Proof:
Suppose not. That is, suppose that the set of prime numbers is finite. Then these prime numbers can be listed,
say, . Now, consider the integer . By the Unique Factorization Theorem,
can be factored into primes.
Thus, there is a prime number such that ( is divided by ) . But since we have
= 1; a contradiction since
Example:
Prove that If is an integer such that is odd then is also odd.
Proof:
Suppose that is an integer that is even. Then there exists an integer such that .
But then ( ) which is even.
Exercise :
1) Use the proof by contradiction to prove the proposition “ There is no greatest even integer.”
2) Prove by contradiction that the difference of any rational number and any irrational number is irrational.
3) Use the proof by contraposition to show that if a product of two positive real numbers is greater than
100, then at least one of the numbers is greater than 10.
4) Use the proof by contradiction to show that the product of any nonzero rational number and any
irrational number is irrational.
Dr. Nader William Amin Page 18
Method of Proof by Induction:
We want to prove that a predicate ( ) is true for any nonnegative integer . The steps of mathematical
induction are as follows:
(i) (Basis of induction) Show that ( ) is true.
(ii) (Induction hypothesis) Assume ( ) is true.
(iii) (Induction step) Show that ( ) is true.
Example:
Use the technique of mathematical induction to show that
( )
Solution:
( )
Let ( ) . Then
( )
(i) (Basis of induction) ( ) . That is, ( ) is true.
( )
(ii) (Induction hypothesis) Assume ( ) is true. That is, ( ) .
( )( )
(iii) (Induction step) We must show that ( ) ( ) .Indeed,
( ) ( )( )
( ) ( ) ( )0 1
Example:
( )
a. Use induction to show ( ) ∑ .
b. Show that .
Solution:
a. We use the method of proof by mathematical induction.
( ) ( )
(i) (Basis of induction) ∑ .That is, ( ) is true.
( )
(ii) (Induction hypothesis) Assume ( ) is true. That is, ∑
( )
(iii) (Induction step)We must show that ( ) is true. That is, ∑ . Indeed,
( )
∑ ∑
( )
b. by a. we have
( . / )
( )
( )
( )
Therefore, is divisible by 3
Example:
Use induction to prove that for all non-negative integers .
Solution:
a. Let ( ) We want to show that ( ) is valid for all . By the method of mathematical
induction we have
(i) (Basis of induction) . That is, . Thus, ( ) is true.
(ii) (Induction hypothesis) Assume ( ) is true. That is, .
(iii) (Induction step) We must show that ( ) is also true. That is, . Indeed,
( ) ( )
( )
Hence, a guess is It remains to show that this formula is valid by using mathematical
induction.
Basis of induction: For , ( ) .
Induction hypothesis: Suppose that :
Induction step: We must show that ( ) . By the definition of we have
( ) ( )
Example: Find a solution to the recurrence relation
( )
Solution: Listing the first five terms of the sequence one finds
Hence, a guess is
( )
( )
We next show that the formula is valid by using induction on
( )
Basis of induction: For , .
( )
Induction hypothesis: Suppose that .
( )
Induction step: We must show that . By the definition of we have
( ) ( )
is also a solution.
Proof:
Since and are solutions to (*), for we have
Therefore,
( ) ( )
( ) ( )
Proof:
Since is a root to the characteristic equation, the sequence * +g is a solution to the recurrence
relation
Find two sequences that satisfy the given generating rule and have the form
Solution:
According to theorem, must satisfy the characteristic equation:
Solving for we find or . So the two solutions to the given recurrence sequence are
and ( ) ( ) ( ) ( )
Example: Find a solution to the recurrence relation
Solution:
Consider the recurrence relation:
According to theorem, must satisfy the characteristic equation:
Solving for we find or . So the two solutions to the given recurrence sequence are
and ( ) ( ) ( ) ( )
According to theorem, ( ) is also a solution to the recurrence relation
Solution:
The roots of the characteristic equation
√ √
are and .Thus,
√ √
( ) ( )
is a solution to
√ √
( ) ( )
Solution:
Solving the characteristic equation
Exercise:
1) Find the first four terms of the following recursively defined sequence:
Solution:
a. is not simple since it has a loop and parallel edges. b. is simple.
- A complete graph on vertices, denoted by , is the simple graph that contains exactly one edge between
each pair of distinct vertices.
Example: Draw and .
Solution:
* +, * + * +, * +
* + * +
* + * +
* +
- The degree of a vertex in an undirected graph, in symbol ( ); is the number of edges incident on it.
By definition, a loop at a vertex contributes twice to the degree of that vertex.
- The total degree of is the sum of the degrees of all the vertices of .
( ) ( ) ( )
The total degree of the graph= 6
Theorem:
For any graph ( ) , we have
| | ∑ ( )
Proof:
Suppose that * + and | | . Let . If is a loop then it contributes 2 to the total
degree of . If is not a loop then let and denote the endpoints of . Then e contributes 1 to ( )
and contributes 1 to the ( ) . Therefore, contributes 2 to the total degree of G. Since was chosen
arbitrarily, this shows that each edge of G contributes 2 to the total degree of G. Thus,
| | ∑ ( )
(a) (b)
Solution:
a. Connected.
b. Disconnected since there is no path connecting the vertices and .
- A simple path that contains all edges of a graph is called an Euler path. If this path is also a circuit, it is
called an Euler circuit.
Theorem:
If a graph has an Euler circuit then every vertex of the graph has even degree.
Proof:
Let be a graph with an Euler circuit. Start at some vertex on the circuit and follow the circuit from vertex to
vertex, erasing each edge as you go along it. When you go through a vertex you erase one edge going in and one
edge going out, or else you erase a loop. Either way, the erasure reduces the degree of the vertex by 2.
Eventually every edge gets erased and all the vertices have degree 0. So all vertices must have had even degree
to begin with.
It follows from the above theorem that if a graph has a vertex with odd degree then the graph can not have an
Euler circuit.
The following provides a converse to the above theorem.