0% found this document useful (0 votes)
16 views

Wa0006.

Uploaded by

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

Wa0006.

Uploaded by

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

MTH 122: INTRODUCTION TO

DISCRETE MATHEMATICS

Dr OmiezaYusuf

June 23, 2016

(3 Credits

Units)TOPICS

1. SET THEORY
2. LOGIC
3. FUNCTIONS AND RELATIONS
4. BOOLEAN ALGEBRA
5. ELEMENTS OF GRAPH THEORY
6. FUNDAMENTALS OF MATHEMATICAL PROOFS.

Contents

1 SETTHEORY 6
1.1 RusselsParadox:....................................................................................................6
1.2 CartesianProduct..................................................................................................9
1.3 PropertiesofSets.................................................................................................10
1.4 De Morgan′s Law:.............................................................................................12
1.5 CardinalityofaSet:...............................................................................................14

1
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

2 LOGIC 16
3 FUNCTIONSANDRELATIONS 24

3.1 RELATIONS:.....................................................................................................24

3.1.1 INVERSERELATION:.........................................................................25
3.1.2 PICTURESOFRELATIONONFINITESETS:..................................25
3.1.3 COMPOSITIONOFRELATION:....................................................... 27
3.1.4 TYPESOFRELATIONS:.................................................................... 27

3.2 FUNCTIONS:....................................................................................................31

3.2.1 CompositionofFunctions:......................................................................32
3.2.2 One-to-oneFunctions:............................................................................33
3.2.3 OntoFunctions:......................................................................................34

4 BOOLEANALGEBRA 36

4.1 INTRODUCTION:.............................................................................................36
4.2 COMBINATORIALCIRCUITS:......................................................................36
4.3 SWITCHINGCIRCUITS:.................................................................................40
4.4 BOOLEANALGEBRA:....................................................................................43
4.5 BOOLEANFUNCTIONS:................................................................................46

5 ELEMENTSOFGRAPHTHEORY 48

5.1 Graphs,PathsandCircuits:...............................................................................48

5.1.1 Graphs:.................................................................................................. 48

5.1.2 PATH:...................................................................................................53

5.1.3 CIRCUITorCYCLE:.............................................................................53

5.1.4 CONNECTEDANDDISCONNECTEDGRAPH:...............................54
5.1.5 EULERPATHANDEULERCIRCUIT:...............................................54
5.1.6 HAMILTONIAN PATH AND HAMILTONIAN CIRCUIT: . 54

5.2 TREES...............................................................................................................55

5.2.1 RootedTree:...........................................................................................57

6 FUNDAMENTALSOFMATHEMATICALPROOFS 61

6.1 MethodsofDirectProof..................................................................................61

2
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

6.1.1 VacuousProof:....................................................................................63
6.1.2 TrivialProof:.......................................................................................63
6.1.3 ProofbyCases:...................................................................................64
6.1.4 Methods of Indirect Proofs: Contradiction and Contrapositive 65
6.1.5 MethodsofProofbyInduction:.......................................................65

List of Figures

1 Arrow Diagram.................................................................................................26

2 Arrow Diagram.................................................................................................26

3 Graph.................................................................................................................49

4 Multigraph.........................................................................................................49
5 (a).......................................................................................................................49
6 (b)......................................................................................................................49

7...................................................................................................................................50

8...................................................................................................................................51

9...................................................................................................................................51

3
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

10.................................................................................................................................52

11.................................................................................................................................53

12 (a).......................................................................................................................54

13 (b).......................................................................................................................54

14 (a).......................................................................................................................55

15 (a).......................................................................................................................55

16 (a).......................................................................................................................56

17 (b).......................................................................................................................56

18 (c)........................................................................................................................56

List of Tables

1 The truth value of p ∧ q table........................................................................17


2 The truth value of p ∨ q table........................................................................17
3 The truth value of p ⊕ q, table......................................................................18
4 The truth value of (p ⊕ q)⊕r table...............................................................18
5 The truth value of ∼ p table...........................................................................18
6 The truth value of [∼ (p ∨ q)] ∨r table.........................................................19
7 The truth value of ∼ p ∨ ∼ q table...............................................................19
8 The truth value of (p ∨ q) ∨ (p ∨ ∼ q) table................................................19
9 The truth value of p ∧ ∼ p table...................................................................20
10 The truth value of p → q table.......................................................................21
11 Matrix representation.......................................................................................25
12 Matrix representation.......................................................................................26

4
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

13 Truth table for ∼ (a ∧ b).................................................................................40


14 Truth table for ∼ a ∨ ∼ b...............................................................................40

5
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

1 SET THEORY

1.1 Russels Paradox:

Define the set A = {X : X is a set, X ∈/ X}since A is a set, saying that A ∈A,


we imply A∈/ A by the definition of A.

Saying A ∈/ A, will mean that A ∈A by the definition of A. Thus, in either


case, the assumption thatAis a set leads to a paradox.

Definition1. Aset A isthecollectionofwelldefinedobjects,calledelementsor


membersof A inbracket({}). Suchthatforanygivenobject x,eitherone(not both) of
the following hold.

i x belongs to A and we write x ∈ A

ii x does not belongs to A and we write x ∈/ A.

We denote sets by capital letters A, B, C . . . and elements by lower case letters


a, b, c . . . .

There are two ways of representing a set:

i is to list the elements without repetition

ii is to describe a property that characterizes the elements of a set.

Definition2. Emptysetwritten ∅,isdefinedasasetwithoutelements. Forexample:

Example 1.1. List the elements of the following sets:-

(i)A = {x : x is a real number and x2 − 1 = 0} = {1, −1}.

(ii) B = {x : x an integer and x2 = 3} = {∅}.

Example 1.2. Use a property to give a description of each of the following sets.

(i) A = {a, e, i, o, u} (ii) B = {1, 2, 3, 5, 7, 9}

Solution

(i) A = {x: x is a vowel}.

(ii) B = {x : x is an odd number less than 10}

6
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

or B = {x : x is an odd number and 1 ≤ x < 10}.

Definition 3. Let A and B betwosets,wesay A isasubsetof B, denotedby A ⊆


B ifandonlyifeveryelementof A isalsoanelementof B. Symbolically,A⊆ B ⇐⇒
∀x∈ A x∈ B.

If there exist (∃) an element of A, which is not in B, then we write A Ç B.

Conventionally, the empty set is a subset of any

set.Example 1.3. WriteR, Q, Z, Nin order of inclusion

using⊆.Solution

N ⊆ Z ⊆ Q ⊆ R where,

N- Natural Numbers, Z- Integers, Q- Rational Numbers and R- Real Numbers.

Represent A ⊆ B using Venn diagram.

A B

Definition 4. Twosets A and B aresaidtoequalif A⊆ B and B ⊆ A andwe


writeA=B.

Example 1.4. Determine which of the following sets are equal:

(i) A = {2, 3, 5, 7}, B = {5, 7, 3, 2}.


(ii) C = {2, {2}}, D = {{2}}.

Solution

(i) A= B.

(ii) C /= D. Because 2 ∈ C but 2 ∈/ D.

Example 1.5. Determine which of the following are true:

7
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(a) x ∈ {x}, (b) {x} ≤ {x}, (c) {x} ∈ {x}, (d) {x} ∈ {{x}}, (e) ∅ ≤ {x}, (f ) ∅ ∈
{x}.

Solution

(a) T (b) T (c) F (d) T (e) T (f) F.

Definition 5. If U is a given set whose subset are under consideration then we


callU auniversalset.

Definition 6. Let U be a universal set. Let A, B be two subsets of U.

a The complement ofAdenoted byAc is given thissets:-

Ac = {x∈ U :x∈/ A}.

b The union of A and B, denoted A ∪ B is given by this sets:-

A ∪ B = {x : x ∈ A or x ∈ B}.

c The intersection of A and B, denoted A ∩ B is given by this sets:-

A ∩ B = {x :x ∈ A and x ∈ B}.

d The difference of A from B, denoted A − B is given by this sets:-

A − B = {x : x ∈ A and x ∈/ B}.

That is, A − B =A ∩ Bc.

Example 1.6. Let A = {x ∈ R : x < −1 or x > 1}, B = {x ∈ R : x ≤ 0}. Find


(a) Ac, (b) B − A.

Solution

By definition set A = {. . . , −3, −2, 2, 3, . . . }, B = {. . . , −3, −2, −1, 0}.Therefore;

(a) Ac = {−1 ≤ x ≤ 1}.

(b) Ac = {−1 ≤ x ≤ 0}.

Definition 7. Let A1, A2, . . . be sets.

∪∞
i=1 Ai = {x : x ∈ Ai, for some i}.

8
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Similarly the intersection

∩∞
i=1 Ai = {x : x ∈ Ai, ∀ i}.

Example 1.7. Let A = {1, 3, 5, 6}, B = {1, 2, 5, 6}, C = {2, 5, 6}.

Find (a) A ∪ B (b) A − B (c) A ∩ C.

Assignment

Let An = {x ∈ R : x < 1 + 1
n
}. Show that n=1


An = {x∈ R : x ≤ 1}.

