USIT104 Discrete Mathematics
USIT104 Discrete Mathematics
(IT)
SEMESTER - I (CBCS)
DISCRETE MATHEMATICS
SUBJECT CODE : USIT104
© UNIVERSITY OF MUMBAI
Prof. Suhas Pednekar
Vice Chancellor
University of Mumbai, Mumbai.
Prof. Ravindra D. Kulkarni Prof. Prakash Mahanwar
Pro Vice-Chancellor, Director
University of Mumbai. IDOL, University of Mumbai.
Published by : Director
Institute of Distance and Open Learning ,
University of Mumbai,
Vidyanagari, Mumbai - 400 098.
ipin Enterprises
Tantia Jogani Industrial Estate, Unit No. 2,
Ground Floor, Sitaram Mill Compound,
J.R. Boricha Marg, Mumbai - 400 011
CONTENTS
Chapter No. Title Page No
Unit I
1. Introduction And Introduction To Set Theory................................................................... 01
2. The Logic Of Compound Statements.................................................................................26
Unit II
3. Quantified Statements........................................................................................................36
4. Elementary Number Theory And Methods Of Proof...........................................................54
Unit III
5. Sequences, Mathematical Induction And Recursion............................................................75
6. Functions........................................................................................................................106
Unit IV
7. Relations.........................................................................................................................130
8. Graphs............................................................................................................................149
9. Trees...............................................................................................................................170
Unit V
10. Counting.........................................................................................................................198
11. Probability...................................................................................................................... 202
*****
Syllabus
B. Sc (Information Technology) Semester – I
Course Name: Discrete Mathematics Course Code: USIT104
Periods per week (1 Period is 50 minutes) 5
Credits 2
Hours Marks
Evaluation Theory 2½ 75
System Examination - 25
- 25
List of Practical: Write the programs for the following using SCILAB
1 Set Theory
a. Inclusion Exclusion principle.
b. Power Sets
c. Mathematical Induction
3. Counting
a. Sum rule principle
b. Product rule principle
c. Factorial
d. Binomial coefficients
e. Permutations
f. Permutations with repetitions
g. Combinations
h. Combinations with repetitions
i. Ordered partitions
j. Unordered partitions
4. Probability Theory
a. Sample space and events
b. Finite probability spaces
c. Equiprobable spaces
d. Addition Principle
e. Conditional Probability
f. Multiplication theorem for conditional probability
g. Independent events
h. Repeated trials with two outcomes
5. Graph Theory
a. Paths and connectivity
b. Minimum spanning tree
c. Isomorphism
6. Directed Graphs
a. Adjacency matrix
b. Path matrix
7. Properties of integers
a. Division algorithm
b. Primes
c. Euclidean algorithm
d. Fundamental theorem of arithmetic
e. Congruence relation
f. Linear congruence equation
8. Algebraic Systems
a. Properties of operations
b. Roots of polynomials
9. Boolean Algebra
a. Basic definitions in Boolean Algebra
b. Boolean algebra as lattices
1
INTRODUCTION AND INTRODUCTION
TO SET THEORY
Unit structure
1.0 Objectives
1.1 Introduction
1.2 Introduction to Sets
1.3 Relations and Functions
1.4 Subsets- Proof of the Concept
1.5 Properties of Set
1.6 Proving Property of Sets using Venn Diagram
1.7 Boolean Algebras, Russell’s Paradox and the Halting Problem
1.8 List of References
1.9 Unit End Exercise
1.0 OBJECTIVES
1.1 INTRODUCTION
2
Universal Existential Statements:
There exists a positive number greater than zero that belongs to the
set of natural numbers OR Every positive integer m in set of natural of
numbers n such that m, n is always >=0
3
Example 2: Rewriting an Existential Universal Statement:
A rectangle has two opposite sides equal and parallel and belongs to the
parallelogram family. The other forms of writing the statement are as
follows:
a) A rectangle having equal and opposite sides that are parallel is a
parallelogram.
b) Each parallelogram that has two opposite sides equal and parallel is
a rectangle.
4
To solve the above please note that for part “a” elements of asset are
never repeated i.e.
a. All the sets denoted by A, B, C have exactly the same number of
elements within the set and also the elements are the same.
b. As per the set notation the set containing “0” represents that there
exists a single element in the set and it is not equal to 0.
c. There are two elements in the set the first element being “5” and the
second element being a set containing the number5.
d. N3 = {3,-3},N4={4,-4},N = {0,0}
There are certain set of numbers which are commonly referenced through
symbolic names and are presented in the table below:
Set Represented by
R Set of all real numbers
Set-Builder Notation:
Let S be a set and let P(x) be a property such that for the elements of
the set S the property might either hold true or false. The above can be
represented as follows: We may define a new set to be the set of all
elements x in S such that P(x) is true. The most natural way of denoting it
is as follows:
{ x | P(x)} or {x ∈ S | P(x)}
2 3
Subsets:
Example 4: Subsets:
Let A = {Set of whole numbers, B = {n ∈ W | 0 ≤ n ≤ 100}, and C
= {40, 50, 60, 70, 80,120}. Evaluate the truth and falsity of each of the
following statements.
a. B ⊆A- True
b. C is a proper subset of A - True
6
c. C and B have at least one element in common - True
d. C ⊆ B - False 120 is not in B
e. C ⊆ C True because every element in C is also in C and every set is a
subset of itself.
Cartesian Products:
Cartesian Product:
Example 7:
Let P = {8, 9} and B = {8,9,10} and define a relation R from P to Q as
follows: Given any (m, n) ∈ P × Q, means that m – n/2 is an integer.
a. State the ordered pairs are in P × Q and which are in R.
b. Is 8 R 10? Is 9 R 10? Is 9 R 9?
7
c. What are the domain and co-domain of R?
Solution:
a. P x Q= {(8, 8), (8, 9), (8, 10), (9, 8), (9, 9), (9, 10)}. To determine
explicitly the composition of R, examine each ordered pair in P × Q to see
whether its elements satisfy the defining condition for R.
(8, 8) ∈ R because 8−8/2 = 0/2 = 0, which is an integer.
(8, 9) ∉ R because 8−9/2 = −1/2, which is not an integer.
(8, 10) ∈ R because 8−10/2 = −2/2 = −1, which is an integer.
(9, 8) ∉ R because 9−8/2 = 1/2, which is not an integer.
(9, 9) ∈ R because 9−9/ 2 = 0/2 = 0, which is an integer.
(9, 10) ∉ R because 9−10/ 2 = −1/ 2 , which is not an integer.
Thus
a) R = {(8,8) (8, 10), (9, 9)}
b) Yes, 8 R 10 because (8, 10) ∈ R.
No, 9 R 10 because (2, 3) ∉ R.
Yes, 9 R 9 because (9, 9) ∈ R.
c) The domain of R is {8, 9} and the co-domain is {8, 9, 10}.
Example 8:
Let P = {7, 8, 9} and B = {8, 9, 10} and define relations S and T from P to
Q as follows: For all (m, n) ∈ P × Q, (m, n) ∈ S means that m < n. S is a
“less than” relation.
T = {(7, 8), (7, 9)}.
Draw arrow diagrams for S and T .
Solution:
S.T.
8
From every element in a set, based on a condition we can show
single or multiple relationships within elements of two different sets using
the arrow diagram.
Functions:
A proper subset of a set is a subset that does not have at least one
element of the original set. Thus P is a proper subset of Q⇔ P⊆ Q and
there is at least one element in Q that is not in P.
9
Example 10:
Let P = {5} and B = {5,{5}}.
a. Is P⊆ Q?
b. P a proper subset of Q
Solution:
a. Yes P is a subset of Q. P has an element from the set of elements
present in Q
b. P is also a proper subsetof Q because there exists at least one element
in Q that is not in P.
A method of direct proof can be used to show one set is a subset of the
other using the concept of element argument.
Element Argument: This is a method for proving that a set is the subset
of another. Given X and Y. To prove that X ⊆ Y
a. suppose that m is a particular but arbitrarily chosen element of P
b. m has to be an element of Q .
a. To prove that P ⊆ Q
b. Q⇔ P⊆ Q (To prove that it is a proper subset)
c. Disprove that Q⊆ P.
Solution:
10
with a common difference “d” of 2. Hence it is proved that it is a
proper subset of Q.
6a + 12 = 2by assumption
3a + 4 = 1 by reduction
a= -1 which is not an integer Hence P cannot be a subset of set Q.
Set Equality:
Sets P and Q are said to be equal if, and only if, they have exactly
the same number of elements. The definition can still be formulated using
the set language.
Let there be two sets P and Q. It is said that they are equal if every
element of set P is in set Q and vice versa represented as P = Q⇔ P⊆ Q
and Q⊆ P.
11
Set Operations:
Union of sets: Let P and Q be the subsets of a universal set U. The union
of P and Q is the setdenoted by P U Q such that the set contains all
elements those which either belong to P or to Q.
P∪ Q = {m∈ U | m ∈ P or m∈ Q}
P ∩ Q={m ∈ U | m∈ P and m∈ Q}
Q – P or Q/p = {x ∈ U | x ∈ Q and x ∉ P},
Pc or P = {x ∈ U | x ∉ P}.
Here the above symbols are commonly used set theory symbols
introduced in 1889 by the Italian mathematician G Peano.Venn diagrams
embody mathematical or logical sets pictorially as circles enclosed within
rectangles (the universal set U), and the common elements of the sets
being represented by intersections of the circles.
Solution:
P ∪ Q = {m. n, o, p, q}
P ∩ Q = {m.n,p, q}
Q - P = {o}
Pc = {}
12
m ≤ n: (m, n) = {y∈ R | m < y < n} [m, n]={y ∈ R | m ≤ y ≤ n}
(m,n)=n{y ∈ R | m < y ≤ n} [a, b) = {y∈ R | m ≤ y ≤ n}
Find P∪ Q, P ∩ Q, Q − P, and Pc
Solution:
P∪ Q = {y∈ R | y∈ (−1, 0] OR y∈ [0, 1)}={y∈ R | y∈ (−1, 1)} = { (-1,0)
∪ (0,1)} = (-1,1)
P ∩ Q = {y∈ R | y∈ (−1, 0] AND y∈ [0, 1)}={(-1,0) ∩(0,1) = 0}
Q – P = {y∈R | y∈ [0, 1) and y∉(−1, 0]} = {y∈ R | 0< y<= 1} = {1}
Pc = {y∈ R | y∉ (−1, 0]}
Empty sets are otherwise known as the null sets and denotedby∅.
For example if we take { 3,4 } ∩ {2,5} then it is = ∅
Solution: Such an element does not exist hence the set is an empty set
Partitions of Sets:
13
Sets P and Q are disjoint ⇔ P ∩ Q = ∅.
Let P = {9, 3, 2} and B = {1, 4, 8}. Prove that P and Q are disjoint
Solution :
Since these two sets have no element in common they are said to be
disjoint
{9, 3, 2}∩{1, 4, 8}=∅.
P1, P2, P3 ... are pairwise disjoint or non-overlapping if, and only if, no two
sets Pi and Pj with distinct subscripts have any element in common i.e. Pi
∩ Pj = ∅ where i,j = 1,2,3………..
Solution:
a. P1 and P2 have {1,5} as common elements, P1 and P3 have no
elements and P2 and P3 have no elements common. Hence P1 and P3
and P2 and P3 are mutually disjoint.
Partition:
P1, P2 , P3 and P4 if mutually disjoint can also act as partitions for the total
set P and P can be written as P = P1∪P2 ∪, P3∪ P4 and is represented in the
following manner.
Solution:
a. P = P1∪ P2∪ P3 and the sets are mutually disjoint
b. Let S = { Set of all integers}
P1 = {n ∈ S| m = 5n, for some integer n},
P2 = {n∈ S| m = 5n + 1, for some integer n},
P3 = {n ∈ S| m = 5n + 2, for some integer n}.
Is { P1 , P2 ,P3} a partition of P?
Yes the sets are disjoint and no two sets have any common elements
in them because the remainders 0, 1, 2 added to the equations give
different values of m each time. For example for 5n (n = 1,2,3,4) i.e.
5,10,15 20 …… the remainders are 0 in each case. For example for 5n + 1
(n = 1,2,3,4) i.e. 6,11,16,21 the remainders are 1 in each case. For 5n+2 (n
= 1,2,3,4) i.e.7,12,17,22 the remainders are 2 in each case.
Power Sets:
The power set of B, denoted P (B), is the set of all subsets of B
Solution
P({m,n}) = { ∅,{m},{n},{m,n}}
Set Identities
Consider the universal set U and the following identities as represented
5. Complement Laws:
(a) P ∪ Pc = U and (b) P ∩ Pc = ∅.
Solution:
The two sets are equal if, and only if, each is a subset of the other. Hence,
it is essential to prove the following:
P∪ (Q ∩ R) ⊆ (P∪ Q) ∩ (P∪ R)
and (P∪ Q) ∩ (P∪ R) ⊆ P∪ (Q ∩ R)
17
The Empty Set:
The property is true if and only if the given equality holds for all sets
P,Q and R false otherwise. The following can be proved using Venn
Diagram by shading the different regions of the Venn diagram as per the
formula given and arrive at the result Shade the region corresponding to (P
− Q) ∪ (Q − R) and then shade the region corresponding to P − R. They
are not the same . Here take A = P ,B= Q and C = R
(P – Q) ∪ (Q − R)(P – R)
Power Sets:
Basis step :P(0) is true, because the set with cardinality 0 (the empty set)
has 1 subset (itself) and 20 = 1.
Inductive step: To prove P(k) → P(k+1) That is, prove that if a set with k
elements has 2K subsets, then a set with k+1 elements has 2K+1 subsets.
Proof: Any set with cardinality k has 2K subsets. Let P be a set such that
|P| = k+1. Enumerate the elements of P: P = c1……ck+1. Let S = c1……..ck.
Then |S|=k, so S has 2k subsets, and according to theory of mathematical
induction P = S ∪ {ck+1}.Hence every subset of S is also a subset of P.
Any subset of Pcontains the element ck+1, or it doesn’t contain ck+1. If a
subset of P doesn’t contain ck+1, then it is also a subset of S, and there are
2k of those subsets. On the other hand, if a subset of P contains the
element ck+1, then that subset is formed by including ck+1 in one of the 2k
subsets of S, so P has 2k subsets containing ck+1. We have shown that P has
2k subsets containing ck+1 , and another 2k subsets not containing c k+1, so
the total number of subsets of P is 2k + 2k = 2k+1 which is of the order of
2k .
Set Difference:
Construct an algebraic proof that for all sets P, Q, and R,
(P∪ Q) − R = (P − R) ∪ (Q − R).
Solution:
Let P, Q and R be any sets. Then
= (P U Q) − R = (P U Q) ∩ Rc by the set difference law
= Rc∩ (P∪ Q) by the commutative law
= (Rc∩ P) ∪ (Rc ∩ Q) by the distributive law
= (P ∩ Rc )∪ (Q ∩ Rc ) by the commutative law
= (P − R) ∪ (Q− R) by the set difference law.
Associative Law
Prove that for any sets A1, A2, A3, and A4,
((A1 ∪ A2) ∪ A3) ∪ A4 = A1 ∪ ((A2 ∪ A3) ∪ A4).
Solution:
Above can be written as (A U B) U C = A U( B UC) where A = A1 ∪ A2
for L.H.S and B = A2 ∪ A3 for R.H.S and solved using associative law.
20
Boolean Algebra:
A Boolean algebra typically constitutes of a set with two
operations i.e. + and ·. If p and q are elements of that set then p+q and p·q
are in that set and the following properties hold true:
Identity Laws: There exist distinct elements 0 and 1 in S such that for all
p in S, (a) p + 0 = p and (b) p ·1 = p.
Proof:
Uniqueness of the Complement Law: Suppose p and x are particular, but
arbitrarily chosen,elements of B that satisfy the following hypothesis: p +
x = 1 and p · x = 0. Then
21
= x = x ·1 because 1 is an identity
= x ·(p + p) by the complement law
= x ·p + x ·p by the distributive law
= p · x + x ·p by the commutative law
= 0 + x ·p by hypothesis
= p ·p + x ·p by the complement law
= (p ·p) + (p· x) by the commutative law for
= p·(p + x) by the distributive law
= p ·1 by hypothesis
= p because 1 is an identity
and
p ·p = p ·p by the commutative law
= 0 by the complement law for 0.
Russell’s Paradox:
Russell’s paradox is the most famous set-theoretical paradoxes. Also
known as the Russell-Zermeloparadox, it considers that the set of all sets
are not members of themselves. Such a set appears to bea member of itself
if and only if it is not a member of itself. Hence the paradox. Example S =
{S1,S2, S3…}. Hence S is not a member of itself. If S is not a member of
itself then S is a member ofitself.
The answer is neither yes nor no. For if S ∈ S, then S satisfies the
defining property for S. But if S ∉ S, then S is a set such that S ∉ S and so
S satisfies the defining property for S, which implies that S ∈ S. Thus
neither is S ∈ S nor is S ∉ S, which is a contradiction
22
The Halting Problem:
return TRUE;
}
}
The assumption was that the first algorithm that was written was a
solution to the halting problem. That is the first algorithm will terminate
after answering whether a program will loop forever on specific inputs.
23
Where as “stops_on_self” algorithm conducts two passes where one is to
execute the program and second is to provide the same program as an
input sequence to the program. Now if stops_on_self”
24
2. Let P = {8, 4, 6} and Q = {1, 3, 4}. Which of the relations D, E, and F
defined below are functions from P to Q?
a. D = {(8, 1), (4, 1), (4, 3), (6, 4)}
b. For all (m, n) ∈ P × Q, (m, n) ∈ E means that n = m + 1.
c. T is defined by the arrow diagram
*****
25
2
THE LOGIC OF COMPOUND
STATEMENTS
Unit Structure
2.0 Objectives
2.1 Introduction
2.2 Logical Form and Logical Equivalence
2.3 Conditional Statements
2.4 Valid and Invalid Arguments
2.5 Unit End Exercise
2.6 List of References
2.0 OBJECTIVES
2.1 INTRODUCTION
Statements:
Compound Statements:
26
of ~. Given another statement q, the sentence “p ˄q” is read “p and q” and
is called the conjunction of p and q. The sentence “p ˅ q” is read “p or q”
and is called the disjunction of p and q.
Truth Values:
The truth values for negation are summarized in a truth table. Truth Table
for ∼p
P ∼P
T F
F T
Definition:
If p and q are statement variables, the conjunction of p and q is “p
and q,” denoted p ˄ q. It is true when, and only when, both p and q are
true. If either p or q is false, or if both are false, p ˄ q is false.
The truth values for conjunction can also be summarized in a truth table.
Truth Table for p ˄ q
P q p˄q
T T T
T F T
F T T
F F F
Definition:
27
p q p∨q
T T T
T F T
F T T
F F F
P Q ( p ∨ q) ∧q)
( p∧ ∼( p ∧ q) ( p ∨ q) ∧ ∼( p ∧ q)
T T T T F F
T F T F T T
F T T F T T
F F F F T F
28
Truth Table for ( p ˄ q) ˅ ~r
P q r ( p ˄ q) ~r ( p ˄ q) ˅ ~r
T T T T F T
T T F T T T
T F T F F F
T F F F T T
F T T F F F
F T F F T T
F F T F F F
F F F F T T
Logical Equivalence:
Definition: Two statement forms are called logically equivalent if, and
only if, they have identical truth values for each possible substitution of
statements for their statement variables. The logical equivalence of
statement forms P and Q is denoted by writing P ≡ Q. Two statements are
called logically equivalent if, and only if, they have logically equivalent
forms when identical component statement variables are used to replace
identical component statements.
1. Construct a truth table with one column for the truth values of P and
another column for the truth values of Q.
2. Check each combination of truth values of the statement variables to
see whether the truth value of P is the same as the truth value of Q.
a. If in each row the truth value of P is the same as the truth value of Q,
then P and Q are logically equivalent.
b. If in some row P has a different truth value from Q, then P and Q are
not logically equivalent.
Solution:
p ~p ~(~p)
T F T
F T F
In the above truth table p and ~(~p) always have the same truth values, so
they are logically equivalent
29
Example 4 Showing Nonequivalence:
Show that the statement forms ~(p ˄ q) and ~p ˄ ~q are not logically
equivalent.
P Q ~p ~q p˄q ~(p ˄ q) ~p ˄ ~q
T T F F T F F
T F F T F T F
F T T F F T F
F F T T F T T
∼(p ∧ q) and ∼p ∧∼q have different truth values in rows 2 and 3, so they
are not logically equivalent.
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
T F T T F T T
In the above truth table ~ (p ˄ q) and ~p ˅ ~q always have the same truth
values, so they are logically equivalent.
Symbolically,
~ (p ˄ q) ≡ ~p ˅ ~q.
30
variables. A statement whose form is a contradiction is a contradictory
statement.
Solution:
P ~p p ˅ ~p p ˄~p
T F T T
F T T T
In the above truth table in the 3rd column all the values are T,
Hence prove p ˅ ~p is a tautology and 4th column all the values are F,
hence prove p ˄~p is a contradiction.
P q p→q
T T T
T F F
F T T
F F T
31
∨ ∼q is true and the conclusion ∼p is false are the first and second rows.
So you put F’s in those two rows and T’s in the other two rows.
p q ∼p ∼q p ∨ ∼q
∼ p ∨ ∼q
∼ →∼p
→∼
T T F F T F
T F F T T F
F T T F F T
F F T T T T
p ˅ q → r ≡ ( p → r) ˄ (q → r)
Use truth tables to show the logical equivalence of the statement forms p ∨
q → r and (p → r) ∧ (q → r).
Solution: First fill in the eight possible combinations of truth values for p,
q, and r. Then fill in the columns for p ∨ q, p → r, and q → r using the
definitions of or and if-then. For instance, the p → r column has F’s in the
second and fourth rows because these are the rows in which p is true and q
is false. Next fill in the p ∨ q → r column using the definition of if-then.
The rows in which the hypothesis p ∨ q is true and the conclusion r is false
are the second, fourth, and sixth. So F’s go in these rows and T’s in all the
others. The complete table shows that p ∨ q → r and (p → r) ∧ (q → r) have
the same truth values for each combination of truth values of p, q, and r.
Hence the two statement forms are logically equivalent.
32
Bi-conditional Statements:
Definition: Given statement variables p and q, the bi-conditional of p
and q is “p if, and only if, q” and is denoted p ↔ q. It is true if both p and
q have the same truth values and is false if p and q have opposite truth
values. The words if and only if are sometimes abbreviated iff.
P q p↔q
T T T
T F F
F T F
F F T
According to the separate definitions of if and only if, saying “p if, and
only if, q” should mean the same as saying both “p if q” and “p only if q.”
The following annotated truth table shows that this is the case:
Truth Table Showing that p ↔ q ≡ ( p → q) ˄ (q → p)
p → q ∨ ∼r
q→p∧r
∴p→r
Solution:
1 2 3 4 5 6 7 8 9
p q r ∼r q ∨ ∼r p∧r p → q ∨ ∼r q→p∧r p→r
T T T F T T T T T
T T F T T F T F
T F T F F T F T
T F F T T F T T F
F T T F T F T F
F T F T F T F F
F F T F F F T T T
F F F T T F T T T
In the above truth table column number (7) & column number (8) are the
premises and column number (9) is the conclusion.
34
In above truth table row number (4) shows that an argument of this form
can have true premises and a false conclusion.
Definition:
An argument is called sound if, and only if, it is valid and all its premises
are true. An argument that is not sound is called unsound.
Contradiction Rule:
If you can show that the supposition that statement p is false leads
logically to a contradiction, then you can conclude that p is true
*****
35
Unit II
3
QUANTIFIED STATEMENTS
Unit Structure
3.0 Objectives
3.1 Introduction
3.2 Predicates and Quantified Statements
3.3 Statements with Multiple Quantifiers
3.4 Arguments with Quantified Statements
3.5 List of References
3.6 Unit End Exercises
3.0 OBJECTIVES
3.1 INTRODUCTION
where P(x) is the open sentence “x is odd.” And if we wanted the express
“There is at least one element of S that is odd,” we’d have to write
The problem is that these expressions might never end. To overcome this
defect, we will introduce two new symbols ∀ and ∃. The symbol ∀ stands
for the phrase “for all” and ∃ stands for “there exists.” Thus the statement
“Every element of S is odd.” is written symbolically as
∀x ∈ S,P(x),
We are going to use the word ‘‘predicate to talk’’ about sentences with
variables.
Here is example of predicate: ‘‘x 2 > 2x.’’ This is a not statement yet, but
when you put a specific number for x, we do get a statement. Let’s let P(x)
denote this predicate.
37
Lets plug in a few values of x to see if we get true or false statements.
P(2) : 22 > 2(2), or 4 > 4. False
P(3) : 32 > 2(3), or 9 > 6. True
The truth set of a predicate is the set of numbers that make the predicate
true. We must always specify a ‘‘domain’’ of the predicate – that’s the set
from which we may plug in values into the predicate variable.
Example 3.2.1: let Q(n) be the predicate ‘‘n has no common factors (other
than 1) with 12’’ Find the truth set of Q(n) if its domain is
{1,2,3,…..,11,12}.
Solution: The truth set is {1,5,7,11}. Since all other natural numbers less
than or equal to 12 will have a common factor (other than 1) with 12. For
example 8 and 12 have the common factor 4. What if we change the
domain to {1,2,3,….,23,24}? Now there are more numbers that will not
have a common factor (other than 1) with 12. Now the answer will be
{1,5,7,11,13,17,19,23}. You should check this answer.
It’s important to keep in mind that the truth set of a predicate depends on
the domain of predicate variable.
Solution:
a. Check that ‘‘x 2 ≥ x’’ is true for each individual x in D.
12 ≥ 1, 22 ≥ 2, 32 ≥ 3, 42 ≥ 4, 52 ≥ 5
Solution:
a. Observe that 12 = 1. Thus ‘‘m2 = m’’ is true for at least one integer
m. Hence ‘‘∃ m ∈ Z such that m2 = m’’ is true.
b. Note that m2 = m is not true for any integers m from 5 through 8:
52 = 25 ≠ 5, 62 = 36 ≠ 6, 72 = 49 ≠ 7, 82 = 64 ≠8.
Solution:
a. All real numbers have nonnegative squares.
Or: Every real number has a nonnegative square.
Or: Any real number has a nonnegative square.
Or: The square of each real number is nonnegative
Note : The singular noun is used to refer to the domain when the ∀
symbol is translated as every, any, or each.
b. All real numbers have squares that are not equal to −1.
39
Or: No real numbers have squares equal to −1.
(The words none are or no ... are are equivalent to the words all are not.)
Solution:
If a real number is greater than 2 then its square is greater than 4.
Or: Whenever a real number is greater than 2, its square is greater than 4.
Or: The square of any real number greater than 2 is greater than 4.
Or: The squares of all real numbers greater than 2 are greater than 4.
Thus
The negation of a universal statement (‘‘all are’’) is logically equivalent to
an existential statement (‘‘some are not’’ or ‘‘there is at least one that is
not’’).
Thus
The negation of an existential statement (‘‘some are’’) is logically
equivalent to a universal statement (‘‘none are’’ or ‘‘all are not’’).
Solution:
a. By applying the rule for the negation of a ∀ statement, you can see
that the answer is ∃ a prime p such that p is not odd.
b. By applying the rule for the negation of a ∃ statement, you can see
that the answer is ∀ triangles T, the sum of the angles of T does not
equal 200
Rewrite the following statement formally. Then write formal and informal
negations. No politicians are honest.
41
Solution:
Formal version : ∀ politicians x, x is not honest.
Formal negation : ∃ a politician x such that x is honest.
Informal negation : Some politicians are honest
Show that the following statement is true in this world: For all triangles x,
there is a square y such that x and y have the same color
Solution: The statement says that no matter which triangle someone gives
you, you will be able to find a square of the same color. There are only
three triangles, d, f , and i. The following table shows that for each of
these triangles a square of the same color can be found.
You must find one single element (call it x) in D with the following
property:
• After you have found your x, someone is allowed to choose any
element whatsoever from E. The person challenges you by giving
you that element. Call it y.
• Your job is to show that your x together with the person’s y satisfy
property P(x, y). Note that your x has to work for any y the person
gives you; you are not allowed to change your x once you have
specified it initially.
42
Example 3.3.2 Truth of a ∃∀ Statement in a Tarski World
Consider again the Tarski world in Figure
Show that the following statement is true: There is a triangle x such that
for all circles y, x is to the right of y.
Solution: The statement says that you can find a triangle that is to the
right of all the circles. Actually, either d or i would work for all of the
three circles, a, b, and c, as you can see in the following table
B yes
C yes
43
These facts can be summarized as follows:
Write each of following statements informally and find its truth value.
a. ∃ an item I such that ∀ students S, S chose I.
b. ∃ a student S such that ∀ items I, S chose I.
c. ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose
I.
d. ∀ students S and ∀ stations Z, ∃ an item I in Z such that S chose I.
Solution:
a. There is an item that was chosen by every student. This is true; every
student chose pie.
44
b. There is a student who chose every available item. This is false; no
student chose all nine items.
c. There is a student who chose at least one item from every station.
This is true; both Uta and Tim chose at least one item from every
station.
d. Every student chose at least one item from every station. This is false;
Yuen did not choose a salad.
Order of Quantifiers:
Consider the following two statements:
∀ people x, ∃ a person y such that x loves y.
∃ a person y such that ∀ people x, x loves y.
Note that except for the order of the quantifiers, these statements
are identical. However, the first means that given any person, it is possible
to find someone whom that person loves, whereas the second means that
there is one amazing individual who is loved by all people. (Reread the
statements carefully to verify these interpretations!) The two sentences
illustrate an extremely important property about multiply-quantified
statements:
45
Do the following two statements have the same truth value?
a. For every square x there is a triangle y such that x and y have different
colors.
b. There exists a triangle y such that for every square x, x and y have
different colors.
Solution:
Statement (a) says that if someone gives you one of the squares
from the Tarski world, you can find a triangle that has a different color.
This is true. If someone gives you square g or h (which are gray), you can
use triangle d (which is black); if someone gives you square e (which is
black), you can use either triangle f or triangle i (which are both gray); and
if someone gives you square j (which is blue), you can use triangle d
(which is black) or triangle f or i (which are both gray).
Statement (b) says that there is one particular triangle in the Tarski
world that has a different color from every one of the squares in the world.
This is false. Two of the triangles are gray, but they cannot be used to
show the truth of the statement because the Tarski world contains gray
squares. The only other triangle is black, but it cannot be used either
because there is a black square in the Tarski world. Thus one of the
statements is true and the other is false, and so they have opposite truth
values.
46
Let Triangle(x), Circle(x), and Square(x) mean ‘‘x is a triangle,’’
‘‘x is a circle,’’ and ‘‘x is a square’’; let Blue(x), Gray(x), and Black(x)
mean ‘‘x is blue,’’ ‘‘x is gray,’’ and ‘‘x is black’’; let RightOf (x, y),
Above (x, y), and Same Color As(x, y) mean ‘‘x is to the right of y,’’ ‘‘x
is above y,’’ and ‘‘x has the same color as y’’; and use the notation x = y
to denote the predicate ‘‘x is equal to y’’. Let the common domain D of all
variables be the set of all the objects in the Tarski world. Use formal,
logical notation to write each of the following statements, and write a
formal negation for each statement.
a. For all circles x, x is above f .
b. There is a square x such that x is black.
c. For all circles x, there is a square y such that x and y have the same
color.
d. There is a square x such that for all triangles y, x is to right of y.
Solution:
a. Statement: ∀x(Circle(x) → Above(x, f )).
Negation: ∼(∀x(Circle(x) → Above(x, f )))
≡∃x ∼ (Circle(x) → Above(x, f ))
by the law for negating a ∀ statement
≡∃x(Circle(x) ∧ ∼Above(x, f ))
by the law of negating an if-then statement
This argument has the form of universal modus ponens and is therefore
valid.
Write the conclusion that can be inferred using universal modus ponens. If
T is any right triangle with hypotenuse c and legs a and b, then c2 = a2 +
b2. The triangle shown at the right is a right triangle with both legs equal
to 1 and hypotenuse c.
Pythogorean theorem c
Note that if you take the nonnegative square root of both sides of this
equation, you obtain c = √2. This shows that there is a line segment whose
length is √2.
Mortals
Mortals Zeus
Human beings
The two diagrams fit together in only one way, as shown in Figure below
Mortals
50
Since the Zeus dot is outside the mortals disk, it is necessarily
outside the human beings disk. Thus the truth of the conclusion follows
necessarily from the truth of the premises. It is impossible for the premises
of this argument to be true and the conclusion false; hence the argument is
valid.
mortals
Human beings
Felix
All that is known is that the Felix dot is located somewhere inside
the mortals disk. Where it is located with respect to the human beings disk
cannot be determined. Either one of the situations shown in Figure below
might be the case.
mortals mortals
Felix
human beings human beings
Felix
(a) (b)
51
Converse Error (Quantified Form):
3.5 REFERENCES
52
3.6.3 Negating Statements in a Tarski World:
Refer to the Tarski world of Figure 3.3.1,
*****
53
4
ELEMENTARY NUMBER THEORY AND
METHODS OF PROOF
Unit Structure
4.0 Objectives
4.1 Introduction to Direct Proofs
4.2 Rational Numbers
4.3 Divisibility
4.4 Division into Cases and the Quotient-Remainder Theorem
4.5 Floor and Ceiling
4.6 Contradiction and Contraposition
4.7 Two Classical Theorem
4.8 Unit End Exercises
4.9 List of References
4.0 OBJECTIVES
Assumptions:
Definitions:
An integer n is even if, and only if, n equals twice some integer. An
integer n is odd if, and only if, n equals twice some integer plus 1.
Symbolically, if n is an integer, then
n is even ⇔ ∃ an integer k such that
n = 2k. n is odd ⇔ ∃ an integer k such that n = 2k + 1.
Use the definitions of even and odd to justify your answers to the
following questions.
a. Is 0 even?
b. Is −301 odd?
c. If a and b are integers, is 6a2b even?
d. If a and b are integers, is 10a + 8b + 1 odd?
Solution:
a. Yes, 0 = 2·0.
b. Yes, −301 = 2(−151) + 1.
c. Yes, 6a2b = 2(3a2b), and since a and b are integers, so is 3a2b (being a
product of integers).
d. Yes, 10a + 8b + 1 = 2(5a + 4b) + 1, and since a and b are integers, so
is 5a + 4b (being a sumof products of integers).
• Definition:
An integer n is prime if, and only if, n > 1 and for all positive
integers r and s, ifn = rs, then either r or s equals n. An integer n is
55
composite if, and only if, n > 1and n = rs for some integers r and s with 1
< r < n and 1 < s < n.
In symbols:
Solution:
a. No. A prime number is required to be greater than 1.
b. Yes. Let n be any integer that is greater than 1. Consider all pairs of
positive integers r and such that n = r s. There exist at least two such
pairs, namely r = n and s = 1 and r = 1 and s = n Moreover, since n = r
s, all such pairs satisfy the inequalities 1 ≤ r ≤ n and 1 ≤ s ≤ n. If n is
prime, then the two displayed pairs are the only ways to write n as rs.
Otherwise, there exists a pair of positive integers r and s such that n = r
s and neither r nor s equals either 1 or n. Therefore, in this case 1 < r <
n and 1 < s < n, and hence n is composite.
c. 2, 3, 5, 7, 11, 13
d. 4, 6, 8, 9, 10, 12
56
Solution:
a. Let n = 10. Then 10 = 5 + 5 = 3 + 7 and 3, 5, and 7 are all prime
numbers.
b. Let k = 11r + 9s. Then k is an integer because it is a sum of products
of integers; and by substitution, 2k = 2(11r + 9s), which equals 22r +
18s by the distributive law of algebra.
∀x ∈ D, if P(x)then Q(x).
Solution:
4=2+2 6=3+3 8=3+5 10 = 5 + 5
12 = 5 + 7 14 = 11 + 3 16 = 5 + 11 18 = 7 + 11
20 = 7 + 13 22 = 5 + 17 24 = 5 + 19 26 = 7 + 19
57
In most cases in mathematics, however, the method of exhaustion
cannot be used. For instance, can you prove by exhaustion that every even
integer greater than 2 can be written as a sum of two prime numbers? No.
To do that you would have to check every even integer, and because there
are infinitely many such numbers, this is an impossible task.
At some time you may have been shown a “mathematical trick” like
the following. You ask a person to pick any number, add 5, multiply by 4,
subtract 6, divide by 2, and subtract twice the original number. Then you
astound the person by announcing that their final result was 7. How does
this “trick” work? Let an empty box or the symbol x stand for the number
the person picks.
Thus no matter what number the person starts with, the result will
always be 7. Note that the x in the analysis above is particular (because it
represents a single quantity), but it is also arbitrarily chosen or generic
(because any number whatsoever can be put in its place). This illustrates
the process of drawing a general conclusion from a particular but generic
object.
58
Example 4.1.6 A Direct Proof of a Theorem:
Prove that the sum of any two even integers is even.
Proof:
Suppose m and n are [particular but arbitrarily chosen] even integers. [We
must show that m + n is even.] By definition of even, m = 2r and n = 2s
for some integers r and s. Then m + n = 2r + 2s by substitution.
Solution :
It is helpful to rewrite the statement formally using a quantifier and a
variable:
Solution:
59
Proving that the given statement is false is equivalent to proving its
negation is true. The negation is
For all positive integers n, n2 + 3n + 2 is not prime.
Because the negation is universal, it is proved by generalizing from the
generic particular.
Claim: The statement “There is a positive integer n such that n2 + 3n + 2 is
prime” is false
Proof:
• Definition A real number r is rational if, and only if, it can be expressed
as a quotient of two integers with a nonzero denominator. A real number
that is not rational is irrational. More formally, if r is a real number, then
a
r is rational ⇔ ∃ integers a and b such that r = and b ≠ 0
b
Example 4.2.1 Determining Whether Numbers Are Rational or
Irrational:
a. Is 10/3 a rational number?
b. Is 0.281 a rational number?
c. Is 7 a rational number?
d. Is 0 a rational number?
e. Is 2/0 a rational number?
f. Is 2/0 an irrational number?
g. Is 0.12121212 ... a rational number (where the digits 12 are assumed
to repeat forever)?
h. If m and n are integers and neither m nor n is zero, is (m + n)/mn a
rational number?
Solution:
a. Yes, 10/3 is a quotient of the integers 10 and 3 and hence is rational.
b. Yes, 0.281 = 281/1000. Note that the real numbers represented on a
typical calculator display are all finite decimals. An explanation
similar to the one in this example shows that any such number is
rational. It follows that a calculator with such a display can represent
only rational numbers.
c. Yes, 7 = 7/1.
60
d. Yes, 0 = 0/1. f. No, 2/0 is not a number (division by 0 is not allowed).
e. No, because every irrational number is a number, and 2/0 is not a
number.
f. No, because every irrational number is a number, and 2/0 is not a
number.
g. Yes. Let x = 0.12121212 .... Then 100x = 12.12121212 .... Thus
100x − x = 12.12121212 ... − 0.12121212 ... = 12.
But also 100x − x = 99x by basic algebra
Hence 99x = 12,
and so x = 12 99.
Therefore, 0.12121212 ... = 12/99, which is a ratio of two nonzero
integers and thus is a rational number.
h. Yes, since m and n are integers, so are m + n and mn (because sums
and products of integers are integers).
Proof:
Suppose r and s are rational numbers. [We must show that r + s is
rational.] Then, by definition of rational, r = a/b and s = c/d for some
integers a, b, c, and d with b≠0 and d ≠ 0.
Thus
r + s = a/ b + c /d by substitution
= ad + bc/ bd by basic algebra.
4.3 DIVISIBILITY
• Definition
If n and d are integers and d ≠ 0 then
n is divisible by d if, and only if, n equals d times some integer.
Instead of “n is divisible by d,” we can say that
n is a multiple of d,
or d is a factor of n, or
d is a divisor of n, or
d divides n.
The notation d | n is read “d divides n.” Symbolically, if n and d are
integers and d ≠ 0:
61
d | n ⇔ ∃ an integer k such that n = dk.
Solution
a. Yes, 21 = 3·7. b. Yes, 40 = 5·8. c. Yes, 42 = 7·6.
d. Yes, 32 = (−16)·(−2). e. Yes, 54 = 6·9. f. Yes, −7 = 7·(−1).
Solution:
Yes, because 0 = k ·0.
Two useful properties of divisibility are (1) that if one positive integer
divides a second positive integer, then the first is less than or equal to the
second, and (2) that the only divisors of 1 are 1 and −1.
Proof:
Suppose a and b are positive integers and a divides b. [We must show that
a ≤ b.] Then there exists an integer k so that b = ak. By property T25 of
Appendix A, k must be positive because both a and b are positive. It
follows that
1≤k
because every positive integer is greater than or equal to 1. Multiplying
both sides by a gives
a ≤ ka = b
because multiplying both sides of an inequality by a positive number
preserves the inequality by property T20 of Appendix A. Thus a ≤ b
Proof:
Since 1·1 = 1 and (−1)(−1) = 1, both 1 and −1 are divisors of 1. Now
suppose m is any integer that divides 1. Then there exists an integer n such
that 1 = mn. By Theorem T25 in Appendix A, either both m and n are
positive or both m and n are negative. If both m and n are positive, then m
is a positive integer divisor of 1. By Theorem 4.3.1, m ≤ 1, and, since the
only positive integer that is less than or equal to 1 is 1 itself, it follows that
m = 1. On the other hand, if both m and n are negative, then, by Theorem
T12 in Appendix A, (−m)(−n) = mn = 1. In this case −m is a positive
integer divisor of 1, and so, by the same reasoning, −m = 1 and thus m =
62
−1. Therefore there are only two possibilities: either m = 1 or m = −1. So
the only divisors of 1 are 1 and −1.
Solution:
No, 15/4 = 3.75, which is not an integer. Be careful to distinguish between
the notation a | b and the notation a/b. The notation a | b stands for the
sentence “a divides b,” which means that there is an integer k such that b =
ak. Dividing both sides by a gives b/a = k, an integer. Thus, when a ≠ 0, a
| b if, and only if, b/a is an integer. On the other hand, the notation a/b
stands for the number a/b which is the result of dividing a by b and which
may or may not be an integer. In particular, be sure to avoid writing things
like
4 | (3 + 5) = 4 | 8
If read out loud, this becomes, “4 divides the quantity 3 plus 5 equals 4
divides 8,” which is nonsense.
Proof:
Suppose a, b, and c are [particular but arbitrarily chosen] integers such that
a divides b and b divides c. [We must show that a divides c.] By definition
of divisibility,
b = ar and c = bs for some integers r and s.
By substitution
c = bs
= (ar)s
= a(r s) by basic algebra.
63
Let k = r s. Then k is an integer since it is a product of integers, and
therefore
c = ak where k is an integer.
Because of the unique factorization theorem, any integer n > 1 can be put
into a standard factored form in which the prime factors are written in
ascending order from left to right.
Definition
Given any integer n > 1, the standard factored form of n is an expression
of the form
e1 e2 e3 ek
n = p1 p2 p3 ...... p k
where k is a positive integer; p1, p2,..., pk are prime numbers; e1, e2,..., ek
are positive integers;
Solution:
First find all the factors of 3,300. Then write them in ascending order:
3,300 = 100·33 = 4·25·3·11
= 2·2·5·5·3·11 = 22 ·31 ·52 ·111
64
quotient-remainder theorem can be illustrated on the number line as
follows:
For each of the following values of n and d, find integers q and r such that
n = dq + r and 0 ≤ r < d.
Solution :
• Definition
Solution:
65
If you use a four-function calculator to divide 32 by 9, you obtain an
expression like 3.555555556. Discarding the fractional part gives 32 div 9
=
3, and so 32 mod 9 = 32 − 9·(32 div 9) = 32 − 27 = 5.
Solution:
There are 365 days in a year that is not a leap year, and each week has 7
days.
Now
365 div 7 = 52 and 365 mod 7 = 1
because 365 = 52·7 + 1. Thus 52 weeks, or 364 days, from today will be a
Tuesday, and so 365 days from today will be 1 day later, namely
Wednesday.
More generally, if Day T is the day of the week today and DayN is the day
of the week in N days, then
Solution:
66
Since 4q + 2 is an integer (because products and sums of integers are
integers) and since 2 < 11, the remainder obtained when 4m is divided by
11 is 2. Therefore, 4m mod 11 = 2.
Representations of Integers:
n = 2q + r and 0 ≤ r < 2.
But the only integers that satisfy 0 ≤ r < 2 are r = 0 and r = 1. It follows
that given any integer n, there exists an integer q with
n = 2q + 0 or n = 2q + 1.
The parity of an integer refers to whether the integer is even or odd. For
instance, 5 has odd parity and 28 has even parity. We call the fact that any
integer is either even or odd the parity property
Show that any integer can be written in one of the four forms
n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3 for some integer q.
Solution:
n = 4q + r and 0 ≤ r < 4.
But the only nonnegative remainders r that are less than 4 are 0, 1, 2, and
3. Hence n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3 for some integer
q.
67
4.5 FLOOR AND CEILING
n n+1
floor of x=[x]
• Definition:
x
( n-1) n
Ceiling of x=[x]
Example 4.5.1 Computing Floors and Ceilings:
Solution:
a. 25/4 = 6.25 and 6 < 6.25 < 7; hence F25/4G = 6 LMN H25/4I = 7
b. 0 < 0.999 < 1; hence F0.0999G = 0 LMN H0.999I = 1
c. −3 <−2.01 <= and
The 1,370 students at a college are given the opportunity to take buses to
an out-of-town game. Each bus holds a maximum of 40 passengers.
a. For reasons of economy, the athletic director will send only full buses.
What is the maximum number of buses the athletic director will send?
68
b. If the athletic director is willing to send one partially filled bus, how
many buses will be needed to allow all the students to take the trip?
Solution :
a. F1370/40G = F34.25G = 34
b. F1370/40G = F34.25G = 35
Theorem 4.6.1:
Proof:
[We take the negation of the theorem and suppose it to be true.]
Suppose not. That is, suppose there is a greatest integer N. [We must
deduce a contradiction.] Then N ≥ n for every integer n. Let M = N + 1.
Now M is an integer since it is a sum of integers. Also M > N since M = N
+ 1.
Theorem 4.6.2:
There is no integer that is both even and odd.
Proof:
[We take the negation of the theorem and suppose it to be true.] Suppose
not. That is, suppose there is at least one integer n that is both even and
odd. [We must deduce a contradiction.] By definition of even, n = 2a for
some integer a, and by definition of odd, n = 2b + 1 for some integer b.
Consequently,
Theorem 4.6.3:
The sum of any rational number and any irrational number is irrational.
Proof:
[We take the negation of the theorem and suppose it to be true.] Suppose
not. That is, suppose there is a rational number r and an irrational number
s such that r + s is rational. [We must deduce a contradiction.] By
definition of rational, r = a/b and r + s = c/d for some integers a, b, c, and d
with b ≠ 0 and d ≠ 0. By substitution,
a/b + s = c/d ,
and so
Now bc − ad and bd are both integers [since a, b, c, and d are integers and
since products and differences of integers are integers], and bd ≠ 0 [by the
zero product property]. Hence s is a quotient of the two integers bc − ad
and bd with bd ≠ 0. Thus, by definition of rational, s is rational, which
contradicts the supposition that s is irrational. [Hence the supposition is
false and the theorem is true.]
Argument by Contraposition:
A second form of indirect argument, argument by contraposition, is
based on the logical equivalence between a statement and its
contrapositive. To prove a statement by contraposition, you take the
contrapositive of the statement, prove the contrapositive by a direct proof,
and conclude that the original statement is true. The underlying reasoning
is that since a conditional statement is logically equivalent to its
contrapositive, if the contrapositive is true then the statement must also be
true.
Proposition:
For all integers n, if n2 is even then n is even.
Proof(by contraposition):
Suppose n is any odd integer. [We must show that n2 is odd.] By definition
of odd, n = 2k + 1 for some integer k. By substitution and algebra, n2 =
(2k + 1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1. But 2k2 + 2k is an integer
because products and sums of integers are integers. So n2 = 2·(an integer)
+ 1, and thus, by definition of odd, n2 is odd [as was to be shown].
Proof:
[We take the negation and suppose it to be true.] Suppose not. That is,
suppose √2 is rational. Then there are integers m and n with no common
factors such that √2 = m/n
Solution:
The essence of the argument is the observation that if 1 + 3 √2 could be
written as a ratio of integers, then so could √2. But by Theorem 4.7.1, we
know that to be impossible.
1 + 3 √2 is irrational
Proof:
Suppose not. Suppose 1 + 3 √2 is rational. [We must derive a
contradiction.] Then by definition of rational 1 + 3 √ 2 = a/b for some
integers a and b with b ≠ 0.
But a − b and 3b are integers (since a and b are integers and differences
and products of integers are integers), and 3b ≠ 0 by the zero product
property. Hence √2 is a quotient of the two integers a − b and 3b with 3b
≠ 0, and so √2 is rational (by definition of rational.) This contradicts the
fact that √2 is irrational. [This contradiction shows that the supposition is
false.] Hence 1 + 3 √2 is irrational.
4.8 REFERENCES
1. Discrete Mathematics with Applications by Sussana S. Epp 4th
edition.
2. Discrete Mathematics Schaums Outline Series
3. Discrete Mathematics and its Applications by Kenneth H. Rosen
4. Discrete Strictures by Liu
73
3. The product of any two odd integers is odd.
4. The product of any even integer and any odd integer is even.
5. The sum of any odd integer and any even integer is odd.
6. The difference of any odd integer minus any even integer is odd.
7. The difference of any even integer minus any odd integer is odd. Use
the properties listed above to prove that if a is any even integer and b
is any odd integer, then a2+b2+1/2 is an integer.
*****
74
Unit III
5
SEQUENCES, MATHEMATICAL
INDUCTION AND RECURSION
Unit Structure
5.0 Objectives
5.1 Introduction
5.2 Sequences
5.3 Mathematical Induction
5.4 Strong Mathematical Induction and The Well Ordering Principle for
the Integers
5.5 Defining Sequences Recursively
5.6 Solving Recurrence Relation by Iteration
5.7 Second Order Linear Homogeneous Recurrence Relation with
Constant Co-effcients
5.8 General Recursive Definition and Structural Induction
5.9 Summary
5.10 Bibliography
5.11 Unit End Exercise
5.0 OBJECTIVES
5.1 INTRODUCTION
5.2 SEQUENCES
Addition: If the sequence is to be added, then all the terms are needed to
be added continuously hence the Continuous addition method is
represented by Summation ( ∑ )
n
∑a
k =m
k = am + am+1 + am + 2........+ an
∏a
k =m
k = am × am +1 × am + 2......... × an
If am,am+1 ,am+2 ,...andbm ,bm+1 ,bm+2 ,...are sequence so f real numbers and c
is any real number, then the following equations hold for any integer n ≥ m.
n n n
(a) ∑ ak + ∑ bk = ∑ (ak + bk )
k =m k =m k =m
n n
( b) c × ∑ ak = ∑ ( c × ak )
k =m k =m
n
n n
(c) ∏ ak × ∏bk = ∏( ak × bk )
k =m k =m k =m
Example1: Write the first four terms of these quences defined by the formulas
76
k
A. ak = for all integers k ≥ 1
10 + k '
ci =
( −1)
B. , for all integers i ≥ 0
10 + 3
c1 =
( −1) =
−1
1 for (i=1)
3 3
2
c2 =
( −1) =
1
2 for (i=2)
3 9
3
c3 =
( −1) =
−1
3 for (i=3)
3 27
4
c4 =
( −1) =
1
4 for (i=4)
3 81
77
Sol : Since
1
a1 = 1 − (First Position Term).
2
1 1
a2 = − (Second Position Term).
2 3
1 1
a3 = − (Third Position Term).
3 4
1 1
a4 = − (Fourth Position Term).
4 5
1 1
a5 = − (Fifth Position Term).
5 6
∑ ( k + 1) = (1 + 1) + (1 + 2) + (1 + 3) + (1 + 4) + (1 + 5)
k =1
(2)+(3)+(4)+(5)+(6)
= 20
7
1 1
B. ∑ n − n + 1
k =1
1 1
Let ak = − where k is varying from 1to7. Hence the summation
n n +1
or the addition of the terms will be :
5
1 1
∑ −
k =1 n n +1
1 1 1 1 1 1 1 1 1 1
= − + − + − + − + − +
1 1+1 2 2 +1 3 3 +1 4 4 +1 5 5 +1
1 1 1 1
− + −
6 6 +1 7 7 +1
1 1 1 1
− + −
6 7 7 8
1 1 1 1 1 1 1
+ + + + + +
2 6 12 20 30 42 56
7
=
8
78
4
C. ∏k
k =1
2
∏ ( k ) = (1 ) × ( 2 ) × ( 3 ) × ( 4 )
k =1
2 2 2 2 2
(1) × ( 4 ) × ( 9 ) × (16 )
= 576
6
1
D. ∏1− k
k =2
1 1
Sol: Let ak = 1 − = 1 − where k is varying from 2 to 6. Hence
k 2
the product or the multiplication of the terms will be:
2
1 1 1 1
∏ 1 − k = 1 − 2 × 1 − 3 × 1 − 4 ×
k =−2
1 1
1 − 5 × 1 − 6
1 2 3 4 5
= × × × ×
2 3 4 5 6
1
=
6
79
• Step 2: This step is performed if and only if Step 1 is True. In this step
we assume that the given expression is valid at k(Where k is a Natural
Number.). According to the assumption made, it is to be proved that the
same expression will be valid at (k+1)also.(Where(k+1)is a Natural
Number or the number successive to k.)
Sol:
n −1
n ( n + 1)( n − 1) n −1
Given ∑ ( )( )
i i + 1 =
3
where p ( ) ∑ ( i )( i + 1)
n
i =1 i =1
2 −1
A. p ( 2 ) ∑ ( i )( i + 1)
i =1
1
p ( 2 ) ∑ ( i )( i + 1)
i =1
p ( 2 ) = (1) + (1 + 1)
p ( 2) = 2
It is expressed in the form of the following equation:
n ( n + 1)( n − 1)
=
3
Hence the value at n=2
2 ( 2 + 1)( 2 − 1)
=
3
2 ( 3)(1)
=
3
=2
80
C. Similarly P(k+1) will be expressed as:
k
k ( k + 1)( k + 2 )( k )
p ( k ) = ∑ ( i )( i + 1)
i =1 3
( k + 1)( k + 2 )( k )
RHS =
3
Considering LHS
K +1
LHS = ∑ ( i )( i + 1)
i =1
K
= ∑ ( i )( i + 1) + ( k ) + ( k + 1)
i =1
From the expression in (b)
K −1
k ( k + 1)( k + 2 )( k )
∑ ( i )( i + 1) =
3
i =1
Hence,
k ( k + 1)( k − 1)
= k + ( k + 1) +
3
Taking k(k + 1) common
( k − 1)
= k ( k + 1) × 1 +
3
3 + k −1
= k ( k + 1) ×
3
k +2
= k ( k + 1) ×
3
( k )( k + 1)( k + 2 )
=
3
Thus, LHS=RHS Hence Proved by Mathematical Induction.
Sol:
1 1 1 n
Given: + + ...... =
1.2 2.3 n. ( n + 1) n + 1
1 1 1
LHS = + + ......
1.2 2.3 n. ( n + 1)
81
n
RHS =
n +1
Substitute n=1 in LHS and RHS respectively
1
LHS =
1.2
1
=
2
1
RHS =
1+1
1
=
2
Solving LHS
1 1 1 1
+ + ...... +
1.2 2.3 k . ( k + 1) ( k + 1) . ( k + 2 )
1 1 1 k
But + + ...... = from (1)
1.2 2.3 k . ( k + 1) k + 1
k 1
Hence, +
( k + 1) ( k + 1) . ( k + 2 )
1
Taking common
( k + 1)
1 1
= × k +
( k + 1) k + 2
1 k ( k + 2) + 1
= ×
( k + 1) k + 2
1 k 2 + 2k + 1
= ×
( k + 1) k + 2
82
2
Since a 2 + 2ab + b 2 = ( a + b )
1 ( k + 1)2
= ×
( k + 1) k + 2
( k + 1) 2
=
k +2
Thus LHS=RHS hence proved
Considering, 5k +1 − 1
= 5k × 5 − 1
But 5k = 4q + 1 from (1)
Hence, (4q + 1) x 5 - 1
= 4q x 5 + 5 - 1
= 4q x 5 + 4
= 4(q x 5+1)
Since, q is an integer hence (q x 5+1) will also be an integer.
Let q x 5 + 1 = p
Therefore, 5k+1 – 1 = 4p
Sol:
To prove 7n – 2nis divisible by 5 by using Mathematical Induction,
substitute the value of n=0
83
= 70 – 20
=1–1
=0
Considering 7k+1 – 2k +1
= 7k × 7 − 2k × 2
= 7 k × (5 + 2 ) − 2k × 2
= 7 k × 5 + 7 k × 2 − 2k × 2
( )
= 7 k × 5 + 7 k − 2k × 2
But 7 k − 2 k = 5q from ….1
Hence, 7 k × 5 + ( 5q ) × 2
(
= 7 k + 2q × 5 )
( )
Since, q is an integer hence 7k + 2q will also be an integer.
( )
Let 7k + 2q = p
k +1 k +1
Therefore, 7 − 2 = 5 p
85
Sol:
an is odd for all integers n ≥ 1i. e. an = 2n-1
We know that a1= 1, a2= 3, and
an = 2n-1………..(1)
Sol:
To Prove, f n = 3 × 2n + 2 × 5n by using Strong Mathematical Induction
We know that f0 = 5, f1 = 6 and
f n = 3 × 2n + 2 × 5n …………(1)
86
Hence, Substitute n=0 and n=1 respectively in (1).
at n=0: f0 = 3 × 20 + 2 × 50
f0 = 3 + 2
f0 = 5
at n=1: f1 = 3 × 21 + 2 × 51
f1 = ( 3 ) × ( 2 ) + ( 2 ) × ( 5 )
f1 = 6 + 10
f1 = 16
Considering f k = 7 f k −1 −10 f k −2
So for k+1 the equation will be fk +1 = 7 fk −10 fk −1
where and f k = 3 × 2k + 2 × 5k and f k −1 = 3 × 2k −1 + 2 × 5k −1
Substituting the values in fk +1 = 7 fk −10 fk −1 and solving further,
Substituting the values in and solving further,
( ) (
f k +1 = 7 × 3 × 2k + 2 × 5k − 10 × 3 × 2k −1 + 2 × 5k −1 )
k k k −1 k −1
f k +1 = 21× 2 + 14 × 5 − 30 × 2 − 20 × 5
2k 5k
f k +1 = 21× 2k + 14 × 5k − 30 × − 20 ×
2 5
k k k k
f k +1 = 21× 2 + 14 × 5 − 15 × 2 − 4 × 5
f k +1 = ( 3 × 2 ) × 2 k + ( 5 × 2 ) × 5 k
f k +1 = ( 3 ) × 2 k +1 + ( 2 ) × 5k +1
87
A Recurrence Relation for a sequence b0, b1, b2, .... is an expression which
is used to represent each term bkusing its predecessor terms b0, b1, b2, ....,
bk-i, where k − i ≥ a and i is a non-negative integer.
Example 1. Find the first four terms o f each of the recursively defined
sequences:
A. ak = 2ak −1 + k , for all integers k ≥ 2 a1=1
Sol :
K=1 : a1 = 1 (First Position Term)
K=2 : a2 = 2 a1 + 2 = 2 (1) + 2 = 4 (Second Position Term)
K=3 : a3 = 2 a2 + 2 = 2 ( 4 ) + 2 = 10 (Third Position Term)
K=4 : a4 = 2 a3 + 2 = 2 (10 ) + 2 = 22 (Fourth Position Term)
Sol:
Given:bn= 4n, for n ≥ 0 Hence b0 = 40 = 1
Let ‘k’ be an integer such that k ≥ 1
Therefore, bk-1= 4k-1
4 x bk-1= 4 x 4k-1
88
4k
= 4×
4
= 4k
which is, bk, Hence Proved.
n
Sol : Given: sn =
( −1) , , for n ≥ 0 Hence s0 =
( −1) =1
n! 0!
Let ‘k’ be an integer such that k ≥ 1
k −1
Therefore, s k −1 =
( − 1)
( k − 1) !
s k −1
=−
k
( −1)k −1
( k − 1) !
= −
k
( −1)k −1
= ( −1) ×
k × ( k − 1) !
( −1)k
−
( k )!
Which is, sk Hence Proved.
89
A sequence a0, a1, a2, ..... is called an Geometric Sequence of the
( )
form an = r n a0 where ‘n’ and ‘r’ are the integers, if the recurrence
relation is given as ak = r × ak −1
Sol:
r n +1 − 1
Given: 1 + r + r 2 + r 3 + ....... + r n =
r −1
2 i−1
(a) 1 + 2 + 2 + ....... + 2 on comparing the expression r = 2.
90
2n −1 − 1
= 2n + ×3
1
= 2 n + 3 × 2 n−1 − 3
= 2 n × 2 n −1 + 3 × 2 n −1 − 3
= ( 2 + 3 ) × 2 n −1 − 3
= ( 5 ) × 2 n −1 − 3
g
C. gk = k −1 for all integers k ≥ 2, g1 = 1
g k −1 + 2
91
Sol:
g
Given: gk = k −1 ,
g k −1 + 2
g g
At k = 2 g 2 = 2−1 = 1
g 2−1 + 2 g1 + 2
1 1
g2 = =
1+ 2 3
1
g2 = 2
2 −1
g g
At k = 3: g3 = 3−1 = 2
g3−1 + 2 g 2 + 2
1 1
g3 = 3 = 3
1 7
+2
3 3
1 1
= 3
7 2 −1
g g
At k = 4: g 4 = 4−1 = 3
g 4−1 + 2 g3 + 2
1 1
g4 = 7 = 7
1 15
+2
7 7
1 1
= 4 k=n
15 2 − 1
g
At k = n g n = n−1 k = n :
g n−1 + 2
on simplifying
1
= n
2 −1
At k = 3 y3 = y3−1 + 32 = y2 + 32
= 1 + 2 2 + 32
92
At k = 4 y4 = y4−1 + 42 = y3 + 32 + 42
= 1 + 2 2 + 32 + 4 2
At k = n : yn = yn −1 + n 2
on simplifying:
= 1 + 2 2 + 32 + 4 2 + ........ + n 2
Case(a): If the roots are distinct then the generalized solution of the
recurrence relation will be:
n n
f n = C ( r1 ) + D ( r2 )
where, r1 and r2 are the roots of the Characteristic Equation.
93
Case(b): If the roots are repeated then the generalized solution of the
recur-rencerelation will be:
n n
f n = ( C + nD ) ( r1 )
where,r1 and r2 are the roots of the Characteristic Equation.
Step 4: Find the value of A and B by using the initial condition values.
Example 2. Let a0; a1; a2; :::::: be the sequence defied by the explicit
formula
an = c × 2n + D for all integers n ≥ 0 where C and D are real numbers.
A. Find C and D so that a0 = 1 and a1 = 3.What is a2 in this case?
B. Find C and D so that a0 = 0 and a1 = 2. What is a2 in this case?
Sol:
The given an = c × 2n + D
94
A. To find C and D use the initial values of an.
At n = 0 and a0 = c × 20 + D where a0 = 1
1= C + D………(1)
At n=1; a1 = c × 21 + D , where a1 + 3
3 = 2c + D……… (2)
Solving (1) and (2) simultaneously
C=2 and D= -1.
Hence recurrence relation becomes: an = 2 × 2n − 1
Therefore, a2 will be:
a2 = 2 × 2 2 − 1
= 2x 4 -1
=7
Example 3. Let b0 ,b1 ,b2 ,.....be the sequence defined by the explicit
formula:
n n
bn = C ( 2 ) + D ( −2 ) for all integers n ≥ 0
Where C and D are real numbers. Show that for any choice of C and D,
bk = bk −1 + 6bk −2 for all integers k ≥ 2
Sol :
n n
Given bn = C ( 3) + D ( −2 )
from the generalized function the roots of the characteristic equation
can be determined. They are: 3 and -2.
Hence, the characteristic equation will be
f ( x ) = ( x − 3) × ( x + 2 ) = 0
0 = x ( x + 2) − 3( x + 2)
0 = x2 + 2x − 3x − 6
0 = x2 − x − 6
x + 6 = x2
Thus the recurrence relation will be: bk = bk −1 + 6bk −2 , Hence
Proved.
95
Example 4. Following sequences satisfies the given recurrence relation and
initial conditions. Find an explicit formula for the sequence.
A ak = 2ak −1 + 3ak −2 , for all integers k ≥ 2 a0 = 1, a1 = 2.
Sol:
Given: ak = 2ak −1 + 3ak −2 , k ≥ 2 with initial conditions given as:
a0 = 1, a1 = 2.
By using the recurrence relation: ak = 2ak −1 + 3ak −2 , the characteristic
equation will be:
t 2 − 2t − 3 = 0
( t + 1)( t − 3 ) = 0
Hence, the roots are: t = -1 and 3.
Now, the generalized explicit formula will be an = A(“1)n +B(3)n
To find the value ‘A’ and ‘B’ we need initial conditions:
at n=0, a0 = A(-1)0 + B(3)0 but a0 = 1
Therefore, 1 = A + B .......(1)
Similarly, at n=1 the equation will be:
2 = -A + 3B .......(2)
Solving equation (1) and (2) simultaneously.
1 3
A = and B =
4 4
1 n 3 n
Hence the explicit formula is: An = ( −1) + ( 3 )
4 4
Derive the fact that the following is a Boolean expression over the English
alphabet a, b, c, . . . , x, y, z:
( ∼ ( p ∧ q ) ∨ ( ∼ r ∧ p ))
Sol:
A. In the given expression, all the symbols are included, Hence from
1. the p, q and r are Boolean expression
B. ∼ r is a Boolean expression from 1 and 2 C.
97
C. ∼ r ∧ p is a Boolean expression from 1 and 2 A.
D. p ∧ q is a Boolean expression from 1 and 2 A.
E. ∼ (p ∧ q) is a Boolean expression from 1 and 2 C.
F. (∼ (p ∧ q) ∨ (∼ r ∧ p)) is a Boolean expression from 1 and 2 B.
Example 2. The set of arithmetic expressions over the real numbers can be
defined recursively as follows:
• BASE: Each real number r is an arithmetic expression.
• RECURSION: If u and v are arithmetic expressions, then the
following are also arithmetic expressions:
A. ( +u )
B. ( −u )
C. ( u + v )
D. ( u − v )
E. ( u × v )
u
F.
v
• RESTRICTION: There are no arithmetic expressions over the real
numbers other than those obtained from a and b.
A. In the expression since all the number are real numbers hence, from
1. 9, 6.1, 2, 7 and 6 are arithmetic expressions.
B. 6.1 + 2 is an Arithmetic expression from 1. and 2 C
C. 9 × (6.1 + 2) is an Arithmetic expression from 1. and 2 E.
D. 4 − 7 is an Arithmetic expression from 1. and 2 D.
E. (4 − 7) × 6 is an Arithmetic expression from 1. and 2 E.
9 × ( 6.1 + 2 )
F. is an Arithmetic expression from 1. and 2 F.
( 4 − 7) × 6
98
• RECURSION:
A. If x I is in the MIU-system, where x is a string, then x I U is in the
MIU-system. (In other words, you can add a U to any string that
ends in I. For example, since MI is in the system, so is MIU.)
B. If Mx is in the MIU-system, where x is a string, then Mxx is in the
MIU system. (In other words, you can repeat all the characters in a
string that follow an initial M. For example, if MUI is in the
system, so is MUIUI.)
C. If x I I I y is in the MIU-system, where x and y are strings (possibly
null), then xUy is also in the MIU-system.(In other words, you can
replace I I I by U. For example, if M I I I I is in the system, so are
MIU and MUI.) D. If x.
D. If xUUy is in the MIU-system, where x and y are strings (possibly
null), then xUy is also in the MIU-system. (In other words, you can
replace UU by U. For example, if MIIUU is in the system, so is
MIIU.)
• RESTRICTION: No strings other than those derived from I and II are
in the MIU-system.
Sol:
In the given statement, the string should end with 1 and according
to BASE of the recursion, one of the object is present in S is 1. Hence
BASE condition is satisfied.
Sol:
In the given statement, the string should not start with 0 and
according to BASE of the recursion, only 0 does not belong to S. Hence
BASE condition is satisfied.
5.9 SUMMARY
• The symbol to represent continuous addition is ∑ .
100
• The sequence whose values depends on the previous value or the
initial value is known as Recurrence Function.
• If the elements of set is to be determined by using Mathematical
Induction. Such inductions are known as Structural Mathematical
Induction.
5.10 REFERENCES
n k n k +1
ii. ∏ ×∏
k =1 k + 1 k =1 k + 2
101
5
1
i (i + 2)
iii ∑ ( i ) × ( i + 1) iv ∏
i =−1 i = 2 ( i − 1) × ( i + 1)
102
(9) Suppose p1 , p2 , p3 ,...... is a sequence defined as follows:
p1 = 3, p2 = 5, p k = 3 pk −1 − 2 pk − 2 for all integers k ≥ 3. Prove that
gn = 2n + 1 for all integers n ≥ 1.
(11) Find the first four terms of each of the recursively defined sequences:
2
i. ck = k ( ck −1 ) , for all integers k ≥ 1 c0 = 1
ii. sk = sk −1 + 2 sk − 2 ,for all integers k ≥ 2 s0 = 1, s1 = 1
iii. vk = vk −1 + vk − 2 + 1 , for all integers k ≥ 3 v1 = 1, v2 = 3
iv. uk = kuk −1 − uk − 2 + 1 for all integers k ≥ 3 u1 = 1, u2 = 1
n ( n + 1)
(16) The formula: 1 + 2 + 3 + 4 + ..... + n = true for all integers
2
n ≥ 1. Use this fact to solve each of the following problems:
i. If k is an integer and k ≥ 2, find a formula for the expression 1
1 + 2 + 3 + ..... + ( k − 1)
ii. If n is an integer and n ≥ 1, find a formula for the expression
3 + 2 + 4 + 6 + 8 + ....... + 2n
iii. If n is an integer and n ≥ 1, find a formula for the expression
3 + 3 × 2 + 3 × 3 + ....... + 3 × n + n
103
(17) Following sequence is defined recursively. Use iteration to guess an
explicit formula for the sequence.
b
i. gk = g k = k −1 for all integers k ≥ 2, b0 = 1
bk −1 + 1
ii. ek = 4 × ek−1 + 5, for all integers k ≥ 1, e0 = 2
iii. tk = tk−1 + 3k+1, for all integers k ≥ 1, t0 = 0
iv. sk = sk−1 + 2k, for all integers k ≥ 1, s0 = 3
v. pk = pk−1 + 2 × 3 k , for all integers k ≥ 2, p1 = 2
vi. dk = 2 × dk−1 + 3, for all integers k ≥ 2, d1 = 2
19) Let b0, b1, b2, ....... be the sequence defined by the explicit formula:
bn = C × 3 n + D × (−2)n for all integers n ≥ 0, where C and D are real
numbers.
i. Find C and D so that b0 = 0 and b1 = 5. What is b2 in this case?
ii. Find C and D so that b0 = 3 and b1 = 4. What is b2 in this case?
(20) Let a0, a1, a2, ...... be the sequence defined by the explicit formula:
an = C × 2 n + D for all integers n ≥ 0, where C and D are real
numbers. Show that for any choice of C and D, ak = 3 ak −1 − 2 ak −2
for all integers k ≥ 2.
(21) Following sequences satisfies the given recurrence relation and initial
conditions. Find an explicit formula for the sequence.
i. bk = 7bk-1 − 10bk-2 , for all integers k ≥ 2, b0 = 2, b1 = 2
ii. tk = 6tk-1 − 9t k-2, for all integers k ≥ 2, t0 = 1, t1 = 3
iii. sk = 2sk-1 + 2sk-2, for all integers k ≥ 2, s0 = 1, s1 = 3
iv. ck = ck −1 + 6 ck −2, for all integers k ≥ 2, c0 = 0, c1 = 3
v. ek = 9 ck −2, for all integers k ≥ 2,ec0 = 0, e1 = 2
104
(23) Consider the Arithmetic expression discussed in Example 2.(5.8.1)
Give derivations showing that ((2 × (0.3–4.2)) + (−7)) is an
arithmetic expression.
(28) Give a recursive definition for the set of all strings of 0’s and 1’s that
have the same number of 0’s as 1’s.
*****
105
6
FUNCTIONS
Unit Structure
6.0 Objectives
6.1 Introduction
6.2 Functions Defined on Sets
6.3 One-One, Onto and Inverse Function
6.4 Composition of Function
6.5 Summary
6.6 Bibliography
6.7 Unit End Exercise
6.0 OBJECTIVES
6.1 INTRODUCTION
Note: Co-Domain and Range may or may not become equal. Range ⊆ Co
− domain
A function can be mathematically expressed as:
f : X →Y
Where, f is a function, X is Domain and Y is Co-Domain.
A function f will be considered as a valid function if and only if it satisfies
two basic properties.
(a) Every element in the Domain should get mapped with some elements of
the Co-Domain.
(b) No element in Domain should be mapped with more than one element in
Co-Domain.
P Q
P0 q0
P1 q1
P2 q2
P3 q3
Logarithmic Function to the base ‘b’ of ‘x’ yields the value which is
raised to the power of ‘b’ to get ‘x’. It is mathematically expressed as
logbx, where b > 0 and x >0.
107
Boolean Function : is defined as the function whose Domain is an ordered
n-tuples of 0’s and 1’s. The Co-Domain of the function is {0,1} . The
mapping of the function can be mathematically expressed as:
f : {0,1} → {0,1}
n
where, f : {0,1} is the cartesian product of n copies of 0, 1.
Let, F : a → b and G : A → B be the two functions. The functions will be
equal if and only if F ( x ) = G ( x ) , x ∈ X
X Y
1 s
3 t
5 u
v
Sol:
A. Domain= {1, 3, 5}
Co-Domain= {s, t, u, v}
B. Referring the Arrow Diagram
f(1) = v
f(3) = s
f(5) = v
C. Range= {s, v}
D. Yes, 3 is an inverse image of s.
No,1 is not an inverse image of u.
E. Inverse image of s is 3.
Inverse image of u is φ.
Inverse image of v is 5.
F. The ordered pairs are f = {(1, v); (3, s); (5, v)}
108
Example 2 : Let A = {1, 2, 3, 4, 5} and define a function F : P(A) → Z as
follows: For all sets X in P(A),
Sol:
In the given function, the Domain is the elements of the Power Set of A
(P(A)).
A. F({1, 3, 4}) = 0 (Number of Element= 3 (Odd))
B. F({2, 3}) = 1 (Number of elements= 2 (Even))
C. F({2, 3, 4, 5}) = 1 (Number of elements= 2 (Even))
D. F(φ) = 1 (Number of elements= 0 (Even))
109
= 5 mod 5
=0
At x=2 g(x) =(22 + 3(2)+1) mod 5
= 11 mod 5
=1
At x=3 g(x) =(32 + 3(3)+1) mod 5
= 19 mod 5
=4
At x=4 g(x) =(42 + 3(4)+1) mod 5
= 29 mod 5
=4
At x=5 g(x) =(52 + 3(5)+1) mod 5
= 41 mod 5
=1
Since each element of J5 is providing outputs in f(x) which are equal to
g(x). Hence, f=g.
Example 4 : Let F and G be functions from the set of all real numbers to
itself. Define the product functions F · G : R → R and G · F :
R → R as follows: For all x ∈ R
(F · G)(x) = F(x) · G(x)
(G · F)(x) = G(x) · F(x)
Does (F · G)(x) = (G · F)(x)? Explain
Sol:
Given: (F · G)(x) = F(x) · G(x) and (G · F)(x) = G(x) · F(x)
Since, multiplication follows Commutative Property a · b = b· a
Hence, F(x) · G(x) = G(x) · F(x)
Therefore, it can be concluded that (F · G)(x) = (G · F)(x)
Example 5 Find exact values for each of the following quantities. Do not
use a calculator.
A. log381
Sol: 81 = 34
log3 81 = log3 34 by using the following property:
y
logb ( x ) = y × logb ( x ) ) where b= 3, x= 3 and y= 4.
= 4 × log3 ( 3)
but, logb ( b ) = 1 Hence, log3 ( 3) = 1
=4
B. log 21024
Sol: 1024 = 210
log 21024 = log 2 210
110
y
by using the following property logb ( x ) = y × logb ( x ) where b = 2 x and
y = 10
= 10 × log2 ( 2 )
but, logb ( b ) = 1 Hence, log 2 ( 2 ) = 1
=10
C. log 3 1
27
Sol:
27 = 33
= log3 = log3 3
1 1
27 3
by using the following property: logb x = logb ( x ) − logb ( y )
y
where b= 3, x= 1 and y= 27.
log3 (1) − log3 ( 33 )
but, logb (1) = 0 Hence, log3 (1) = 0
= −log3 ( 33 )
y
by using the following property: logb ( x ) = y × logb ( x ) where b= 3, x= 3
and y= 3.
= −3 × log3 ( 3)
but, logb ( b ) = 1 Hence, log 2 ( 2 ) = 1
=-3
111
log ( y ) log ( y )
=
log ( b 2 ) 2 × log(b)
1 log ( y )
= ×
2 log(b)
but, log ( y ) = 2
log(b)
log ( y ) 1
2
= 2×
log(b ) 2
=1
Example 7 : Draw arrow diagram for the Boolean function defined by the
following input/output table.
Input Output
P Q R
1 1 0
1 0 1
0 1 0
0 0 1
Sol:
According to the Table given above, the Boolean functions have
been defined using 3 variables in which 2 are used in the Input and 1 has
been used as an Output. Thus the domain will be the Combinations formed
by 0’s and 1’s in the Input and Co-Domain will be 0 and 1.
Domain: {00, 01, 10, 11}
Co-Domain: {0, 1}
Function: Boolean
Hence, The arrow diagram will be:
Boolean
Input Output
11
0
10
1
01
00
112
Example 8 Student A tries to define a function g : Q → Z by the rule
m
g = m − n for all integers m and n with n 6= 0. Student B claims that
n
g is not well defined. Justify student B’s claim.
Sol:
m
Given: Student A defined the following function: g = m − n
n
1 3
Let x = and y =
2 6
1 3
According to the divisibility theorem, g =
2 6
but according to the definition,
1
g = 1 − 2 = −1
2
3
g = 3 − 6 = −3
6
Since −1 ≠ −3
Hence, the function defined by Student A is wrong.
Therefore, Student B’s claim is Correct.
P Q
P0 q0
P1 q1
P2 q2
113
F
P Q
P0 q0
P1 q1
P2 q2
P Q
P0 q0
P1 q1
P2
P3 q2
Onto: All the elements in the Co-Domain should have at-least on element
in Domain. It is also termed as Surjective. It can be mathematically
expressed as: A function f defined as f : X → Y is an Onto function if and
only if:
∀y ∈ Y, ∃x ∈ X such that f(x) = y.
F
P Q
P0 q0
P1 q1
P2 q2
114
F
P Q
P0 q0
P1 q1
P2 q2
P Q
P0 q0
P1 q1
P2
P3 q2
P0 Q0
Example 1. All but two of the following statements are correct ways to
express the fact that a function f is onto. Find the three that are correct.
A. f is onto ⇐⇒ every element in its co-domain is the image of some
element in its domain.
B. f is onto ⇐⇒ every element in its domain has a corresponding image
in its co-domain.
115
C. f is onto ⇐⇒∀y ∈ Y, ∃x ∈ X such that f(x) = y.
D. f is onto ⇐⇒∀x ∈ X, ∃y ∈ Y such that f(x) = y.
E. f is onto ⇐⇒ the range of f is the same as the co-domain of f .
Sol:
A function is an Onto if and only if all the elements of co-domain
are mapped (having images) to at least one element in the Domain.
Sol:
Given: X = {1, 5, 9} and Y = {3, 4, 7}, f : X → Y such that f (1) = 4, f
(5) = 7, f (9) = 4.
The following function is not an Onto function because y=3 is not having
any image in X (Domain).
116
Thus, all the integer value will not be have the corresponding image in the
Domain. Hence, g(n) is not an Onto function.
Sol:
A. To check whether the G(x) is One-One function, let us consider two
integers m and n such that m and n ∈ R and G(m) = G(n).
=2 − 3m = 2 − 3n
=−3m = −3n
=m = n
Sol:
To check whether the f(x) is One-One function, let us consider two integers
m and n such that m and n ∈ R and f(m) = f(n).
117
3m − 1 3n − 1
=
m n
n × (3m − 1) = m × (3n − 1)
n × (3m) − n = m × (3n) − m
3mn − n = 3mn − m
n=m
Since, m = n if f(m) = f(n). Hence f(x) is a One-One Function.
Example 6 Let S be the set of all strings of 0’s and 1’s, and define
I : S → Ζnonneg by l(s) = the length of s, for all strings s in S.
Sol:
Given: l(s) = the length of s, for all strings s in S.
A. Let a=101 and b=110. The length of ’a’ and ’b’ are 3.
Since, the definition of l(s) = the length of s, for all strings s in
S.
And in this case, l(a) = l(b) but a ≠ b
Thus violating the basic definition of One-One Function.
B. The function is mapped as: I : S → Ζnonneg . Hence all the the non-
negative integers are having an image in its domain value.
Therefore, l(s) is an Onto Function.
Example 7.Let S be the set of all strings in a’s and b’s, and define C : S →
S by:
C(s) = as, for all s ∈ S.(C is called concatenation by a on the left.)
A. Is C one-to-one? Prove or give a counter example.
B. Is C onto? Prove or give a counter example.
Sol:
Given: C(s) = as, for all s ∈ S.(C is called concatenation by a on the left.)
A. In One-One function, all the domain value should be mapped with
exactly one element in the Co-Domain. But, in the function defined by
C : S → S the string s=a will not get mapped to any of the element in
the Co-Domain. Hence, the function is not One-One Function.
B. In Onto function, all the Co-Domain value should have at least one
image in the Domain.
But, in the function defined by C : S → S the string s=a will not have
any image Domain. Hence, the function is not an Onto Function.
118
B. Is G onto? Prove or give a counter example.
Sol:
Given: G(x, y) = (2y, −x) for all (x, y) ∈R × R.
B. To check whether the G (x, y) is Onto function, let (u, v) be the Real
number pair such that G (x) = (u, v).
2y = u
U
Y=
2
Similarly,
−x = v
x = −v
u
Since , −v are also a Real number pairs for any value of u and v,
2
Thus, all the Real number pairs will have the corresponding image in the
Domain.
Hence, G(x, y) is an Onto function.
119
Fig. 6.4.1 Representation of Composite Function using Arrow
Diagram
X X X X
1 1 1 1
3 3 3 3
5 5 5 5
Sol:
From the above arrow diagram:
g ◦ f(1) = 1
g ◦ f(3) = 5
g ◦ f(5) = 3
120
Similarly,
f ◦ g(1) = 3
f ◦ g(3) = 1
f ◦ g(5) = 5
Since, the output of g ◦ f and f ◦ g are not equal hence, g ◦ f ≠ f ◦ g Steps to
map the composite functions using arrow diagram.
f g
X X X
1 1 1
3 3 3
5 5 5
X X X
1 1 1
3 3 3
5 5 5
In this method the complete arrow diagram has been shown below.
f g
X X X
1 1 1
3 3 3
5 5 5
Example 4. The function H and H−1 are both defined from R − {1} to R −
{1} by the formula:
x +1
H ( x ) = H −1 ( x ) = for all x ∈ R − {1}.
x −1
Sol:
x +1
Given: H ( x ) = H −1 ( x ) = for all x ∈ R − {1}.
x −1
(
HoH −1 = H H −1 )
x +1
HoH −1 = H
x −1
x +1
−1
x −1 +1
HoH =
x + 1 −1
x −1
x +1 + x −1
HoH −1 =
x +1 − x −1
2x
HoH −1 =
2
H ◦ H−1 = x
H ◦ H−1 = Ix
122
Example 5. True or False? Given any set X and given any functions f : X
→ X, g : X → X and h : X → X, if h is one-to-one and h ◦ f = h ◦ g, then f
= g. Justify your answer.
Sol:
Given: h is one-to-one and h ◦ f = h ◦ g
Since, h is a One-One function: h(a) = h(b) if and only if a = b.
But, h ◦ f = h ◦ g
h(f(x)) = h(g(x))
According to the definition of One-One
f(x) = g((x)
Hence Proved.
f−1 ◦ g−1 = −(y + 3) because all the functions are defined within the same
sets X.
hence, f−1 ◦ g−1 = (g ◦ f)−1
6.5 SUMMARY
• If a single Domain value does not have more than one number of values
in the Co-Domain, then function is Valid.
123
• If each Domain value is mapped with exactly one Co-Domain value,
then the function is known as One-One.
• If each Co-domain value is mapped with at least one Domain value,
then the function is known as Onto.
• if f is a function then f−1 is known as Inverse function.
6.6 REFERENCES
X Y
1 a
b
3
c
5 d
(2) Indicate whether the statements in parts (a)–(d) are true or false. Justify
your answers.
i. If two elements in the domain of a function are equal, then their
images in the co-domain are equal.
ii. If two elements in the co-domain of a function are equal, then
their preimages in the domain are also equal.
iii. A function can have the same output for more than one input.
124
iv. A function can have the same input for more than one output.
(6) Let F and G be functions from the set of all real numbers to itself.
Define new functions F − G : R → R and G − F : R → R as follows:
For all x ∈ R,
(F − G)(x) = F (x) − G(x)
(G − F )(x) = G(x) − F (x)
Does F − G = G − F ? Explain.
1
(7) If b and y are positive real numbers such that log ( y ) why?
b
(8) Let S be the set of all strings of a’s and b’s. Define f : S → Z as
follows: For each string s in S.
(9) Draw arrow diagram for the Boolean function defined by the
following input/output table.
Input Output
P Q R S
1 1 1 1
1 1 0 0
1 0 1 1
1 0 0 1
125
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 1
(14) Define H : R → R by the rule H(x) = x2, for all real numbers x.
i. Is H one-to-one? Prove or give a counterexample.
ii. Is H onto? Prove or give a counterexample.
(18) Let S be the set of all strings of 0’s and 1’s, and define D : S → Z as
follows:
126
For all s ∈ S,D(s) = the number of 1’s in s minus the number of 0’s in
s.
i. Is D one-to-one? Prove or give a counterexample.
ii. Is D onto? Prove or give a counterexample.
X X X X
1 1 1 1
3 3 3 3
5 5 5 5
(24) The function F and F−1 are both defined from R → R by the
y−2
formula:H(x) = 3x + 2, H−1(x) = x = , for all x ∈ R.
3
(25) True or False? Given any set X and given any functions f : X → X, g
: X → X and h : X → X, if h is one-to-one and f ◦ h = g ◦ h, then f
=g. Justify your answer.
127
(28) Let X = {a, c, b}, Y = {x, y, z}, and Z = {u, v,w}. Define f : X → Y
and g : Y → Z by the arrow diagrams below.
f g
X Y Z
a x u
b y v
c z w
*****
128
Unit IV
7
RELATIONS
Unit structure
7.0 Objectives
7.1 Introduction
7. 2 An overview
7.2.1 Basic concepts related to set
7.3 Relation
7.3.1 Binary relation
7.3.2 Domain and range of a relation
7.3.3 Types of relation
7.3.4 Properties of relation
7.3.5 Representation of types of relation
7.4 Equivalence Relation
7.5 Partial Order Relation
7.5.1 Antisymmetric
7.5.2 Linear or Totally ordered relation
7.5.3 Hasse Diagram
7.6 Summary
7.7 References
7.0 OBJECTIVES
7.1 INTRODUCTION
Often in mathematics, we come across with the word ‘relation’.
Generally speaking, by relation we usually understand some connection
129
between the two living or non-living things. Like the relations of mother-
daughter, brother-sister, teacher-student etc. We are quite familiar with
these relations. In this chapter we will learn about a new concept of
“relations” in mathematics. We can also define a relationship between the
two elements of a set. Associated with a relation is the act of comparing
objects which are related to one another. In this chapter we first formulize
the concept of a relation, various basic types and properties of relation. We
will learn about well-known relations like equivalence relation and the
partial order relation, linear or totally ordered relation.
7.2 AN OVERVIEW
Equal Sets: Let A and B be any two sets. Two sets A & B are said to be
equal if they contain the exact same elements. i.e. A ⊆ B and B ⊆ A.
Symbolically, A = B ⇔ (A ⊆ B Λ B ⊆ A)
Proper Subset: Let A and B be any sets. Set B is said to be proper subset
of set A if B ⊆ A and B ≠ A, it is denoted by B ⊂ A.
Symbolically, B ⊂ A ⇔ (B ⊆ A Λ A ≠ B)
Empty set or Null set: A set which does not contain any element is called
an empty set or null set. It is denoted by ϕ.
If A = {a, b, c}
We know that the null set ϕ and the set A are both subsets of A.
∴ p(A) or 2A = {ϕ, A, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}}
130
7. Cartesion Product: Let A and B be any two non empty sets. The set of
all ordered pairs such that the first member of the ordered pair is an
element of A and the second member is an element of B is called Cartesion
Product of A and b and it is written as A X B.
Symbolically,
A X A = {(x, y) / (x ∈A Λ y ∈ B) }
e. g. If A = {1, 2, 3}, B = {a, b}
A X B = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)}
B X A = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}
7.3 RELATION
If there are two sets A and B and relation R have order pair (x, y)
then the set of all first coordinators of elements of R is called the domain
of R, written as dom (R) and the set of al second coordinates of R is called
the range of R, written as Range (R)
∴ dom (R) = {a: (a, b) ∈ R} and
132
e.g: If R = {(a, b), (c, d)} then
R′ = {(b, a), (d, c)}
Exercise:
133
b) Let A be the set of all students of girls school. The relation R on
A given by R = {(a, b)| difference between the height of a and b
is less than 2 meters}. Therefore R is universal Relation.
c) Every identity relation on a non empty set A is a reflexive
relation, but not conversely.
Soln: A = {1, 2, 3}
R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1), (2, 3), (3, 2)}.
By definition of symmetric relation,
If (a, b) ∈ R then (b, a) ∈ R ∴
from above relation,
(1, 1) ∈ R ⇒ (1, 1) ∈ R
(2, 2) ∈ R ⇒ (2, 2) ∈ R
(3, 3) ∈ R ⇒ (3, 3) ∈ R
(1, 2) ∈ R ⇒ (2, 1) ∈ R
(2, 1) ∈ R ⇒ (1, 2) ∈ R
∴ R is symmetric
Soln: A = {1, 2, 3}
R = { (1, 2), (2, 3), (1, 3)} and relation is less than.
Let a = 1, b = 2 and c = 3
By definition of transitive relation, for all x, y, z ∈ X if (x, y) ∈
R and (y, z) ∈ R then, (x, z) ∈ R.
∴ (1, 2) ∈ R and (2, 3) ∈ R ⇒ (1, 3) ∈ R
∴ R is transitive.
Example 3: Let S be the set of all real numbers and let R be a relation in
S, defined by R = {(a, b) | a ≤ b}. Which properties satisfy by the relation.
134
Soln: S be the set of all real numbers
R = {(a, b) | a ≤ b}
2. Symmetric: consider 4, 6 ∈ S
∴ (4, 6) ∈ R as 4 < 6
But (6, 4) ∉ R as 6 ≤ 4 is not true.
∴ R is not symmetric
Exercise:
Q.1 Let A = {1, 2, 3,4} and define relations are as follows. Check which
relations are reflexive relations?
a) R1 = {(1, 1), (2, 2), (3, 3), (4, 4)}
b) R2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)} [not Reflexive]
c) R3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
d) R4 = {(1, 3), (2, 2),(2, 4), (3, 1), (4, 4)} [not Reflexive]
Example1: Let X = {1, 2, 3, 4} and R = {(1, 1), (1, 4), (2, 2), (2, 3), (3, 2),
(3, 3), (4, 1), (4, 4)} show that it is equivalence relation.
135
1. Reflexive: X = {1, 2, 3, 4}
(1, 1) ∈ R
(2, 2) ∈ R
(3, 3) ∈ R
(4, 4) ∈ R
∴∀ a ∈ X, (a, a)∈R
∴ R is reflexive.
2. Symmetric: X = {1, 2, 3, 4}
(1, 1) ∈ R ⇒ (1, 1) ∈ R
(1, 4) ∈ R ⇒ (4, 1) ∈ R
(2, 2) ∈ R ⇒ (2, 2) ∈ R
(2, 3) ∈ R ⇒ (3, 2) ∈ R
(3, 3) ∈ R ⇒ (3, 3) ∈ R
(4, 1) ∈ R ⇒ (1, 4) ∈ R
(4, 4) ∈ R ⇒ (4, 4) ∈ R
∴ R is symmetric.
3. Transitive: X = {1, 2, 3, 4}
(1, 1) ∈ R, (1,4) ∈ R ⇒ (1, 4) ∈ R
(1, 4) ∈ R, (4,1) ∈ R ⇒ (1, 1) ∈ R
(2, 2) ∈ R, (2,3) ∈ R ⇒ (2, 3) ∈ R
(2, 3) ∈ R, (3,3) ∈ R ⇒ (2, 3) ∈ R
(3, 2) ∈ R, (2,2) ∈ R ⇒ (3, 2) ∈ R
(3, 3) ∈ R, (3,2) ∈ R ⇒ (3, 2) ∈ R
(4, 1) ∈ R, (1,1) ∈ R ⇒ (4, 1) ∈ R
(4, 4) ∈ R, (4,1) ∈ R ⇒ (4, 1) ∈ R
∴R is transitive. Thus R is reflexive,
symmetric and transitive.
∴ R is an equivalence relation.
136
⇒ (a – b) is even
⇒ - (a – b) is even
⇒ (b – a) is even
⇒ (b – a) ∈ R
∴ R is symmetric.
3. Transitive:
Let a, b, c ∈Z such that (a, b) ∈R and (b, c) ∈R
Then (a, b) ∈R and (b, c) ∈R ⇒ (a – b) is even and (b–c) is even
⇒ (a – b) + (b – c) is even
⇒ (a – c) is even
⇒ (a, c)∈R
∴ R is transitive.
Thus R is reflexive, symmetric and transitive.
∴ R is an equivalence relation.
Example 3: Let N be the set of all natural numbers and let R be a relation
on N X N, defined by (a, b)R(c, d ) ⇔ ad = bc Show that R is an
equivalence relation.
1. Reflexive:
Let (a, b) ∈ R then by definition,
(a, b)R(a, b ) as ab = ba.
(a, b)R(a, b ) ∀ (a,b) ∈ R.
∴ R is reflexive.
2. Symmetric:
Let (a, b) ∈ R and (c, d) ∈ R
(a, b)R(c, d ) ⇒ ad = bc
⇒ bc = ad
⇒ cb = da
⇒ (c, b)R (d,a)
∴ R is symmetric.
3. Transitive:
Let (a, b) ∈ R, (c, d) ∈ R and (e,f) ∈ R,
(a, b)R(c, d ) and (c, d)R(e, f )
i.e. ad = bc and cf = de
⇒ adcf =bcde
⇒ (af)(cd) = (be)(cd)
⇒ af = be
⇒(a, b) R (e, f)
137
∴(a, b)R(c, d ) and (c, d)R(e, f ) ⇒(a, b) R (e, f)
∴ R is transitive.
Thus R is reflexive, symmetric and transitive.
∴ R is an equivalence relation.
Exercise:
7.5.1 Antisymmetric:
This symbol does not necessarily mean “less than or equal to” as is used
for real numbers.
138
If ≤ is a partial ordering relation on P, then the ordered pair (P, ≤) is called
a Partially ordered set or POSET.
Example1: Let X = {2, 3, 6, 12, 24, 36} and the relation ≤ be such that
x≤y ifff x divides y. Show that (X, ≤) is Partially Ordered Relation.
Relation is x divides y
i. e. x | y. ∴ R = {(2, 2), (2, 6), (2, 12), (2, 24), (2, 36), (3, 3), (3, 6), (3,
12), (3, 24), (3, 36), (6, 6), (6, 12), (6, 24), (6, 36), (12, 12), (12, 24), (12,
36), (24, 24), (36, 36)}
In the above example (2, 6), (3, 6), (3, 12), (3, 24), (3, 36) are
comparable. But (2, 3) are not comparable as 2|3 or 3|2 is not possible. i.e.
2 doesn’t divide 3 or vice versa.
Note that “cover” as used here should not be confused with the
“cover” of set defined in the part of set.
140
In such diagram, each element is represented by a small circle or
dot. The circle for x ∈ P is drawn below the circle for y ∈ P if x < y and a
line is drawn between x and y if y covers x.
If x < y but y does not cover x, then x and y are not connected
directly by a single line, However, they are connected through one or more
elements of P.
Soln: P = { 1, 2, 3, 6, 12}
R = {(1, 1), (1, 2), (1, 3), (1, 6), (1, 12), (2, 2), (2, 3), (2, 6), (2, 12), (3, 3),
(3, 6), (3, 12), (6, 6), (6, 12), (12, 12)}
Soln: A = {a, b}
p(A) = { ϕ, A, {a}, {b}}
B0 B1 B2 B3
Relation R = ⊆ = {(B0, B0), (B0, B1), (B0, B2), (B0, B3), (B1, B1), (B2, B1),
(B2, B2), (B3, B1), (B3, B3)} 12 6 3 2 1 B1 B3 B2 B0
Example 3: Let A = { 2, 3, 6, 12, 24, 36}. Check the relation divide on set
A is linear or totally ordered relation and draw its Hasse diagram.
Soln: A = { 2, 3, 6, 12, 24, 36}
Relation is divide relation.
∴ R = {(2, 2), (2, 6), (2, 12), (2, 24), (2, 36), (3, 3), (3, 6), (3, 12), (3, 24),
(3, 36), (6, 6), (6, 12), (6, 24), (6, 36), (12, 12), (12, 24), (12, 36), (24, 24),
(36, 36)} 12 6 2 3 24 36
∴ R = {(1, 1), (1, 2), (1, 3), (1, 5), (1, 6), (1, 10), (1, 15), (1, 30), (2, 2), (2,
6), (2, 10), (2, 30), (3, 3), (3, 6), (3, 15), (3, 30), (6, 6), (6, 30), (10, 10),
(10, 30), (15, 15), (15, 30), (30, 30)}
Fig.
Q.2 Let A = {1, 2, 3, 6, 12, 18}. Let R be the relation “is divisor of”.
Show that relation is partial ordered relation and draw its hasse
diagram.
7.6 SUMMARY
7.7 REFERENCES
1. Tremblay J. P. & Manohar R., "Discrete Mathematical structure
with applications to computer science", MGH, 1999.
2. Deo Narsingh., "Graph theory with applications to Engineering &
Computer Science", PHI, 2000.
3. Rosen K.H., "Discrete Mathematics and Its Applications", 6/E,
MGH, 2006.
4. Kolman B., Busby R.C. & Ross S., "Discrete Mathematical
Structure", 5/E, PHI, 2003.
5. Liu C.L., "Elements of Discrete Mathematics", MGH, 2000. .
*****
143
8
GRAPHS
Unit structure
8.0 Objectives
8.1 Introduction
8.2 What is Graph?
8.2.1 Definitions
8.3 Basic Properties of graph
8.4 Trails/Walk, Path, Circuit
8.5 Hamiltonian Path and Hamiltonian Circuit
8.6 Indegree and outdegree
8.7 Matrix Representation
8.7.1 Adjacency matrix
8.7.2 Incidence matrix
8.8 Isomorphism of graphs
8.9 Summary
8.10 References
8.0 OBJECTIVES
8.1 INTRODUCTION
We shall assume all over that both the sets V and E of a graph are
finite. It would be suitable to write a graph G as (V, E) or simply as G.
If some edges are directed and some are undirected in a graph the graph is
called mixed.
Note that, in drawing a graph it is immaterial whether the lines are drawn
straight or curve, long or short. What is important is the incidence between
the edges and vertices.
e.g. The two graphs shown in the following figure are same.
8.2.1 Definitions:
Let (V,E) be a graph and let e1 ∈ E be a directed edge associated with the
ordered pair of nodes (v1, v2).
In directed and undirected graphs, when there are more than one
edge between pairs of nodes such edges are called parallel edges.
Fig 8.4
146
In Fig (a), there are two parallel edges joining the nodes a and d
while there is a loop at node b. In fig 8.4 (b), there are two parallel edges
between nodes c and d.
If there is no more than one edge between a pair of nodes then such a graph
is called a simple graph.
A vertex which is not adjacent to any other vertex is called isolated vertex.
Fig 8.6
Fig 8.7
147
8.3 BASIC PROPERTIES OF A GRAPH
Fig 8.8
It is denoted by e (V).
To find the eccentricity of vertex, first find the distance from a vertex to all
other vertices and the maximum distance is the eccentricity of that vertex.
In the above example, if we want to find the eccentricity of vertex 'a' then:
d (a, b) = 1
d (a, c) = 2, i. e (a→ b→ c , do not take path A → D → G → F→ C )
d (a, d) = 1
d (a, e) = 1
d (a, f) = 2
d (a, g)= 2
148
Hence, the eccentricity of vertex 'a' is 2, which is a maximum distance
from vertex a to all other vertices.
e (b) = 3
e (c) = 3
e (d) = 3
e (e) = 2
e (f) = 2
e (g) = 3
5. Central Point: If the eccentricity of the graph is equal to its radius, then
it is called as central point of the graph. i.e. if r (G) = e (V) then V is the
central point of the graph. In the above example, vertex e and vertex f are
central point of the graph. r (G) = e (e ) = e (f )=2
6. Centre: The set of all central point of the graph is called as Centre of the
graph. In the above example, {e, f} are central point of the graph.
Fig. 8.9
149
Walk – v1 e10 v7 e8 v2 e2 v3
Closed Walk: If initial and ending vertices are same then the walk is
called closed walk. Closed Walk - v2 e2 v3 e3 v4 e5 v6 e4 v2
Open Walk: If initial and ending vertices are not same then the walk is
called open walk. Open Walk – v2 e2 v3 e3 v4 e5 v6
Simple Path: A path in a diagram in which the edges are all distinct is
called a simple path (edge simple).
Fig: 8.10
Simple path 1) v1 e1 v2 e8 v4 e6 v1 e7 v4 e5 v3
2) v4 e6 v1 e1 v2 e4 v3 e3 v2 e2 v1
Elementary path: 1) v1 e1 v1 e8 v4 e5 v3
2) v4 e6 v1 e1 v2 e2 v3
Circuit : A path which originates and ends in the same node is a circuit or
cycle.
Simple circuit: A circuit is called simple circuit if its path is simple. i.e. no
edge in the circuit appears more than once in the path.
A simple diagram which does not have any cycles (circuits) is called
acyclic. From fig 8.10,
Elementary Circuit: v1 e7 v4 e5 v3 e3 v2 e2 v1
Simple circuit: v1 e7 v4 e5 v3 e2 v2 e9 v2 e2 v1
150
Exercise:
Q.1 Find Simple path, Elementary path and Elementary circuit from
following graph.
Fig 8.11
Note:
1. Every graph that has a Hamiltonian circuit, also has a Hamiltonian
path.
Exercise:
Q.1 Find different paths and circuits for the following graph.
Fig 8.12
Fig 8.13
d(v1) = 2d
(v2) = 2d
(v3) = 3 + 2(loop) = 5
d(v4) = 3
d(v5) = 2
d(v6) = 0 (isolated vertex)
152
Outdegree: In directed graph, the number of edges going out from a vertex
v is the outdegree of v.
The sum of indegree of all vertices is equal to the sum of outdegree of all
vertices.
Fig. 8.14
Indegree: Outdegree:
I (v1) = 2 O (v1) = 3
I (v2) = 2 O (v2) = 2
I (v3) = 2 O (v3) = 2
I (v4) = 2 O (v4) = 1
Σ I (vi) = Σ O (vi) = 8.
Fig 8.15a
b)
Fig 8.15b
153
c)
Fig 8.15c
154
In the above graph, there is an edge is from v1 to v3. So we put 1
from v1 to v3 in the matrix. There is no edge is from v3 to v1. So we put 0
from v3 to v1 in the matrix and so on.
Consider the following undirected graph:
For Undirected Graph
A(G) =
a b c d e
a 2 1 1 01
b 1 0 0 0
2
c 1 0 0 21
d 1 2 1 10
e 0 0 2 1 0
Fig 8.17 For undirected graph (graph and matrix)
155
Fig 8.18.For directed graph (Graph and matrix)
Exercise:
156
a)
Fig.8.20
b)
Fig 8.21
c)
Fig 8.22
≅ G2
It is denoted by G1≅
G1 G2
Fig 8.23
Soln:
To check graphs are isomorphic
1. In graph G1 and G2, numbers of vertices are same.
2. In graph G1 and G2, numbers of edges are same.
3. Degree of vertices in graph G1 and G2
d (G1) d (G2)
d(u1) = 2 d(v1) = 2
d(u2) = 3 d(v2) = 3
d(u3) = 3 d(v3) = 3
d(u4) = 2 d(v4) = 2
In G1, vertices of degree 3 is adjacent to two vertices of degree 2. Same in
G2 as well as vertices of degree 2 is adjacent to two vertices of degree 3 in
both the graphs.
∴ Incidence relation is preserved.
Correspondence:
u1 → v1
u2 → v2
u3 → v3
u4 → v4
∴ G1 ≅ G2
Example 2:
Check whether G1 and G2 are isomorphic or not.
G1 G2
Fig 8.24
158
Soln: Number of vertices are same in G1 and G2.
Number of edges are same in both the graphs.
In both the graphs, there are 4 vertices of degree 3 and 2 vertices of degree
2. Also, incidence relation is preserved.
G1 G2
Fig 8.25
Soln: The number of vertices are same in G1 and G2
Number of degrees are same in G1 and G2
G1 G2
Fig. 8.26
159
Soln: Number of vertices are same in G1 and G2
Number of edges are same in G1 and G2
d(G1) d(G2)
I(v1) = 2 O(v1) = 1 I(u1) = 2 O(u1) = 2
I(v2) = 1 O(v2) = 2 I(u2) = 2 O(u2) = 1
I(v3) = 2 O(v3) = 2 I(u3) = 2 O(u3) = 1
I(v4) = 1 O(v4) = 2 I(u4) = 1 O(u4) = 2
I(v5) = 2 O(v5) = 1 I(u5) = 1 O(u5) = 2
Correspondence:
v1→ u2
v2→ u4
v3→ u1
v4→ u5
v5→ u3
∴ G1 ≅ G2
Exercise: Check whether graphs are isomorphic or not.
a)
G1 G2
Fig 8.27 [Ans: Graphs are not isomorphic graphs]
b)
G1 G2
Fig 8.29 [Ans: Graphs are isomorphic graphs]
160
d)
G1 G2
d) Fig 8.30 [Ans: Graphs are not isomorphic graphs ]
∴ The number of incident pair is the sum of degree since every edge is
incident with exactly two vertices, each edge gets counted twice, once at
each end.
Σ d(v) = 2E
Fig 8.31
161
The number of edges in G are 10 and total degree of graph is
d(G) = d(v1) + d(v2) + d(v3) + d(v4) + d(v5) + d(v6) + d(v7)
=3+4+4+4+4+1+0
= 20
= 2 x 10
=2xE
Thus the sum of degrees is equal to twice the number of edges.
8.9 SUMMARY
8.10 REFERENCES
*****
162
9
TREES
Unit structure
9.0 Objective
9.1 Introduction
9.2 Tree
9.2.1 Basic terms
9.2.2 Properties of Tree
9.3 Rooted Tree
9.3.1 Basic terms and definitions
9.3.2 Level of node
9.3.3 Height of node
9.3.4 Depth of node
9.4 Binary Tree
9.4.1 Full Binary Tree
9.5 Isomorphism of Tree
9.6 Spanning Tree and Shortest Paths
9.6.1 Fundamental Circuit
9.6.2 Minimum Spanning Tree
9.6.3 Prim’s Algorithm
9.6.4 Kruskal’s Algorithm
9.7 Summary
9.8 References
9.0 OBJECTIVE
9.1 INTRODUCTION
The concept of tree is probably the most important in graph theory.
To describe any structure which involves hierarchy, trees are very useful.
163
Our family is the best example of tree. In this chapter we shall define a tree
and its properties. There are many new terms and definitions introduced in
this chapter. This chapter will discuss level of node, height of node, height
of tree, depth of node as well as some concepts of binary tree. Here we also
introduced isomorphism of tree, spanning tree, different spanning tree and
shortest path. Prim’s Algorithm and Kruskal’s Algorithm are used for
finding the Minimum Spanning Tree (MST) of a given graph. To apply
these algorithms, the given graph must be weighted, connected and
undirected.
9.2 TREE
Tree: A directed tree is an acyclic diagraph which has one node called its
root with indegree 0, while all other nodes have indegree 1.
Every directed tree must have atleast one node. An isolated node is also a
directed tree.
A tree is a connected undirected graph with
• No simple circuit
• No multiple edges
• No loop
Therefore, any tree must be a simple graph.
9.2.1 Basic terms:
An undirected graph is a tree if and only if there is a unique simple
path between any two of its vertices
It consists of nodes with a parent child relation.
Examples of tree:
a b c e
d e f
b c d
(a) (b)
Fig 9.1
Examples of not a tree:
a b c a b
d f c d
(a) (b)
Fig 9.2
164
Figure a is not a tree because it contains a cycle or loop. Figure b is not a
tree because it is not a connected graph.
Fig 9.3
If we want to travel from b to g, there is only one path. Every edge in a tree
is a bridge.
If a tree has n vertices then it has n – 1 edges.
Any connected graph with n vertices and n – 1 edges is also a tree
Exercise:
Q.1 Which of the following graphs are trees?
Fig 9.4. (a – e) [Ans: Fig 9.4. (a) & (e) are Not a tree]
Fig 9.5
165
d (a, b) is distance between a and b.
d (a, b) = d (a, c) = 1
d (a, d) = d (a, e) = d (a, f) 2
d (a, g) = d (a, h) = 3
d (a, i) = d (a, j) = 4
d (a, k) = d (a, l) = d (a, m) = 5
d (a, n) = d (a, o) = d (a, p) = 6
Rooted Tree: A rooted tree is a tree in which one vertex has been
designated as the root and every edge is directed away from the root.
Fig 9.6
If v is a vertex in a rooted tree other than the root, the parent of v is the
unique vertex u such that there is a directed edge from u to v.
Parent of d, e, f is b.
∴ a is ancestor for d, e, f
Node g and node h are siblings because they have same parent i.e.
parent c. But node f and node g are not siblings because they have different
parent. Node f is having parent b and node g is having parent c.
Leaf Node: Leaf nodes are those nodes which do not have any child.
Internal/branch nodes: the nodes which are neither roots node nor leaf
nodes are called internal nodes or we can say that vertices that have
children are called internal nodes.
The level of any node is the length of its path from the root.
Level of node b and c is 1
Level of node d, e, f, g, and h is 2.
Level of node i, j and k is 3.
Level of node m, n, o is 4.
167
Fig 9.7
9.3.3 Height of node:
Height of a tree: Height of a tree is length of the longest path between root
node to any leaf node.
So here height of tree is 3.
9.3.4 Depth of a node: Longest path from root node to that node.
Depth (B) =1 (from A→B)
Depth (C) =1 (from A→C)
Depth (D) =2 (from A→B→D)
Depth (E) =2 (from A→B→E)
Depth (F) =2 (from A→B→F)
Depth (G) =3 (from A→B→E→G)
Depth (H) =3 (from A→B→E→H)
Exercise:
Q.1 Show root node, leaves, siblings, internal nodes, ancestors of v11,
descendants of v2, subtree of node v4.
168
Fig. 9.8
Fig. 9.9
a) Which is the root vertex?
b) Which vertices are internal vertices?
c) Which are the leaf vertices?
d) Which vertex is the parent of vertex h?
e) Which are the children of vertex f?
f) Which vertices are siblings of vertex i?
g) Which vertices are ancestors of h?
h) Which vertices are descendants of e?
Example: Consider the following tree. Find the height and depth of tree.
fig. 9.10
169
Node Height Depth
a 3 0
b 1 1
c 0 1
d 2 1
e 0 2
f 0 2
g 0 2
h 1 2
i 0 3
Exercise: Find height and depth of each node of tree.
Fig. 9.11
m-ary tree: An m-ary tree is a rooted tree in which each node has no more
than m children.
Fig. 9.12
In this tree maximum number of children are 4. i.e. the children of vertex e
are f, g, h and i. e.
∴ It is 4-ary tree.
The tree is called a full m ary tree if every vertex has exactly m children.
170
Fig 9.13
This is full binary tree.
Internal node, i = 6
The total number of nodes in a full m ary tree with i internal nodes,
n = m*I +1, where n= number of nodes
= 2 * 6 + 1, m = 2
= 13
Fig 9.14
This is full ternary tree.
Internal node, i = 5
The total number of nodes with i internal nodes,
n = m*I +1, where n= number of nodes
= 3 * 5 + 1, m = 3
= 16
Example: Draw 2 binary tree with 6 leaves.
Soln:
1 4
3 4
1 2 5 6 2 3
5 6
(a) (b)
Fig. 9.15 (a) and (b) are two different binary trees with 6 leaves.
These are binary trees because it has almost two children and have 6 leaves
as shown in the tree.
171
Note: Binary tree with n vertices has (n+1)/2 pendent vertices. (Pendent
vertex is same as leaf vertex).
Example: Draw a tree with 7 vertices and count the pendent (leaf) vertices.
Soln: A tree with 7 vertices is as follows.
3
2 5
4 7
6
Fig. 9.16
Number of vertices, n = 7
∴Pendent vertex = (n + 1)/2
= (7 + 1)/2
= 8/2
=4
∴Pendent (leaf) vertices are 4, i. e. vertices 2, 4, 6, 7.
172
9.5 ISOMORPHISM OF TREE
Two trees are called isomorphic if one of them can be obtained from
other by a series of flips, i.e. by swapping left and right children of a
number of nodes. Any number of nodes at any level can have their children
swapped.
Eg.
1 1
2 3 2 3
or
Left subtree of one must been same with right subtree of other's & right
subtree of one must same with left subtree of other's.
1 1
2 3 3 2
Fig. 9.17
173
Soln: Consider the above trees.
Fig. 9.18
In above tree, left child of 4 is equal to left child of 4 and right child of 4 is
equal to right child of 4.
Also, left child of 5 is equal to right child of 5 and right child of 5 is equal
to left child of 5.
∴ In every subtree of tree, isomorphism is preserved.
∴ Trees T1 and T2 are Isomorphic Trees.
Exercise:
Q.1 Check whether the following trees are isomorphic or not.
a)
Fig. 9.19
Fig: 9.20
There are more than one spanning tree for the same graph. Only condition
is minimum number of edges with all vertices.
∴The different spanning trees for graph given in the Fig 9.20 are,
Fig. 9.21
Number of edges in spanning tree are always (n – 1), for n vertices. If there
are four vertices, the number of edges are three.
175
In a spanning tree, there are two terms, 1. Branch 2. Chord
1. Branch: Branch is an edge in a spanning tree
2. Chord : Chord is an edge in a graph which is not in a spanning tree
Fig 9.22
Fig 9.23
n = 5, e = 4
Branch = {a, b, c, f}
Chord = {d, e, g, h}
b)
Fig 9.24
n = 5, e = 4
Branch ={a, b, f, h }
Chord = {c, d, e, g}
176
Consider the graph G.
Fig. 9.25
Fig. 9.26
Fig: 9.27
Fig: 9.28
We add chord g, which form the following circuit.
177
Fig: 9.29
We add chord h, which form the following circuit.
Fig: 9.30
Exercise:
Q.1 Draw the different spanning tree from the following graph:
Fig 9.31
178
Fig 9.32
9.6.2 Minimum Spanning Tree:
The weight of a spanning tree is the sum of all the weight’s assigned to
each edge of the spanning tree.
Fig. 9.33
Consider minimum weight in the graph, minimum weight is 1 for the edge
c to d.
Next minimum weight is 2 for the edge d to a
179
Next minimum weight is for two edges. Take that edge which do not form
a cycle. If we take edge from a to c, then it forms a cycle so take another
edge d to b with weight 3.
Example: Draw the minimum spanning tree for the following graph.
Fig 9.34
Fig 9.35
180
a)
Fig 9.36
b)
Fig 9.37
[Hint: You can take all edges with same weight but the condition is there
should not form a cycle.]
Step-1: Remove all the loops and parallel edges (keep that parallel edge
which has minimum weight.)
Step-2: Find all the edges that connect the tree to new vertices, find the
minimum and add it to the tree (no cycle allowed)
181
Fig 9.38
Visited vertices = {a, f, e}, Edges to choose from = {ab, eg, ed}
182
Visited vertices = {a, f, e, d}, Edges to choose from = {ab, eg, dg, dc}
Here weight of edge dc is minimum. So we select edge dc.
Visited vertices = {a, f, e, d, c}, Edges to choose from = {ab, eg, dg, cb}
Here weight of edge cb is minimum. So we select edge cb.
Visited vertices = {a, f, e, d, c, b}, Edges to choose from = {ab, eg, dg, bg}
Here weight of edge bg is minimum. So we select edge bg.
Fig 9.39
b)
Fig 9.40
[ Hint: Remove all loops and parallel edges from the given graph. In case
of parallel edges, keep the one which has the least weight and remove all
others.]
c)
Fig 9.41
184
9.6.3 Kruskal’s Algorithm for minimum spanning tree:
Step-1: Arrange all the edges of the given graph. In ascending order as per
their weight.
Step-2: Select the edge with minimum weight from the graph and check if
it forms a cycle with the spanning tree.
185
Now draw all the vertices
We start with minimum weighted edge i. e. edge (a, f) with weight 6/873.
After adding edge (a, f)
Next minimum weighted edge (d, g). If we add edge (d, g), it will form
cycle.
186
∴ We ignore edge (d, g).
Again if we add edge (e, g) then it will form cycle. So ignore edge (e, g).
Next minimum weighted edge is (e, f).
After adding edge (e, f)
Fig 7
Since all the vertices have been included in the minimum spanning tree, so
we stop here. Number of edges are 6 which is equal to n-1 (where n is
number of vertices).
Weight of the minimum spanning tree = sum of all the edge weights
= 6 + 8 + 10 + 12 + 18 + 21 = 75
Exercise:
Q.1 Find minimum spanning tree for following graph using Kruskal’s
algorithm.
a)
Fig 9.43
187
b)
Fig 9.44
9.7 SUMMARY
9.8 REFERENCES
*****
188
UNIT V
10
COUNTING
Unit Structure
10.0 Objectives
10.1 Introduction
10.2 Possibility Trees and the multiplication Rule
10.3 Counting elements of disjoint sets with Addition Rule
10.4 The Pigeonhole Principle
10.5 Counting Subset of a Set
10.6 Combinations
10.7 Let us sum up
10.8 Unit end Exercises
10.9 List of References
10.0 OBJECTIVES
10.1 INTRODUCTION
189
10.2 POSSIBILITY TREES AND THE
MULTIPLICATION RULE
Suppose that there are two box, each containing an equal number of
black and white marbles. You take one marble from one box and then one
marble from other box. Draw the possibility tree to determine all possible
outcomes.
X---------------G-------------N
Solution: The possible tree diagram for all point by given condition is
given below,
X---------------------D
191
Step VI: from F he can travel E and H than from E to G to H and from H
to G to E, From F to G and H to G , from G to H to F to C.
Multiplication Rule:
If the procedure can be broken into first and second stages, and if
there are m possible outcomes for the first stage and for each of these
outcomes, there are n possible outcomes for second stage, then the total
procedure can be carried out in the designate order, in ways. This principle
can be extended to a general form as follows:
Example 3: How many four digits numbers can be formed contains each
of the digits 7, 8, and 9 exactly once?
First for ‘7’ there are 4 places, for ‘8’ there are 3 places and for ‘9’ there
are 2 places. For last digit, we can choose any of 0,1,2,3,4,5,6 so there will
be 7 digits.
Solution:
One English and one Hindi book is chosen, that selection can be done by
4 x 5 = 20 ways.
One English and one Marathi book is chosen, that selection can be done by
ways. 4 x 7 = 28 ways.
One Hindi and one Marathi book is chosen, that selection can be done by
ways = 5 x 7 = 35 ways.
194
10.3.2 Additive Principle with Disjoint sets:
Given two sets A and B, both sets are disjoint i.e. if , A ∩ B=φ than
A∪B = A + B
Pigeonhole Principle
In one set 13 or more people there are at least two whose birthdays fall in
the same month.
That this intuitively obvious result can be quite useful is illustrated by the
following example.
Example 8: If eight people are chosen in any way what so ever at least two
of them will have been born on the same day of the week.
195
Solution: Here each person (pigeon) is assigned the day of the
week(pigeonhole) on which he and she was born since there are eight
people and only seven days of the week, the pigeonhole principle. Tells us
that at least two people must be assigned to the same day.
1
6 2
5 3
4
If seven points are chosen we can assign each one to a triangle that
contains it.
Example 10: Five points are located inside a square whose sides are of
length 2. Show that two of the points are within a distance 2 of each
other.
Solution: Divide up the square into four square regions of area 1 unit. as
indicated in figure 1.2.
Example 11: Show that if any five numbers from 1 to 8 are chosen, then
two of that will add to 9.
196
Solution: Constructs four different sets each contains two numbers that
add to 9, as follows A1 = {1,8} , A2 = {2,7} , A3 = {3,6} , A4 = {4,5} each of
the five numbers chosen will be assigned to the set that contains it .Since
there are only four sets. The pigeonhole principle tells that two of the
chosen numbers will be assigned to the same set. These two numbers will
add to 9.
Example 12: Fifteen children together gathered 100 nuts. Prove that some
pair of children gathered the same numbers of nuts.
Example 13: Show that in any set of 10 integers there are at least pair of
integers who have same remainder when divided by 9.
Solution: Let the pages be the pigeons and the dictionaries are the
pigeonholes. Assigns each to the dictionaries in which it appears then by
the extended pigeonhole principle are dictionary must contain at least
( 61,327 − 1) 61,326
+1 = + 1 = 2045 pages
30 30
197
Example 15: Show that if any 29 people are selected then one may choose
subset of 5. So that all 5 were born on the same day of the week.
Solution: Assign each person to the day of week on which he and she was
born. Then n = 29 persons are being assigned to m = 7 pigeonholes. By the
extended pigeonholes principle at least
( n − 1) ( 29 − 1) 28
+1 = +1 = + 1 = 5 persons
m 7 7
Therefore 5 persons must have been born on the same day of the week.
1. Show that if there are seven numbers from 1 to 12 are chosen then
two of them will add to 13.
3. Show that if any Eight positive integer are chosen two of them will
have the same remainder when divided by 7.
4. Show that if seven colors are used to paint 50 bicycles at least eight
bicycles must have the same colors.
Sets : A set is any well defined collection of distinct objects. Objects could
be fans in a class room, numbers, books etc.
Note:
(1) Every set A is a subset of itself i.e. A ⊆ A
(2) If A ⊆ B but A ≠ B then we say A is a proper subset of B and we
write A ⊂ B. If A is not a proper subset of B then we write A ⊄ B.
(3) ∅ ⊆ A for any set ‘A’
(4) A = B iff A ⊆ B and B ⊆ A
Cardinality of a set:
The number of elements in a set is called as cardinality of a set and it is
denoted by n(A) or |A|. For example,
(1) A = {1, 2, 3, 4, 5}, |A| = 5
(2) B = ∅ , |B| = 0
Power set : Let A be a given set. Then set of all possible subsets of A is
called as a power set of
(1) If A = {1, 2} than P(A) = { ∅ , {1}, {2}, {1, 2}}
Example 16: If X is a finite set having n elements, then the total number of
subset of X is 2n
Solution: consider X contain n elements.
∴ X = {x1, x2 , x3 , x4 ,......., xn} .
There are two possibility of every element of X it may or may not be the
subset of X . ∴It is true for every element of xi ∈ X .
x2 x3 x4 x ………………… x n
2 2 2 2 …………………. 2
∴ By multiplication principle, the total number of way it can be done
by = 2×2×2×2×..............×2( n times).
= 2 n.
∴ The total number of subset of X is 2n .
199
10.6 COMBINATIONS
Example 18: A bag contains 4 red marbles and 5 green marbles. Find the
number of ways that 4 marbles can be selected from the bag, if selection
contain i) No restriction of colors. ii) all are of same colors.
Example 19: There are 10 members in a society who are eligible to attend
annual meeting. Find the number of ways a 4 members can be selected that
200
i) No restriction
ii) If 2 of them will not attend meeting together.
iii) If 2 of them will always attend meeting together.
Solution:
i) To select 4 members from 10 members, it can be done by = C
(10,4)=210 ways
Example 20: How many diagonal has a regular polygon with n sides?
Solution: The regular polygon with n sides has n vertices. Any two
vertices determine either a side or diagonal. Therefore these can be done by
n ( n − 1)
= C ( n, 2 ) = . But there are n sides by which are not diagonal.
2
Therefore total number of diagonals are
n ( n − 1) n 2 − 1 2n n 2 − 3n n ( n − 3)
= −n = − = = diagonals.
2 2 2 2 2
Till now, we have seen the formula for the number of combinations
when r objects are chosen from the collection of n distinct objects. The
following results is very important to find the number of selection of n
objects when not all n are distinct.
201
Solution: One can pick one marble of each colors and then the remaining
seven marbles in any way. There is no choice in picking one marble of
each type. The choice occurs in picking the remaining 7 marbles from 5
colors. By the result of r-combination with repetition allowed,
These can be done by C ( 5 + 7 − 1,7 ) = C (11,7 ) = 330 ways
Example 23: In how many ways can a teacher choose one or more
students from 5 students?
Solution: Let set of student are 5, therefore total number of subsets are
25 = 32
To select one or more students, we must deleted empty set,.
Therefore total number of selection = 32 – 1= 31 ways.
202
A B C
E F
4. How many four digit passwords can be formed using the digits
1,2,3,4,5,6,7 if i) no digit is repeated in password? ii) Repetition of
digits is allowed in password?
5. How many six digit Gpay PIN can be generated by using two letters
and digits, if i) no digit is repeated in PIN? ii) Repetition of digits is
allowed in PIN?
6. 10 people want to go to the movies, and there are only 7 cars, then at
least more then one person in the same car.
7. Prove that among the 51 positive integers less than 100. There is a pair
whose sum is 100.
8. There are 33 students in the class and sum of their ages 430 year. Is it
true that one can find 20 students in the class such that sum of their
ages greater 260?
9. A bag contains 5 black marbles and 6 white marbles. Find the number
of ways that five marbles can be drawn from the bag such that it
contains i) No restriction ii) no black marbles, iii) 3 black and 2 white,
iv) at least 4 black, v) All are of same colors.
11. There are 12 points in a given plane, no three on the same line. i) How
many triangle are determine by the points? ii) How many of these
triangle contain a particular point as a vertex?
12. Which regular polygon has the same number of diagonal as sides?
203
13. How many committees of two or more can be selected from 8 people?
15. Find the number of combinations if the letters of the letters of the word
EXAMINATION taken out at a time.
*****
204
11
PROBABILITY
Unit Structure
11.0 Objectives
11.1 Introduction
11.2 Basic concept of probability
11.3 Probability Axioms
11.3.1 Addition theorem of probability
11.4 Condition Probability
11.5 Independent events
11.5.1 For Independent events multiplication theorem
11.6 Baye’s formula
11.7 Expected Value
11.8 Let us sum up
11.9 Unit end Exercises
11.10 List of References
11.0 OBJECTIVES
11.1 INTRODUCTION
Some time in daily life certain things come to mind like “I will be
success today’, I will complete this work in hour, I will be selected for job
and so on. There are many possible results for these things but we are
happy when we get required result. Probability theory deals with
experiments whose outcome is not predictable with certainty. Probability
is very useful concept. These days many field in computer science such as
machine learning, computational linguistics, cryptography, computer
vision, robotics other also like science, engineering, medicine and
management.
Types of events:
Equally likely events: when all events get equal chance of occurrences is
called equally likely events. For e.g. Events of occurrence of head or tail
in tossing a coin are equally likely events.
206
number are exhaustive events. Therefore (5 ∪ 6) = 1.
Let S be a sample space. A probability function P from the set of all event
in S to the set of real numbers satisfies the following three axioms for all
events A and B in S.
i.) P( A) ≥ 0
ii) P(φ ) = 0 and P (S) =1
iii) If A and B are two disjoint sets ( A ∩ B = φ ) i.e. equation than the
probability of the union of A and B is P ( A ∪ B ) = P ( A) + P ( B )
207
11.3.1 Addition theorem of probability:
Theorem: If A and B are two events of sample space S, then probability of
union of A and B is given by P(A∪ B) = P ( A) + P ( B ) − P ( A ∩ B )
Proof: A and B are two events of sample space S.
S
A∩ B B∩ A
A
∩
B
Now from diagram probability of union of two events A and B is given by,
P(A∪ B) = P ( A ∩ B ) + P ( A ∩ B ) + P ( B ∩ A )
P(A∩ B) = P ( A) − ( A ∩ B ) and P ( B ∩ A ) = P ( B ) − P ( A ∩ B )
∴ P ( A ∪ B ) = P ( A) − P ( A ∩ B ) + P ( A ∩ B ) + P ( B ) − P ( A ∩ B )
∴ P ( A ∪ B ) = P ( A) + P ( B ) − P ( A ∩ B )
Example 1:
A bag contains 4 black and 6 white balls; two balls are selected at random.
Find the probability that balls are i) both are different colors. ii) both are of
same colors.
208
Let B be the event to select both are white balls.
∴ n ( B ) = C ( 6, 2 ) = 15
n( B) 15
P ( B) = =
n(S ) 45
A and B are disjoint event.
The required probability is
6 15 21
∴ P ( A ∪ B ) = P ( A) + P ( B ) = + = = 0.467
45 45 45
Example 2:
From 40 tickets marked from 1 to 40, one ticket is drawn at random.
∴ n ( S ) = C ( 40,1) = 40 Find the probability that it is marked with a
multiple of 3 or 4.
210
P ( A ∩ B)
P ( A / B) = If and only if P ( B ) > 0
P ( B)
Example 4: A pair of fair dice is rolled. What is the probability that the
sum of upper most face is 6, given that both of the numbers are odd?
( B)
P ( A ∩ B) = P (B) P A
Note:
1) If A and B are independent event then, A and B are independent event.
2) If A and B are independent event then, A and B are independent event.
3) If A and B are independent event then, A and B are independent event.
Example 7:
Manish and Mandar are trying to make Software for company. Probability
1 3
that Manish can be success is and Mandar can be success is , both are
5 5
doing independently. Find the probability that i) both are success. ii) At
least one will get success. iii) None of them will success. iv) Only Mandar
will success but Manish will not success.
213
1
Solution: Let probability that Manish will success is P ( A) = = 0.2
5
Therefore probability that Manish will not success is
( )
P A = 1 − P ( A ) = 1 − 0.2 = 0.8
3
Probability that Mandar will success is P ( B ) == 0.6
5
Therefore probability that Mandar will not success is
( )
P B = 1 − P ( B ) = 1 − 0.6 = 0.4.
i) Both are success i.e. P ( A ∩ B )
iv) Only Mandar will success but Manish will not success. i.e. P A ∩ B ( )
( ) ( )
P A ∩ B = P A × P ( B ) = 0.8 × 0.6 = 0.48
3 2
Example 9 : Given that P ( A) = , P ( B ) = , if A and B are independent
7 7
( ) (
events than find i) P ( A ∩ B ) ii) P B iii) P ( A ∪ B ) iv) P A ∩ B )
3 2
Solution: Given that P ( A) = , P ( B ) = ,
7 7
i) A and B are independent events,
3 2 6
∴ P ( A ∩ B ) = P ( A) × P ( B ) = × = = 0.122
7 7 49
2 5
ii) ( )
P B = 1 − P ( B ) = 1 − = = 0.714
7 7
iii) By addition theorem,
3 2 6 29
P ( A ∪ B ) = P ( A) + P ( B ) − P ( A ∩ B ) = + − = = 0.592
7 7 49 49
iv) ( ) ( )
P A ∩ B = P A ∪ B = 1 − P ( A ∪ B ) = 1 − 0.592 = 0.408
2. The probability that A,B, and C can solve the same p-roblem
1 2 3
independently are , and respectively. Find the probability that i0
3 5 4
the problem remain unsolved, ii) the problem is solved , iii) only one of
them solve the problem.
3. The probability that Ram can shoot a target is 2/5 and probability of
Laxman can shoot at the same target is 4/5. A and B shot
independently.Find the probability that (i) the target is not shot at all,
(ii) the target is shot by at least one of them. (iii) the target shot by only
one of them. iv) target shot by both.
215
Suppose A1, A2, ........... Ak , are k mutually exclusive events defined in
B (a collection of events) each being a subset of the sample space S such
that U iK=1 Ai = S and P ( Ai ) > 0, ∀i = 1, 2........k .
i.e. B = ( B ∩ E1 ) ∪ ( B ∩ E2 ) ∪ ....... ∪ ( B ∩ Ek )
k
∴ P ( B ) = ∑ P ( B ∩ Ai )
i =1
P ( B ∩ Ai )
P ( B ∩ Ai ) = p ( Ai B ) × P ( B ) ⇒ p ( Ai B ) =
P (B)
But P ( B ∩ Ai ) = p ( B Ai ) P ( Ai ) and P ( B ) = ∑ i =1 P ( B / Ai )P ( Ai )
k
Therefore we get,
p ( B Ai ) P ( Ai )
P ( Ai / B ) = k this known as Baye’s formula.
∑ i=1 P ( B / Ai )P ( Ai )
Example 10:
There are three bags, first bag contains 2 white, 2 black, 2 red
balls; second bag 3 white, 2 black, 1 red balls and third bag 1 white 2
black, 3 red balls. Two balls are drawn from a bag chosen at random.
These are found to be one white and I black. Find the probability that the
balls so drawn came from the third bag.
Solution: Let B1 be the first bag, B2 be the second bag and B3 be the third
bag
A denotes the two ball are white and black.
First select the bag from any three bags,))
1
P ( B1 ) = P ( B2 ) = P ( B3 ) =
3
216
Probability of white and black ball from first bag:
c ( 2,1) × c ( 2,1) 4
P ( A / B1 ) = =
c ( 6, 2 ) 15
Example 11:
By Bayes’ formula,
P ( F1 ) P ( A / F1 ) 0.55 × 0.07
P ( F1 / A ) = =
P ( F1 ) P ( A / F1 ) + P ( F2 ) P ( A / F2 ) 0.55 × 0.07 + 0.45 × 0.03
0.0385
= = 0.74
0.052
∑
n
ii. i
Pi = 1
For e.g. Three coins are tossed, the probability distribution of the discrete
variable X is getting head.
X = xi 0 1 2 3
P = xi 1 3 3 1
8 8 8 8
If random variable X takes values x1, x2, ………….. xn, with corresponding
probabilities P1, P2, ………….Pn, respectively, then expectation of random
variable X is
E ( X ) = ∑ i =1 pi xi where ∑ i =1 pi = 1
n n
Example 12:
In Vijay sales every day sale of number of laptops with his past
218
experience the probability per day are given below:
No. of laptop 0 1 2 3 4 5
Probability 0.05 0.15 0.25 0.2 0.15 0.2
X= xi -1 0 1 2 3
P=( xi ) K 0.2 0.3 2k 2k
⇒ k + 0.2 + 0.3 + 2k + 2k = 1
⇒ 5k = 0.5
⇒ k = 0.1
X= xi -1 0 1 2 3
P=( xi ) 0.1 0.2 0.3 0.2 0.2
Example 15:
A box contains 5 white and 7 black balls. A person draws 3 balls at
random. He gets Rs. 50 for every white ball and losses Rs. 10 every black
ball. Find the expectation of him.
Solution: Total number of balls in box = 5 white + 7 black = 12 balls.
X= xi -30 30 90 150
P=( xi ) 35 105 70 10
220 220 220 220
35 105 70 10
E ( X ) = −30 × + 30 × + 90 × + 150 × = Rs.45.
220 220 220 220
220
11.9 UNIT END EXERCISES
1. A card is drawn at random from well shuffled pack of card find the
probability that it is red or king card.
2. There are 30 tickets bearing numbers from 1 to 15 in a bag. One
ticket is drawn from the bag at random. Find the probability that the
ticket bears a number, which is even, or a multiple of 3.
3. In a group of 200 persons, 100 like sweet food items, 120 like salty
food items and 50 like both. A person is selected at random find the
probability that the person (i). Like sweet food items but not salty
food items (ii). Likes neither.
4. A bag contains 7 white balls & 5 red balls. One ball is drawn from
bag and it is replaced after noting its color. In the second draw again
one ball is drawn and its color is noted. The probability of the event
that both the balls drawn are of different colors.
1 1
5. The probability of A winning a race is & that B wins a race is .
3 5
Find the probability that (a). either of the two wins a race. b), no one
wins the race.
6. Three machines A, B & C manufacture respectively 0.3, 0.5 & 0.2 of
the total production. The percentage of defective items produced by
A, B & C is 4 , 3 & 2 percent respectively. for an item chosen at
random , what is the probability it is defective.
7. An urn A contains 3 white & 5 black balls. Another urn B contains 5
white & 7 black balls. A ball is transferred from the urn A to the urn
B, then a ball is drawn from urn B. find the probability that it is
white.
8. A husband & wife appear in an interview for two vacancies in the
1
same post. The probability of husband selection is & that of wife’s
7
1
selection is. What is the probability that, a). both of them will be
5
selected. b). only one of them will be selected. c). none of them will
be selected?
9. A problem statistics is given to 3 students A,B & C whose chances of
1 3 1
solving if are , & respectively. What is the probability that the
2 4 4
problem will be solved?
10. A bag contains 8 white & 6 red balls. Find the probability of drawing
2 balls of the same color.
11. Find the probability of drawing an ace or a spade or both from a deck
of cards?
12. A can hit a target 3 times in a 5 shots, B 2 times in 5 shots & C 3
221
times in a 4 shots. they fire a volley. What is the probability that a).2
shots hit? b). at least 2 shots hit?
13. A purse contains 2 silver & 4 cooper coins & a second purse contains
4 silver & 4 cooper coins. If a coin is selected at random from one of
the two purses, what is the probability that it is a silver coin?
14. The contain of a three urns are : 1 white, 2 red, 3 green balls; 2 white,
1 red, 1 green balls & 4 white, 5 red, 3 green balls. Two balls are
drawn from an urn chosen at random. This are found to be 1 white &
1 green. Find the probability that the balls so drawn come from the
second urn.
15. Three machines A,B & C produced identical items. Of there
respective output 2%, 4% & 5%of items are faulty. On a certain day
A has produced 30% of the total output, B has produced 25% & C the
remainder. An item selected at random is found to be faulty. What are
the chances that it was produced by the machine with the highest
output?
16. A person speaks truth 3 times out of 7. When a die is thrown, he says
that the result is a 1. What is the probability that it is actually a 1?
17. There are three radio stations A, B and C which can be received in a
city of 1000 families. The following information is available on the
basis of a survey:
(a). 1200 families listen to radio station A
(b). 1100 families listen to radio station B.
(c). 800 families listen to radio station C.
(d). 865 families listen to radio station A & B.
(e). 450 families listen to radio station A & C.
(f). 400 families listen to radio station B & C.
(g). 100 families listen to radio station A, B & C.
The probability that a family selected at random listens at least to one
radio station.
18. The probability distribution of a random variable x is as follows.
X 1 3 5 7 9
P( x ) K 2K 3K 3K K
Find value of (i). K (ii). E(x)
19. A player tossed 3 coins. He wins Rs. 200 if all 3 coins show tail, Rs.
100 if 2 coins show tail, Rs. 50 if one tail appears and loses Rs. 40 if
no tail appears. Find his mathematical expectation.
20. The probability distribution of daily demand of cell phones in a
mobile gallery is given below.
Find the expected mean .
Demand 5 10 15 20
Probability 0.4 0.22 0.28 0.10
222
4 7
21. If P ( A) = , P ( B) = and if A and B are independent events,
15 15
( )
find ( i" P ( A ∩ B ) , (ii) P ( A ∪ B ) , (iii) P A ∩ B .
5 2
22.
9
( )
If P ( A ) = , P B = and if A and B are independent events, find
9
( )
( i" P ( A ∩ B ) , (ii) P ( A ∪ B ) , (iii) P A ∩ B
(
P A∩ B . )
24. A box containing 5 red and 3 black balls, 3 balls are drawn at
random from box. Find the expected number of red balls drawn.
25. Two fair dice are rolled. X denotes the sum of the numbers
appearing on the uppermost faces of the dice. Find the expected
value.
*****
223