Definition 8. Let A and B be two sets, the symmetric difference between A and
B denoted by AΔB is given by

AΔB = {x : x ∈ A and x ∈/ B or x ∈ B and x ∈/ A.}


= {x : x ∈ A and x ∈/ B} or {x ∈ B and x ∈/ A.}
= (A − B) ∪ (B − A).

Example 1.8. Let A = {2, 4, 7}, B = {2, 5, 4}. Find AΔB.

Solution

AΔB = (A − B) ∪ (B − A).
= {7} ∪ {5}.
∴ AΔB = {5, 7}.

The notation a1, a2, . . . , an is called an orderedn-tuple. Wesaythattwo n-


tuplesa1, a2, . . . , an and b1, b2, . . . , bn are equal iff a1 =b1, a2 =b2, . . . , an =bn.
That is, (a1, a2)=(b1, b2) iff a1 =b1, a2 =b2.

1.2 Cartesian Product

Given n sets, A1, A2, . . . An, the cartesian product of these sets is the set A1 × A2 ×
· · · × An = {(a1, a2, . . . , an) : a1 ∈ A1, a2 ∈ A2, . . . , an ∈ An}.

Example 1.9. LetA = {1, 2}, B = {3, 4}. FindA × B.

Solution A × B = {(1, 2), (1, 4), (2, 3), (2, 4)}.

Example 1.10. Let A = {x, y}, B = {1, 2, 3} C = {a, b}. Find

9
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(i) A × B × C.

10
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(ii) (A × B) × C

Solution

(i) A × B × C = {(a, b, c) : a ∈ A, b ∈ B, c ∈ C}.

A × B × C = {(x, 1, a), (x, 1, b), (x, 2, a), (x, 2, b), (x, 3, a), (x, 3, b),
(y, 1, a), (y, 1, b), (y, 2, a), (y, 2, b), (y, 3, a), (y, 3, b)}.

(ii) (A × B) × C = {((a, b), c) : (a, b)∈ A × B, c∈

C}. A× B ={(x, 1), (x, 2), (x, 3), (y, 1), (y, 2), (y,

3)}.

(A × B) × C = {((x, 1), a), ((x, 2), a), ((x, 3), a), ((y, 1), a), ((y, 2), a), ((y, 3), a),
((x, 1), b), ((x, 2), b), ((x, 3), b), ((y, 1), b), ((y, 2), b), ((y, 3), b)}.

1.3 Properties of Sets

Theorem 1. Let A ⊆ B and B ⊆ C. Show that A ⊆ C

Aim: To show that A ⊆ C.

Let x ∈ A, we need to show that x ∈ C.

But A ⊆ B (assumption)

=⇒ x ∈ B

But B ⊆ C (assumption)

=⇒ x ∈ C

∴ ∀ x ∈ A, x ∈ C

Hence A ⊆ C.

Example 1.11. Let A = {1, 2}, B = {1, 2, 3}, C = {1, 2, 3, 4}. Find (i) A ⊆ B
(ii) B ⊆ C (iii) A ⊆ C

Theorem 2. Let A and B be two sets. Then :-

(i) A ∩ B ⊆ Aand A ∩ B ⊆ B.
(ii) A ⊆ B ∪ A and A ⊆ B ∪ B.

11
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Proof:

(i) Goal: To show that A ∩ B ⊆ A.

Let x ∈ A ∩ B.

=⇒ x ∈ A and x ∈ B

∴ x ∈ A.

Hence A ∩ B ⊆ A.

(ii) Goal: To show that A ⊆ A ∪ B

Let x ∈ A.

=⇒ x∈ A ∪ B.

=⇒ A ∈ A ∪ B.

Hence A ⊆ A ∪ B.

Theorem 3. (i) ∅c = U (ii) U c = ∅ (iii) (Ac)c = A (iv) A ∪ Ac (v) A ∩ Ac = ∅

(vi) A∪A = A (vii) A∪∅ = A (viii) A∩∅ = ∅ (ix) A∪B = B∪A (x) A∩B = B∩A.

Theorem 4. (i) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).

(ii) A ∪ (B∩ C) = (A ∪ B) ∩ (A ∪ C).

Proof:

(i) Goal: To show that A ∩ (B ∪ C) ⊆ (A ∩ B) ∪ (A ∩ C).

Now,

Let x ∈ A ∩ (B ∪ C).

=⇒ x ∈ A and x ∈ (B ∪ C).

=⇒ x ∈ A and x ∈ B or x ∈ C.

=⇒ x ∈ A and x ∈ B or x ∈ A and x ∈ C.

=⇒ x ∈ (A ∩ B) or x ∈ (A ∩ C).

=⇒ x ∈ (A ∩ B) ∪ (A ∩ C).

12
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

=⇒ A ∩ (B ∪ C) ⊆ (A ∩ B) ∪ (A ∩ C).

∴ A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).

(ii) Goal: To show that A ∪ (B∩ C)⊆ (A ∪ B) ∩ (A ∪ C).

Let x∈(A∩ B)∪ (A∩ C).

=⇒ x ∈ (A ∩ B) or x ∈ (A ∩ C).

=⇒ x ∈ A and x ∈ B or x ∈ A and x ∈ C.

=⇒ x ∈ A and x ∈ B or x ∈ C.

=⇒ x ∈ A and x ∈ (B ∪ C).

=⇒ x ∈ A ∩ (B ∪ C).

=⇒ (A ∩ B) ∪ (A ∩ C) ⊆ A ∩ (B ∪ C).

∴ A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C).

1.4 De Morganrs Law:

Let A and B be two subsets of U. Then,

(a) (A ∪ B)c = Ac ∪ Bc.

(b) (A ∩ B)c = Ac ∩ Bc.

Proof:

(a) Goal: To show that x ∈ (Ac ∪ Bc).

Now,

Let x ∈ (A ∪ B)c.

=⇒ x ∈ A and x ∈ (B ∪ C).

=⇒ x ∈/ (A ∪ B)c.

=⇒ x ∈/ A and x ∈ B .

=⇒ x ∈ (A ∩ B) or x ∈ (A ∩ C).

13
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

=⇒ x ∈ Ac and x ∈ Bc.

=⇒ x ∈ (Ac ∪ Bc).

=⇒ (A ∪ B)c ⊆ (Ac ∪ Bc)······························································∗

Conversely,

Letx ∈ Ac ∪ Bc.

=⇒ x ∈ Ac and x ∈ Bc.

=⇒ x ∈/ A and x ∈/ B.

=⇒ x ∈/ A ∪ B .

=⇒ x ∈ (A ∪ B)c.

=⇒ Ac ∩ Bc ⊆ (A ∪ B)c······················································································· ∗ ∗

Combining ∗ and ∗∗ we

have,(A∪B)c =Ac ∪Bc.

Exercise:

1. Suppose A ⊆ B. Show That


(a) A ∩ B = A.
(b) A ∪ B = B.
2. Prove that (A − B) ∩ B = ∅

Proof:

(A − B) ∩ B = A ∩ Bc ∩ B = A ∩ ∅.

{Note : A − B = A ∩ Bc ∩ B = x ∈ A ∩ Bc.}

Definition 9. A collection of non-empty subsets {A1, A2,......., An} of A is said to


a partition of A iff;


(i) Ui=1 Ai = A.
(ii) Ai ∩ Aj = ∅, i /= j.

Example 1.12. Let = {1, 2, 3, 4, 5, 6}.

14
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Solution:

A1 = {1, 2}, A2 = {3, 4}, A1 = {5, 6}.

∴ {A1, A2, A3} is a partition of A since;

(i) A1 ∪ A2 ∪ A3 = A.
(ii) A1 ∩ A2 = ∅, A1 ∩ A3 = ∅, A2 ∩ A3 = ∅.

1.5 Cardinality of a Set:

The number of elements of a set is called the cardinality of the set denoted |A| or
Card(A) or n(A).

Example 1.13. Determine the cardinality of each of the following sets:-

(i) ∅ (ii) {∅} (iii) A = {a, {a}, {a, {a}}}.

Solution:

(i) 0 (ii) 1 (iii) |A| = 3.

Example 1.14. Determine the cardinality of each of the following sets:-

(a) A = {x, y, z} (b) B = {2, 3, x, y, z}.

Solution:

(a) |A| = 3

(b) |A| = 5.

Definition 10. LetA ⊆U.Then, the power set ofAdenotedP(A) is the collection of
all possible subsets ofAtogether with the empty set.

Example 1.15. Find P(A), when A = {a, b, c}

Solution:

P(A) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Exercise:

Show that if A ⊆ B, Then P(A) ⊆ P(B)

Theorem 5. If cardinality of A is n i.e (|A| = n), then |P(A) = 2n.

15
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example 1.16. If |P(A)| = 256, determine |A|.

Solution:

|A| = 8.

16
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

2 LOGIC

Logic is commonly known as the science of reasoning. The emphasis therewill be


on logic as working tools. Some of the reason to study logic are the following:-

• At hardware level the design of logic circuits to implement instructions is


greatly simplified by the use of logic.
• At the software level a knowledge of symbolic logic is helpful in the design
ofprogramming.

Definition 11. Apropositionisanymeaningfulstatementthatiseither trueor false,


butnotboth. Weshalluselowercaseletterstorepresentpropositions. We will use also
the notation p: 1+ 1=3 to define p to be a proposition.

Thetruthvalueofapropositionistruedenoted T ifitisatruestatement,and false


denotedF if it is a false statement.

Remark: Statements that are not propositions include:- questions and commands.

Exercise: Which of the following are proposition? Give the truth value of each.

a 2 + 3 = 7. (F)

b Samson is the president of Nigeria. (F)


c What time is it? (Not a proposition)
d Be quiet. (Not a proposition)

New proposition called compound or propositional functions can be obtained from


old ones by using symbolic corrections. The propositions that form a propositional
functions are called the proposition variables.

Let p,q, be propositions, the conjunctionof p and q denoted, p∧q, is the


propositionpandq.This proposition is defined to be true only when bothpandqare
true and is false otherwise.

The disjunction of p and q, denoted p∨ q i.e p or q is a proposition p or q. The


”or” is used in an inclusive way. The proposition is defined to be false when
bothpandq are false, otherwise true.

Example 2.1. Let p : 4 < 8 and q : 7 < 5 Construct p ∧ q and p ∨ q.

Solution

17
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

The conjunction ofpandq.

p∧ q: 4<8 and 7<5

The disjunction of p and q.

p ∨ q: 4 < 8 or 7 < 5

Example 2.2. Let p : It is Friday and q : It is raining. Construct p ∨ q. and p ∧ q.

Solution

p ∨ q: It is Friday or It is raining.

p ∧ q: It is Friday and It is raining.

Definition12. A truth table displays the relationship between the truth value of
a proposition.

Example 2.3. Disply the truth value of p∧ q and p∨ q.

p q p∧ q
T T T
T F F
F T F
F F F

Table 1: The truth value of p ∧ q table


p q p∨ q
T T T
T F T
F T T
F F F

Table 2: The truth value of p ∨ q table

(Note: for n-numbers of statement, we have, 2n numbers of

rows).i.e

21 , p = {T or F}.
22 , p, q = {TT, TF, FT, FF}.
23 , p, q, r = {TTT, TTF, TFT, FTT, FFF, FTF, FFT, TFF}.

Let p and q betwoproposition. The“exclusive”of p and q, denoted p ⊕ q, isthe


proposition that is true when exactly one ofpandq is true, and false otherwise.

18
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

p q p⊕ q
T T F
T F T
F T T
F F F

Table 3: The truth value of p ⊕ q, table

Example 2.4. Construct the truth table for (p ⊕ q)⊕r.

Solution

p q r p⊕ q (p ⊕ q)⊕r
T T T F T
T T F F F
T F T T F
T F F T T
F T T T F
F T F T T
F F F F F
F F T F T

Table 4: The truth value of (p ⊕ q)⊕r table

The negative of p, denoted ∼ p, is the proposition not p.

The truth value is displayed below.

p ~p
T F
F T

Table 5: The truth value of ∼ p table

Example 2.5. p : Today is Tuesday

q:2+7=9

r: There is no corruption in Nigeria.

Construct the truth table for [∼ (p ∨ q)]

∨r.Solution

Example 2.6. If p : −5 ≤ x ≤ 0, then ∼ p is

~ p : x < −5 or x > 0.

19
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

p q r p∨ q ~ (p ∨ q) [∼ (p ∨ q)] ∨r.
T T T T F T
T T F T F F
T F T T F T
T F F T F F
F T T T F T
F T F T F F
F F T F T T
F F F F T T

Table 6: The truth value of [∼ (p ∨ q)] ∨r table

Example 2.7. Use table to show that.

1. ∼(p ∧ q) ≡ ∼ p ∼ p∨ ∼ q.

2. ∼ (p ∨ q) ≡ ∼ p ∧ ∼ q

Solution

p q ~p ~q p∧ q ~ (p ∧ q) ~ p ∨ ∼ q.
T T F F T F F
T F F T F T T
F T T F F T T
F F T T F T T

Table 7: The truth value of ∼ p ∨ ∼ q table

Definition 13. A compound proposition is called tautology if it is always true,


regardless of the truth values of the basic proposition which comprise it.

Example 2.8. Construct the truth value of the proposition (p ∨ q) ∨ (p ∨ ∼ q).


Determine if this is tautology.

Solution

p q p∨ q ~q p ∨ ∼ q (p ∨ q) ∨ (p ∨ ∼ q).
T T T F T T
T F T T T T
F T T F F T
F F F T T T

Table 8: The truth value of (p ∨ q) ∨ (p ∨ ∼ q) table

Hence the statement is tautology.

Exercise: Show that p ∼ p is tautology.

20
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Definition 14. Two proposition are equivalent if they have exactly the same truth
values under all circumstance.

Example 2.9. Establish the following facts.

i ∼ (p ∨ q) ≡ ∼ p ∧ ∼ q

ii ∼ (p ∧ q) ≡ ∼ p ∨ ∼ q

iii ∼ (∼ p) ≡ p

Remarks: (i) and (ii) are called De Morgan′s laws and (iii) is called involution.

Example 2.10. Show that

(a) p ∧ q = q ∧ p and p ∨ q = q ∨ p
(b) (p ∨ q) ∨ r = p ∨ (q ∨ r) and (p ∧ q) ∧ r = (p ∧ q) ∧ r.
(c) (p ∧ q) ∨ r ≡ (p ∨ r) ∧ (q ∨ r) and (p ∨ q) ∧ r ∧ (p ∧ r) ∨ (q ∧ r.
(d) ∼ (p ∧ q) /≡∼ p ∧ ∼ q.

Solution

p q r p∧ q (p ∧ q) ∨ r p∨ r q∨ r (p ∨ r) ∧ (q ∨ r)
T T T T T T T T
T T F T T T T T
T F T F T T T T
T F F F F T F F
F T T F T T T T
F T F F F F T F
F F T F T T T T
F F F F F F F F

Definition 15. A compound proposition that has the value F for all possible
values of the proposition in it is called contradiction.

Example 2.11. Show that p ∧ ∼ p is contradiction.

Solution

p ~p p∧∼p
T F F
F T F

Table 9: The truth value of p ∧ ∼ p table

21
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Conditional and Biconditional Statement:

Let p and q be two proposition, the implication p → q is the proposition that is


false only when p is true and q is false otherwise, it is true.

p is called the hypothesis and q is called the conclusion. The connective → is called
conditional connective.

Example 2.12. If you have money, then you have everything.

Solution

p q p→q
T T T
T F F
F T T
F F T

Table 10: The truth value of p → q table

Example 2.13. Show that p → q ≡ ∼ p ∨ q

Solution

p q ~p p→q ~ ∨q
T T F T T
T F F F F
F F T T T
F F T T T

Hence p → q ≡ ∼ p ∨ q.

In words, the proposition p → q also reads

(a) p implies q.
(b) If p then q.
(c) p is a sufficient condition for q.
(d) q is a necessary condition for p.
(e) p if only q.

In a propositional function that involves the connective ∼, ∧, ∨, and →, the


operations are performed in the order:-

22
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(a) Negative.
(b) →.
(c) ∨, or ∧.

Example 2.14. ∼ (p → q) =∼ (∼ p ∨ q)

⇒∼ (p → q) ≡ ∼ (∼ p ∨ q).

Solution Recall that

p → q ≡ ∼ p ∨ q.

Definition16. Theconverseof p→ q istheproposition q → q. Theoppositeor inverse


of the propositionp→ q is the proposition∼ p → ∼ p. Thecontrapositive of p→q
is the proposition ∼q→ ∼p.

Example 2.15. Find the converse, opposite and the contrapositive of


theimplication:

“If today is Wednesday, then I have a test.”

Solution

If today is Wednesday(p) then I have test

(q)Converse:- If I have a test then today is

Wednesday.

Opposite:- If today is not Wednesday thenIdon’t have a test.

Contrapositive:- IfIdon’t have a test, then today is not

Wednesday.p→q ≡ ∼p∨ q.

Exercise:

1) Show that p → ≡ ∼ q →∼ p.

2) Using truth value table, show that

i) p → q /≡ q → q
ii) p → q /≡∼ q →∼ q.

Solution

23
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

p q p→q q→p
T T T T
T F F T
F T T F
F F T T

The biconditonal propositions ofpandq, denoted byp↔qis the propositional function


that is true when both p and q have the same truth values and false if pandq
have opposite truth value.

i) p if and only if q

ii) p and q are both necessary and sufficient condition for each other.

Example 2.16. Show that p ⇐⇒ q ≡ (p → q)∧ (q → p).

Solution

p q p ⇐⇒ q p→q q→p (p → q) ∧ (q → p)
T T T T T T
T F F F T F
F T F T F F
F F T T T T

Hence p ⇐⇒ q ≡ (p → q) ∧ (q → p).

24
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

3 FUNCTIONS AND RELATIONS

Definition 17. An ordered pair of elements a and b where a is designated as the


first element and b as the second element, is designated by (a, b).

Recall that A × B = {(a, b) : a ∈ A and b∈ B}.

3.1 RELATIONS:

Definition 18. Let A and B betwosets. Abinaryrelationorsimplyarelation


fromAtoB is a subset ofA × B.

Example 3.1. Let A = {1, 2, 3} andB = {x, y}

R1 = {(1, x), (2, y)}.

R1 = {(3, x), (2, y)}.

For each pairs a ∈ A, b ∈ B, exactly one of the following is true.

(i) (a, b) ∈ R, we then say ”a is related to b” written as aRb.


(ii) (a, b) ∈/ R, we then say ”a is not related to b” written as a/R b.

The domain of a relation is the set of all first elements of the ordered pair which
belong toR and the range is the set of all the second elements.

Example 3.2. R2 = {(3, y), (2, y)}.

Dom (R2) = {3, 2}.

Range (R2) = {y}.

Example 3.3. Set inclusion is a relation ⊆ is a relation is a relation on any


collection of sets. For any given two setsA and B, either A⊆ B or A¢B.

Example 3.4. Let A be any set, then A × A and ∅are subsets of A × A and
hence are relation onAcalleduniversalrelation andemptyrelation respectively.

e.g A ⊆ A (Universal relation) A × A ⊆ A × A.

∅ ⊆ A (Empty relation) ∅ ⊆ A × A.

Example 3.5. Let A = {1, 4, 6}. Write down the universal relation on A.

25
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Solution

A × A = {1, 4, 6} × {1, 4, 6}.


= {(1, 1), (1, 4), (1, 6), (4, 1), (4, 4), (4, 6), (6, 1), (6, 4), (6, 6)}.
= A × A.

3.1.1 INVERSE RELATION:

LetR ba a relation from a setAto a setB.The inverse ofR,denoted byR−1,isthe


relation fromBtoAwhich consist of those ordered pairs which, when reversedbelongs
toR.

That is, R−1 = {(b, a) : (a, b) ∈ R}.

Example 3.6. Let A = {x, y, z} and B= {4, 3, 6}.

Solution

R1 = {(x, 4), (x, 6), (z, 3), (y, 4)}.

1 = {(4, x), (6, x), (3, z), (4, y)}.


R−1

3.1.2 PICTURES OF RELATION ON FINITE SETS:

Suppose A and B are finite sets, there are two ways of picturing a relation from A
to B.

(i) Matrix representation.

(ii) Arrow diagram.

Example 3.7. Represent the relation {(1, y), (1, z), (3, y)}.

Solution

i)

y z
1 1 1
3 1 0

Table 11: Matrix representation.

ii)

26
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Figure 1: Arrow Diagram.

Example 3.8. Represent the relation {(1, z), (1, y), (2, z), (3, y), (4, x), (4, z)}.
Solution

i)

x y z
1 0 1 1
2 0 0 1
3 0 1 0
4 1 0 1

Table 12: Matrix representation.

ii)

Fi
g
ur
e
2:
A
rr
o
w
Di
a
gr
a
m
.

27
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

3.1.3 COMPOSITION OF RELATION:

Let A, B and C be sets and R be a relation from A to B, S be a relation


fromB to C. Thatis, R isasubsetof A × B and S isasubsetof B× C.
Thenthecomposition of R with S, denoted by R◦S = {(a, b) : there exists b ∈ B
with (a, b) ∈R and (b, C)∈S.}

Example 3.9. Let A = {1, 2, 3, 4}, B = {a, b, c, d} and B = {x, y, z}.

Solution

R = {(1, a), (2, d), (3, a), (3, b), (3, d)}.

S = {(b, x), (b, z), (c, y), (d, z)}.

∴ R ◦ S = {(3, x), (2, z), (3, z)}.

Theorem 6. The composition of relation is associative. i.e ∀ R, S, T, then


(R ◦ S) ◦ T = R ◦ (S ◦ T ).

3.1.4 TYPES OF RELATIONS:

1. Reflexive Relation:

28
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

A relation R on a set A is said to be reflexive if ∀aRa ∀a ∈ A. i.e


(a, a) ∈R,∀aRA.
Thus, R is not reflexive there exist a ∈ A such that (a, a) ∈/ R.

Example 3.10. Let A = {1, 2, 3, 4}.


Solution
R1 = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}. → not reflexive
R2 = {(1, 1), (2, 2), (2, 1), (3, 3), (4, 4)}. → reflexive
R3 = {(1, 3), (2, 1)}. → not reflexive.

Example 3.11. Determine which of the following are reflexive.


(i) The relation “ ≤ ” on the set Z.
(ii) Set inclusion “ ⊆ ” on collection of sets.
(iii) Relation ⊥ (perpendicular) on the set L of lines in theplane.
Solution
(i) ≤ := R
a, b ∈ Z if a ≤ b, we say aRb,
(a, b) ∈ R, a/< a, a/R a,
(a, a) ∈ R, ∀a ∈ Z,
a ≤ a = (a, a) ∈ R,
∴ R is a reflexive relation.

2. Symmetric Relation:

Definition19. A relationRon a setAis said to be symmetric if whenever (a,


b) ∈Rwehave(b, a) ∈Ri.ewhenever aRb then bRa. Thus Risnot symmetric
if there exist (a, b)∈ A: (a, b)∈ R and (b, a)∈/ R.

Example 3.12. Let A = {1, 2, 3, 4}.


Solution

R1 = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}. C

R2 = {(1, 1), (2, 2), (2, 1), (3, 3), (4, 4)}. ✓

R3 = {(1, 3), (2, 1)}. C

Example 3.13. Determine which of the following are symmetric.


(i) The relation “ ≤ ”.
(ii) Set inclusion “ ⊆ ” on collection of sets.
Solution
(i) Not symmetric.
(ii) Not symmetric.

29
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

3. Antisymmetric Relation:
A relation R on a set A is antisymmetric if whenever aRb and bRa then a =
b.Thus R is not antisymmetric if there exist distinct elements a and b in A
suchthataRbandbRa.

Example 3.14. Determine which of the following is an


antisymmetricrelation.

R1 = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}. C

R2 = {(1, 1), (2, 2), (2, 1), (3, 3), (4, 4)}. ✓

R3 = {(1, 3), (2, 1)}. C

R4 = ∅.

R5 = A × A. ✓

Example 3.15. Determine which of the following are antisymmetric relation.


Solution

R1 Relation ≤ on the set Z of integers ✓

R2 Set inclusion “ ⊆ ” on collection C of sets. ✓

R3 Relation ⊥ (perpendicular) on the set L of lines in the plane. C

R3 Relation (parallel) on the set L of lines in the plane. C

4. Transitive Relation:
A relation R onaset A istransitiveifwhen aRb and bRa then aRc, i.e,if
whenever (a, b), (b, c) ∈ R then(a, c) ∈ R. Thus, R isnottransitiveifthere
exist a, b, c∈ R such that (a, b), (b, c)∈ R but (a, c)∈/ R.

Example 3.16. Let A = {1, 2, 3, 4}.


R1 = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}.
R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}.
R3 = {(1, 3), (2, 1)}.

Example 3.17. The relation ≤ and ⊆ are transitive.

5. Equivalence Relation:
A relation R on a set A is said to be equivalence relation if it is reflexive,
symmetric and transitive.

Example 3.18. The relation “= ” (equals to) is an equivalence relation.


30
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

That is;
(1) a = a for a ∈ R.
(2) If a =b then b = a.
(3) If a = b, b = c then a = c.

31
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example3.19. (a) LetL be the set of lines andT be the set of triangles in
the Euclidean plane.
(i) The relation “is parallel to or identical to” is an equivalence relation on
L.
(b) The relation ⊆ not equivalence, since A ⊆ B does not imply B ⊆ A.
(3) Let m be a fixed positive integer. Two integers a and b are said to be
congruent modulo m, written

a ≡ b(mod m),

if m divides a − b.

For example, for the modulo m = 4, we have 11 ≡ 3(mod 4) and 22 ≡


6(mod 4) since 4 divides 11 − 3 = 8 and 4 divides 22 − 6 = 16.
This relation of congruence modulo m is an important equivalence relation.

32
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

3.2 FUNCTIONS:

Suppose that to each element of a setAwe assign a unique element of a setB,the


collection of such assignment is called a function from A to B.

Example 3.20.

Domain of a function f is where f is well defined.

Example 3.21. (i) Find the domain of f (x) = x1 .

Solution

33
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

f:R→

1
R,f (x)=
x

1
f (0) = 0
, f is not defined.

∴ Dom (f ) = R − {0}.

(ii) Find the domain of f (x) = x.

Solution

f:R→
R,f (x) =


x.

f (−x) is not defined.

∴ Dom (f ) = R − {(−∞, 0)}.

(iii) Find the domain of f : [−1, 1] → R defined by f (x) =1+x


1
.

Solution

Dom (f ) = [−1, 1] − {−1}.

3.2.1 Composition of Functions:

Consider f : A → B and g : B → C that is the co-domain of f is the domain


ofg, then we may define a new function from A to C called composition of f and
gwritten (g◦f )(a)=g(f (a)).

Example 3.22.

34
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Solution

(g ◦ f )(1) = g(f (1)) = g(a) = r.

(g ◦ f )(2) = g(f (2)) = g(b) = p.

(g ◦ f )(3) = g(f (3)) = g(d) = q.

(g ◦ f )(4) = g(f (4)) = g(c) = s.



(2) f : [0, 2π] → R+, f (x) = |sinx|, g : R+ → R, g(x) = x.

(i) Can we compose g with f ? If yes find (g ◦ f ).


(ii) What about (f ◦ g).

Solution

(i) We can composeg withf since Dom(g) = Co − d(f )

(g◦f )x=g(f (x)).

= g(|sinx|)

= |sinx|.

(ii) We can not compose (f ◦ g) since Dom(f ) /= co − d(g).

3.2.2 One-to-one Functions:

A function f is said to be one-to-one if different elements in the domain A have


distinct images.

Equivalently f is one-to-one iff

f (a) = f (b) ⇒ a = b

35
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

e.g

Example 3.23. f : R → R by f (x) = x + 1, show that f is one to one.

Proof:

Suppose f (a) = f (b), we show that

a=b by a+1=b+1subtract 1

from both sides,

∴a=b

∴ f is a one-to-one function.

Example3.24. f : R → R by f (x) = x2, show that f is one-to-one or not.

Proof:

Suppose f (a) = f (b), we show that a = b,

by definition, a2 = b2.

e.g (—3)2 = 32 9 = 9 but —3 /= 3.

3.2.3 Onto Functions:

A function f : A → B is said to be onto if every element in B is the image of


some elements inA.A function is said to invertible if it is both one-to-one and
onto.

Example 3.25.

36
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Solution:

−1 −1
f (r) = 1, f (s) = 4.

−1 −1
f (t) = 2, f (u) = 3.

A one-to-one function is calledinjective function.

An onto function is calledsurjective function.

An invertible function is called bijective function.

37
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

4 BOOLEAN ALGEBRA

After studying this section, you should: -

• be able to use AND, NOT, OR, and NAND gates;


• be able to use combinatorial and switching circuits,
• understand equivalent circuits,
• understand the laws of Boolean algebra,
• be able to simplify Boolean expressions,
• understand Boolean functions.

4.1 INTRODUCTION:

When George Boole (1815-1886) developed an algebra for logic, little did he realise
thathewasforminganalgebrathathasbecomeidealfortheanalysisanddesign
ofcircuitsusedincomputers,calculatorsandahostofdevicescontrolledbymicroelectroni
cs.

4.2 COMBINATORIAL CIRCUITS:

Thecircuitsandswitchingarrangementsusedinelectronicsareverycomplex. Although
this study only deals with simple circuits, the functioning of all microchip
circuitsisbasedontheidealsinthisstudy. Theflowofelectricalpulseswhich represent
the binary digits 0 and 1 (bits) is controlled by combinations of electronics devices.
These logic gates act as switches for the electrical pulses.

NOT gate:

The NOT gate is capable of reversing the input pulse. The truth table for NOT
gate is as follows:

Input Output
a ~a
0 1
1 0

a ∼a

38
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

The NOT gate receives an input, either a pulse (1) or no pulse (0) and produces
an output as follows:

If inputais 1, output is 0,and

If inputais 0,output is 1.

AND gate:

The AND gate receives two inputs a and b, and produces an output denoted a ∧ b.
The truth table for an AND gate is as follows:

Input Input Output


a b a∧b
0 0 0
0 1 0
1 0 0
1 1 1

a
a∧b
b

The only way that the output can be 1 is whenaANDbare both 1.In other words
there needs to be an electrical pulse at a AND b before the AND gate will output
an electrical pulse.

OR gate:

The OR gate receives two inputs a and b, and produces an output denoted a ∨ b.
The truth table for an OR gate is as follows:

Input Input Output


a b a∨b
0 0 0
0 1 1
1 0 1
1 1 1

a
a∨b
b

The output will be 1 when a or b or both are 1.

Thesethreegates, NOT,AND,andOR,canbejoinedtogethertoform combinatorial


circuits to represent Boolean expressions, as explained in the preciousstudy.

39
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example 4.1. Use logic gates to represent:

(a) ∼ p ∨ q.

(b) (x ∨ y) ∧ ∼ x.

Draw up the truth table for each circuits.

Solution

(a)

p q ~p ~ p∨ q
0 0 1 1
0 1 1 1
1 0 0 0
1 1 0 1

p ~p

~ p∨ q
q

(b)

x y x∨ y ~x (x ∨ y) ∧ ∼
0 0 0 1 x 0
0 1 1 1 1
1 0 1 0 0
1 1 1 0 0

~x

(x ∨ y) ∧ ∼ x
x
y (x ∨ y)

Exercises:

Use logic gates to represent these expressions and draw up the corresponding
truthtables.

40
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

1. x ∧ (∼ y ∨ x

2. a ∨ (∼ b ∧ c)

3. [a ∨ (∼ b ∨ c)] ∧ b
Write down the Boolean expression for each of the circuit below: -

a
b

c
4.
p
q

5.

EQUIVALENT CIRCUITS:

Two circuitsaresaidto beequivalentifeachproducethesameoutputwhenthey receive


the same inputs.

Example 4.2. Are these two combinatorial circuits equivalent?

a
b

Draw up the truth table for each circuits.

Solution

41
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

The truth tables for both circuits will show if they are equivalent.

a b ~ (a ∧
0 0 b) 1
0 1 1
1 0 1
1 1 0

Table 13: Truth table for ∼ (a ∧ b)

a b ~a∨∼
0 0 b 1
0 1 1
1 0 1
1 1 0

Table 14: Truth table for ∼ a ∨ ∼ b

∴ ∼ (a ∧ b) =∼ a ∨ ∼ b

Exercises: Show if these combinatorial circuits are equivalent by working out the
Boolean expression and the truth table for each circuit.

a
b
1.

a
b
2.
a
b

4.3 SWITCHING CIRCUITS:

A network of switches can be used to represent a Boolean expression and an


associated truth table.

Generally the switches are used to control the flow of an electrical current but you

42
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

mightfinditeasiertoconsideraswitchingcircuitasaseriesofwaterpipewith taps or
values at certain points.

Thisdiagrambelowshowsswitches A,B and C whichcanbe open or closed. If


aswitchiscloseditisshownasa1inthefollowingtablewhile0showsthatthe switch is
open.

The switching table for this circuit is as follows:

A B C Circuit Output
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

The truth table shows that there will be anoutput (i.e 1) when A AND B are 1
ORC is 1.This circuit can therefore be represented as;

(A AND B) OR C, i.e (A ∧ B) ∨ C.

The circuit just considered is built up of two fundamental circuits:

1. A series circuit, often called an AND gate. A ∧ B,

43
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

2. A parallel circuit, often called OR gate, A ∨ B.

44
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example 4.3. Represent the circiut shown below symbolically and give the
switching table.

Solution

The symbolic representation: (A ∧ B) ∨ (C ∧ ∼ A).

The table is as follows:

A B C ∼ A (A ∧ B ) (C ∧ ∼ A) (A ∧ B ) ∨ (C ∧ ∼ A)
0 0 0 1 0 0 0

0 0 1 1 0 1 1
0 1 0 1 0 0 0
0 1 1 1 0 1 1
1 0 0 0 0 0 0
1 0 1 0 0 0 0
1 1 0 0 1 0 1
1 1 1 0 1 0 1

45
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Exercises 1:

Represent the following circuit by Boolean

expressions:1.

2.

Draw switching circuits for these Boolean expressions:

3. A ∨ (∼ B ∧ C).
4. A ∧ ((∼ B ∧ C) ∨ (B ∧ ∼ C)).

4.4 BOOLEAN ALGEBRA:

A variety of Boolean expressions have been used but George Boole was responsible
for the development of a computer algebra.

The operators ∧ and ∨ have certain properties similar to those of the arithmetic
operators such as+,—,×, and ÷.

46
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

a) Associative laws

(a ∨ b) ∨ c= a ∨ (b ∨ c),and

(a ∧ b) ∧ c= a ∧ (b ∧ c).

b) Commutative laws

a ∨ b = b ∨ a, and

a ∧ b) = b ∧ c.

c) Distributive laws

a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ b), and

a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ b).

These laws enable Boolean expressions to be simplified and another law developed
by an Englishman, Augustus de Morgan (1806-1871), is useful.

a) De Morgan’s laws

~ (a ∨ b) = ∼ a ∧ ∼ b, and

~ (a ∧ b) = ∼ a ∨ ∼ b.

Two more laws complete the range of laws which are included in the
Booleanalgebra

e) Identity laws

a ∨ 0 = a,

47
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

and

a ∧ 1 = a.

f) Complement laws

a ∨ ∼ a = 1,

and

a ∧ ∼ a = 0.

48
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

4.5 BOOLEAN FUNCTIONS:

Inthesamewayasalgebraicfunctionsdescribetherelationshipbetweenthe domain; (a
set of inputs) and the range (a set of outputs), a Boolean functioncan be
described by a Boolean expression.

Example 4.4. Iff (x1, x2, x3)=x1 ∧(∼ x2 ∨x3) thenf is the Booleanfunction andx1
∧ (∼ x2 ∨ x3) is the Boolean expression.

Example 4.5. Draw the truth table for the Boolean function defined as
f (x1, x2, x3) = x1 ∧ (∼ x2 ∨ x3).

Solution

The inputs and outputs of this Boolean functions are shown in the following table.

x1 x2 x3 f ( x1 , x2 , x3 )
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1

Example 4.6. For the given truth table, form a Boolean function.

a b c f (a, b, c)
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1

Solution

The firststepistolookforplaceswhere f (a, b, c)is1andlinkthemalltogether with OR′s


e.g; in the last rowf (a, b, c)= 1 and this is the row in whicha, b, andcare all true; i.e
whena ∧ b ∧ c=1.

In the 7th row, we have; a ∧ b ∧ ∼ c=1.In

the 5th row, we have; a ∧ ∼ b ∧ ∼ c = 1.

In the 2nd row, we have; ∼ a ∧ ∼ b ∧ ∼ c = 1.

49
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

All these combinations are joined using the connective ∨ to give the
Booleanexpression;

(a ∧ b ∧ c) ∨ (a ∧ b ∧ ∼ c) ∨ (a ∧ ∼ b ∧ ∼ c) ∨ (∼ a ∧ ∼ b ∧ ∼ c).

This is called the disjunctivenormalform of the function f.

50
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

5 ELEMENTS OF GRAPH THEORY

Here, we present the basic concepts related to graphs and trees such as the degree
of avertex, connectedness, Euler and Hamiltonian circuits, isomorphism of graphs,
rootedandspanningtrees.

5.1 Graphs, Paths and Circuits:

5.1.1 Graphs:

AnundirectedgraphGconsists of a setV Gofvertices and a setEGofedges such


thateachedge e∈ EG
isassociatedwithanunorderedpairofvertices,calleditsendpoints.

An directed graph or digraph G consists of a set V G of vertices and a set EG of


edges such that each edgee ∈ EG is associated with an ordered pair of vertices.

We denote a graph by G =(V G, EG).

Definition 20. Consider the following definition of the terms below:

Adjacent:Two vertices are said to beadjacent if there is an edge connecting the


two vertices.

Parallel: Two edges associated to the same vertices are called parallel.

Loop: An edge incident to single vertex is called a loop.

Isolated: A vertex that is not incident in any edge is called an isolated vertex.

Simple graph: A graph with neither loops nor parallel edges is called a
simplegraph.

Example 5.1. Fig. 1 represent the graph of G(V, E) where:

i) V consists of vertices A, B, C, D.

ii) E consists of edges e1 = {A, B}, e2 = {B, C}, e3 = {C, D}, e4 = {A, C}, e5 =
{B, D}.

Multigraphs:

Consider the diagram in fig2. The edges e4 and e5 are called multiple edges since

51
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Figure 3: Graph. Figure 4: Multigraph.

they connect the same endpoints, and the edge e6 is called a loop since its
endpoints are the same vertex. Such a diagram is called amultigraph.

Example 5.2. Which one of the following graphs is simple

Figure 5: (a). Figure 6: (b).

Solution

a) G is not simple, since it has a loop and parallel edges.

b) G is simple.

Example 5.3. Consider the following graph G.

a.) Find EG and V G.

b.) List the isolated vertices.

c.) List the loops.

d.) List the parallel edges.

52
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Figure 7

e.) List the vertices adjacent to V3.

f.) Find all edges incident on V4.

Solution

a.) EG = {e1, e2, e3, e4, e5, e6} and V G = {v1, v2, v3, v4, v5, v6, v7}.

b.) There is only one isolated vertex, v5.

c.) There is only one loop, e5.

d.) {e2, e3}.


e.) {v2, v4}.
f.) {e1, e4,e5}.

Complete graph:

A complete graph on n vertices,denotedby Kn, isthesimplegraphthatcontains


exactly one edge between each pair of distinct vertices.

53
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example 5.4. Draw (a) K2 ( b) K3 (c) K4 (d) K5.

Solution

Figure 8

Figure 9

Degree of vertex:

Thedegree of a vertexV in an undirected graph, in symboldeg(V ), is the number


ofedgesincidentonit. Bydefinition,aloopatavertexcontributestwicetothe degree of
that vertex. The total degree ofGis the sum of the degree of all vertices ofG.

54
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example 5.5. What are the degree of the vertices in the following graph.

Figure 10

Solution

deg(V1) = 0, deg(V2) = 2, deg(V3) = 4.

Theorem 7. For any graph G = (V G, EG) we have;

Σ
2|EG| =
v∈V (G)

deg(V ).

Proof:

Suppose that V G = {v1, v2, . . . , vn}and 2|EG| = m. Let e ∈EG, if e is a


loopthen it contributes two times to the total degree ofG.

If e is not a loop, then let Vi and vj denote the endpoints of e. Then e


contributes one time todeg(vi) and one time to thedeg(vj).

Therefore, e contributestwotimestothetotaldegreeof G. Since e waschoose


arbitrarily, this shows that each edge of G contributes two times to the total degree
ofG.Thus,
Σ
2|EG| =
v∈V (G) deg(V ).

Example 5.6. Find a formula for the number of edges in Kn.

Solution

Since G is complete, each vertex is adjacent to the remaining vertices. Thus, the
degree of each of the n vertices is n — 1, and we have the sum of the degrees of all
the vertices being n(n —1). By Theorem 1. n(n —1) = 2|EG|.

55
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

5.1.2 PATH:

In an undirected graph G a sequence P of the form v0e1v1e2 . . . vn−1envn with no


repeated edge is called apath connectingv0 tovn.

5.1.3 CIRCUIT or CYCLE:

If P is a path such that v0 = vn then it is called a circuit or cycle.

Simple Circuit:

A path or circuit is simple if it does not contain the same vertex more than once.
A graph that does not contain any circuit is calledacyclic.

Example5.7. In the graph below, determine whether the following sequences are
paths, simple paths, circuits or simple circuits.

Figure 11

a.) v0e1v1e10v5e9v2e2v1.

b.) v3e3v4e8v5e10v1e3v2.

c.) v1e2v2e3v1.

d.) v5e9v2e4v3e5v4e6v4e8v5.

Solution

a.) A path (no repeated edge), not a simple path, (repeated vertex v1), not
acircuit.
b.) A simple path.

56
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

c.) A simple circuit.

d.) A circuit, not a simple circuit (vertex v4 is repeated).

5.1.4 CONNECTED AND DISCONNECTED GRAPH:

An undirected graph is called connected if there is a path between every pair


ofdistinctverticesofthegraph. Agraphthatisnotconnectedissaidtobedisconnected.

Example 5.8. Determine which graph is connected and which is disconnected.

Figure 12: (a). Figure 13: (b).

Solution

a.) Connected.

b.) Disconnected since there is no path connecting the vertices v1 and v4.

5.1.5 EULER PATH AND EULER CIRCUIT:

A simple path that contains all edges of a graph G is called Euler path. If this path
is also a circuit, it is called an Euler circuit.

5.1.6 HAMILTONIAN PATH AND HAMILTONIAN CIRCUIT:

A path is called Hamiltonian path, if it visits every vertex of the graph exactly
once. A circuit that visits every vertex exactly once except for the last vertex
which duplicates the first one is called aHamiltonian circuit.

57
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Example 5.9. Find a Hamiltonian circuit in the graph.

Figure 14: (a)

Solution

a.) V WXY ZV.

Example 5.10. Show that the following graph has a Hamiltonian path but no
Hamiltonian circuit.

Figure 15: (a)

Solution

a.) V WXY Z is a Hamiltonian path. There is no Hamiltonian circuit since no


cycle goes throughV.

5.2 TREES

An undirected graph is called atree if each pair of distinct vertices has exactly one
path between them. Thus, a tree has no parallel edges and no loops.

Theorem 8. Any tree with more than one vertex has one vertex of degree 1.

Proof:

Let T be a tree with a number of vertices ≥ 1. Pick a vertex v at random and

58
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

searchoutwardfrom v onapathalongedgesfromonevertextoanotherlooking for a


vertex of degree 1.

Aseachnewvertexisreached,checkwhetherithasdegree1. Ifsoavertexof
degree1hasbeenfound. Ifnot,itispossibletoexitfromthenewvertexalonga different
edge from that used to reach the vertex.BecauseT is a tree, it is circuit
free,andsothepathneverreturnstoapreviouslyusedvertex. Sincethenumber of
vertices of T is finite, the process of building a path must eventually terminate.

When that happens, the final vertex of the path must have degree 1.

Theorem 9. Any tree with n vertices has exactly n — 1 edges.

Example 5.11. Which of the following graphs are trees.

Figure 16: (a)

Figure 17: (b)

Figure 18: (c)

Solution

a.) Satisfies the definition of a tree.

b.) Do not satisfy the conclusion of theorem 10 and therefore, not a tree.

c.) Do not satisfy the conclusion of theorem 10 and therefore, not a tree.

59
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

5.2.1 Rooted Tree:

A rooted tree is a tree in which a particular vertex is designated as the root.

Level of a Vertex:

The level of a vertex v is the length of the simple path from the root to v.

Height of a Rooted Tree:

The height of a rooted tree is the maximum level number that occur.

Example 5.12. Find the level of each vertex and the height of the following
rooted tree.

V1

V2 V3

V4 V5 V6 V7

Solution

V1 is the root of the given tree.

Vertex Level
V2 1
V3 1
V4 2
V5 2
V6 2
V7 2

∴ the height of the tree is 2.

Definition 21. LetT be a rooted tree with root atV0.Suppose (V0, V2, . . . , Vn) is
a simple path inT andX, Y, Zare three vertices. Then: -

a Vn−1 is the parent ofVn.


b V0, V2, . . . , Vn−1 are the ancestors of Vn.
c Vn is the child of Vn−1.

60
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

d If x is an ancestor of y they y is a descendant of x.


e If x and y are children of z, then x and y are siblings.
f If x has no children, then x is a leaf.
g The subtree of T rooted at x is the graph with vertex set V and edge
setE, where V is x together with the descendants of x and E =
{e :eis an edge on a simple path from x to some vertex inV }.

Example 5.13. Consider the rooted tree below.

V1

V3 V5

V2 V4

V6 V7 V8 V9

V10 V11 V12 V13

a.) Find the parent of V6.

b.) Find the ancestors of V13.

c.) Find the children of V3.

d.) Find the descendants of V11.

e.) Find an example of a sibling.

f.) Find the leaves.

g.) Construct the subtree rooted at V7.

Solution

a.) V2.

b.) V1, V3, V7.

c.) V7, V8, V9.

61
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

d.) None.

e.) {V2, V3, V4, V5}.


f.) {V4, V5, V6, V8, V9, V10, V11, V12, V13}.

g.)

V7

V10 V11 V12 V13

Binary Tree:

A binary tree is a rooted tree such that each vertex has at most two children.
Moreover, each child is designated as either a left child or a right child.

Example 5.14. a.) Show that the following tree is a binary tree.

V1

V2 V3

V4 V5

V6 V7

b.) Find the left child and right child of vertex V5.

c.) A fullbinary tree is a binary tree in which each vertex has either two children
or zero children. Construct an example of a full binary tree.

Solution

a.) Following from the definition of a binary tree.

b.) The left child is V6 and the right child V7.

c.)

62
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

V1

V2 V3

V5

V6 V7

63
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

6 FUNDAMENTALS OF MATHEMATICAL
PROOFS

6.1 Methods of Direct Proof.

A mathematical system consists of axioms, definitions, and undefined terms.

Axiom: An axiom is a statement that is assumed to be true.

Definition: A definition is used to create new concepts in terms of existingones.

Theorem: A theorem is a proposition that has been proved to be true.

Lemma: A lemma is a theorem that is usually not interesting in its own but is
useful in proving another theorem.

Corollary: A corollary is a theorem that follows quickly from a theorem.

Example 6.1. (i) Points and lines are examples of undefined terms.

(ii) An example of a definition: Two angles are supplementary if the sum of their
measures is 180◦.
(iii) Anexampleofanaxiom: Giventwodistinctpoints,thereisexactlyoneline that
contain them.
(iv) An example of a theorem: if two sides of a triangle are equal, then the angles
opposite are equal.
(v) An example of a corollary: If a triangle is equilateral, then it is equiangular.

Proof: An argument that establishes the truth of a theorem is called a proof.

Logic: Logic is the tool for the analysis of proofs.

Example 6.2. (i) Show that there exist a positive integer whose squares can be
written as the sum of the squares of two positive integers.

Solution:

Indeed, one example is 52 = 32 + 42.

Example 6.3. (i) Show that there exist a positive integer x such that x2 = 15, 129.

Solution:

64
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Indeed, one example is x = 123.


Example 6.4. (i) Show that for each integer 1 ≤ n≤ 10,n2 — n + 11 is a
primenumber.

Solution:

The given proposition can be written in the form “∀ n ∈ N if 1 ≤ n


≤10 then p(n) is prime”.Wherep(n)= n2 — n + 11.Using the method
ofexhaustionwe see that

p(1) = 11, p(2) = 13, p(3) = 17, p(4) = 23, p(5) = 31, p(6) = 41, p(7) = 53,
p(8) = 67, p(9) = 83, p(10) = 101.

The most powerful technique for proving a universal proposition is one that works
regardlessofthesizeofthedomainoverwhichthepropositionisquantified. Itis called
the method ofgeneralizingfromthegenericparticular.
Theorem 10. For all n, m ∈ Z, if m and n are even then so m + n.

Proof:

Let m and n be two even integers. There exists integers k1 and k2 such that n =
2k1 andm=2k2.

We must show that m + n is even, that is, an integer multiple of 2. Indeed,

m + n = 2k1 + 2k2
= 2(k1 + k2)
= 2k.

Where k = k1 + k2 ∈ Z. Thus by the definition of even, m + n is even.

Theorem 11. Every integer is a rational number.

Proof:

Let n be an arbitrary integer. Then n = n


1. By the definition of rational numbers,
n is rational.
Theorem 12. If a, b ∈ Q then a + b ∈ Q.

Proof:

Let a and b be two rational numbers. Then there exists integers a1, a2, b1 /= 0, and
b2 /= 0 such thata =b1
a1
and b = a2
.
65
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

2 b

66
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

By the property of addition of two fractions we have;


a1 a2
a+b= +
b1 b2
a1b2 + a2b1
= b1b2

By letting p = a1b2 + a2b1 ∈ Z and q = b1b2 ∈ Z, we get a + b =qp .

Thus, a + b ∈ Q.

Example 6.5. Disprove the proposition ∀, a, b ∈ R. If a < b then a2 < b2.

Solution:

A counter example is the following.

Let a = —2 and b = —1. Then a < b but a2 > b2.

6.1.1 Vacuous Proof:

A vacuous proof is a proof of an implication p → q in which it is shown that p


isfalse.

Example 6.6. Use the method of vacuous proof to show that if x ∈ Q then
David is playing pool.

Solution:

Since the proposition x ∈ Q is always false, the given proposition is vacuously true.

6.1.2 Trivial Proof:

A trivial proof of an implication p→ qis one in which qis shown to be true without
any reference toq.

Example 6.7. Use the method of trivial proof to show that if n is an even integer
then,nis divisible by 1.

Solution:

Since the proposition n is divisible by 1 is always true, the given implication is


trivially true.

67
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

6.1.3 Proof by Cases:

The method of proof by cases is a direct method of proving the conditional


proposition p1 ∨ p2 ∨ · · · ∨ pn →q. The method consists of proving the condition
proposition p1 →q, p2 →q, . . ., pn →q.

Example 6.8. Show that if n is an positive integer then, n3 + n is even.

Solution:

We use the method of prove by cases.

Case 1. Suppose that n is even. Then there is k ∈N such that n = 2k. In this
case n3 +n =8k3 +2k =2(4k3 +k) which is even.

Case 1. Suppose that n is odd. Then there is k ∈ N such that n = 2k + 1. So,


n3 + n =2(4k3 + 6k2 + 4k + 1) which is even.

Example 6.9. Use the method of proof by cases to prove that the triangle
inequality |x+y|=|x| +|y|.

Solution:

We use the method of prove by cases.

Case 1. x ≥ 0 and y ≥ 0. Then x + y ≥ 0 and so |x + y| = |x| + |y|.

Case 2. x ≥ 0 and y < 0. Then x + y < x + 0 < |x| ≤ |x| + |y|. On the other hand

—(x + y) = —x + (—y) ≤ 0 + (—y) = |y| ≤ |x| + |

y|.Thus,

if |x + y| = x + y then |x + y| < |x| + |y|

and if |x + y| = —(x + y)then |x + y| ≤ |x|

+ |y|.

Case 3. The case x < 0 and y ≥ 0 is similar to case 2.

Case 4. Suppose x < 0 and y < 0. Then x + y < 0 and therefore |x + y| =


—(x + y) = (—x) + (—y) = |x| + |y|.

So in all the four cases |x + y| ≤ |x| + |y|.

68
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

6.1.4 Methods of Indirect Proofs: Contradiction and Contrapositive

Recall that in a direct proof one starts with the hypothesis of an implicationp→
qand then proves that the the conclusion is true. Any other method of proof will be
referred to as an indirect proof.

Proof by Contradiction:

We want to show thatpis true. We assume it is not and therefore∼ pis trueand
then derive a contradiction. By the rule of contradiction, p must by true.
Theorem 13. If n2 is an even integer so is n.

Proof:

Supposethecontrary. Thatis,supposethat n isodd. Thenthereisaninteger ksuch


that n= 2k + 1.In this case,n2 = 2(2k2 + 2k) + 1 is odd and this contradicts the
assumption thatn2 is even. Hence,nmust be even.

Theorem 14. The number 2 is irrational.

Proof:

Suppose the contrary. That is, suppose that2 is rational. Then there exist two

integers m and n with no common divisors such that 2= nm .

Squaring both sides of this equality, we find that 2n2 = m2.Thus,m2 is even. By
Theorem,(if n2 isanevenintegersois n), m iseven. Thatis2divides m. but then m=
2k forsomeinteger k. Takingthesquarewefindthat2n2 = m2 = 4k2, that isn2 =
2k2.This says thatn2 is even and by the same theorem,nis even.

We conclude that 2 divides both m and n and


√ this contradicts our assumption that
m and n have no common divisors. Hence, 2 must be irrational.

6.1.5 Methods of Proof by Induction:

Withtheemphasisonstructuredprogramminghascomethedevelopmentofan area
called program verification, which means your program is correct as you writing it.
Onetechniqueessentialtoprogramverificationis mathematicalinduction, a method of
proof that has been useful in every area of mathematics as well.

The steps of mathematical induction are as follows:

(i) Basis of induction. Show that P (n0) is true.

69
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(ii) Inductive hypothesis. Assume P (n) is true.

(iii) Inductive step. Show that P (n + 1) is true.

Example 6.10. Use the technique of mathematical induction to show that


1+ 2+ 3+ · · ·+ n= n(n+1)2 , n≥ 1.

Solution:

Let P (n) : 1 + 2 + 3 + · · · + n = 2n(n+1) .

1(1+1)
(i) (Basis of induction. Show that ) P (1) : 1 = 2
= 1. That is, P (1) is true.

(ii) (Inductive hypothesis). Assume P (n) is true.

That is, P (n) : 1 + 2 + 3 + · · · + n = 2n(n+1) is true.

(iii) (Inductive step). We must show that P (n + 1) is true.

That is, P (n + 1) : 1 + 2 + 3 + · · · + n + n + 1 = (n+1)(n+2)


2
indeed.

1 + 2 + 3 + · · · + n + (n + 1) = (1 + 2 + 3 + · · · + n) + n + 12 = n(n+1)
+ n + 1.

(n+1)( n+2)
= 2 .

Example 6.11. (Geometric Progression).

a) Use the technique of mathematical induction to show that ;


Σ
n
a(1 — r )
k+1
P (n) : ark = , n ≥ 0, r /= 1.
k=0

(1 — r)

70
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

b) Use the technique of mathematical induction to show that ;


1 1
P (n) : 1 + + · · · + n 1 ≤ 2, ∀ n ≥ 1.
2 2−

Solution:

a) Use the method of mathematical induction.

0+1 Σ
−r ) n
(i) (Basis of induction. Show that ) a = a(1
1−r = k=0
ark. i.e, P (0) is true.

(ii) (Inductive hypothesis). Assume P (n) is true.


Σ
n
That is, P (n) : (1−r)
k=0

n+1
a(1−r )
ark = is true.

71
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(iii) (Inductive step). We must show that P (n + 1) is true.


Σ
n+1
a(1 — r )
n+1
i.e, P (n + 1) : k
ar = indeed.
k=0
n+1 (1 — r)
Σ
a(1 — n+1
r )
ark = + arn+1.
k=0 a(1 rn+1)
= — +
(arn+1)(1 — r)
(1 — r) .
(1 — r) (1 — r)

a(1 — rn+1 + rn+1 — rn+2)


= (1—r) .
a(1— rn+2)
= .
(1 — r)

b) By (a), we have;

1 1
P (n) : 1 +
+···+ 1 —( 21 )n
2 2n−1 = .
1 — (21 )

.
= 2 1—

n — ≤
1
2

72
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

1
=2 1 2.
2n−1

Example 6.12. (ArithmeticProgression).

Use mathematical induction to show that ;


n
P (n) : Σ (a +(k 1)r) = n [2a + (n 1)r] , n 1.
— 2 —
k=1

Solution:

We use the method of proof by mathematical induction.


Σ
1
(i) (Basis of induction. Show that ) a = 1
[2a + (1 — 1)r] =

(a + (k — 1)r).

73
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

i.e, P (1) is true. 2 k=1

(ii) (Inductive hypothesis). Assume P (n) is true.

n
That is, P (n) : Σ (a +(k 1)r) = n [2a + (n 1)r] is true.
— 2
k=1

74
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

(iii) (Inductive step). We must show that P (n + 1) is true.


n
i.e, P (n + 1) : Σ (a +(k 1)r) = [2a + nr] indeed.
n+2
k=1
1
n+1
— n
Σ Σ
(a + (k — 1)r) = (a + (k — 1)r + a + (n + 1 — 1)r) .
k=1
= [2a + (n — 1)r] + a + nr.
k=1 2 + n2r nr + 2a + 2nr
2an
1 = — .
2
n+
1
=
2
[2a + nr] .

We next exhibit a theorem whose proof uses mathematical induction.

Theorem 15. For all integers n ≥ 1, 22n — 1 is always divisible by 3.

Proof:

Let P (n) : 22n — 1 is divisible b 3. Then,

(i) (Basis of induction. Show that ) P (1) is true, since 3 is divisible 3.

(ii) (Inductive hypothesis). Assume P (n) is true.

That is, P (n) : 22n — 1 is divisible by 3.

(iii) (Inductive step). We must show that 22n+1 — 1 is divisible by 3.

Indeed, P (n+1) : 22n+2 — 1=22n(4)— 1.


= 22n(3 + 1) — 1.
= 22n · 3 + 22n — 1.
= 22n · 3 + P (n).

Since 3|(22n — 1) and 3|(22n · 3), we have 3|((22n · 3 + 22n — 1). This ends the proof
of the theorem.

Example 6.13. a) Use induction to prove that ; n < 2n for all non-negative
integersn.

b) Use induction to prove that ; 2n < n! for all non-negative integers n ≥ 4.

75
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

Solution:

a) Let P (n) : n<2n. We want to show that P (n) is valid for all n ≥ 0. By the
method of mathematical induction we have,

(i) (Basis of induction. Show that ) 20 — 0 = 1 > 0. i.e, 0 < 20. Thus, P (0)
istrue.

(ii) (Inductive hypothesis). Assume P (n) is true.

That is, P (n) : n < 2n is true.

(iii) (Inductive step). We must show that P (n + 1) is also true. That is,
n + 1 < 2n+1.

Indeed, 2n+1 — (n + 1) = 2n · 2 — n — 1.
= 2n(1 + 1) — n — 1.
= 2n + 2n — n — 1.
= (2n — n) + (2n — 1).
> 2n — 1.
> 0.

Where we used the fact that 2n — n > 0.

b) Let P (n) : 2n<n!. We want to show that P (n) is valid for all n≥ 4. By the
method of mathematical induction we have,

(i) (Basis of induction. Show that ) 4! — 24 = 8 > 0. i.e, 8 > 0. Thus, P (0) is true.

(ii) (Inductive hypothesis). AssumeP (n) is true.

That is, P (n) : 2n<n!, n≥4 is true.

(iii) (Inductive step). We must show that P (n + 1) is also true. That is,
2n+1 < (n + 1)!.

Indeed, (n + 1)! — 2n+1 = (n + 1)n! — 2n(1 + 1).


= n! — 2n + nn! — 2n.
> nn! — 2n.
> 0.

Where we used the fact that if n ≥ 1 then, nn! ≥ n!.

Example 6.14. (Bernoulli’s Inequality)

76
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

a) Let h > —1. Use induction to show that ; (1 + nh) ≤ (1 + h)n, n ≥ 0.

Solution:

a) Let P (n) : (1 + nh) ≤ (1 + h)n. We want to show that P (n) is valid for
all negative integers.

(i) (BI) (1 + h)0 — (1 + 0h) = 0. i.e, P (0) is true.

(ii) (IH). Assume P (n) is true.

That is, (1 + nh) ≤ (1 + h)n is true.

(iii) (IS). We must show that P (n + 1) is also true. That is, (1 + (n + 1)h) ≤
(1 + h)n+1.

Indeed, (1 + h)n+1 — (1 + (n + 1)h) = (1 + h)(1 + h)n — nh — 1 — h.


≥ (1 + h)(1 + nh) — nh — 1 — h.
= nh2.
≥ 0.

Exercises:

1. Use the method of induction to show that 2 + 46 + · · · + 2n= n2 + n for


all integers n≥0.
2. Use mathematical induction to prove that 1 + 2 + 22 + · · · + 2n = nn+1 —
1 for all integersn≥ 0.

3. Use mathematical induction to show that 12 + 22 + · · · + n2 = n(n+1)(2n+1)


6
for all integers n ≥ 1.

2 2
n(n+1)
4. Use mathematical induction to show that 13 + 23 + · · · + n3 = for
all integers n ≥ 1.
5. Use mathematical induction to show that 1
+ 1
+···+ 1
= n(n+1)

for all integers n ≥ 1.

1·2

2·3

n(n+1) 2

77
MTH 122: INTRODUCTION TO DISCRETE MATHEMATICS

6. Use the formula1 + 2 + · · · + n = n(n+1)

2
to find the value of the sum,
3 + 4 + · · · + 1000.

L
∗∩∪?† ± ∓ ∈ ⊂ /≡ ⊆
→—

78

You might also like