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

Desecerte Mathematics and Combinatorics A

The document provides an introduction to combinatorics and graph theory. It discusses what combinatorics is, its applications, and basic problems in combinatorics. It then outlines the contents of the document, which covers topics like counting principles, probability theory, generating functions, recurrence relations, and elements of graph theory.

Uploaded by

Gemechis Gurmesa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Desecerte Mathematics and Combinatorics A

The document provides an introduction to combinatorics and graph theory. It discusses what combinatorics is, its applications, and basic problems in combinatorics. It then outlines the contents of the document, which covers topics like counting principles, probability theory, generating functions, recurrence relations, and elements of graph theory.

Uploaded by

Gemechis Gurmesa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 145

Introduction to Combinatorics and Graph theory

What is combinatorics?
Perhaps the fastest –growing area of modern mathematics is
combinatorics.
Combinatorics is concerned with arrangements of the objects of a
set into patterns satisfying specified rules.
In the modern world, people in almost every area of activity find it
necessary to solve problems of a combinatorial nature. Today its
influence continues to expand. Part of the reason for the tremendous
growth of combinatorics has been the major impact that computers have
had and continue to have in our society. Because of their increasing
speed, computers have been able to solve large-scale problems that
previously would not have been possible. But computers do not function
independently. They need to be programmed. The bases for these
programs often are combinatorial algorithms for the solutions of
problems. Analysis of these algorithms for efficiency with regard to
running time and storage requirements requires more combinatorial
thinking.
Another reason for the continued growth of combinatorics is its
applications to disciplines that previously had little serious contact with
mathematics. Thus, we find that the ideas and techniques of
combinatorics are being used not only in the tradition area of
mathematical application, namely the physical sciences, but also in
social sciences, the biological sciences, information theory, and so on.
There are three basic problems of combinatorics. They are the
existence problem, the counting problems, and the optimization problem.

1
The existence problem deals with the question: Is there at least one
arrangement of a particular kind? The counting problem asks: how many
arrangements are there? The optimization problem is concerned with
choosing, among all possible arrangements, that witch is best according
to some criterion.
Thus, in general, combinatorics is concerned with the existence,
enumeration (counting), and optimization of discrete structures. In this
module, discrete generally means finite, although some discrete
structures are infinite.
Objectives:
On completion of the course, successful students will be able to:
 apply principles of counting to solve counting problems,
 Know basic concepts about elementary probability, generating
function and recurrence relation.
 use generating function and recurrence relation to solve counting
Problems
 construct graphs with given degree patterns,
 apply graph theory to solve network oriented problems

Contents
Chapter 1: Counting Principles
1.1 Introduction
1.2 Elementary counting principle
1.2.1 The sum rule principle
1.2.2 The product rule principle
1.3 Indirect counting principle
1.4 Permutations and Combinations

2
1.4.1 Enumeration of permutation and combination
1.4.1.1 Enumeration of permutation and combination
without repetition
1.4.1.2 Enumeration of permutation and combination
with repetition
1.5. The principle of inclusion-exclusion principle
1.5.1 Application of inclusion- exclusion principle
1.5.1.2 The number of integral solution
1.5.1.3 The sieve Eratosthenes
1.5.1.4 The derangements
1.6. The pigeon hole principle
1.6.1. The pigeonhole principle: simple form
1.6.2. The pigeonhole principle: averaging form
1.6.3. The pigeonhole principle: strong form
1.7. The binomial and multinomial theorems
1.7.1. Some combinatorial identities involving binomial
coefficients
1.7.2. Binomial theorem
1.7.3. Multinomial theorem
Chapter 2: Elementary probability theory
2.1. Introduction
2.2. Sample space and events
2.3. Probability of an event
2.3.1 Definitions of probability
2.4. Conditional probability
2.4.1. Multiplication of probability
2.5. Independent events

3
2.6. Bernoulli trials and the binomial distribution
2.7. Random variables and expectation
2.7.1 Random variables
2.7.2. Expected values
2.7.3. Independent random variables
2.7.3. Variance
Chapter 3: Generating function and recurrence relation
3.1. Introductions
3.2. Generating function of a sequence
3.2.1. Generating function model
3.2.2. Useful facts about power series
3.2.3. Solving counting problems using generating functions
3.2.4. The shifting properties of generating functions
3.3. Recurrence relations
3.3.1 Some properties of Fibonacci number
3.3.2 Solving recurrence relation
3.3.2.1. Solving recurrence relation using substitution method
3.3.2.2. Solving homogenous recurrence relation using
generating functions
3.3.2.3. Solving homogenous recurrence relation using
characteristic roots
3.3.2.4. Solving inhomogeneous recurrence relations
using generating functions
3.3.2.5. Solving inhomogeneous recurrence relations
Chapter 4: Elements of Graph Theory
4.1. Definition and Type of Graphs
4.2. Matrix Representation of Graphs

4
4.3. Isomorphism of Graphs
4.4. Path and Connectivity of Graphs
4.5. Eulerian and Hamilton Graphs
4.7. Graph Coloring
4.8. Trees
Chapter 5: Directed Graphs
5.1. Definition and Examples of Directed graphs
5.2. Matrix Representation of Directed graphs
5.3. Isomorphism of direct graphs
5.4. Paths and Connectivity of Diagraphs
Chapter 6: Labeled and Weighted Graph
6.1. Definition and Examples of Labeled and Weighted graphs
6.2. Shortest path Problems
6.3 Spanning Trees

5
Chapter One: Counting principles
1.1. Introduction
In this chapter we will explore the basic counting principles and
their application in solving counting problems.
Objective:
After these lessons the students will be able to:
 State different type of counting principles
 Solve different counting problems using these principles
1.2. Elementary counting principles
In this section we will present two elementary but basic counting
principles. Then we will show how they can be used to solve many
different counting problems. The two basic counting principles are:
1. the sum rule principle and
2. the product rule principle.
After this lesson the students will be able to
State the sum rule principle in terms of events and sets.
 State the product rule principle in terms of events and sets.
 Solve counting problems by applying the elementary counting
principles.
1.2.1 The sum rule principle
This principle states that:
If E1, E2, …, and En are mutually exclusive events (no two of the events
can happen at the same time) and if E1 can happen in t1 ways, E2 can
happen in t2 ways,…, and En can happen in tn ways , then E1 or E2 or…or
En can happen in t1+t2+…+tn ways.

6
Example: 1.2.1.1
How many ways can we get a sum of 4 or a sum of 8 when two
distinguishable dice are rolled?
Solution:
Let E1 and E2 be events of getting a sum of 4 and a sum of 8,
respectively. Then, since the outcomes (1, 3), (2, 2) and (3, 1) are the
only ones whose sum is 4, E1 can happen in 3 ways. Likewise, we obtain
a sum of 8 from the outcomes (2,6),(3,5),(4,4),(5,3) and (6,2).
Thus E2 can happen in 5 ways.
Hence by the sum rule principle, E1 or E2 can happen in 3+5 =8ways.
Hence there are 8 outcomes whose sum is 4 or 8, when two
distinguishable dice are rolled.
The sum rule can also be formulated in terms of choices as follow:
If an object can be selected from a reservoir in t1 ways and an object can
be select from a separate reservoir in t2 ways, then the selection of one
object from either one reservoir or the other can be made in t1+t2 ways.
Example1.2.1.2
A student can choose a computer project from one of three lists. The
three lists contain 23, 15 and 19 possible projects respectively. How
many possible projects are there to choose from?
Solution:
Let E1, E2 and E3 be events of choosing a computer project from the 1st,
2nd and 3rd lists, respectively. Since the 1st list, the 2nd list and the 3rd list
consists of 23,15 and 19 possible projects, respectively, the events E1,E2
and E3 can happen in 23,15 and 19 ways, respectively.
Hence E1 or E2 or E3 can happen in 23+15+19 =57 ways. Thus there are
57 possible projects to choose from.

7
Remark: The sum rule can be re-stated in terms of sets as follows:
If A1, A2,… ,Am are pair wise disjoint sets ,then the number of elements
in the union of these sets is the sum of the number of elements in them.
n n
i.e. if X   Ai and Ai  A j   , then X   Ai
i 1 i 1

Note: X denotes the number of elements in the set X.


To relate this to our statement of the sum rule Principle in terms of
events, let Ei be the events of choosing an element from a set Ai for
i = 1, 2, 3,…, m. Then Ei can happen in Ai ways since no two of the
events can happen at the same time, the number of ways to choose an
element from one of the sets is equal to
A1  A2  ...  Am  A1  A2  ...  Am

Activity: 1.1
1. In how many ways can we draw
a) a heart or a spade
b) an ace or a king
c) a numbered card or a king from an ordinary deck of playing
cards.
2. How many ways can we get an even sum when two
distinguishable dice are rolled?
1.2.2. Product Rule Principle
If events E1, E2,…, En can happen in t1, t2,…,tn ways respectively.
Then the sequence of events E1 first, followed by E2,… and followed
by En can happen in (t1).(t2)…(tn)ways.

Example: 1.2.2.1

8
At one time, a local telephone number was given by a sequence of two
English letters followed by five digits.
How many different telephone numbers were there?
Solution:
Let E1 and E2 be events of choosing a letter and let E3, E4 and E5 be
events of choosing a digit. Since there are 26 choices for each of the
two letters and 10 choices from each of the five digits, hence, by the
product rule principle, this sequence of events can happen in
26.26.10.10.10.10.10. Thus there are a total of (26)2 x (10)5 possible
telephone numbers.
Activity 1.2
1. If five distinguishable dice are rolled, how many possible
out comes are there?
2. How many three digit numbers can be formed using the
digits 1, 2, 3, 4, 5, 6, 7, 8, &9?
3. How many three digit numbers can be formed using the
digits 1, 3, 4,5,6,8 & 9, if no repetition is allowed?
4. How many possible telephone numbers are there when
there are seven digits, the first two of which between 2
and 9 inclusive, the third digit between 1 and 9inclusive,
and each of the remaining may be between 0 and 9
inclusive?
Remark: In terms of choices , the product rule principle, is stated as: if
a first object can be chosen in t1 ways, a 2nd in t2 ways ,…,and an nth
object can be chosen in tn ways, then a choice of a 1st ,2nd ,…,and an nth
object can be made in (t1).(t2)...(tn) ways.
Example: 1.2.2.3

9
How many different bit strings are there of length seven?
Solution:
Since each bit is either zero (0) or one (1), each of the seven bits can be
chosen in two ways, .There fore, the product rule shows that there are a
total of 2.2.2.2.2.2.2=27=128 different bit strings of length seven.
Example: 1.2.2.4
Find the number of ways a man, woman, and girl can be selected from
5men, 6, women, 2 boys, and 4 girls.
Solution:
Let E1, E2, E3, E4 and E5 be events of choosing a man, woman, boy, and
girl, respectively. Since there are 5 men, 6 women, 2 boys, and 4 girls,
the events E1, E2, E3, E4 and E5 can happen in 5, 6, 2, and 4, respectively.
Hence by the product rule principle these sequences of events can
happen in 5.6.2.4 ways. Hence there are 5.8.2.4=240 number of ways of
selecting a man, woman, and girl.
The product rule principle can also be restated in terms of sets in the
following way. If A1, A2,…Am are finite sets, then the numbers of
elements in the Cartesian product of these sets is the product of the
m
number of elements in each set, i.e. A1 X A2 X ... X Am   Ai .
i 1

To relate this to the product rule in terms of events, let Ei be the


events of choosing an element from a set Ai for i = 1, 2, 3,…, m. Then Ei
can happen in Ai ways and note that the task of choosing an element in

the Cartesian product A1 X A2 X ... X Am is done by choosing an


element in A1, an element in A2,…, and an element in Am.

10
m

Hence sequence of events can happen in A1 . A2 …. Am   Ai ways


i 1

m
Hence, A1 X A2 X ... X Am   Ai .
i 1

Theorem: 1.2.2.5
If a1 , a2 ,..., an are the distinct elements of set A and b1 , b2 ,..., bm are the m

distinct elements of B, then A X B  n.m


n
Proof: Clearly AXB  ai xB and
i 1

(ai XB)  (a j XB)   for i  j. (verify them.)

This implies the set AXB is the union of pair wise disjoint sets ai  XB
for for i  1,2,..., n. Hence By the sum rule principle in terms of sets, we
have
n
AXB   ai  XB
i 1

 a1  XB  a2  XB  ...  an  XB

 B  B  ...  B Since, ai  XB  B (verify it.)

 n B  n.m Since B  m
Remark: Frequently the solution of combinatorial problems call for the
application of both the sum rule principle and the product rule principle,
perhaps even a repeated and intermixed application of both principles.

Example1.2.2.6

11
How many different license plates can be formed that involves 1or2
English Letters followed by 4 digits?
Solution:
Let E1 and E2 be events of forming plates using 1 letter followed by 4
digits and 2 letters followed by 4 digits respectively.
We can form plates with 1 letter followed by 4 digits in 26 x 104 ways,
plates with 2 letters followed by 4 digits in 262 x 104 ways. These
separate events are mutually exclusive so we can apply the sum rule to
conclude that there are 26 x 104 +262 x 104 = (26+262) x 104 plates with 1
or 2 followed by 4 digits.
Note: The words “and” & “or” indicate whether the sum rule or the
product rule is appropriate .The word “and” suggests the product rule ,
the word “or” suggests the sum rule .
Activity 1.2.2.7
1. How many different plates can be formed using 1 or 2 letters
followed by 3 or 4 digits?
2. How many 2-digits or 3-digits numbers can be formed using the
digits 1, 3, 4,5,6,8 & 9 if no repetition is allowed?
3. A new born child can be given 1, 2, or 3 names. In how many can
a child be named if we choose from 10 names (and no name can
be repeated)?

1.3 Indirect counting principle

12
In this section we will introduce still another basic counting tool, known
as the indirect counting principle. It is some times beneficial to solve
some combinatorial problems by counting indirectly, that is, by counting
the complement of a set.
Objectives: After this lesson students will be able to:
 State the indirect counting principle in terms of sets.
 Apply this principle to solve different counting problems.
The indirect counting principle states that:
If A be a finite set and U be the largest set containing A and the set
A'  x U : x  A is the complement of A in U .

Then the number A of objects in A is given by the rule A  U  A .


'

This principle follows from the sum rule principle, since U  A  A'

and A  A'   , we have U  A  A and this implies


'

that A  U  A' .

Note that the set U consists of all the objects under discussion is called
universal set. Applying this principle makes sense only if it is easier to
count the number of elements in U and in A'  x U : x  A than to
count the number of objects in A .
Example: 1.3.1
Computer passed words are to consist of a string of 4 symbols taken
from the digits 0, 1, 2,…, 9. How many computer passed words have a
repeated symbol?

Solution:

13
Let U be the set of all computer passwords.
Let A be the set of computer passwords with repeated symbol.
Taking the complement of A in U we get the set A' of computer
passwords with no repeated symbol. Now applying the product rule
principle we get U  10.10.10.10.  10 4  10000 and A'  10.9.8.7  5040 .
Hence by the indirect counting principle we have
A  U  A'  10000  5040  4960 . Hence there are 4960 computer

passwords with no repeated symbol.


Example: 1.3.2
How many positive integers less than 1000 are not divisible by 7?
Solution:
To solve this problem we introduce some notation. For a real number
r, r  stands for the largest integer that does not exceed r , that is the

largest integer x  r . For example, 7.5  7


Now let U be the set of all integers less than 1000. That is,
U  {x  Z : 1  x  1000} . Let A  {x U : x is not divisible by 7}

Hence A'  {x U : x is divisible by 7}


  
1000  6
Now clearly U  999 , and A'     142   142 .
 7   7

Hence by the principle of indirect counting we have


A  U  A'  999  142  857 . Hence there are 857 positive integers

less than 1000 which are not divisible by 7.

Activity: 1.4

14
1. How many positive integers less than or equal to 1000 are not
divisible by 6?
2. How many non-negative integers less than 104 that contain the digit 2?
3. In how many ways can 10 people be seated in a row so that a certain
pair of them is not next to each other?

1.4 Permutation and Combination


In this section we will discus about permutation and combination.
In combinatorics we frequently talk about a set consisting of n distinct
elements.
An r-permutation of a set consisting of n distinct elements is an
arrangement r of the elements in order that is we peak the r elements
and arrange them in order and an r-combination of a set consisting of n
distinct elements is a selection of r elements, which means the order
does not matter.
Most reader of this module will have had some experience with
some counting problems, so that the concepts “permutation” and
“combination” are probably familiar.
Objective:
After these lessons the students will be able to:
 Define r-permutation and r-combination.
 List the r-permutation and r-combination of a set consisting of n
elements.
 Prove theorems on enumeration of permutation and combination
with and with out repetition.
 Solve counting problems using permutation and combination.

15
 Apply the formula of r-combination with unlimited repetition to
the number of nonnegative integral solution of an equation.
Definition: 1.4.1
Let r be a positive integer. A permutation of n objects taken r at a time
(also called r-permutation of n objects) is an ordered arrangement of r
of the objects.
A combination of n objects taken r at a time (also called
r-combination of n objects) is an unordered selection of r of the
objects.
In other words, by an r-permutation of a set S of n elements is an
ordered arrangement of r of the n elements and by an r-combination of a
set S of n elements is an unordered selection of r of the n objects of S.
Example1.4.2
Let S  a, b, c, d . Then list
i. the 2-permutation of S
ii. the 3-combination of S
Solution:
The 2-permutations of S are:
ab, ac, ad , bc, bd , cd , ba, ca, da, cb, db and dc .
And the 3-combinations of S are: {a, b, c},{a, b, d},{a, c, d} and {b, c, d}
Note: We remind you that r-combinations with out repetition are just
subsets of the set S consisting r of the n objects of S.
Some remarks will help clarify these definitions. Note that we are
simply defining the terms r-permutation and r-combinations here and
have not mentioned any thing about the rules governing the selection of
the r-objects. On one extreme, objects could be chosen where all

16
repetition is forbidden, or on the other extreme , each object may be
chosen up to r times , or then again there may be some rule of selection
between these extremes ; for instance , the rule that would allow a given
object to be repeated up to a certain specified numbers of times.
We will use expression like {3.a,2.b,2.c} to indicate that we have 3
objects a, b, c where selections are constrained by the conditions that
a can be selected at most three times, b can be selected at most twice,
and c can be chosen up to five times. The numbers 3, 2, and 5 in this
example will be called repetition numbers.
Example: 1.4.3
Find the 3-combinations and the 3- permutations of the set
{3.a,2.b,2.c}
Solution:
The 3-combinations of {3.a,2.b,2.c} are:
aaa, aab, aac, abb, abc, ccc, ccb, cca, and cbb .

And the 3-pemutation of {3.a,2.b,5.c} are:


aaa, aab, aba, baa, aac, aca, caa, abb bab, bba, abc, acb, bac, bca, cab, cba, ccc

ccb, cbc, bcc, cca, cac, acc, cbb, bcb , bbc and bbc
In order to include the case where there is no limit on the number of
times an object can be repeated in a selection we use the symbol „  ’ as a
repetition number to mean that an object can occur an infinite number of
times. If the repetition numbers are all  , the selections of r objects are
called r-combinations with unlimited repetition and arrangements of the
r objects are called r-permutations with unlimited repetition.

17
If the repetition numbers are all 1, the selections of r objects are
called r-combinations with out repetition and arrangements of the r
objects are called r-permutations with out repetition.
If the repetition numbers are different from 1 and  the selections of r
objects are called r-combinations with constrained repetition and
arrangements of the r objects are called r-permutations with constrained
repetition.
Example1.4.4:
Find the 2-combinations and the 2- Permutations of the set
.a, .b, .c, .d .
Solution:
The 2-combinations of the set .a, .b, .c, .d  are:
aa, ab, ac, ad , bb, bc, bd , cc, cd , dd and, the 2-permutations with unlimited

repetitions are: aa, ab, ba, ac, ca, ad , da, bb, bc, cb, bd , db, cc, cd , dc, dd .
Since in 2-combinations, 2 is the limit on the number of objects to be
chosen.
Activity: 1.5
1. List all 5-combinations of
.a, .b, .c, .d  , where b is chosen an even number of times .
2. List all the 3-permutations of .a, .b, .c, .d .
3. List all 3-combinations and 4-combinations of
a) a, b, c, d , e
b) .a, .b,1.c,1.d .

18
1.4.1 Enumeration of combinations and permutations
Now we will present general formulas for enumerating
combinations and permutations (i.e.the number of r-permutations and r-
combinations of n distinct objects). At this time, we only list formulas
for combination and permutations without repetition and with unlimited
repetitions. We will wait until later to use generating functions to give
general techniques for enumerating combinations where other rules
govern the selections.
1.4.1.1Enumeration of combinations and permutations
without repetition
First let us drive a formula to find the number of r-permutation and r-
combination with out repetition.
Theorem: 1.4.1.1 (Enumerating r-permutation with out repetition)
Let P(n, r ) denote the number of r-permutations of a set S consisting of n
n!
elements. Then P(n, r )  n(n  1)...(n  r  1) 
(n  r )!
Proof:
Let E1, E2,…, Er be events filling the first, second,….., and the rth
positions of an r-permutations. Since there are n distinct, objects,E1 can
happen in n ways, E2 can happen in n  1 ways (since no repetitions are
allowed and there are n  1 objects left to choose from ) and following
in the same way E3 can happen in n  2 ways …,and finally Er can
happen in n-(r-1) = n-r+1ways. Thus by applying the product rule
principle, we conclude that P(n, r )  n(n  1).(n  2)....(n  r  1) .

19
Now for a non negative integer n, let us define n! (read as n factorial)
by n! n(n  1)(n  2)...2.1 (the product of all integers from 1 to n), with
the convention 0! 1
Thus from the definition of factorials, it follows that
n!
P(n, r ) = . (Verify it)
(n  r )!
For n ≥ 0, we define P(n,0) to be 1, and this agrees with the formula
where r = 0.
n!
The number of permutations of n elements is given by P(n, n)   n!
0!
Example: 1.4.1.1.2
1. The number of 4-letter “words” that can be formed by using each of
the letters a, b, c, d ,e at most once is given by
5! 5!
P(5,4)    5!  120 , and the number of 5-letter words is
(5  4)! 1!

5! 5!
given by P(5,5)    5!  120
(5  5)! 0!

2. In how many ways can 7 women and 3 men be arranged in a row if


the 3-men must always stand next to each other?
Solution:
There are 3! ways of arranging the 3 men.
Since the 3 men always stand next to each other, we treat them as a
single entity and we can denote by x.
If w1, w2… w7 represents the women, we are interested in the number
of ways of arranging {x, w1, w2,…, w7}.
There are 8! permutations of these 8 objects. Thus applying the
product rule principle, there are 3!.8! permutations altogether. Hence

20
there are 3!.8! 93,600 different ways of arrangements in which the 3
men stand next to each other.
Activity: 1.6
1. What is the numbers of ways to order the 26 letters of the alphabet
so that no two of the vowels a, e, i, o, and u occur consecutively?
2. In how many ways can the letters of the English alphabet be
arranged so that there are exactly 5 letters between the
letters a and b ?
3. How many seven-digit numbers with out repetitions of digits are
there such that the digits are all non-zero and 5 and 6 do not
appear consecutively in either order?

The permutations that we have been considering for the objects are
being arranged in a line are called linear permutations.
If we arrange objects in a circle, then the number of permutations
decreases. Such permutations are called circular permutations.
Theorem: 1.4.1.1.4
The number of circular r-permutations of a set of n elements is given
p(n, r ) n!
by  .In particular, the number of circular
r r (n  r )!
permutation of n element is (n  1)!
Proof:
Here, in the circular permutations the r objects are not assigned to a
particular place but are only arranged relative to one another. In this
case the set of linear r-permutations can be partitioned in to parts in
such a way that two linear r-permutations correspond to the same

21
circular r-permutations if and only if they in the same part. In other
words, two circular permutations can be regarded as the same if one
is brought to other by a rotation (or, circular shift) ,for example in the
3-permutation of the a, b, c, d  set the arrangements abc, bca, cab are
considered as the same arrangement in a circular arrangements. Thus,
the number of circular r-permutations equals the number of parts
which is obtained by dividing the number of linear r-permutations by
the number of elements of in each part. Since each part contains
r linear r-linear permutations, the numbers circular r-permutations of

parts is given by
p(n, r ) n!
 ,
r r (n  r )!
And the number of circular n-permutations of n elements is
p(n, n) n! n! n!
 .   (n  1)! . Thus, n objects arrange
n n(n  n)! n.0! n

themselves in circle in (n  1)! ways.


This completes the proof.
Example: 1.4.1.1.5
In how many ways can 5 children arrange themselves in a circle?
Solution:
Clearly by the above theorem, the number of circular of permutations
of the 5 children equal to (5  1)! 4! 24.
Example: 1.4.1.1.6
Ten people, including two who do not wish to sit next to one another,
are to be seated at a round table. How many circular seating
arrangements are there?

22
Solution:
To solve this problem, let the 10 people be, P1 , P2 ,..., P10 where, P1 and P2
are the two who do not wish to sit together. Consider seating
arrangements for 9 people X , P3 , P4 ,..., P10 at a round table. There are
(9  1)! 8! such arrangements. If we replace X by either P1 , P2 or by P2 , P1

in each of these arrangements, we obtain 2.(8!) seating arrangements for


the 10 people in which P1 and P2 are next to another. Hence, applying
the indirect counting principle, the number of such arrangement in
which P1 and P2 is not together is 9!2.8! 7.(8!) .
Activity: 1.7
1. In how many ways can six men and six women be seated at a round
table if the men and women are to sit in alternate seats?
2. In how many can 15 people be seated at around if B refuses to sit
next to A? What if B only refuses to sit on A‟s right?
Theorem: 1.4.1.1.8 (Enumerating r-combination with out repetition)
Let C (n, r ) be denote the number of r-combinations of n elements with
p(n, r ) n!
out repetitions. Then C (n, r )   .
r! r!(n  r )!
Proof:
Any r-permutations of n objects with out repetitions can be obtained by
first choosing the r elements and arranging the r elements in all possible
ways.
Let E1 and E2 be events of choosing r elements and arranging the r
elements, respectively. Then E1 can happen in C (n, r) ways and E2 can
happen in r! ways. Thus by the product rule principle it follows that
P(n, r )  C (n, r ).r!

23
P(n, r ) n!
 C (n, r )  , but P(n, r ) 
r! (n  r )!

n!
Hence, C (n, r ) 
(n  r )!.r!
This completes the proof.
Example: 1.4.1.1.9
In how many ways can a committee of 5 chosen from 9 people?
Solution:
Each committee is essentially a 5-combination of 9 people. Thus we can
choose a committee of 5 in C (9, 5) =126 ways.
Example: 1.4.1.1.10
There are 21 consonants and 5 vowels in the English alphabet. Consider
only 8-letter words with 3 different vowels and 5 different consonants.
How many such words can be formed?
Solution:
To solve this problem, there are three tasks to be performed. The first
task choosing the 3 vowels and this can be done in C (5,3) ways, and
the second task is choosing the 5 consonants and this can be done in
C (21,5) ways, and the third task is arranging the 8 letters and this task

is done in 8! ways. Hence applying the product rule principle, there


are C (5,3) . C (21,5) . 8! such words.
Example: 1.4.1.1.11
How many 10-digit binary numbers are there with exactly six 1‟s?
Solution:
The key problem to this problem is that we can specify a binary by
choosing the subset of 6 positions where the 1‟s go (or the subset of
4 positions for the 0‟s). Thus, there are C(10,6)  C(10,4)  210

24
Note: if S is a set with n elements, C (n, r) is the number of subsets of S
with exactly r elements.
Activity: 1.8
1. In how many ways can a committee of 5 teachers and 4 students be
chosen from 9 teachers and 15 students?
2. In how many ways can a team of 5 chosen from 10 players so as to
a) include both the strongest and the weakest?
b) include both the strongest but exclude the weakest?
c) exclude both the strongest and the weakest?
3. A collection of 100 light bulbs contain 8 defective ones. In how
many ways can the sample of 10 bulbs be selected so that either the
sample contains 6 good ones and 4 defective ones or 5 good ones and
5 defective ones?
4. How many bit strings of length 10 have at least three ones?
5. how many 9-letters words can be formed that contain 3, 4, or 5
vowels,
a) Allowing repetition of letters?
b) Not allowing repetition?

1.4.1.2 Enumeration of combinations and permutations


with repetition
Now let us turn our attentions to counting permutations and
combinations with unlimited repetitions.

25
Theorem: 1.4.1.2.1 (enumerating r-permutations with unlimited
repetitions)
Let U (n, r) denote the number of r- permutations of n objects with
unlimited repetitions. Then U (n, r )  n
r

Proof:
Since repetitions are allowed each of the r positions can be filled in n
ways. Hence by the product rule
U (n, r )  n.n.....n (r factors )

 nr
This completes the proof.
Example: 1.4.1.2.2
Find the number 3-permutition of the set .a, .b, .c, .d 
Solution:
The number 3-permutition of the set .a, .b, .c, .d is equal to the
number of 3- permutation of 4 objects with unlimited repetition,
hence this is equal to U (4,3)  43  64
Example: 1.4.1.2.3.
There are 25 true or false questions on an examination. How many
different ways can a student do the examinations if it is forbidden to
leave the answer blank?
Solution:
This problem is the same as finding the number of 25-permutations of
the set S  {.T , .F} . Hence by the theorem 1.4.1.2.1 there are
U (2,25)  225 different ways can a student do the examination.

26
Activity: 1.9
1. A multiple- choice questions test contains 10 questions. There are four
possible answers for each question.
a) How many ways can a student answer the questions on the test
if every question is answered?
b) How many ways can a student answer the questions on the test
if the student can leave answers blank?
3. How many binary sequences are there of length 15?
4. What is the number of ternary numerals with at most 4 digits?
5. How many strings of length n can be formed from the English
alphabet?
Theorem: 1.4.1.2.5(enumerating r-combinations with unlimited
repetitions)
Let V (n, r) denote the number of r-combinations of n objects with
(n  1  r )!
unlimited repetitions. Then V (n, r )  C (n  1  r , r )  .
r!(n  1)!
Proof:
Let the n distinct objects are: a1 , a2 ,..., an so that the selections is

made from the set S  {.a1, .a2 ,..., an } .


Now any r-combinations will be of the form
{x1.a1, x2 .a2 ,..., xn .an } where x1 , x2 ,..., xn are the repetitions number,

each x i is nonnegative ; and x1  x2  ...  xn  r.


Hence V (n, r) = the number of non-negative integral solutions to the
equation x1  x2  ...  xn  r.
=the numbers of ways of distributing r similar balls
into n numbered boxes.

27
= the number of binary numbers with n-1 one‟s and
r zero‟s.
= C (n  1  r , r )
This completes the proof.
Remark: the number of r-combinations of S  {.a1, .a2 ,..., an} is the

same as the number of r-combinations of {r.a1 , r.a2 ,..., r.an } , since


each object is chosen up at most r times.
The following examples will clarify the conclusions of theorem.
Example: 1.4.1.2.6
a) The number of 4-combinations of S  {.a1, .a2 ,..., a5} is
equal to
C (5-1+4, 4) =C (8, 4) =70.
b) The number of 3-combinations of 5 objects with unlimited
repetitions is equal to C(5-1+3,3)=C(7,4)=35.
c) The number of non-negative integral solutions to the equations
x1  x2  x3  x4  x5  50 is C (5-1+50, 50) =C (54, 50)

=316,251.
d) The number of ways of placing 10 similar balls in 6 numbered
boxes is C (6-1+10, 10) =C (15, 10) =3,003.
e) The number of binary numbers with ten 1‟s and five zeros is C
(10+5, 5) =C (15, 5) =3,003, since n-1=10 and r=5.
Example: 1.4.1.2.7
How many different out comes are possible from tossing 10 similar
coins?

Solution:

28
This problem is the same as placing 10 similar balls in to 2 numbered
boxes labeled ” heads” and “tails”. There fore, there are
C (2-1+10, 10) =C (11, 10) =11posiblities.
Example: 1.4.1.2.8
How many different outcomes are possible from tossing 10 similar
dice?
Solution:
This problem is the same as placing 10 similar balls in to 6 numbered
boxes. Therefore there are C (6-1+10, 10) =C (15, 10) =3,003posiblities.
Example: 1.4.1.2.9
What is the number of non-negative integral solutions to the equation
x1  x2  x3  x4  20 in which x1  3, x2  1, x3  0, x4  5

Solution:
Here we introduce the new variables
y1  x1  3, y2  x2  1, y3  x3 , y4  x4  5

And our equations becomes


y1  y2  y3  y4  ( x1  3)  ( x2  1)  x3  ( x4  5)

 ( x1  x2  x3  x4 )  (3  1  0  5)

 20  9

 11
Hence the number of non-integral solutions of the equation
x1  x2  x3  x4  20 in which x1  3, x2  1, x3  0, x4  5 is equal to the

number of non-integral solutions of the


equation y1  y2  y3  y4  11 where yi  0 . Hence this is equal to C (4-
1+11, 11) =C (14, 11) =364.
Activity: 1.10

29
1. Prove that
i) The number of integral solutions of x1  x2  ...  xn  r
where each xi  0 is equal to C(r-1, n-1).

ii) The number of integral solutions of x1  x2  ...  xn  r

where x1  r1 , x2  r2 ,..., and xn  rn is given


n
by C (n  1  r  ( ri ), n  1) .
i 1

2 Enumerate (count) the number of non-negative integral solutions to

the inequality x1  x2  x3  x4  x5  4
3 find the number of integral solution to x1  x2  x3  x4  50 where
x1  4, x2  7, x3  14, x4  10

4 A teacher wishes to give an examination with 10 questions. In how


many ways can the test be given an examination a total of 30 points
if each questions is to be worth 2or more points?
5 Suppose that a cookie shop has four different kinds of cookies. How
many ways can six cookies be chosen?
6 How many outcomes are obtained from rolling n indistinguishable
dice?

Theorem: 1.4.1.2.11. (Enumerating n-permutations with constrained


repetitions)
Let S  {q1.a1, q2 .a2 ,..., qt .at } where n  q1  q2  ....  qt .
The number of n-permutations of S denoted by, P(n ; q1, q2 ,...., qt ) , is given
n!
by P(n ; q1, q2 ,...., qt )  .
q1!q2!.....qt !

Proof:

30
We are given that there are t distinct objects with repetitions
q1, q2 ,...., qt , respectively , for a total of

n  q1  q2  ....  qt objects.
We can think of it in this way. There are n places, and we want to put
exactly one of the objects of S in each of the places. We first decide
which places are to be occupied by the a1 ‟s. since there are q1 a1 ‟s in S;

we must choose a subset of q1 places. We can do this in C (n, q1 ) ways.


We next decide which are to be occupied the a 2 ‟s. There are n  q1 places
left, and we must choose q2 of them .this can be done in C (n- q1 , q2 )

ways. We next find that there are C (n- q1  q2 , q3 ) ways to choose the
places for the a3 ‟s. We continue like this, and applying the product rule
of principle, we have
P(n : q1 , q2 ,..., qt )  C (n, q1 ).C (n  q1 , q2 ).C (n  q1  q2 , q3 )

....C (n  q1  q2  ...  qt  1, qt )

n! (n  q1 )! (n  q1  q 2 )!
 . .
q1!(n  q1 )! q 2 !(n  q1  q 2 )! q3 !(n  q1  q 2  q3 )!

(n  q1  q 2  ...  qt 1 )!
....
qt !(n  q1  q 2  ...  qt )!

n!

q1!.q 2 !...qt !
This proves the result.
Note: P(n : q1 , q2 ,..., qt ) is the same as the number of ways to distribute n

distinguishable objects into t distinguishable boxes so that q i objects are


placed into box i, i  1,2,...., t
Example: 1.4.1.2.12

31
The number of permutations of the letters in the word MISSIPPI is equal
to the number of 11-permutition of the set {1.M ,4.I ,4.S ,2.P} . Hence this
11!
is equal to P(11 : 1,4,4,2)  .
1!4!4!2!
Example: 1.4.1.2.13
A store has 25 flags to hang along the front of the store to celebrate a
special occasion. If there are 10 red flags, 5 white flags, 4 yellow flags,
and 6 blue flags, how many distinguishable ways can the flags be
displayed?
Solution:
The problem is the same as finding the 25-permutition of the set
{10.R,5.W ,4.Y ,6.B} where R, W, Y and B represent the red, white, yellow,

and blue flags, respectively.


25!
Hence there are P(25 : 10,5,4,6)  different ways of displaying
10!.5!.4!.6!
these flags.
Activity: 1.11
1. In how many ways can 3 boys share 15 different sized apples, if the
youngest gets 7 apples and the other two boys get 4 each?
2. How many ways are there to arrange the letters of the word
MATHEMATICS?
3. A student has three mangos, two papayas, and two kiwi fruits. If the
student eats one piece of fruit each day, and only the type of fruit
matters. In how many different ways can these fruits be consumed?

1.5 The principle of inclusion-exclusion

32
In this section we drive and apply an important counting formula
called the inclusions-exclusions principle. Recall that the sum rule
principle gives a simple formula for counting the number of objects in a
union of sets, provided that the sets do not overlap . The inclusions-
exclusions principle gives a formula in which the sets are free to overlap
with out restrictions. First we state and prove the inclusion-exclusion
principle for two sets and three states and finally we sate the general
statement of the principle of inclusion-exclusion with out proof.
Objectives:
After this lesson the students will be able to:
 State inclusion- exclusion principle for two sets and three sets.
 State the general statement of the inclusion- exclusion
principles.
 Solve counting problems using this principle.
 Define derangements of the set {1, 2,…, n}.
 Use inclusion- exclusion principle to find the number of
integral solutions of a given equation.
 Apply the principle of inclusion-exclusion principle to find the
number of derangements.
 Apply principle of inclusion-exclusion principle to find the
number of prime numbers not exceeding a specified positive
integer.

33
Result 1.5.1 (The inclusions-exclusions principle for two sets)
The statement of Inclusions-exclusions principle for two sets states that
if A and B are finite subsets of some universe set U,
then A  B  A  B  A  B .
Proof : Consider the following Venn diagram given bellow
Since in counting the elements of A and the elements of
B we have counted the elements of A  B twice .But it is clear that

A  B is the union of the 3 disjoint sets A  B' , A  B and A'B , so by

the sum rule principle we have A  B  A  B'  A  B  A'B ….(1)


And since ( A  B' )  ( A  B )  A and B  ( A  B)  ( A'B), again applying
sum rule principle we see that
A  A  B'  A  B and B  A  B  A'B

The sum of these two equations gives


A  B  A  B'  A  B  A'B  A  B …(2)

 A  B  A  B by (1)

 A  B  A  B  A  B . This completes the proof.

Note: if A  B   , then A  B  0 and A  B  A  B . Thus this is just

the sum rule principle for two sets.


Result: 1.5.2 (The inclusions-exclusions principle for three sets)
The statement of Inclusions-exclusions principle for three sets states
that if A1 , A2 and A3 are finite subsets of some universe set U , then
A1  A2  A3  A1  A2  A3  A1  A2  A1  A3

 A2  A3  A1  A2  A3

34
Proof: Consider the following Venn diagram given bellow
Since in counting the elements of A1 , A2 and A3 we have counted the
elements of A1  A2  A3 three times.
But it is clear that A1  A2  A3 is the union of the seven disjoint sets
namely A'1  A2  A3 , A1  A' 2  A3 , A1  A2  A'3 , A'1  A' 2  A3 , A'1  A2  A'3
A1  A' 2  A'3 and A1  A2  A3 so by the sum rule principle,

A1  A2  A3  A'1  A2  A3  A1  A' 2  A3  A1  A2  A'3  A'1  A' 2  A3

 A1  A' 2  A'3  A'1  A2  A'3  A1  A2  A3 … (1)

And we observe that


A1  ( A1  A' 2  A'3 )  ( A1  A' 2  A3 )  ( A1  A2  A'3 )  ( A1  A2  A3 )

A2  ( A'1  A2  A'3 )  ( A'1  A2  A3 )  ( A1  A2  A'3 )  ( A1  A2  A3 )

A3  ( A'1  A' 2  A3 )  ( A1  A' 2  A3 )  ( A'1  A2  A3 )  ( A1  A2  A3 )

Thus since these are disjoint unions we can use the sum rule principle to
compute
A1  A1  A' 2  A'3  A1  A' 2  A3  A1  A2  A'3  A1  A2  A3

A2  A'1  A2  A'3  A'1  A2  A3  A1  A2  A'3  A1  A2  A3

A3  A'1  A' 2  A3  A'1  A2  A3  A1  A' 2  A3  A1  A2  A3

Adding all these equation, we have


A1  A2  A3  A1  A' 2  A'3  A1  A2  A'3  A1  A' 2  A3

 A1  A2  A3  A'1  A2  A'3  A'1  A2  A3

 A'1  A' 2  A3  A1  A2  A'3  A1  A2  A3

 A1  A' 2  A3  A1  A2  A3  A'1  A2  A3

A1  A2  A3  A1  A2  A3  A1  A2  A'3  A1  A2  A3

35
 A1  A' 2  A3  A1  A2  A3  A'1  A2  A3

Since the first 7 of these sets make up A1  A2  A3


And clearly, we have
A1  A2  A'3  A1  A2  A3  A1  A2 ,

A1  A' 2  A3  A1  A2  A3  A1  A3 , and

A'1  A2  A3  A2  A3  A1  A2  A3 , thus we have

A1  A2  A3  A1  A2  A3  A1  A2  A1  A3  A2  A3  A1  A2  A3

By rearranging the terms, we get


A1  A2  A3  A1  A2  A3  A1  A2  A1  A3  A2  A3  A1  A2  A3

This completes the proof.


Example: 1.5.3
Suppose that 200 faculty members can speak French and 50 can speak
Russian, while only 20 can speak both French and Russian .How many
faculty members can speak either French or Russian?
Solution:
Let F and R be the set of faculty members who speak French and
Russian, respectively.
Now we are given that, F  200 , R  50 and F  R  20 and we are asked to

compute to compute F  R .

Thus F  R  F  R  F  R
=200+50 -20
=230
Activity: 1.12
1. if there are 200 faculty members that speak French , 50 that speak
Russian , 100 that speak Spanish , 20 that speak French and Russian ,

36
60 that speak French and Spanish 35 that speak Russian and
Spanish, while only 10 speak French , Russian , and Spanish ,how
many speak either French or Russian or Spanish?
2. An advertising agency has 1,000 clients. Suppose that T is the set of
clients that use television advertising, R is the set of clients that use
radio advertising, and N is the set of clients who use newspaper
advertising. Suppose that T  415, R  350, N  280 , 100 clients use
all 3 types of advertising, 175 use television and radio, 180 use radio
and newspaper, and 165 use television and newspaper.
a) Find T  R  N ' .
b) How many clients use radio and news paper advertising but
not television?
c) How many clients use television but do not use radio
advertising and do not use news paper advertising?
d) Find T 'R'N '

Theorem: 1.5.5 (General statement of the principle of inclusion-


exclusion).
If Ai are finite subsets of a universal set U, then
n
A1  A2  ...  An   Ai   Ai  Aj 
i 1 i, j

 A A
i , j ,k
i j  Ak

 ... 
 1n1 A1  A2  ....  An

37
where, the second summations is taken over all 2-combinatons {1,2} of
the integers {1,2,…,n}, the third summations is taken over all 3-
combinations {i, j, k} of {1,2,…,n}, and so on .
for n = 4 there are C(4,1)+C(4,2)+ C(4,3)+C(4,4)=4+6+4+1=15 terms
and the theorem for n=4 states that
A1  A2  A3  A4  A1  A2  A3  A4  A1  A2  A1  A3

 A1  A4  A2  A3  A2  A4  A3  A4

 A1  A2  A3  A1  A2  A4  A1  A3  A4 

 A2  A3  A4  A1  A2  A3  A4

And in general for arbitrary n number of finite sets there are


C(n,1)+C(n,2)+ C(n,3)+…+C(n, n)= 2n  1 terms on the right-hand side of
equation.
Corollary: 1.5.6
if A1' , A2' ,..., An' be the complements of the sets A1 , A2 ,..., An , respectively
n
then, A1 ' A2 '...  An '  U   Ai   Ai  A j   Ai  A j  Ak
i 1 i, j i , j ,k

 ...   1 A1  A2  ....  An
n

Proof:
A1 ' A2 '...  An '  ( A1  A2  ....  An )'

 U  A1  A2  ...  An
n
 U  [  Ai   Ai  A j   Ai  A j  Ak
i 1 i, j i , j ,k

 ...   1
n 1
A1  A2  ....  An ]
n
 U   Ai   Ai  A j   Ai  A j  Ak
i 1 i, j i , j ,k

38
 ...  (1) 1
n 1
A1  A2  ....  An
n
 U   Ai   Ai  A j   Ai  A j  Ak
i 1 i, j i , j ,k

 ...   1 A1  A2  ....  An
n

This completes the proof.


Example: 1.5.7
Find the number of integers between 1 and 1000, inclusive that are not
divisible by 5, 6, and 8.
Solution:
Now let U be the set of integers between 1 and 1000 inclusive and
A1 , A2 and A3 be the set of elements of U divisible by 5, 6, and 8,
respectively. We wish to find the number of integers in A'1  A' 2  A'3 .
We first see that
A1  1000 5  200  200 , A2  1000 6  166.7  166 ,

A3  1000 8  125  125

Integers in the set A1  A2 are divisible by both 5 and 6. But an integer is


divisible both 5 and 6 if and only if it is divisible by LCM (5, 6). Since
LCM(5,6)=30 , LCM(5,8)=40, and LCM(6,8)=24, we see that
A1  A2  1000 30  33.33  33 , A1  A3  1000 40  25  25 ,

A2  A3  1000 24  41..67  41. Because LCM (5,6,8)=120, we

conclude that A1  A2  A3  1000 120  8.33  8 . Thus the number of


integers between 1 and 1000 that are not divisible by 5, 6, and 8 equals
A'1  A' 2  A'3  U  A1  A2  A3

 U  A1  A2  A3  A1  A2  A1  A3

 A2  A3  A1  A2  A3

39
 100  (200  166  125)  (33  25  41)  8
 600
Activity: 1.13
Find the number of integers between 1 and 100 inclusive that are not
divisible by 2 and 3.

Let us give some more examples which use the principle of inclusion-
exclusion principle
Example: 1.5.9
In how many ways can the letters {5.a, 4b, 3.c} be arranged so that all
the letters of the same kind are not in a single block?
Solution:
Let U be the set of all permutations of these letters.
12!
Hence, U 
5!4!3!
And let A1 be the arrangements of the letters where the 5 a‟s are in a
8!
single block, A1  ,
1!4!3!
A2 be the arrangements where the 4b‟s are in a single block,
9!
A2  ,
5!1!3!

and A3 the arrangements where the 3 c‟s are in one block. Then
10!
A3  ,
5!4!1!
A1  A2 is the set of arrangements of the letters where 5 a‟s and 4b‟s are

5!
in a single block. Hence A1  A2  ,
1!1!3!

40
A1  A3 is the set of arrangements of the letters where 5 a‟s and 3 c‟s

5!
are in a single block. Hence A1  A3  , A2  A3 is the set of
1!4!1!
arrangements of the letters where 4 b‟s and 3 c‟s are in a single block.
5!
Hence A2  A3  , and moreover A1  A2  A3 is the set of
5!1!1!
arrangements of the letters where 5 a‟s, 4 b‟s and 3 c‟s are in a single
3!
block thus, A1  A2  A3  ,
1!1!1!
Thus
A'1  A' 2  A'3  U  A1  A2  A3  A!  A2  A1  A3  A2  A3

 A1  A2  A3

12! 8! 9! 10! 5! 5!
=     
5!4!3! 1!4!3! 5!1!3! 5!4!1! 1!1!3! 1!4!1!

Activity: 1.14. In how many ways can the letters {4.a, 3b, 2.c} be
arranged so that all the letters of the same kind are not in a single block?

1.5.1 Application of Inclusion-exclusion principle


Many counting problems can be solved using the principle of
inclusion-exclusion. For instance, we can use to find the number of
integral solutions of an equation with constraints, to find the numbers of
primes less than a positive integer, to find the number of permutation of
a set of n-elements in which no element is in its specified location.
1.5.1.2 Number of integral solution

41
The principle of the inclusion-exclusion principle can be used
n
together with the formula C (n  1  r  ( ri ), n  1) to find the number of
i 1

integral solution of the equation


x1  x2  ...  xn  r , where x1  r1 , x2  r2 ,..., and xn  rn we count the

number of integral solutions of an equation x1  x2  ...  xn  r where for


each i , the solutions xi are bounded above and below by integer bi and ci .
Let us give an example.
Example: 1.5.1.2.1
Count the number of integral solution to the equation
x1  x2  x3  20 , where 2  x1  5, 4  x2  7, and  2  x3  9 … (1)

Solution:
Let U be the set of solutions ( x1 , x2 , x3 ) of the equation x1  x2  x3  20
where x1  2, x2  4, x3  2 . Thus
U  C (3  1  20  (2  4  (2)),3  1)  C (18,2)

Let A1  {( x1, x2 , x3 ) U : x1  6} , A2  {( x1 , x2 , x3 )  U : x2  8} and


A3  {( x1 , x2 , x3 )  U : x3  10}

We wish to count the number of elements in A'1  A' 2  A'3 .


Now A1 is the set of solutions of equation (1) where
x1  6, x2  4, x3  2

Thus, A1  C (3  1  20  (6  4  2),3  1)  C (14,2)


Similarly, A2 is a set of solutions of equation(1) where
x1  2, x2  8, x3  2 therefore, A2  C (3  1  20  (2  8  2),3  1)  C (14,2)

Like wise A3 is a set of solutions of equation (1) where


x1  2, x2  4, x3  10 therefore, A3  C (3  1  20  (2  4  10),3  1)  C (6,2)

42
Now A1  A2 is a set of solutions of equation (1) where
x1  2, x2  8, x3  2 therefore,

A1  A2  C (3  1  20  (6  8  2),3  1)  C (10,2)

Again A1  A3 is a set of solutions of equation (1) where


x1  6, x2  4, x3  10 therefore,

A1  A3  C (3  1  20  (6  4  10),3  1)  C (2,2)

And A2  A3 is a set of solutions of equation (1)


where x1  2, x2  8, x3  10 .This implies
A2  A3  C (3  1  20  (2  8  10),3  1)  C (2,2) .

Moreover A1  A2  A3 is a set of solutions of equation (1)


where x1  6, x2  8, x3  10 .This implies A1  A2  A3  0 , since there is no

solution which satisfies the equation x1  x2  x3  20 with the


condition x1  6, x2  8, x3  10 , this is because 6  8  10 exceed 20
By the corollary of the principle of inclusions-exclusions, we have
A'1  A' 2  A'3  ( A1  A2  A3 )'

 U  A1  A2  A3

 U  A1  A2  A3  A1  A2  A1  A3

 A2  A3  A1  A2  A3

 C(18,2)  2C(14,2)  C(6,3)  C(10,2)  2C(2,2)

Activity: 1.14
1. How many integral solution are there of x1  x2  x3  11
where 0  x1  3,  0  x2  4, 0  x3  6 ?
2. How many integral solution are there of x1  x2  x3  20 ,
where 1  x1  6, 1  x2  7, 1  x3  8 and 1  x4  9 ?

43
1.5.1.3The sieve Eratosthenes
A method developed by the Greek mathematician Eratosthenes who
lived in Alexandria in the third century B.C. gives a way of listing all
primes between 1 and n. his procedure is the following: remove all
multiples of 2 other than 2. Keep the first remaining integers exceeding
2, namely, the prime 3. Remove all the multiples of 3 except 3. Keep the
first remaining integers exceeding 3, namely, the prime 5. Remove all
the multiples of 5 except 5, and so on. The retained all numbers are the
primes. This method is called the “the sieve of Eratosthenes.”
The principle of inclusion-exclusion can be used to find the numbers
of primes not exceeding a specified positive integer. Recall that a
composite integer is divisible by a prime not exceeding its square root.
Example: 1.5.1.3.1
Find the numbers of primes not exceeding 100.
Solution:
First note that composite integer not exceeding 100 must have a prime
factor not exceeding 10. Because the only primes less than 10 are 2, 3, 5,
and 7, the primes not exceeding 100 are those 4 primes and those
positive integers greater than 1 and not exceeding 100 that are divisible
by none of 2, 3, 5, or 7.
To apply the principle of inclusion-exclusion let U  {x  Z : 1  x  100} .
Let A1 , A2 , A3 , and A4 be the set of elements of U divisible by 2, 3, 5, and
7, respectively. We wish to compute A'1  A' 2  A'3  A' 4 .

We know that
A'1  A' 2  A'3  A' 4  U  A1  A2  A3  A4  A!  A2  A1  A3 

 A1  A4  A2  A3  A2  A4  A3  A4

44
 A1  A2  A3  A1  A2  A4  A1  A3  A4

 A2  A3  A4  A1  A2  A3  A4

100  100  100  100  100  100 


 99       
 2   3   5   7   6   14 

100  100  100  100  100  100 


     
 15   21   35   30   42   70 
100   100 
 
105   210 
 99  50  33  20  14  16  10  7  6  4  2  3  1  0  0
 21
Hence there 4  21  25 prime numbers not exceeding 100.
Hence there are 21 prime letters between 1 and 100. These are: 2, 3, 5,
7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79,
83, 89, and 97.

1.5.1.4 Derangements
The principle of inclusion-exclusion will be used to count the
permutation of n objects that leave no objects in their original position.
Consider the following examples:
1. At a party, 10 gentlemen check their hats. In how many ways can
their hats be returned so that no gentleman gets the hat which he
arrived?
2. In how many ways can the letters M, A, D, I, S, O, N be written
down so that the “word” spelled disagree completely with the
spelling of the word MADISON in the sense that no letters occupies
the same position as it does in the word MADISON?
Each of these questions is an instance of the following general problem.

45
We are given a set X with n elements in which each element has a
specified location, and we are asked to find the number of permutation
of the set X in which no element is in its specified location. In the first
question, the set X is the set of 10 hats, and the specified location of a
hat is (the head of) the gentleman to which it belongs. In the second
question X = {M, A, D, I, S, O, N}, and the location of a letter is that
specified by the word MADISON.
Since the actual nature of the objects is irreverent, we may take X to be
the set {1, 2, 3, …, n} in which the location of each of the integers is
that specified by its natural position in the sequence 1, 2, 3, …, n
Among the permutations of {1, 2, 3…, n} there are some, called
derangements, in which none of the n integers appears in its natural
position.
Definition: 1.5.1.4.1
A derangement of {1, 2, 3…, n} is a permutation i1i2 ...in of the set
{1, 2, 3…, n} such that i1  1, i2  2..., in  n .
For example, the permutation 2 1 4 5 3 is a derangement of the set
{1, 2, 3, 4, 5} since 2  1, 1  2, 4  3, 5  4, 3  6
Let Dn the number of derangements of {1, 2, 3, …, n}. As illustrations
we note there are no derangements for n=1.
The only derangements for n=2 is 2 1.
For n=3 there are two derangements, namely 2 3 1 and 3 1 2.
The derangements for n=4 are as follows:
2143 3142 4123
2341 3412 4312
2 4 13 3421 4321

46
Thus, we have D1 =0, D2  1 D3  2 and D4  9
Theorem: 1.5.1.4.2
The number of derangements of a set with n elements is
1 1 1 1
Dn  n!(1     ....  (1) n ) , for n  1
1! 2! 3! n!
Proof:
To prove this theorem we apply the principle of inclusion-exclusion
Let U be the set of all permutations of {1, 2, 3…, n} then U  n!

For each i , let Ai be the set of permutations of the form b1b2 b3 ...bn of {1,
2, 3… n} such that bi  i .
Then the set of derangements is precisely the set A1 ' A2 '...  An ' .
Thus, Dn  A1 ' A2 '...  An ' .
The permutations in A1 are all of the form 1b2 b3 ... bn where b2 b3 ... bn is a
permutation of {2, 3…, n}.
Thus A1  (n  1)! , and more generally we have Ai  (n  1)!. The
permutations in A1  A2 are of the form 1 2 b3 b4 ... bn where b3 b4 ... bn is a
permutations of {3, 4…, n}.
Therefore, A1  A2  (n  2)! and more generally we have

Ai  A j  (n  2)! for any 2-combinations {i, j} of {1, 2, 3…, n}.

For any integer k with 1  k  n the permutations in A1  A2  ...  Ak are

of the form 1 2 3....kbk 1 bk 2 ... bn where bk 1 bk 2 ... bn is a permutations of


{k+1, k+2 …, n} consequently A1  A2  ...  Ak  (n  k )! ; more

generally, Ai  Ai  ...  Ai  (n  k )!for any k-combinations


1 2 k

{ i1 , i2 ,..., ik } of {1, 2, 3…, n}.

47
Since there are C (n, k) k-combinations of {1, 2, 3,…, n}, applying the
inclusions-exclusions principle we have
Dn  A'1  A' 2 ...  A' n

 U  A1  A2  ... An
n
 U   Ai   Ai  A j   Ai  A j  Ak  ...
i 1 i, j i , j ,k

 ...  (1) n A1  A2  ... An

 n!C(n,1)(n  1)!C(n,2)(n  2)!C(n,3)(n  3)!

 ....  (1) n C (n, n)(n  n)!


n! n! n!
 n! (n  1)! (n  2)! (n  3)!
(n  1)!1! (n  2)!2! (n  3)!3!
n!
 ....  (1) n (n  n)!
(n  n)!n!

n! n! n! n!
 n!    ....  (1) n )
1! 2! 3! n!

1 1 1 1
 n!(1     ....  (1) n )
1! 2! 3! n!
1 1 1 1
Thus, Dn  n!(1     ....  (1) n )
1! 2! 3! n!
This proves the result.
1 1 1 1 1
In particular, D5  5!(1      ) =44
1! 2! 3! 4! 5!
Example: 1.15
Let n books be distributed to n students. Suppose that the books are
returned and distributed to students again later on. In how many ways
can the books be distributed so that no student will get the same book
twice?
Solutions:

48
The first time the books are distributed n! ways, the second time Dn ways.
Hence by product rule principle the total number of ways is given by
1 1 1 1
n!.Dn  (n!) 2 [1     ....  (1) n ] .
1! 2! 3! n!
Activity: 1.5
1. How many ways can the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 are
arranged so that no even digit is in its original position?
2. Find D3 .
3. At a party there are n men and n women. In how many ways can
the n women choose partners for the first dance? How many ways
are there for the second dance if every one has to change partners?
4. prove that Dn  nDn1  (1) n for n  2.

5. find the number of permutations of the integers 1 to 10 inclusive

that do not have 1 in the first place, nor 4 in the forth place, nor 7
in the seventh place.

1.6 The pigeonhole principle


We consider in this section an important, but elementary,
combinatorial principle that can be used to solve a variety of
interesting problems, often with surprising conclusions. This
principle is known as pigeonhole principle. It is one of the most
widely used tools for proving that a certain kind of arrangement or
patterns exists.

49
Objectives:
After this lesson the students will be able to:
 State the pigeonhole principle in different form.
 Apply this principle to solve a variety of interesting problems.
 Prove some results using pigeonhole principle.
1.6.1 The pigeonhole principle: simple form
The simplest form of the pigeonhole states that: If you put n+1
pigeons are put into n pigeonholes, then there is at least one pigeonhole
which contains two or more pigeons.
Proof:
Let n+1 pigeons are put into n pigeonholes.
Claim: there exists at least one pigeon hole which contains two or
more pigeons.
Suppose not i.e. each pigeonholes are contains at most 1 pigeon. This
implies that the n pigeonholes contain at most n pigeons. But this
contradicts the hypothesis. Hence, this proves the claim.
This principle can be applied to many problems where we want to
show that a given situations can occur.

Example: 1.6.1.1
1. Among any group of 367 people, there must be at least two with
the same birthday, because there are only 366possible birthdays.
2. In any group 27 English words, there must be at least two that
begin with the same letter, since there are 26 letters in the English
alphabet.

50
3. How many students must be in a class to guarantee that at least
two students receive the same score on the final exam, if the exam
is graded on a scale from 0 to 100 points?
Solution:
There are 101 possible scores on the final. The pigeonhole principle
shows that among any 101+1=102 students there must be at least 2
students with the same score.
The simplest form of pigeonhole is generalized as follows:
If k.n+1 pigeons are put into n pigeonholes then there exists at least
one pigeonhole which contains k  1 or more pigeons. This is called
generalized simple form Pigeonhole principle.
Example: 1.6.1.2
Find the minimum number of students in a class to be sure that three
of them are born in the same month.
Solution:
Here the n=12 months are the pigeonholes and k  1  3 , or k=2.
Hence, by the generalized simple form pigeonhole principle, among
any k.n  1 =2(12) +1=25 students (pigeons), there of them are born
in the same month.

Example:
During a month with 30 days a base ball team plays at least 1 game a
day, but no more than 45 games. Show that there must be a period of
some number of consecutive days during which the team must play
exactly 14 games.
Solution:

51
Let a i be the number of games played at the end of the ith day. Since
at least 1 game is played each day, at most 45 games, we
have 1  a1  a2  ...  a30  45 . Also adding 14 to each of these
inequalities gives a1  14  a2  14  ...  a30  14  30  45  59
Now consider the following numbers:
a1 , a2 ,..., a30 , a1  14, a2  14,..., a30  14 . These are 60 numbers, each

between 1 and 59. By the pigeonhole principle, two of these numbers


are equal. Since a1 , a2 ,..., a30 are all different and
a1  14, a2  14,..., a30  14 are all different, there exists i and j (i  j ) so

that ai  a j  14 . Thus there are 14 games between days i and j .


Activity: 1.16
1. Suppose a laundry bag contains many red, white, and blue socks.
Find the minimum number of socks that one needs to choose in
order to get two pairs (four socks) of the same color.
2. A child watches TV at least one hour each day for seven weeks
but never more than 11 hours in any week. Prove that there is
some period of consecutive days during in which the child
watches exactly 20 hours of TV. (It is assumed that the child
watches TV for a whole number of hours each day.)
3. Use the pigeonhole principle to show that one of any n
consecutive integer is divisible by n.

1.6.2 The pigeonhole principle: the averaging form


The averaging form of the pigeonhole principle states that: If A is the
average number of pigeons per hole, then some pigeonhole contains at
least A pigeons and some pigeonhole contains at most A pigeons.

52
Proof:
Let n is the number of pigeonholes and mi is the number of pigeons in

hole. We want prove that either m1  A or m2  A …, or mn  A .


th
the i

(The proof is similar for some mi  A .) Let us assume the contrary, that

is, m1  A and m2  A …, and mn  A . Now the sum


m1 + m2 +…+ mn  n. A  the total number of pigeons. This clearly is a

contradiction since m1 + m2 +…+ mn also equals to the total number of


pigeons. Hence, this proves the result.

Now the number of pigeons in a pigeonhole is necessarily an integer but


the average A need not be an integer. Let us use notations (called the
ceiling of A)  A to mean the smallest integer x  A and  A (called the
floor of A) to mean the largest integer x  A . Thus, 9.7  10 and 9.7  9 .
In this terminology, the averaging form of the pigeonhole principle can
be stated: If A is the average number of pigeons per hole, then some
pigeonhole contains at least  A pigeons and some pigeonhole contains
at most  A pigeons.

Example: 1.6.2.1
In a group of 61 people, show that at least 6 people were born in the
same month.
Solution:
Here the problem is the same as distributing 61pigeons among 12
pigeonholes. Hence by the second versions of the averaging form

53
pigeonhole principle there are at least    5.08  6 people who were
61
12 
born in the same month.
Example: 1.6.2.2
Prove the generalized simple form of the pigeonhole principle using the
averaging form of the pigeonhole principle.
Solution:
Recall that the generalized form of the pigeonhole principle states that
“if k.n  1 pigeons are put into n pigeonholes then there exists at least one
pigeonhole which contains k  1 pigeons”. Let A is the average number
of pigeons per hole, then by second version of the averaging form of the
pigeonhole principle, there exists at least one pigeonhole which contains
 k .n  1  1
A     k    k  1 . Hence this completes the proof.
 n   n

54
Activity: 1.17
1. If 401 letters were delivered to 50 apartments, then show that
some apartment received at most 8 letters.
2. If x1 , x2 , x3 ,...., x8 are the 8 distinct integers, then show that there is
some pair of some integers with the same remainder when divided
by 7.
1.6.3 Pigeonhole principle: strong form
Theorem: 1.6.3.1
Let m1, m2,…,mk be positive integers. If m1+m2+…+mn –n+1 objects are
put into n boxes , then either the first box contains at least m1 objects , or
the second box contains at least m2 objects , …, or the nth box contains at
least m n objects.
Proof:
Let m1+m2+…+mn –n+1 objects are put into n boxes.
Claim: for some i= 1, 2, … ,n the ith box contains at least mi objects.
Suppose the contrary, i.e. for all i the ith box contains at most mi -1 balls
i.e. the first box contains at most m1-1 objects , the second box contains
at most m2 -1 objects ,…, and the nth box contains at most
mi -1 objects. This implies all the n boxes contain at most m1 -1+m2 -
1+…+mn -1= m1+ m2+…+ mn- n objects. Which contradicts the
hypothesis m1+m2+…+mn –n+1 objects are put into n boxes. Hence this
proves the strong form of the pigeonhole principle is valid, i.e., the ith
box contains at least mi objects for some i=1, 2, …, n.
Note:
The simple forms of the pigeonhole principle is obtained from the strong
form by taking m1=m2=…=mn=2. That is, if m1+m2+…, mn –n+1=2n-

55
n+1=n+1 pigeons are put on n pigeon holes there exists one pigeonhole
which contains at least mi  2 pigeons.
Example: 1.6.3.2
If 41 balls are chosen from a collection of red , white , blue, green, and
yellow colored balls, show that there are at least 12 red balls, 15 white
balls, 4 blue balls,10green balls , or 4 yellow balls chosen.
Solution:
Let x1, x2, x3, x4, x5 represent, respectively, the number of red, white,
green, and yellow balls chosen. Thus, x1+x2+x3+x4+x5=41.
Claim: x1  12 x2  15, x3  4, x4  10, or x5  4.
Suppose, on the contrary, that is x1  11 x2  14, x3  3, x4  9, and x5  3.
Then
41=x1+x2+x3+x4+x5  11+14+3+9+3=40. Thus, we have arrived at the
contradiction 41  40 , hence the claim.
Alternative method
Let m1 =12, m2=15, m3=4, m4=10 and m5=4.
Since,
m1+ m2+ m3+ m4+…+ m5 – 5+1=12+15+4+10+4 - 5+1=41.
Then by strong form of the pigeonhole principle, there are at least 12 red
balls, 15 white balls, 4 blue balls,10green balls , or 4 yellow balls
chosen.
Example: 1.6.3.3
A basket of fruit is being arranged out of apples, bananas, and oranges.
What is the smallest number of piece of fruit that should be put in the
basket in order to guarantee that either there are at least 8 apples or at
least 6 bananas or at least 9 oranges?

56
Solution:
By a strong form of the pigeonhole principle, 8+6+9-3+1=21 pieces of
fruit, no matter how selected, will guarantee a basket of fruit with the
desired properties.
Activity: 1.18
Suppose that every student in mathematics class of 25 students is a
freshman, a sophomore, or a junior.
a) Show that there are at least 9 freshman, at least 9 sophomore, or at
least 9 juniors in the class.
b) Show that there are at least 3 freshman, at least 19 sophomore, or at
least 5 juniors in the class.

1.7 The binomial and multinomial theorems


In this section we will present some basic identities involving
binomial coefficients and the proof of binomial theorem and multinomial
theorem. The number C (n.r ) is called a binomial coefficient and
n!
P(n : q1 , q 2 ,..., qt )  is called multinomial coefficients. The
q1!.q 2 !....qt !

name binomial coefficient and multinomial coefficients is used because


these numbers occur as coefficients in the expansion of powers of

binomial expressions such as x  y  and ( x1  x2  ...  xt ) n .


n

The symbol C (n.r ) has two meanings: the combinatorial and the
factorial. In other words, C (n.r ) represents the number of ways of
choosing r objects from n distinct objects (the combinatorial meaning)
n!
and, as well, C (n.r ) equals (the factorial or algebraic meaning).
r!(n  r )!

There fore as a general rule, all the theorems and identities about

57
factorials and binomial coefficients can be viewed as two kinds of
statements for which two kinds of proof can be given – a combinatorial
proof and an algebraic proof.
Objectives:
After these lessons the students will be able to:
 Prove some basic identities involving binomial coefficients using
combinatorial proof and algebraic proof.
 Prove the binomial theorem and multinomial theorem.
 Use these theorems to expand and to determine the coefficient of
the terms of an expression.
1.7.1 Some basic combinatorial identities involving binomial
coefficients
1. Representation of binomial coefficients by factorials.
For every pair of integer n and r where 0  r  n ,
n!
C (n, r )  This identity was proved in theorem 1.4.1.1.8
r!(n  r )!
chapter one.
2. Symmetry property
C (n, r )  C (n, n  r )

Proof:
Using combinatorial proof:
When we choose r objects from n objects there are n-r objects left.
These n-r objects can be considered as an (n-r)-combination.
Hence to every r-combinations automatically there is an associated (n-r)-
combination and conversely. In other words there are precisely the same
number of r-combinations as (n-r)-combinations. Hence,
C (n, r )  C (n, n  r ) .

58
Using algebraic proof:
n!
We know that C (n, r )  ,
r!(n  r )!
n!
and C (n, n  r ) 
(n  (n  r ))!(n  r )!

n!

r!(n  r )!
= C (n, r ) , which completes the proof.
3. Newton’s identity:
For integers, 0  k  r  n , C(n, r ) C(r, k )  C(n, k ) C(n  k , r  k ) .
Proof:
Using combinatorial proof
The left-hand side counts the number of ways of selecting two
sets: first a set A of r objects and then from A, a set B of k objects.
For example, we may be counting the number of ways to select a
committee of r people and then select a subset of k leaders from this
committee. On the other hand, the right hand side counts the number
of ways we could select the group of k leaders from the n people first,
and then select the remaining r - k people for the committee from the
remaining n – k people. And these two ways of counting are the
same, hence C(n, r ) C(r, k )  C(n, k ) C(n  k , r  k )
Using algebraic proof
Let us start from the right hand side of the equation, thus
n! (n  k )!
C (n, k ) C (n  k , r  k )  .
k!(n  k )! (r  k )!(n  k  (r  k ))!

59
n! (n  k )!
 .
k!(n  k )! (r  k )!(n  r )!
n! 1
 .
k! (r  k )!(n  r )!

n! 1
 .
(n  r )! (r  k )!

1 r! r!

n!
. . ,since 1
(n  r )! (r  k )! r! r!
n! r!
 .
(n  r )!r! (r  k )!

 C (n, r ) C (r, k ) . This completes the proof.


A special case of Newton‟s identity are:
i) C(n, r ) r  n C(n  1, r  1)
n
ii) C (n  1, r  1)  C (n, r )
r
iii) C(n, r  1)( r  1)  (n  r ) C(n, r )
nr
iv) C (n, r  1)  C (n, r ) .for 1  r  1  n , it is directly follows
r 1
Proof (i) Now C(n, r ) r  C(n, r ).C(r,1) since r  C (r,1)
 C (n,1).C (n  1, r  1) , by the Newton‟s identity

and letting k  1 . This completes the proof


Proof (ii) it is directly follows from part (i).
Proof (iii) Hint. replaces r and k in the Newton‟ identity
by r+1 and 1, respectively.
Proof (iv) it is directly follows from part (iii)

60
Sir Isaac Newton (1646-1727) discovered the importance of this
identity: it shows how to compute C (n, r  1) from C (n, r ) . That is by ii)
n
above C (n, r  1)  C (n, r )
r 1
4. Pascal’s Identity
For all integers n and r with 1  r  n  1 ,
C (n, r )  C (n  1, r )  C(n  1, r  1)

Proof:
Using algebraic proof
n!
We know that C (n, r )  and
r!(n  r )!

(n  1)! (n  1)!
C (n  1, r )  C (n  1, r  1)  
(n  r  1)!r! (n  r )!(r  1)!
(n  r )(n  1)!  r (n  1)!

(n  r )!r!
(n  r  r )(n  1)!

(n  r )!r!

n(n  1)!

(n  r )!r!
n!

(n  r )!r!
 C (n, r )

This is the factorial proof of this identity.


Using combinatorial proof
Let S be a set of n elements.
Let us distinguish one of the elements of S and denote it by y .
Let X be the set of all r-combinations of S .
Now the set X can be partitioned in to parts, A and B .

61
In A we put all those r-combinations which do not contain y . In B
we put all the r-combinations which contain y .

Clearly X  C (n, r ) A and B are disjoint; hence, by the sum rule of


principle, we have
C (n, r )  A  B . But the r-combinations in A are exactly the

r-combinations of the set S  {y} of n – 1 elements; thus,


A  C (n  1, r ) and the r-combinations in B is obtained by adjoining

the element y to a (r-1)-combinations of S  {y} .


Thus, B  C (n  1, r  1) .
Combining these facts, we obtain C (n, r )  C (n  1, r ) + C (n  1, r  1)
Hence this completes the proof.
To illustrate the proof,
Let n=5, r=3, and S= { y , a, b, c, d}. Then the 3-combinations of the
set {a, b, c, d} are:
{a, b, c},{a, b, d}, {a, c, d}, {b, c, d}.
The 3-combinations of S which contains y are:
{ y , a, b}, { y , a, c}, { y , a, d}, { y , b, c,} { y , b, d}
{ y ,c, d}.
Upon deletion of the element y in these 3-combinations, we obtain
{a, b}, {a, c}, {a, d}, {b, c,}, {b, d} { c, d},
which is the 2-combination of {a, b, c, d}.
Thus, C(5,3)  10  4  C(4,3)  C(4,2)

62
By using the relation C (n, r )  C (n  1, r ) + C (n  1, r  1) and the initial
C (n,0)  1 and C (n, n)  1 , ( n  0) , we can build successive rows in the

table of binomial coefficients, called Pascal’ triangle.


The nth row in the triangle consists of the binomial
coefficients C (n, r ) , k  0,1,2,..., n .
Row number
n=0 C (0,0)

n=1 C (1,0) C (1,1)

n=2 C (2,0) C (2,1) C (2,2)

n=3 C (3,0) C (3,1) C (3,2) C (3,3)

n=4 C (4,0) C (4,1) C (4,2) C (4,3) C (4,4)

n=5 C (5,0) C (5,1) C (5,2) C (5,3) C (5,4) C (5,5) .

n=0 1
n=1 1 1
n=2 1 2 1
n=3 1 3 3 1
n=4 1 4 6 4 1
n=5 1 5 10 10 5 1.
Figure Pascal‟s triangle
Pascal‟s identity shows that when two adjacent binomial
coefficients in this triangle are added, the binomial coefficient in the
next row between these coefficients is produced.
The binomial coefficients enjoy many other identities besides
Pascal‟s identity.

63
5. Diagonal summation
C(n,0)  C(n  1,1)  C(n  2,2)  ....  C(n  r, r )  C(n  r  1, r )

Proof:
Let us give a combinatorial proof by counting the numbers of ways to
distribute r similar balls into n+2 numbered boxes. This can be done
in  C (n  2  1  r, r )  C (n  r  1, r ) ways. But the balls may also be
distributed as follows: for each 0  k  r , distribute k in the first n+ 1
box, and then the remainder in the last box. This can be done in

 
r r
k 0
C (n  k , k ) ways. Hence, k 0
C (n  k , k )  C (n  r  1, r ) . This

completes the proof.


An alternate proof can be done by repeated application of Pascal‟s
identity. In this proof we start with
C(n  r  1, r )  C(n  r, r )  C(n  r, r  1) and then decompose

C (n  r , r  1) into C (n  r  1, r  1)  C (n  r  1, r  2) . This gives

C(n  r  1, r )  C(n  r, r )  C(n  r  1, r  1)  C(n  r  1, r  2) . Again

decompose the last term by Pascal‟s identity and combine to get


C(n  r  1, r )  C(n  r, r )  C(n  r  1, r  1)  C(n  r  2, r  2)  C(n  r  2, r  3)
this process can be continued until the last term is C (n,0)
Hence, C(n  r  1, r )  C(n,0)  C(n  1,1)  C(n  2,2)  ....  C(n  r, r )


r
That is k 0
C (n  k , k )  C (n  r  1, r ) . This completes the proof.

5. Row Summation.
n
Let n be a positive integers. Then,,  C (n, r )  2 .
n

r 0

Proof:
Let S be a set with n elements. Let X is a set of all subsets of S.

64
X  2 n . The set X consists of subsets of S with zero elements,

one element, two elements, …, n elements .we know that ,there


are C (n,0) subsets with 0 elements , C (n,1) subsets with 1 element ,
C (n,2) subsets with 2 elements , …., C (n, n) subsets with n

elements . Therefore, applying the sum rule principle, we have,


X  C (n,0)  C (n,1)  ....  C (n, n) .

 2 n  C (n,0)  C (n,1)  ....  C (n, n) .


n
Thus this proves the result,  C (n, r )  2
r 0
n

6. Column Summation
C(r, r )  C(r  1, r )  ....  C(n, r )  C(n  1, r  1)

for any positive integer n  r .


Proof: let us give combinatorial proof by counting the number of
nonnegative integral solution of the inequality
x1  x2  ....  xr 1  n  r , that is by counting the number of ways
of distributing either 0, or 1, or 2,..., or n  r of these balls into the
r  1boxes.

Again this is equal to the number of nonnegative integral solutions to


the equations x1  x2  ....  xr 1  k where k  0,1,2,...., n  r , thus the
number of nonnegative integral solution of the inequality
x1  x2  ....  xr 1  n  r is equal to
C (r, r )  C (r  1, r )  ....  C (n, r ) . But there is also an alternate way to

approach the problem. If k is some integers between 0 and n  r , then


for every distribution of k balls into r  1 boxes, one could distribute the

65
remaining n  r  k into a (r  2) box. Hence the number of
th

nonnegative integral solution of the inequality


x1  x2  ....  xr 1  n  r is the same as the number of
nonnegative integral solution of the equations
y1  y2  ...  yr 1  yr 2  n  r . (Note we have one more variable, y r  2 ).

Hence there are C(r  2  1  n  r, r  2  1)  C(n  1, r  1) such solutions.


Thus , C(r, r )  C(r  1, r )  ....  C(n, r )  C(n  1, r  1)
This completes the proof.
Example:
Using the binomial coefficient identities show that
n(n  1)
1  2  3  ....  n  .
n
Solution: Note that k  C (k ,1) ,
1  2  3  ....  n  C(1,1)  C(2,1)  C(3,1)  ...  C(n,1)

 C (n  1,1  1) … by column summation identity

 C (n  1,2)

n(n  1)

2
Example: 1.7.1.1
Evaluate the sum 12  2 2  32  ....  n 2 .
Solution:
Here we observe that k 2  k (k  1)  k  2C(k ,2)  C(k ,1) for k  1,2,3,..., n
Hence 12  2 2  32  ....  n 2  [2C(1,2)  C(1,1)]  [2C(2,2)  C(2,1)]
 [2C(3,2)  C(3,1)]  ....  [2C(n,2)  C(n,1)]

 2[C (1,2)  C (2,2)  C (3,2)  ....  C (n,2)] 

 [C (1,1)  C (2,1)  C (3,1)  ....  C (n,1)]

66
 2C (n  1,2  1)  C (n  1,1  1) by column summation identity

 2C (n  1,3)  C (n  1,2)

n(n  1)(2n  1)
 (verify it)
6
Activity: 1.19
1. a) Show that k 3  k (k  1)(k  2)  3k 2  2k  C(k ,1)  6C(k ,2)  6C(k ,3) .
b) Evaluate 13  23  33  ....  n 3 .
c) Using the fact that k 4  k (k  1)(k  2)(k  3)  6k 2  11k 2  6k , derive
a formula for k 4 like (a) in terms of binomial coefficients.
2. Use the binomial identities to evaluate the sum
1.2.3  2.3.4  ...  (n  2)(n  1)(n).

1.7.2 The binomial theorem


Theorem: 1.7.2.1 (The binomial theorem)
Let n be a positive integer. Then, for all x and y
( x  y) n  C (n,0) x n  C (n,1) x n1 y  C (n,2) x n2 y 2  ...  C (n, n) y n
n
=  C (n, r ) x nr y n
r 0

First proof: (Using combinatorial proof)


Write ( x  y) n as the product ( x  y) ( x  y) … ( x  y) of n factors.
Then expand this product until no parentheses remain. Since the
nr r
terms in the product are of the form x y for some r  0,1,..., n ,
and the collection of all terms with the same exponents on
x and y determines the coefficients in the expansion ( x  y) n , we
need to count the number of terms of the form x nr y r . Note that to
obtain such term it is necessary to choose n  r x' s from the n
sums (so that the other r terms in the product are y' s ). This can be

67
done in C(n, n  r )  C(n, r ) ways. Therefore, the coefficient of the
term x nr y r is C(n, n  r )  C(n, r ) . This proves the theorem.
Second proof :( using algebraic proof)
The proof is by induction on n. It‟s more cumbersome and helps one
appreciate the combinatorial viewpoint given in the first proof.
If n  1, the formula becomes
1
( x  y)1 =  C (1, r ) x1r y r  C (1,0) x y  C (1,1) x y  x  y , and this is clearly true.
1 0 0 1

r 0

We now assume that the formula is true for a positive integer n, that
n
is, ( x  y) n =  C (n, r ) x nr y r and we want prove that it is true when n is
r 0

replaced by n  1 . We write ( x  y)
n 1
 ( x  y) ( x  y) n , and by the
inductive hypothesis this becomes
n
( x  y) n1  ( x  y)  C (n, r ) x
r 0
nr
yr

 C (n, r ) x
n
 x ( C (n, r ) x nr nr
y )  y(
r
yr )
r 0 r 0

n n
=  C (n, r ) x n1r y r +  C (n, r ) x nr
y r 1
r 0 r 0

n n 1
= C (n,0) x n1   C (n, r ) x n1r y r +  C (n, r ) x nr
y r 1  C (n, n) y n1
r 1 r 0

If we set r  k  1 in the third term above,


n 1 n

 C (n, r ) x nr y r 1 
r 0
 C (n, k  1) x
k 1
n 1 k
y k . Now the letter of the dummy

variable is immaterial so now replace k by r and this becomes


n

 C (n, r  1) x
r 1
n 1 r
y r and

68
n
( x  y) n1  x n1   C (n, r ) x n1r y r +
n

r 1
 C (n, r  1) x
r 1
n 1 r
y r  y n 1

n
 x n 1   C (n, r )  C (n, r  1)x n1r y r + y
n 1

r 1

n
x n 1
  C (n  1, r ) x n 1r y r  y n1 (Since by Pascal‟s identity
r 1

C (n, r )  C(n, r  1)  C (n  1, r ) )

Since C(n,0)  C(n, n)  1, we may write this last equation and obtain
n 1
( x  y) n1   C (n  1, r ) x
r 0
n 1 r
yr

Hence the formula is true for n  1 and the binomial theorem holds by
mathematical induction.
Example: 1.7.2.2
Expand ( x  y) 8 .
Solution:
( x  y) 8  C (8,0) x 8  C (8,1) x 7 y  C (8,2) x 6 y 2  C (8,3) x 5 y 3  C (8,4) x 4 y 4

 C (8,5) x 3 y 5  C (8,6) x 2 y 8  C (8,7) x. y 7  C (8,8) y 8

 x 8  8x 7 y  28x 6 y 2  56 x 5 y 3  70 x 4 y 4

 56 x 3 y 5  28x 2 y 8  8xy 7  y 8

Corollary: 1.7.2.3
n
Let n be a positive integer. Then for all x, (1  x) n =  C (n, r ) x
r 0
r

Proof:
By the binomial theorem we have
n n
(1  x) n =  C (n, r )(1)
r 0
nr
xr =  C (n, r ) x
r 0
r
. This completes the proof.

69
Activity: 1.20
1. Expand (2a  5b) 8 .
2. Find the coefficient of x 3 y 7 in (2 x  9 y)10
n
3. Prove (1  x) n   C (n, r )(1) r x r
r 0

4. Prove the following identities using the binomial theorem


n
i) C(n,0)  C(n,1)  ....  C(n, n) =  C (n, r )  2 n
r 0

ii) C(n,0)  C(n,1)  C(n,2)  C(n,3)  ....  (1) n C(n, n)  0


n
iii) (3) n   C (n, r )2 r
r 0

1.7.3 The Multinomial theorem


The binomial theorem gives a formula for ( x  y) n for each positive
integer. It can be generalized to give a formula for ( x  y  z) n or more

generally for the nth power of the sum of ( x1  x2  ...  xt ) n . In this


theorem the role of binomial coefficients is replaced by the
n!
numbers P(n : q1 , q 2 ,..., qt )  where q1 , q2 ,..., qt are none
q1!.q 2 !....qt !

negative integers with q1  q2  ...  qt  n


Before stating the general theorem, we first consider a special case. Let
x1 , x2 , x3 be real numbers. If we completely multiply out ( x1  x2  x3 ) 3 and

collect like terms, we obtain


x1  x2  x3  3x1 x2 + 3x1 x2  3x1 x3  3x1 x3  3x2 x3  3x 2 x3 + 6 x1 x2 x3 .
3 3 3 2 2 2 2 2 2

The terms that appear in the preceding sum are all the terms of the
q q q
form x1 1 .x2 2 .xt 3 ,where q1 , q2 , q3 are non-negative integers

70
with q1  q2  q3  3 . The coefficient of x1 q .x2 q .x3 q in this expression
1 2 3

3!
equals P(3 : q1 , q2 , q3 )  . More generally, we have the following
q1!.q 2 !.q3 !

multinomial theorem:
Theorem1.7.3.1 (The Multinomial Theorem)
Let n be a positive integer. Then for all x1 , x2 ,..., xt we have

( x1  x2  ...  xt ) n   P(n : q1 ,..., qt ) x1 1 x 2 2 ...xt t where the summation


q q q

extends over all non-negative integral solutions of q1  q2  ...  qt  n .


Proof:
q q q
The coefficient of x1 1 .x2 2 ...xt t is the number of ways of arranging the
n letters {q1 . x1 , q2 . x2 , ..., qt . xt } , there fore, it is P(n : q1 , q2 ,..., qt ) .
The number of different terms that occur in the multinomial
expansions of ( x1  x2  ...  xt ) n equals the number of non-negative
integral solutions of q1  q2  ...  qt  n . Hence there are C (n+ t-1, n)
numbers of different terms.
Example: 1.7.3.2
When ( x1  x2  x3  x4  x5 ) 7 is expanded, the coefficient of x1 2 x3 x4 3 x5
7!
equals P(7 : 2,0,1,3,1)   420. And contains C (7+5-1, 7) = C
2!.0!.1!.3!.1!
(13, 7) =1716 terms if multiplied out completely.
Example: 1.7.3.3
When (2 x1  3x2  5x3 ) 6 is expanded, the coefficient of x13 x2 x3 3 equals
6!
P(6 : 3,1,3).23 (3)(5)  2 3 (3)(5)  -36,000.
3!.1!.3!

71
Activity: 1.21
1. Find the coefficient of x13 x22 x32 x53 in ( x1  x2  x3  x4  x5 )10
2. Determine the coefficient of x 5 y10 z 5 w5 in ( x  7 y  3z  w) 25 .
3. Determine the number of terms in the expansion ( x  7 y  3z  w) 25 .

72
Chapter 2:
Elementary probability theory
2.1 Introduction
The probability theory is a mathematical modeling of the
phenomena of chance or randomness. Such phenomena are
characterized by the fact that their future behavior is not predictable
in a deterministic fashion.
The theory of probability originated from the game of chance and
gambling. The study of probability dates back to the 17th century and
the work of two mathematicians Blaise Pascal (1623-1662) and Pierre
de Fermat (1601-1665).
Objectives:
After these lessons the students will be able to:
 define probability and some terminologies on probability
 find the probability of an event
 proves theorems on probability
 define conditional probability and independent events
 explain Bernoulli trials and the binomial distribution
 define random variables and expectations
Sample Space and events
In our every day life we very often deal with the situations whose out
come can not forecast. We call such situations random experiments.
Random experiment
Random experiment is an experiment which can be repeated any number
of times under the same conditions, but does not give unique results i.e.
for each trial the result will not be known in advance.

73
Example: 2.2.1
If we toss a coin it is impossible to forecast whether the head will come
up or tail. Thus tossing a coin is a random experiment.
Sample space
The set S of all possible outcomes of a given random experiment is
called a sample space. Every element of the sample space S is called a
sample point.
Example: 2.2.2
When a coin is tossed, there are two sample points Head (H) and Tail
(T). Then the sample space is S= {H, T} and S  2 .
Example: 2.2.3
An urn contains 4 balls of different colors. The colors are red, yellow,
black and white. Two balls are simultaneously taken out of the urn.
describe the sample space of this experiment.
Solution:
The sample space is S= {RY, RB, RW, YB, YW, BW} where R, Y, B
and W stand for red, yellow, black and white colors respectively.
Activity: 2.1
1. A coin is tossed twice. If the second throw results in tail a die is
thrown. Describe the sample space for this experiment.
2. A random experiment has m outcomes a1, a2,…, am and another has n
out comes b1, b2,... ,bn. Describe the sample space when both the
experiment carried out .
Events
Any subset of sample space S is called an event.

74
Note:
The entire sample space S and the empty set  are events since they
are subsets of S.  is sometimes is called the impossible event.
Since an event is a set, we can combine events to form new events
using the various set operations.
i) A  B is the event that occurs if and only if A occurs or B occurs
(or both).
ii) A  B is the event that occurs if and only if A occurs and B
occurs.
iii) A' , the complement of A, is the event that occurs if and only if A
does not occur.
Two events A and B are called mutually exclusive if they are disjoint,
i.e., if A  B   . In other words, A and B are mutually exclusive if and
only if the can not occur simultaneously.

Example 2.2.4
1. When we toss a coin, either head or tail can be up, but both can
not be up at a time, hence the outcome of getting a head (H) and
tail (T) are mutually exclusive events.
2. When we throw a die the outcome of getting 1, 2, 3,…, 6 are
mutually exclusive events.
The probability of an event
In this section, we will restrict our selves to experiment that have finitely
many, equally likely outcomes.

75
2.3.1 Definitions of probability

Mathematically definitions of probability


The probability of an event E, which is a subset of a finite sample space
E
S of equally outcomes, is denoted by P(E ) is defined as P( E ) 
S

Example: 2.3.1
If at least one child in a family of three children is a boy, what is the
probability that all three are boys?
Solution:
The sample space is S= {BBB, BBG, BGB, GBB, GGB, GBG, BGG}
where B represents a boy and G represents a girl.
Hence S  7 and since E is the event that all the three are boys, E  1 .
E 1
There fore P( E )  P( BBB )   .
S 7

Activity: 2.2
In tossing 3 coins at a time, find the probability of getting
a) at most one head
b) at least one head
c) exactly 2 heads.
Statistical or empirical definitions of probability
m
If in n trials, an event E happen m times, then P( E )  lim
n
( ) i.e. the
n
limit of the number of times E occurs divided by the number of times
the experiment is performed.

76
Axiomatic definitions of probability
Let S be a sample space. Let  be the collections of all subsets of S.
Then the functions P :   [0,1] is called a probability functions if
i) P( E)  0 for all E  

ii) P(S)=1
 
iii) P( Ei )   P( Ei ) whenever, E1 , E 2 ,… are disjoint events which is
i 1 i 1

to say that Ei  E j   whenever i  j .

Theorems on probabilities
Theorem 2.3.3
Prove the probability of an impossible event is zero, i.e. P( )  0
Proof:
Impossible event contains no sample point. The sample space S and
the impossible event  are mutually exclusive events.
Thus, S    S
 P(S   )  P(S )

 P(S )  P( )  P(S )  P( )  0 . This completes the proof.

Theorem: 2.3.4
The probability of the complement event A' of A is P( A' )  1  P( A)
Proof
Clearly A and A' are disjoint events. Thus P( A  A' )  P( A)  P( A' )
Now A  A'  S  P( A  A' )  P(S )
 P( A)  P( A' )  1 since, P(S )  1

 P( A' )  1  P( A)

This completes the proof.

77
Activity: 2.3
1. Prove that for any two events A and B
i) P( A'  B)  P( B)  ( A  B)
ii) If B  A , then
a) P( A  B' )  P( A)  ( B)
b) P( B)  P( A)
iii) P( A  B)  P( A) & P( A  B)  P( B)
2.3.6 Additions theorem of probability
If A and B are any two events, then P( A  B)  P( A)  P( B)  P( A  B)
Proof:
Consider the following Venn diagram given bellow
Clearly A and A'  B are disjoint sets and their unions is A  B
Now A  B  A  ( A'  B)
 P( A'  B)  P( B)  P( A  B) ….(1)

Putting in (1): P( A  B)  P( A)  P( B)  P( A  B) Hence, this completes


the proof.
Example: 2.3.7
A card is taken from a pack of cards. Find the probability that it is
either spade or an ace.
Solution:
Let A and B denote the events of drawing a spade card and an ace
13 4 1
card, respectively, so that P( A)  , P( B)  , P( A  B)  .
52 52 52
Therefore the probability that the card drawn is either a spade or an
ace is given by P( A  B)  P( A)  P( B)  P( A  B)
13 4 1 4
   
52 52 52 13

78
2.4 Conditional Probability
Definition: 2.4.1
If A and B be events in a sample space S with P( B)  0 . The
conditional probability of A given B denoted by P( A \ B) and
P( A  B)
defined as P( A \ B)  , in other words, it is the probability of
P( B)

the occurrence of A when the event B has already happened.


Example: 2.4.2
A die is thrown twice. If A is the event in which 1 occurs on the first
throw, B is the event of getting a sum of less than 4 then
find, P( A \ B) .
Solution:
The event A  {(1,1), (1,2), (1,3), (1,4), (1,5), (1,6)} , the condition is imposed
on A that 1 must be in the first throw whatever the second place.
The event B is such that sum of the digits in each pair must be less
than 4 hence B  {(1,1), (1,2), (2,1)}.
Since A  B  {(1,1), (1,2)} , we see that P( A  B)  2 36 and P( B)  3 36 .
P( A  B) 2 36 2
Hence, P( A \ B)    .
P( B) 3 36 3

Example: 2.4.3
A box contains 4 bad and 6 good tubes. Two are drawn out from the
box at a time. One is tested and found to be good. What is the
probability that the other one is also good?
Solution:
Let A be the event that one tube is good and B be the event that the
other tube is good.

79
C (6,2) 1
Now P( A  B)  P(both tubes are good )   and P( A)  6 10  3 5
C (10,2) 3

P( A  B) 1 3 5
thus, P( B \ A)   
P( A) 35 9

Activity: 2.4
1. An unbiased coin is tossed twice. If A is the event: both head or
tail have occurred and B is the event: at most one tail is observed,
find P(A) , P(B) , P( A \ B) and P( B \ A) .
2. If P( A)  1 3 , P( B)  3 4 , P( A  B)  11 12 , then find P( A \ B) and
P( B \ A) .

3. Find P( B \ A) if: a) A is a subset of B ; b) A and B are mutually


exclusive. (Assume P( A)  0 )
4. What is the conditional probability that exactly four heads appear
when a fair coin is tossed five times, given that the first outcome
is a head?
Multiplication law of probability
If A and B are events in a sample space S with P( B)  0 then by
P( A  B)
definition of conditional probability, P( A \ B) 
P( B)

P( A  B)
This implies P( A  B)  P( B) . P( A \ B) and P( B \ A)  , with
P( A)

P( A)  0 gives P( A  B)  P( A) . P( B \ A)

Where P( A \ B) represents the conditional probability of A given B and


P( B \ A) represents the conditional probability of B given A .

The multiplication law of probability gives us a formula for the


probability that events A and B both occur. It can easily be extended to

three or more events A1 , A2 , ... , An ; that is,

80
P( A1  A2 , ... , An )  P( A1 ) . P( A2 \ A1 ) . P( A3 \ A1  A2 ).....P( An \ A1  A2  ....  An )
Example: 2.4.5
An urn contains ten balls of which 3 are black and 7 white. The
following game is played. At each trial a ball is selected at random its
color noted, and it is replaced along with two additional balls of the
same color. What is the probability that a white ball is selected in each of
the first three trials?
Solution:
Let Ai denote the event that a white ball is selected on the ith trials.
P( A1  A2  A3 )  P( A1 ) . P( A2 \ A1 ) . P( A3 \ A1  A2 )

C (7,1) C (9,1) C (11,1)


 . .
C (10,1) C (12,1) C (14,1)

 0.4125
Activity: 2.5
A lot contains 12 items of which 4 are defective. Three items are drawn
at random from the lot one after the other. Find the probability that all
the three are no defective.

2.5 Independent events


Events A and B in the probability space S are said to be independent if
the occurrence of one of them does not influence the occurrence of the
other. More specifically, A is independent of B if P(A) is the same
as P( A \ B) . Now substituting P(A) for P( A \ B) in the multiplication law of
probability P( A  B)  P( B) . P( A \ B) yields
P( A  B)  P( A) . P( B) .

We formally use the above equation as our definition of independence


Definition: 2.5.1

81
Events A and B are said to be independent if and only
if P( A  B)  P( B) . P( A) ; otherwise they are dependent.
Example: 2.5.2
The events A and B are independent with P( A)  0.5 and P( B)  0.8 .
Find the probability that neither of the event occurs.
Solution:
Since A and B are independent events we have
P( A  B)  P( A) . P( B)  0.4

Thus the probability that neither of the events occur is


P( A'B' )  P(( A  B)' )  1  P( A  B)

 1  [ P( A)  P( B)  P( A  B)]

 1  [0.5  0.8  0.4]  0.1

82
Example: 2.5.3
Let P( A  B)  5 6 , P( A  B)  1 3 , P( B' )  1 2 . Are events A and B are
independent? Explain.
Solution:
First let us find P( A ) and P( B) . Now P( B)  1  P( B' )  1  1 2  1 2 and
P( A )  P( A  B)  P( A  B)  P( B)

 5 6 1 3 1 2

2 3

Now P( A ) . P( B)  2 3.1 2  1 3  P( A  B)
Hence
P( A  B)  P( A) . P( B) , thus A and B are independent events.

Activity: 2.6
1. consider the following events for a family with children:
A  {children of both sexes}, B  {at most one boy}

a) Show that A and B are independent events if a family has


three children.
b) Show that A and B are dependent events if a family has only
two children.
2. If A and B are independent events, then prove that A ' and B' are
independent events.
2.6 Bernoulli trials and the binomial distribution
Suppose that an experiment can have only two possible outcomes. For
instance, when a bit is generated at a random, the possible outcomes are
0 and 1. When a coin is tossed, the possible outcomes are heads and
tails. Each performance of an experiment with two possible outcomes is
called a Bernoulli trial, after James Bernoulli, who made important

83
contributions to probability theory. In general, a possible outcome of a
Bernoulli trial is called a success or a failure. If p is the probability of a
success and q is the probability of a failure, it follows that p  q  1 . A
binomial experiment consists of a fixed number of Bernoulli trials.
The notation B(n, p) will be used to denote a binomial experiment with
n trials and probability p of successes.
Frequently, we are interested in the number of successes in a
binomial experiment with and not in the order in which they occur.
The following theorem is applies.
Theorem: 2.6.1
The probability of exactly k success in a binomial experiment
B(n, p) is given by P(k )  P( k successes)  C(n, k ) p k q nk
Proof:
The sample space of the n repeated trials consists of all
n-tuples (t1 , t 2 ,..., t n ) , where t i  S (for success) or t i  F (for failure)
for i  1, 2, ... , n . Since the n trials are independent, the probability of
each outcome of n trials consisting of k success and n  k failures.
Now let A be the event of exactly k successes. Then A consists
of all n-tuples of which k components are S and n  k components
are F . The number of such n-tuples in the event is equal to the
numbers of ways that k letters S can be distributed among the n
components of an n-tuple; hence A consists of C (n, k ) sample points.
k nk
The probability of each point in A is p q ;
k nk
Hence, P( A)  P( k successes)  C (n, k ) p q .
In particular, the probability of no successes is

84
P(0)  C (n,0) p 0 q n  q n . Thus the probability of one or more
successes is 1  q n
Example: 2.6.2
A fair coin is tossed three times; call heads a success. This is a
binomial experiment with n  6 and p  q  1 2 . Now
a) The probability that exactly two heads occurs (i.e., k  2 ) is
P(2)  C (6,2)(1 2) 2 (1 2) 4  15 64

b) The probability of getting at least four heads (i.e. k  4, 5, or 6 ) is


P(4)  P(5)  P(6)  C (6,4)(1 2) 4 (1 2) 2  C (6,5)(1 2) 5 (1 2)

 C (6,5)(1 2) 6 (1 2) 0

 15 64  6 64  1 64

 11 64

d) The probability of getting no heads (i.e., all failures)


is q 6  (1 2) 6  1 64 , so the probability of one or more heads is
1  q n  1  1 64  63 64 .

Example: 2.6.3
What is the probability that exactly eight 0 bits are generated when 10
bits are generated with the probability that a 0 bit generated is 0.9, the
probability that a 1 bit generated is 0.1, and the bits are generated
independently?
Solution:
By the above theorem, the probability that exactly eight 0 bits are
generated is P(8)  C(10,8)(0.9) 8 (0.1) 2  0.1937102445.
Remark:
The function P(k )  P( k successes)  C (n, k ) p k q nk for k  0,1, 2, ..., n for
a binomial experiment B(n, p) is called the binomial distribution since

85
it corresponds to the successive terms of the binomial expansion:
( p  q) n  p n  C (n,1) p n1q  C (n,2) p n2 q 2  ...  q n
n
  C (n, k ) p k q n k
k 0

n
And note that  C (n, k ) p k q nk  ( p  q) n  1 , that is, the sum of the
k 0

probabilities that there are k successes with n independent Bernoulli


trials, for k  0,1, 2, ..., n equals to 1.
Activity: 2.7
1. Suppose 20% of the items produced by a factory are defective.
Suppose four items are chosen at random. Find the probability
that:
a) two are defective;
b) three are defective;
c) non is defective.
2. Team A has probability 2 3 of winning whenever it plays.
Suppose A plays four games. Find the probability p that A wins
more than half of its games.
2.7 Random variables and expectation
Many problems are concerned with a numerical value associated
with the out come of an experiment. For instance, we may want to know
the probability that there are nine 1 bits generated when 10 bits are
randomly generated, or we may want to know the probability that a coin
comes up tails when it is tossed 20 times. To study problems of this type
we introduce the concept of a random variable.

86
2.7.1 Random variables
Definition: 2.7.1.1
A random variable X is a function from the sample space of an
experiment to the set of real numbers. That is, a random variable is a rule
that assigns a numerical value to each outcome in a sample space S.
Remark:
Note that a random variable is a function. It is not a variable.

Example: 2.7.1.2
Suppose that a coin is tossed three times. Let X (t ) be the number of
heads that appear when t is the outcome. Then the random variable
X (t ) takes on the following values:

X ( HHH )  3

X (HHT )  X (HTH )  X (THH )  2

X (TTH )  X (THT )  X ( HTT )  1

X (TTT )  0

Activity: 2.8
1. Let X be the sum of the numbers that appears when a pair of dices
is rolled. What are the values of this random variable for the 36
possible outcomes (i, j ) , where i and j are the
numbers that appear on the first die and the second die,
respectively, when these two dice are rolled.

87
2.7.2 Expected values
Many questions can be formulated in terms of the value we expect a
random variable to take, or more precisely, the average value of a
random variable when an experiment is performed a large number of
times. Questions of this kind include: how many heads are expected
to appear when a coin is tossed 100 times? To study such questions
we introduce the concept of the expected value of a random variable.
Definition: 2.7.2.1
The expected value (or expectation) of the random variable X (t ) on
the sample space S is equal to E ( X )   P(t ).X (t ) .
tS

Note that when the sample space S has n elements S  {x1 , x2 , ... , xn } ,

E ( X )  i 1 P( xi ). X ( xi )
n

Remark:
We are concerned only with random variable with finite expected
values here.
Example: 2.7.2.2
A fair coin is tossed three times. Let S be the sample space of the
eight possible outcomes, let X be the random variable that assigns to
an outcome the number of heads in this outcome. What is the
expected value of X ?
Solution:
In example 2.7.1.2 above we listed the values of X for the eight
possible out comes when a coin is tossed three times. Since the coin
is fair and the events are independent, the probability of each
outcome is 1 8 .
Consequently,

88
E (X )  1 8[ X ( HHH )  X (HHT )  X (HTH )  X (THH )  X (TTH ) 

X (THT )  X (HTT )  X (TTT ) ]

 1 8[3  2  2  2  1  1  1  0]

 12 8  3 2

Activity: 2.9
1. What is the expected value of the sum of the numbers of that
appear when a pair of fair dice is rolled?
2. What is the expected value of the numbers of successes when n
Bernoulli trials are performed, where P is the probability of
successes on each trial?
Theorem: 2.7.2.4
If X and Y are random variables on a space S and a and b are real
numbers, then a) E( X  Y )  E( X )  E(Y )
b) E(aX  b)  aE( X )  b
Furthermore, if X i , i  1, 2, ..., n are random variables on S , then
E ( X 1  X 2  ....  X n )  E ( X 1 )  E ( X 2 )  ...  E ( X n ) .

Proof:
a) the first result follows directly from the definition of expected
value, since
E ( X  Y )   P(t ).[ X (t )  Y (t )]
tS

 [ P(t ). X (t )  P(t ).Y (t )]


tS

  P(t ). X (t )   P(t ).Y (t )


tS tS

 E ( X )  E (Y )

b) E (aX  b)   P(t ).(aX  b)(t )


tS

89
  P(t ).(aX (t )  b)
tS

  aP(t ). X (t )  bP(t )
tS

 a P(t ). X (t )  b P(t )
tS tS

 aE ( X )  b , since,  P(t )  1 .
tS

The case with n random variables follows easily using mathematical


induction from the case of two random variables which is proved in part
(a) above, or we can prove as follow.
E ( X 1  X 2  ....  X n )   P(t ).[ X 1  X 2  ...  X n ](t )
tS

  P(t ).[ X 1 (t )  X 2 (t )  ...  X n (t )]


tS

  P(t ). X 1 (t )  P(t ). X 2 (t )  ...  P(t ). X n (t )


tS

  P(t ). X 1 (t )   P(t ). X 2 (t )  ...   P(t ). X n (t )


tS tS tS

 E ( X 1 )  E ( X 2 )  ...  E ( X n ) , which completes the proof.

The above theorem can be useful for computing expected values, since
many random variables are sums of simpler random variables.
Example: 2.7.2.5
Using the above theorem, find the expected values of the sum of the
numbers that appear when a pair of dice is rolled.
Solution:
Let X 1 and X 2 be the random variables with X 1 (i, j)  i and X 2 (i, j )  j so
that X 1 is the number appearing on the first die and X 2 is the number
appearing on the second die. Now we see that
6
E ( X 1 )   P(t ). X 1 (t )
t 1

90
 P(1).X 1 (t )  P(2).X 1 (2)  P(3).X 1 (3)  P(4). X 1 (4)

 P(5). X 1 (5)  P(6). X 1 (6)

 1 6[1  2  3  4  5  6] , since P(1)  P(2)  .....  P(6)  1 6

 21 6  7 2

But we observe that E( X 2 )  E( X 1 )  7 2 since E ( X 2 ) is also


equals 1 6[1  2  3  4  5  6] .
Now the sum of two numbers that appear when the two dice are rolled is
the sum X 1  X 2 . Thus by the above theorem, the expected value of the
sum is E( X 1  X 2 )  E( X 1 )  E( X 2 )  7 2  7 2  7
Activity: 2.10
Using the above theorem show that the expected value of the number of
successes when n Bernoulli trials are proved, where P is the probability
of successes on each trial, is equal to nP .
We have already discussed independent events. We will now define
what it means for two random variables to be independent.
2.7.3. Independent Random Variables
Definition: 2.7.3.7
The random variable X and Y on a sample space S are independent if
P[ X (t )  r1 and Y (t )  r2 ] = P[ X (t )  r1 ]. P[Y (t )  r2 ] or in words, if the

probability that X (t )  r1 and Y (t )  r2 equals the product of the


probabilities that X (t )  r1 and Y (t )  r2 , for all real numbers r1 and r2 .
Example: 2.7.3.8
Are the random variables X 1 and X 2 from the above Example 2.7.3.5
independent?

91
Solution:
Let S  {1, 2, 3, 4, 5, 6} , and let i  S and j  S . Since there are 36 possible
outcomes when the pair of dice is rolled and each is equally likely, we
have P[ X 1 (t )  i and X 2 (t )  j ]  1 36 .
Furthermore, P[ X 1 (t )  i]  1 6 and P[ X 2 (t )  1 6] , since the probability that
i appears on the first die and the probability that j appears on the second

die are both 1 6 . It follows that


P[ X 1 (t )  i and X 2 (t )  j ]  1 36  (1 6).(1 6) = P[ X 1 (t )  i].P[ X 2 (t )  j ] so

X 1 and X 2 are independent.

Example: 2.7.3.8
Show that the random variables X 1 and X  X 1  X 2 , where X 1 and X 2 are
defined in Example2.7.3.5 are not independent.
Solution:
Note that P[ X 1 (t )  1 and X (t )  12]  0 , since X 1 (t )  1 means the number
of appearing on the first die is 1, which implies that the sum of the
numbers on the two dice equal 12. On the other hand,
P[ X 1 (t )  1]  1 6 and P[ X (t )  12]  1 36 .

Hence P[ X 1 (t )  1 and X (t )  12]  P[ X 1 (t )  1].P[ X (t )  12] . This counter


example shows that X 1 and X 2 are not independent.
Theorem: 2.7.3.9
If X and Y are independent variables on a sample space S ,
then E( X .Y )  E( X ).E(Y ) , that is, the expected values of the product of two
independent variables is the product of their expected values.

92
Proof:
From the definition of expected value and since X and Y are independent
random variables, it follows that
E ( X .Y )   P(t ).[( X .Y )(t )]
tS

  P(t ).( X (t ).Y (t )


tS

 
r1X ( S ), r2 Y ( S )
r1r2 .P[ X (t )  r1 and Y (t )  r2 ]

 
r1X ( S ), r2 Y ( S )
r1r2 .P[ X (t )  r1 ].P[Y (t )  r2 ]

(  r .P[ X (t )  r ]) . (  r .P[Y (t )  r ] )
1
r1X ( S )
1
r2 Y ( S )
2 2

 E ( X ).E (Y ) .

This completes the proof.


2.7.4. Variance
The expected value of a random variable tells us its average value but
nothing about how widely its values are distributed. For example, if
X and Y are the random variables on the set S  {1, 2, 3, 4, 5, 6} , with X (t )  0

for all t  S and Y (t )  1 if t  {1, 2, 3} and Y (t )  1 if t  {4, 5, 6} , then the


expected values of X and Y are both zero. However, the random variable
X never varies from 0, while the random variable Y always differs from

0 by 1. The variance of a random variable helps us characterize how


widely a random variable is distributed.
Definition 2.7.4.1
Let X be a random variable on a sample space S . The variance of X ,
denoted by V (X ) , is V ( X )  [ X (t )  E ( X )]2 P(t ) . The standard deviation
tS

of X , denoted  (X ) , is defined to be V (X ) .

93
The following theorem provides a useful simple expression for the
variance of a random variable.
Theorem: 2.7.4.2
If X is a random variable on a sample space S , then
V ( X )  E ( X 2 )  [ E ( X )]2

Proof:
Note that V ( X )  [ X (t )  E ( X )]2 P(t )
tS

 [ X 2 (t )  2E ( X ) X (t )]  E 2 ( X )]P(t )
tS

 [ X 2 (t ) P(t )  2 E ( X ) X (t ) P(t )  E 2 ( X ) P(t )


tS tS tS

 E( X 2 )  2E ( X ) E( X )  E 2 ( X )

 E ( X 2 )  [ E ( X )]2 .

Example: 2.7.4.3
What is the variance of the random variable X with X (t )  1 if a Bernoulli
trial is a success and X (t )  0 if it is failure, where P is the probability of
success?
Solution:
Since X takes only the values 0 and 1, it follows that
X 2 (t )  X (t ). Hence,

V ( X )  E ( X 2 )  [ E ( X )]2  p  p 2  p(1  p)  pq .

Activity: 2.11
What is the variance of the random variable X ((i, j ))  2i , where i is the
number appearing on the first die and j is the number appearing on the
second die, when two dice are rolled?

94
Another useful fact about variance is that the variance of the sum of
two independent random variables is the sum of their variances. This
result is useful for computing the variance of the result of n independent
Bernoulli trials.
Theorem: 2.7.4.4
If X and Y are two independent random variables on a sample space S ,
then V ( X  Y )  V ( X )  V (Y ) .
Proof:
From the Theorem: 2.74.2, we have, V ( X  Y )  E(( X  Y ) 2 )  [ E( X  Y )]2 .
It follows that
V ( X  Y )  E (( X  2 XY  Y 2 )  [ E ( X )  E (Y )]2

 E ( X 2 )  2E ( XY )  E (Y 2 )  E 2 ( X )  2E ( X ) E (Y )  E 2 (Y )

Since X and Y are independent, by theorem 2.7.3.9


we have, E( XY )  E( X ) E(Y ) . It follows that
V ( X  Y )  [ E ( X 2 )  E 2 ( X )]  [ E (Y 2 )  E 2 (Y )]

 V ( X )  V (Y ) .

Example: 2.7.4.5
What is the variance of the number of successes when n independent
Bernoulli trials are performed, where p is the probability of success on
each trial?
Solution:
Let X i be the random variables with X i ((t1 , t 2 ,..., t n ))  1 if t i is a successes
and X i ((t1 , t 2 ,..., t n ))  0 if t i a failure is. Let X  X 1  X 2  ....  X n .Then
X counts the number of successes in the n trials. From theorem 2.7.4.4

it follows that V ( X )  V ( X 1 )  V ( X 2 )  ....  V ( X n ) . Using example 2.7.4.3

95
we have that V ( X i )  pq for i  1, 2. 3, ...n . It follows that V ( X )  npq .
Activity: 2.12
Find the variance and standard deviation of the random variable
X whose value when two dice are rolled is X ((i, j ))  i  j , where i is the

number appearing on the first die and j is the number of appearing on


the second die.

96
Chapter 3
Generating Functions of a sequence and a Recurrence
relation
3.1 Introduction:
Many counting problems cannot be solved easily using the method
discussed so far. Thus in this chapter we will see other methods of
solving counting problems. These are generating function and recurrence
relation.
Many counting problems solved using a formal power series, called
generating functions, where the coefficients of power of x represent
terms of the sequence we are interested in and by finding relationship,
called recurrence relation, between the terms of the sequence.
After this chapter the students will be able to:
Objectives:
 solve counting problems using generating function and
recurrence relation
 solve recurrence relations using different methods
3.2 Generating Functions of a Sequence
In this section we discuss the method of generating functions to
solve counting problem, such as the number of ways to select or
distribute objects, subject to a variety of constraints.
The objects of interest in this section are sequences of a real numbers.

97
Objectives
After these lessons the students will be able to:
 Define generating functions of a sequence of a real numbers
 find a generating functions of a sequence involving counting
problems
 solve counting problems using generating functions
 explain about the shifting properties of a generating functions.
Definition: 3.2.1
A sequence of real numbers (a0 , a1 , a2 ..., ar ,...) is function whose
domain is the set of nonnegative integers and whose range is the set of
real numbers. In other word, it is a function f : N  {0)  R

defined by f (0)  a0 , f (1)  a1 f (2)  a 2 ,….



We use expressions like A  {ar }r 0 to denote such sequences.
Example: 3.2.2
The sequence A  {2 r }r 0 is the sequence (1,2,4,8,...,2 r ,...) ;the
sequence B  {br }r 0 where br  r  1 for each value r, is the
sequence (1,2,3,4,....)

The sequence A  {ar }r 0 where a r is the number of nonnegative
integral solutions of the equation x1  x2  ...  xn  r where n is a
fixed positive integer and each xi is subject to certain constraints.
Now if the constraints xi  0 then ar  C (n  1  r, r ) .Thus
a0  C (n  1,0)  1 a1  C (n,1)  n , a2  C (n  1,2) , and so on.

98
Definition: 3.2.3
Let A  {ar }r 0 be a sequence of real numbers. The generating
functions of the sequence A  {ar }r 0 is defined to be the formal
power series
A( x)  a0  a1 x  a2 x 2  ......  an x n  ....  r 0 ar x r

Example: 3.2.4
1. A( x)  r 0 2 r x r is a generating functions for the sequence

A  {2 r }r 0  (1,2,4,8,...)

2. The generating functions of the infinite sequence 1, 1, 1… 1…


Each of whose term equals 1, is
B( x)  1  x  x 2  ......  x n  ....  r 0 x r

Definition: 3.2.5
Let A( x)  r 0 ar x r , B( x)  s 0 bs x s be two formal power series.
 

Then i) A( x)  B( x) iff an  bn for each n  0



ii) A( x)  B( x)  n 0
(an  bn ) x n

iii) A( x).B( x)  n0 Pn x n , where Pn 



a b
i  j n
i k .

n
That is Pn  a0 bn  a1bn1  a2 bn2  ...  an1b1  an b0   ai bni .
i 0

Thus A( x).B( x)  a0 b0  (a0 b1  a1b0 ) x  (a0 b2  a1b1  a2 b0 ) x 2  ...


....  (a 0 bn  a1bn 1  a 2 bn 2  ...  a n 1b1  a n b0 ) x n  ...

Example: 3.2.6
Let A( x)  a0  a3 x 3  a4 x 4  a8 x 8 and B( x)  b0  b4 x 4  b5 x 5  b8 x 8 . Find
the coefficient of a) x 8 , b) x 5 in A( x).B( x).

99
Solution:
The coefficient of x 8 in A( x).B( x) is found by considering the powers

x 0

, x 3 , x 4 , x 8 from the first factor and the powers x 0 , x 4 , x 5 , x 8 in the
second factor such that their sum is 8.
Hence the coefficient of x 8 is
P8  a b
i  j 8
i j , where, i  0,3,4, or 8 , and j  0,4,5, or 8 .

Thus P8  a0 b8  a3b5  a4 b4  a8b0 , because (0,8), (3,5), (4,4), (8,0) are the
only pairs of exponents of A( x) and B( x) whose sum is 8 .
Like wise the coefficient of x 5 in the product is
P5  a b
i  j 5
i j where i  0,3,4, or 8 and j  0,4,5, or 8

Thus P5  a0 b5 because there is only one pair of exponents


of A( x) and B( x) , namely (0, 5), whose sum is 5.

However, the case where all the nonzero coefficients


of A( x) and B( x) are 1 is a special interest. Note that in this
case P8  a0 b8  a3b5  a4b4  a8b0  1  1  1  1  4 which is equal to the
number of pairs of exponents whose sum is 8, that is the coefficient of
x 8 in the product
A( x).B( x)  (1  x 3  x 4  x 8 ) .(1  x 4  x 5  x 8 ) is just the number of integral

solutions to the equations e1  e2  8 , where


e1 and e2 represent the exponents of A( x) and B( x) , respectively.

In this case e1 can only be 0,3,4, or 8 and e2  0,4,5, or 8 .


Like wise P5  a0 b5  1 since there is only one solution to

100
e1  e2  5 , namely (0,5) with this restrictions on e1 and e2 . Hence the
coefficient of x 5 is (1  x 3  x 4  x 8 ) .(1  x 4  x 5  x 8 ) is 1 .
Now we have observed that: the coefficient of x r in the product
A( x).B( x)  (1  x 3  x 4  x 8 ) .(1  x 4  x 5  x 8 ) is the number of integral

solutions to the equations e1  e2  r subject to the

constraints e1  0,3,4,8 , and e2  0,4,5,8 .


Note that the exponents of the factors in the product reflect the
constraints in the equations. Note also that we can view this clue in two
ways.
i) We can compute the coefficient of x r by algebra and then
discover the number of integral solutions to the equations
e1  e2  r subject to the constraints;

ii) Or we can compute all solutions of the equation subject to


the constraints and then discover the coefficient of x r .
3.2.1 Generating function models
The reader can extend the above idea to the products of several
factors. Thus, here is our rule:
Assume each nonzero coefficients of each formal power
series Ai (x) is 1. Then the coefficient of x r in the product
A1 ( x) . A2 ( x) ... An ( x) can be interpreted as the number of

nonnegative integral solutions to an equation e1  e2  ...  en  r


where constraints on each ei are determined by the exponents of
the ith factor Ai (x) .
Of course, this line of reasoning can be reversed. Given a
problem to count the number of nonnegative integral solutions to

101
an equation e1  e2  ...  en  r with constraints on each ei , then
we can build a generating function A1 ( x) . A2 ( x) ... An ( x) whose
coefficients of x r is the answer to the problem. Having sated this
model let us give some examples how to construct a generating
function of a given sequence involving counting problem.
Example: 3.2.1.1
1. Find a generating function for the sequence (a0 , a1 , a2 ..., ar ,... )

where a r  the number of nonnegative integral solutions of


e1  e2  e3  e4  e5  r where 0  e1  3 , 0  e2  3 , 2  e3  6 ,

2  e4  6 , e5 is odd , and 1  e5  9 .

Solution:
Now clearly, A1 ( x)  A2 ( x)  1  x  x 2  x 3 ,
A3 ( x)  A4 ( x)  x 2  x 3  x 4  x 5  x 6 , and

A5 ( x)  x  x 3  x 5  x 7  x 9 . Thus, by the generating function

model ,
A( x)  A1 ( x) . A2 ( x) A3 ( x) A4 ( x) . A5 ( x)

 (1  x  x 2  x 3 ) 2 . ( x 2  x 3  x 4  x 5  x 6 ) 2 . ( x  x 3  x 5  x 7  x 9 )

is the generating function of the given sequence


Example: 3.2.1.2
2. Find a generating function for the sequence (a0 , a1 , a2 ..., ar ,... )
where ar  the number of nonnegative integral solutions to
e1  e2  ...  en  r where 0  ei .

102
Solution:
Now let Ai ( x)  1  x  x 2  ... for each i  1,2,3....., n . Thus, the
generating function we want
is A( x)  A1 ( x) . A2 ( x) ....An ( x)  (1  x  x 2  ...) n .
But we recall ar  C (n  1  r, r )
n
Thus A( x)   C (n  1  r , r ) x r is another expression for this same
r 0

n
generating function, thus (1  x  x 2  ...) n   C (n  1  r , r ) x r .
r 0

Again let us see out to find the coefficient of x r in the given


generating function.
Example: 3.2.1.3
Find a) the coefficient of x 9 and
b) the coefficient of x 25 ,in the expressions (1  x 3  x 8 )10
Solution:
a) By the generating function model, the coefficient of x 9 in
(1  x 3  x 8 )10 is the same as the number of integral solutions of
e1  e2  . . .  e10  9 where each ei  0,3,8 .

The solution of this equation involves three 3‟s and seven 0‟s.
10!
Hence there are  C (10,3) such integral solutions.
3!.7!

Hence the coefficient x 9 in the expressions (1  x 3  x 8 )10 is


10!
 C (10,3)  120 .
3!.7!
b) Similarly the coefficient of x 25 in (1  x 3  x 8 )10 is the same as
the number of integral solutions of e1  e2  . . .  e10  25 where

103
each ei  0,3,8 . Clearly the solution of this equation involves
10!
three 3‟s, two 8‟s, and five 0‟s. Hence there are  2520
3!.2!.5!
such solutions. Hence, by generating function model the
coefficient of x 25 in the expressions
10!
(1  x 3  x 8 )10 is  2520.
3!.2!.5!
Activity: 3.1
1. Find a generating function for the sequence (a0 , a1 , a2 ..., ar ,... )
where ar  the number of nonnegative integral solutions to
e1  e2  ...  en  r where 0  ei  1 for each i  1,2,3....., n .

2. Find a generating function for the sequence (a0 , a1 , a2 ..., ar ,... )


where ar  the number of ways of distributing r similar balls
into n numbered boxes where each box is nonempty.
3. In the expression (1  x 5  x 9 )10 find
a) the coefficient of x 23
b) the coefficient of x 32 .
4. Find a generating function for the sequence (a0 , a1 , a2 ..., ar ,... )
where ar  the number of ways the sum r can be obtained
when two distinguishable dice are tossed.
3.2.2 Useful facts about power series
When generating functions are used to solve counting
problems, they are usually considered to be formal power series.
Questions about the convergence of this series are ignored.
However, to apply some results from calculus, it is sometimes
important to consider for which x the power converges. We will

104
not be concerned with questions of convergence in our
discussions.
We will state now some important facts about infinite series
used when working with generating functions.
1
1. The function A( x)  is a generating function of the
1 x
sequence 1, 1, 1, 1,…,
1
 1  x  x 2  ....  ....  r 0 x r for x  1

since A( x) 
1 x
1
2. The function A( x)  generates the sequence 1, -1, 1, -1,…,
1 x
1
3. The function B( x)  is the generating function of the
1  ax

sequence 1, a, a 2 , a 3 ..., since

 1  ax  a 2 x 2  ....  ....  r 0 a r x r when ax  1 , or


1 
B( x) 
1  ax
1
equivalently, for x  for a  0 .
a
2
1  1 
4. The function C ( x)    
(1  x) 1 x 
2

= ( 1  x  x 2  ....  ....) 2  r 0 (r  1) x r

is a generating function of the sequence (1,2.3,....)


Since the coefficient of x r is the same as the number of
nonnegative integral solutions of the equation
e1  e2  ...  en  r where 0  ei for each i  1,2 .

Hence the coefficient of x r is


C (2  1  r, r )  C(r  1, r )  r  1 .

5. Similarly the function

105
n

D( x) 
1
  1 
 
(1  x) n 1 x 

= (1  x  x 2  ....  ....) n   C (n  1  r , r ) x r generates the sequence
r 0

(a0  C (n  1,0)  1, a1  C (n,1)  n , a2  C (n  1,2),....)

Useful Generating functions


A(x) ar
n C (n, r )
(1  x) n   C (n, r ) x r
r 0

n
C (n, r ) a r
(1  ax) n   C (n, r )a
r 0
r
x r

1  x n 1 n
1 if r  n
1 x
 x r
= 1  x  x 2  ....  x n 
r 0 0 otherwise

1
1 x
 x
r 0
r
 1  x  x 2  .... 1


1 (1) r
1 x
  (1) r x r
r 0

 1  x  x 2  x 3  ....

1 ar
1  ax
 a
r 0
r
x r  1  xa  x 2 a 2  ....


1 1 if k is divisible by r
1 xk
 x kr
 1  x k  x 2k  .... 
r 0 0 otherwise

1 r 1
(1  x) 2
  (r  1) x
r 0
r

 1  2 x  3x 2  ....
1  C (n  1  r, r )  C(n  1  r, n  1)
(1  x) n
 
r 0
C (n  1  r , r ) x r


1 (1) r C (n  1  r, r )  (1) r C (n  1  r, n  1)
(1  x) n
 
r 0
C (n  1  r , r )(1) r x r

106

1 C (n  1  r, r )a r  C (n  1  r , n  1)a r
(1  ax) n
  C (n  1  r , r )a
r 0
r
xr

3.2.3 Solving Counting Problems using Generating functions


Generating functions can be used to solve a wide variety of counting
problems. Such problems are equivalent to counting the integral
solutions to equations of the form e1  e2  ...  en  r where r is a constant

and each ei is a nonnegative integer that may be subject to a specified


constraint.
Example: 3.2.3.1
Find the number of ways of placing 20 similar balls into 6 numbered
boxes so that the first box contains any number of balls between 1and 5
inclusive and the other 5 boxes must contain 2 or more balls each.
Solution:
The problem is the same as finding the number of nonnegative integral
solutions of the equation
e1  e2  e3  e4  e5  e6  20 where 1  e1  5 , 2  ei , for i  2, 3, 4, 5, 6 . Thus

generating functions we consider is:


A( x)  ( x  x 2  x 3  x 4  x 5 ) ( x 2  x 3  x 4  . .. ) 5

 x(1  x  x 2  x 3  x 4 ) [ x 2 (1  x  x 2  . .. )]5

 x11 (1  x  x 2  x 3  x 4 ) (1  x  x 2  . .. ) 5

1  x5   1 
5

 x 
11
. 
 1  x  1 x 
6
 1 
 x (1  x )
11 5

1 x 

107
  
 x11 (1  x 5 )  C (5  r , r ) x r 
 r 0 
Now we observe that the number of nonnegative integral solution
is the same as the coefficient of x 20 in A(x) .
Thus the coefficient of x 20 in A(x)
 

= coefficient of x 20 in x11 (1  x 5 )  C (5  r , r ) x r 
 r 0 

 

= coefficient of x 9 in (1  x 5 )  C (5  r , r ) x r 
 r 0 
 
=  C (5  r , r ) x r  x 5  C (5  r , r ) x r
r 0 r 0

= C(5  9,9)  C(5  4,4)


= C(14,9)  C(9,4)
Hence, the coefficient of x 20 in A(x) is C(14,9)  C(9,4) , which is to
the answer to the problem C(14,9)  C(9,4) .
Example: 3.2.3.2
Find the number of nonnegative integral solution of the equation
e1  e2  e3  17 where, 2  e1  5 , 3  e2  6 , 4  e3  7 .

Solution:
First let us find the generating function A(x) of the sequence
involving counting problem
e1  e2  e3  r where, 2  e1  5 , 3  e2  6 , 4  e3  7 .

Clearly
A( x)  ( x 2  x 3  x 4  x 5 ) . ( x  x  x  x ) . ( x 4  x 5  x 6  x 7 ) .
3 4 5 6

Thus the answer to the problem is the same as the coefficient of


x17 of the generating function A(x) .

108
Now A(x)  ( x 2  x 3  x 4  x 5 ) . ( x 3  x 4  x 5  x 6 ) . ( x 4  x 5  x 6  x 7 )
 x 2 (1  x  x 2  x 3 ) x 3 (1  x  x 2  x 3 ) x 4 (1  x  x 2  x 3 )

 x 9 (1  x  x 2  x 3 ) 3
3
1 x4 
 x 9

 1 x 
3
 1 
 x (1  x ) 
9 4 3

1 x 

Now the coefficient of x17 in A(x)


3

in x (1  x ) 
1 

17 9 4 3
=the coefficient of x
1 x 
3

= the coefficient of x 8 in (1  x 4 ) 3 
1 

1 x 

=the coefficient of x 8 in (1  x 4 ) 3  C (2  r , r ) x r
r 0

=the coefficient of x 8 in

[1  C (3,1) x 4  C (3,2) x 8  x12 ]  C (2  r , r ) x r
r 0

=the coefficient of x 8 in
 

 C (2  r, r ) x r  C (3,1) x 4  C (2  r, r ) x r 
r 0 r 0

 
 C (3,2) x 8  C (2  r , r ) x r x12  C (2  r , r ) x r
r 0 r 0

= C(2  8,8)  C(3,1)C(2  4,4)  C(3,2)C(2  0,0)


= C(10,8)  C(3,1)C(6,4)  C(3,2)C(2,0)  3
Therefore, the coefficient of x17 in A(x) is 3 which is the number of
integral solutions of the problem

109
Activity: 3.2
1. find the coefficient of x 20 in
A( x)  ( x10  x11  ...  x 25 ) ( x  x 2  ....x15 ) 5 ( x 20  x 21  ....  x 45 )

2. Let a r be the number of ways the sum r can be obtained by


tossing 9 distinguishable dice.
a) write a generating function for the
sequence {ar }r 0 .
b) find the number of ways to obtain the sum
25, that is, a 25 .
3. using generating functions to find the numbers of was to select
10 balls from a large pile of red, white, and blue balls if
a) the selection has at least 2 balls of each
color,
b) the selection has at most 2 red balls, and
c) the selection has an even number of blue
balls.
3.2.4 The shifting property of generating functions
The shifting property of a generating function states that if
A( x)  a0  a1 x  a2 x 2  ......  an x n  ....  r 0 ar x r generates the

sequence (a0 , a1 , a2 ..., ar ,... ) , then x k A(x) generates the sequence


(0,0,...,0a0 , a1 , a2 ..., ar ,...) where there are k zeros before a 0 .

For example xA(x) generates (0, a0 , a1 , a2 ..., ar ,...) x 2 A( x) generates


the sequence (0,0, a0 , a1 , a2 ..., ar ,...) .

110

1
For instance, we know that
1 x
 x
r 0
r
generates the sequence (1,1,1,....) .

 
x
Thus
1 x
  x r 1   x n generates the sequence (0,1,1,1,....) and
r 0 n 1

 
x2
1 x
 x
r 0
r 2
  x n generates the sequence (0,0,1,1,1,....) .
n2

 
1
Similarly we know that
(1  x) 2
  C (r  1, r ) x r   (r  1) x r generates the
r 0 r 0

 
x
sequence (1,2,3,...) so that
(1  x) 2
  (r  1) x r 1   nx n generates the
r 0 n 1

sequence (1,2,3,...) .

Note that the expression  nx
n 1
n
describes that the coefficient of x 0 is 0

because the sum is taken over from n  1 to  , but the form of


coefficients would give the same conclusion even if n is allowed to
 
x
equal zero; hence we can write
(1  x) 2
two ways: as  nx n and as
n 1
 nx
n 0
n
,

and both expression mean that the coefficient of x 0 is 0.


 
x2
Likewise,
(1  x) 2
  (r  1) x
r 0
r 2
  (n  1) x n generates the sequence
n2

(0,0,1,2,3,...) that is, the sequence {bn }n0 , where bn  n  1 if n  2, but

b0  b1  0 . Since the expression bn  n  1 equals zero when n  1, it


 
x2
happens that
(1  x) 2
  (n  1) x n also can be written as
n2
 (n  1) x
n 1
n
.

Following this line of thought further, we see that


1  
(r  2)(r  1) r
(1  x) 3
  C (r  2, r ) x r  
r 0 r 0 2
x generates

111

(r  2)(r  1) 
the sequence  
 1.2 2.3 3.4 
 , , , ... , and therefore,
 2  r 0  2 2 2 

generates (r  2)(r  1)r 0  (1.2, 2.3, 3.4, ... ) . But
2
(1  x) 3
  (r  2)(r  1) x
r 0
r

 
2x
then
(1  x) 3
  (r  2)(r  1) x
r 0
r 1
  (n  1)(n) x n generates the sequence
n 1

(n  1)(n)n0  (0,1.2, 2.3, 3.4, ... ) . Now since bn  (n  1)(n) equals 0 when
 
2x
n  0 , we see that we can write
(1  x) 3
 
n 1
( n  1)( n ) x n
 
n 0
(n  1)(n) x n so

generates (n  1)nn0 .


2x
that
(1  x) 3
  
2x 2
Likewise
(1  x) 3
  (r  2)(r  1) x r 2   (n)(n  1) x n   (n)(n  1) x n
r 0 n2 n 0

generates the sequence (0,0,1.2, 2.3, 3.4, ... ) , and the last term can be taken
n  0 to  because the coefficient n(n  1) is 0 when n  0,1 .

Activity: 3.3
Using shifting properties of generating functions show that

6x
1.   (n  2)(n  1)(n) x n
(1  x) 4 n 0

6x 2
2.   (n  1)(n)(n  1) x n
(1  x) 4 n 0

3.3 Recurrence Relations


Some of the counting problems that cannot be solved using the
techniques discussed in the previous chapters can be solved by finding
relationships, called recurrence relations, between the terms of a
sequence. In this section we discussed how sequences can be defined
recursively and we will study a variety of counting problems and finally

112
we discussed about the methods of solving recurrence relation that can
be modeled using recurrence relations.
Objectives:
After these lessons the students will be able to:
 define recurrence relation
 solve counting problems using recurrence relation
 prove some properties of Fibonacci number
 solve recurrence relations using different methods discussed
bellow
Definition: 3.3.1
A recurrence relation is a formula that relates for any integer n  1 , the
nth term of a sequence A  {ar }r 0 to one or more of the

terms a0 , a1 , a2 ..., an1 .


Example: 3.3.2
1) s n  n  s n1 … (Here s n denotes the sum of the first n positive
integers.)
2) an  an1  d ... (here a n denotes the nth term of arithmetic
progression with common difference d)
3) pn  rpn1 … (Here p n denotes the nth term of a geometric progression
with common ratio r
4) an  3an1  2an2  0
5) an  (n  1)an1  (n  1)an2  0
6) an  9an1  26an2  24an3  5n
7) an  3(an1 ) 2  2an2  n
8) (an ) 2  (an1 ) 2  1

113
9) an  a0 an1  a1an2  ...  an1a0 are examples of recurrence relations.
Definition: 3.3.4
Suppose n and k are non negative integers. A recurrence relations of the

form c0 (n)an  c1 (n)a n1 ....  ck (n)ank  f (n) for n  k , ….(1)

Where c0 (n) , c1 (n) …., c n (n) and f (n) are functions of n is called
a linear recurrence relation. Except (7), (8) and (9) in the above examples
all are linear recurrence relation. Examples 7,8, and 9 are non-linear
recurrence relation.
If c0 (n) and c k (n) are not identically zero, then (1) is said to be a
linear recurrence relation of degree k . In example 3.3.2 (1-3) are linear
recurrence relation of degree 1 , examples 4 and 5 are of degree 2 and
example 6 is a linear recurrence relation of degree 3 .
If all c0 (n) , c1 (n) …., cn (n) are constants, then (1) is said to be linear
recurrence relation with constant functions. Examples 1, 2, 4 and 6 are
linear recurrence relation with constant functions, but not 3 and 5
If f (n) is identically zero, zero, then (1) is said to be a homogenous linear
recurrence relation; otherwise, it is called inhomogeneous.
Examples 3, 4 and 5 are homogenous linear recurrence relation but not 1,2
and 6.
Next let us discuss how to find a recurrence relation of certain kind of
counting problems, by considering the examples given below.
Examples: 3.3.5
1. The number of bacteria in a colony doubles every hour. Find a
recurrence relation for the number of bacteria at the end of n hours.

114
Solution:
Let a n the number of bacteria after n hours.
Since the number of bacteria doubles every hour, the relation
an  2an1 holds whenever n is a positive integer.
2. Consider the following problem, which was originally posed by
Leonardo di Pisa, also known as Fibonacci, in the thirteenth century
in his book Liber abaci. A young pair of rabbits (one of each sex) is
placed on an island. A pair of rabbits does not breed until they are
two months old. After they are old, each pair of rabbits produces
another pair each month.
i) Find a recurrence relation for the number of pairs of rabbits
on the island after n months, assuming that no rabbits ever
die.
ii) Find the number of rabbits after one year.
Solution:
i) Let us denote by Fn the number of pairs of rabbits after n
months. We will show that Fn , n=0, 1, 2, 3 … are the terms of
the Fibonacci sequence. The rabbit population can be
modeled using a recurrence relation as follow: We start one
pair of newly born rabbits since they are not yet mature
enough to reproduce. After 2 months we have 2 pairs of rabbits
because the first pair has now reproduced. After 3 months we have
3 pairs of rabbits since those born just last month cannot reproduce
yet, but the original pair has reproduced again. After 4 month we
have 5 pairs of rabbits because the first pair is continuing to
reproduce, the second pair has produced a new pair, and the third

115
pair is still maturing. For each integer, let Fn denote the number of
pairs of rabbits alive at the end of the nth month. Now at the end of
the first month, the number of pairs of rabbits on the island is F0  1 .
Since this pair does not breed during the second month, F1  1also.
To find the number of pairs after n months, add the number on the
island the previous month, Fn1 and the number of new born pairs,
which equals Fn2 , since each born pair comes from a pair at least 2
months old. In other words Fn is formed by starting with Fn1 pairs
of rabbits alive last month and adding the babies that can only come
from the Fn2 pairs alive 2 months ago. Hence Fn  Fn1  Fn2 for
n  2 is the recurrence relation together with the initial conditions

F0  1 and F1  1.

ii) Here we asked to determine the value of F12 . Since this


recurrence relation and the initial conditions uniquely
determine this sequence, the number of pairs of rabbits on
the island after 12 months (1year) is given by the 12th
Fibonacci number. Using the relation Fn  Fn1  Fn2 , we see
that
F2  F1  F0  1  1  2 , F3  F2  F1  2  1  3

F4  F3  F2  3  2  5 , F5  F4  F3  5  3  8

F6  F5  F4  8  5  13 , F7  F6  F5  13  8  21

F8  F7  F6  21  13  34 , F9  F8  F7  34  21  55

F10  F9  F8  55  34  89 , F11  F10  F9  89  55  144

F12  F11  F10  144  89  233 .

Thus after 12 months there are 233 pairs of rabbits alive.

116
Activity: 3.2.10
1. Find the recurrence relation for the number of ways to arrange flags on a
flagpole n feet tall using 4 types of flags: red flags 2 feet high, or white
blue, and yellow flags each 1 foot high.
2. Find a recurrence relation for the number of ways to make a pile of n
chips using garnet, gold, red, white, and blue chips such that no two gold
chips are together.
3.3.1 Some properties of Fibonacci number
The relation Fn  Fn1  Fn2 is called the Fibonacci relation and the
numbers Fn generated by the Fibonacci relation with the initial
conditions F0  1  F1 are called the Fibonacci numbers and the sequence
{Fn }n0 is called Fibonacci sequence.

From our calculations, we see that the first few terms of the Fibonacci
sequence are 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,...
The Fibonacci sequence has many remarkable properties. We give two
in the next two examples.
Example: 3.3.1.1
Prove that the partial sums of the terms of the Fibonacci sequence
are S n  F0  F1  F2  ...  Fn  Fn2  1 .
Proof:
From the Fibonacci relation Fn  Fn1  Fn2 we observe that
Fn2  Fn  Fn1 . This gives the numbers in array as follows:

F0  F2  F1

F1  F3  F2

F2  F4  F3

117
.
.
Fn  Fn2  Fn1 .

If we add all of these equations, we get


F0  F1  F2  ...  Fn  F2  F1  ( F3  F2 .)  ( F4  F3 )...  ( Fn2  Fn1 )

 Fn 2  F1 but, F1  1.
Hence S n  F0  F1  F2  ...  Fn  Fn2  1 . This completes the proof.
Example: 3.3.1.2
Prove that F0  F2  F4  ...  F2n  F2n1
proof:
From the Fibonacci relation Fn  Fn1  Fn2 we observe that
F0  F2  F4  ...  F2n  F0  ( F1  F0 )  ( F3  F2 .)..  F2n1  F2n2

 F0  ( F0  F1  F2  ...  F2n2  F2n1 )

 F0  F2n1 2  1 by example 3.3.1.1 above

 1  F2n1  1 since F0  1

 F2 n1 . This completes the proof.

Activity: 3.5
Prove that F0 2  F12  F2 2  ...  Fn 2  Fn Fn1 .
3.3.2 Solving a recurrence relation
In this section we will discuss the different techniques of solving a
recurrence relation. First let us define what a solution of the
recurrence relation mean.
Objectives:
After these lessons the students will be able to:

118
 define what a solution of a recurrence relation mean.
 solve a linear recurrence relation using the methods of substitution,
generating functions , characteristic root and undetermined
coefficients
Definition: 3.3.2.1
Suppose that S is a subset of the nonnegative integers. Then a sequence
A  {an }n0 is a solution to a recurrence relation over S if the values a n of

A make the recurrence relation a true for every value of n in S. That is the

sequence A  {an }n0 is a solution of a recurrence relation if it is satisfy the


recurrence relation.
Example: 3.3.2.2
If c1 and c2 are arbitrary constants, then show that
an  c1 2 n  c2 5 n is a solution of the recurrence relation: an  7an1  10an2  0

over the set S of integers n  2 .


Proof:
Now substituting the expression c1 2 n  c2 5 n for a n into the recurrence
relation, we have
an  7an1  10an2  (c1 2 n  c2 5 n )  7(c1 2 n1  c2 5 n1 )  10(c1 2 n2  c2 5 n2 )

 c1 2 n  7c1 2 n1  10c1 2 n2  c2 5 n  7c2 5 n1 )  10 c2 5 n2 )

 2 n2 c1[2 2  7(2)  10]  5n2 c2 [52  7(5)  10]

 2 n2 c1[0]  5 n2 c2 [0]

0

Thus the sequence A  {an }n0 , where an  c1 2 n  c2 5 n satisfies the

given recurrence relation for n  2 ,hence an  c1 2 n  c2 5 n is solution of


the given recurrence relation.

119
Note that in the above example there are infinitely many different
solutions, one for each specific value of the constants. c1 and c2 . Such
solution is called general solution.
Suppose we are asked to find a solution of the recurrence relation in
example above for which a0  10 and a1  41 . These are called boundary
conditions (or initial condition).
Now a0  10  c1  c2  10 and a1  41  2c1  5c2  41 .

Now solving c1  c2  10
2c1  5c2  41 we get c1  3, c2  7 .

Hence an  3(2 n )  7(5n ) is a particular solution of the recurrence relation


that satisfies the given boundary conditions.
Activity: 3.6
1. For arbitrary constants c1 and c2 , show that an  c1 5 n  c2 n5 n satisfies
the recurrence relations an  10an1  25an2  0

2. For arbitrary constants c1 , c2 and c3 show that

an  c1 2 n  c2 5 n  c3 n5 n satisfies the recurrence

relations an  12an1  45an2  50an3  0 .


Now we shall consider four methods of solving recurrence relation.
These are:
1. substitution method,
2. generating function,
3. characteristic roots, and
4. Undetermined coefficients.

120
3.3.2.1 Solving recurrence relation by substitution
In the substitution method the recurrence for a n is used repeatedly to solve
for a n in terms of n . We desire that this expression involve no other terms
of the sequence except those given by boundary conditions. Let us also
illustrate the method in the next two examples.
Example: 3.3.2.1.2
Solve the recurrence relation an  an1  f (n) for n  1 by substitution.
Solution:
Now an  an1  f (n) for n  1 implies
a1  a0  f (1)

a2  a1  f (2)  (a0  f (1))  f (2)

a2  a1  f (2)  (a0  f (1))  f (2)

an  a0  f (1)  f (2)  . . .  f (n)


n
a n  a0   f (k )
k 1

n
Thus a n  a0   f (k ) is a solution of the given recurrence relation.
k 1

Example: 3.3.2.1.3
Solve the recurrence relation an  an1  n where a0  2 by substitution.
Solution:
Now an  an1  n implies
a1  a0  1  a1  a0  1

a2  a1  2  a2  a1  2

a3  a 2  3  a3  a 2  3

. .
. .

121
. .
an  an1  n  a n  a n1  n
   

If we add all of these equations, we get


a n  a0  1  2  . . .  n

an  a0  (1  2  ...  n)

n n
 2  (n  1) since a0  2 and 1  2  ...  n  (n  1) .
2 2
n
Hence an  2  (n  1) is a solution of the given recurrence relation.
2
Activity: 3.7
Solve the following recurrence relations by substitution.
1. an  an1  n 2 , where a0  7
1
2. a n  a n 1  , where a0  1
n(n  1)

3. an  an1  3n , where a0  1
Divide-and-Conquer relation
The recurrence relation of the form an  ca n d  f (n) where c and d are

constants and f (n) is some function of n is called “divide-and-conquer”


relation.
Usually these relations can be solved by substituting a power of d for n.
Example: 3.3.2.1.5
Solve the following divide-and-conquer relation given
by an  2an 2  n  1 , where a1  0 by substitution.
Solution:
We can solve this recurrence relation for n  2 k where k  1 by repeatedly
using the basic relation to get:

122
an  2an 2  n  1

 n 
2a n 2  22a n 4   1
 2 

 2 2 an 4  n  2

2 2 an 4  2 2 [2an 8  (n 4)  1]

 2 3 an 8  n  2 2 ,etc,

so that we have the following sequence of equations:


an  2an 2  n  1

2an 2  2 2 an 4  n  2

2 2 an 4  2 an 8  n  2
3 2

.
.
2 k 1 a n 2k 1  2 a n
k
2k
 n  2 k 1

Summing both sides of this sequence of equations, canceling appropriate


summands we get
an  2 k an 2k  n  1  n  2  n  2 2  ...  n  2 k 1

 an  n  1  n  2  n  2 2  ...  n  2 k 1 , since n  2 k and an 2k  a1  0

 kn  (1  2  ...  2 k 1 )

 kn  (2 k  1) ,since (1  2  ...  2 k 1 )  2 k  1
 kn  (n  1) ,since n  2 k
 n log 2 (n)  (n  1) ,since n  2 k implies k  log 2 (n)

Hence a n  n log 2 (n)  (n  1) is the solution of the given divide and


conquer relation.
Activity: 3.8

123
Solve the following divide-and-conquer relations by substitution:
1. an  2an 3  5 , where n  3k and a1  1

2. an  2an 4  n , where n  4 k and a1  1


3. an  2an 2  2n  1 , where n  2 k and a1  1

3.3.2.2 Solving recurrence relation by Generating function


In this section we show how to use generating function in order to
solve linear homogenous recurrence with constant coefficients.
Example: 3.3.2.2.1
Solve the recurrence relation an  7an1  10an2  0 for n  2 .

Solution:

Let A( x)   a n x be the generating function for the sequence {an }n0 .
n

n 0

We then have the following equations:


A( x)  a0  a1 x  a2 x 2  ...  an x n  ...

 7 xA( x)   7a0 x  7a1 x 2  ...  7an1 x n  ...

10 x 2 A( x)  10a0 x 2  ...  10an2 x n  ...

Adding these three equations, we obtain


(1  7 x  10 x 2 ) A( x)  a0  (a1  7a0 ) x  (a2  7a1  10a0 ) x 2 

 ...  (an  7an1  10an2 ) x n  ...

Since an  7an1  10an2  0 for n  2 , we get

(1  7 x  10 x 2 ) A( x)  a0  (a1  7a0 ) x

a0  (a1  7a0 ) x a0  (a1  7a0 ) x


 A( x)   .
1  7 x  10 x 2 (1  2 x)(1  5 x)

Now decomposing A(x) as a sum of partial fractions, we get

124
c1 c
A( x)   2 , for some constants c1 and c2 .
1  2 x 1  5x
c1 c
But A( x)   2
1  2 x 1  5x
 
 c1  2 n x n  c2  5 n x n
n 0 n 0


  (c1 2 n  c2 5 n ) x n
n 0

Hence an  c1 2 n  c2 5 n is the general solution of the given recurrence


relation.
The constants c1 and c2 can be determined if the initial conditions for

a 0 and a1 are specified. For example, if a0  10 and a1  41 , we may use


the form of the general solution an  c1 2 n  c2 5 n , and let n  0 and let
n  1to obtain the two equations

c1  c2  10 and 2c1  5c2  41 . Solving these two equations we


get c1  3 and c2  7 .
Hence an  (3)2 n  (7)5 n is a particular solution of the given recurrence

relation with boundary condition a0  10 and a1  41 .


Example: 3.3.2.2.2
Solve the recurrence relation an  6an1  12an2  8an3  0 for n  3

using generating functions.



Let A( x)   a n x be the generating function for the sequence {an }n0 . We
n

n 0

then we have the following equations:


A( x)  a0  a1 x  a2 x 2  a3 x 3  ...  an x n  ....

 6 xA( x)   6a0 x  6a1 x 2  6a2 x 3  ...  6an1 x n  ...

125
12 x 2 A( x)  12a0 x 2  12a1 x 3  ...  12an2 x n  ...

 8x 3 A( x)  8a0 x 3  ...  8an3 x n  ...

Adding these four equations, we obtain


(1  6 x  12 x 2  8x 3 ) A( x) 
a0  (a1  6a0 ) x  (a2  6a1  12a0 ) x 2  (a3  6a2  12a1  8a0 ) x 3

 ...  (an  6an1  12an2  8an3 ) x n  ...

Since an  6an1  12an2  8an3  0 for n  3 , we have

(1  6 x  12 x 2  8x 3 ) A( x)  a0  (a1  6a0 ) x  (a2  6a1  12a0 ) x 2

a0  (a1  6a0 ) x  (a 2  6a1  12a0 ) x 2


Thus A( x) 
1  6 x  12 x 2  8 x 3
But since (1  6 x  12 x 2  8x 3 )  (1  2 x) 3 , we use partial fractions to

conclude that there are constants c1 , c2 , c3 such that


c1 c2 c3
A( x)   
1  2 x (1  2 x) 2 (1  2 x) 3
  
 c1  2 n x n  c2  C (n  1, n)2 n x n  c3  C (n  2, n)2 n x n
n 0 n 0 n 0


(n  2)(n  1) n n
  (c1 2 n  c2 (n  1)2 n  c3 2 )x
n 0 2
(n  2) n
Thus an  c1 2 n  c2 (n  1)2 n  c3 2 is the general solution of the
2
given recurrence relation
Theorem 3.3.2.2.3 (General Solutions of the Fibonacci relation)
If Fn satisfies the Fibonacci relation Fn  Fn1  Fn2 for n  2 , then there are
n n
1 5  1 5 
constants C1 and C 2 such that Fn  C1    C2 


 2  , where the
 2   

constants are completely determined by the initial conditions.

126
Proof:
To prove this result we apply the generating function method of solving
a recurrence relation.
Now Fn  Fn1  Fn2 ,  Fn  Fn1  Fn2  0 for n  2

let F ( x)   Fn x n be the generating functions for the Fibonacci
n 0

sequence {Fn }n0 . Then note that


F ( x)  F0  F1 x  F2 x 2  F3 x 3  ...  Fn x n  ...

 xF ( x)   F0 x  F1 x 2  F2 x 3  ...  Fn1 x n  ...

 x 2 F ( x)   F0 x 2  F1 x 3  ...  Fn2 x n  ...

Adding these three equations we get


(1  x  x 2 ) F ( x)  F0  ( F1  F0 ) x  ( F2  F1  F0 ) x 2  ( F3  F2  F1 ) x 3  ...

 ( Fn  Fn1  Fn2 ) x n  ...

 F0  ( F1  F0 ) x since Fn  Fn1  Fn2  0 for n  2

Now we get
F ( x)(1  x  x 2 )  F0  ( F1  F0 ) x

F0  ( F1  F0 ) x
 F (x) 
1 x  x2
F0  ( F1  F0 ) x

(1  5 ) (1  5)
[1  x][1  x]
2 2
Thus, for whatever initial conditions on F0 and F1 , the method of partial
fractions applies to give F (x)  C1

C2
(1  5 ) (1  5 )
[1  x] [1  x]
2 2

1 5 1 5
Letting a  and b  , we get
2 2

127
  

1  ax 1  bx n 0

F (x)  C1  C2  C1 a n x n  C 2 b n x n 
n 0
  (C a
n 0
1
n
 C2b n ) x n

 
  Fn x n   (C1 a n  C 2 b n ) x n
n 0 n 0

n n
1 5  1 5 
 Fn  C1a  C2 b  C1 
n n
  C2 


 2  , for each n  0.
 2   

Thus this completes the proof.


Of course if we are given the initial conditions that F0  1  F1 , then we

1 1 5  1 1 5 
can find C1    and C 2    so that, the nth Fibonacci
5  2  5  2 

number is
n 1 n 1
1 1 5  1 1 5 
Fn       .
5  2  5  2 

Activity: 3.9
Solve the following recurrence relations using generating functions.
1. an  9an1  20an2  0 for n  2 with initial values a0  3 , a1  10

2. an  9an1  26an2  24an3  0 for n  3

Note:

From the above examples we observe that, If A( x)   a n x of a sequence
n

n 0

{a n }n0 where a n satisfies the homogenous linear recurrence relation

an  c1an1  c2 an2  ...  ck ank  0 , where ck  0, and n  k , then the

P( x)
generating function A(x)  , where
Q( x)

P(x)  a0  (a1  c1a0 ) x  (a2  c1a1  c2 a0 ) x 


2

128
...  (ak 1  c1ak 2  ...  ck 1a0 ) x k 1 and

Q( x)  1  c1 x  c2 x 2  ...  ck x k .

Example: 3.3.2.2.5
Let A(x) be the generating function of the sequence {an }n0 where
a n satisfies the recurrence relation an  5an1  3an2  0 for n  2 , a0  1 ,

a1  2 . Write A(x) in the form of P( x) .


Q( x)

Solution:
Clearly P( x)  a0  (a1  5a0 ) x and Q( x)  1  5x  3x 2 .

P ( x) a0  (a1  5a0 ) x
Hence A(x)   , since a0  1 , a1  2 , we get
Q( x) 1  5 x  3x 2
P( x) 1  7x
A(x)   .
Q ( x) 1  5 x  3x 2
Activity: 3.10
P( x)
Write a general expression for A(x)  , where A(x) is the generating
Q( x)

function for the sequence {a n }n0 where a n satisfies the following


recurrence relations:
1. an  5an1  8an2  4an3  0 for n  3 , a0  1 , a1  0 a2  1

2. an  2an3  an6  0 for n  6 , a0  1 , a1  a2  3 ,

a 3  a 4  a5  2
3.3.2.3 Solving recurrence relation by Characteristic Roots

129
This method is nothing more than a synthesis of all that we have
learned from the method of generating functions. If we want to solve
an  c1an1  c2 an2  ...  ck ank  0 where ck  0, then we can find
P( x)
A(x)  where Q( x)  1  c1 x  ...  ck x k is a polynomial of degree k .
Q( x)

The polynomial C (t ) obtained from the polynomial Q(x) by replacing x by


1 t and multiplying by t k is called the characteristic polynomial of the
recurrence relation. Thus,

C (t )  t k Q(1 t )
k 1
 t k (1  c1 1 t  c2 1 t 2  ...  ck 1 t k )  t k  c1t  ...  c k

Example 3.3.2.3.1
Find the characteristic polynomial for the recurrence relation
an  6an1  12an2  8an3  0 for n  3

Solution:
Clearly by the above discussion Q( x)  1  6 x  12 x 2  8x 3 ,
Hence the characteristic polynomial of the given recurrence relation
is C (t )  t 3Q(1 t )
 t 3 (1  6(1 t )  12(1 t 2 )  8(1 t 3 ))

 t 3  6t 2  12t  8

Activity 3.11
Find the characteristic polynomial for the recurrence
relation an  7an1  12an2  0 for n  2 .

130
Now let us discus how to solve the recurrence relation using the
characteristic roots method. Consider the following two cases.
1. The characteristic polynomial having distinct roots
If the characteristic polynomial C (t ) of a homogenous recurrence
relation an  c1an1  c2 an2  ...  ck ank  0 has distinct roots 1 ,  2 ,...,  k , then
the general form of the solutions for the relation is given by
an  c11  c2 2 ...  ck k where c1 , c2 ,..., ck are constants which may be
n n

chosen to satisfy any initial conditions.


Example 3.3.2.3.3:
Solve the recurrence relation an  7an1  12an2  0 for n  2 subject to the

initial values a0  2 and a1  5 .


Solution:
Clearly the characteristic polynomial of this recurrence relation is
C (t )  t 2  7t  12  (t  3)(t  4) .

Now the roots of this polynomial are 3 and 4.


Hence an  c1 3n  c2 4 n is the general solution of the given relation.

To determine the constants c1 and c2 we proceed as follow:


a0  2  c1  c2  2 and a1  5  3c1  4c2  5 .

c1  c 2  2
Now solving  these equation we get c1  3 and c2  1 .
3c1  4c 2  5

Thus an  (3)3n  4 n is a particular solution of the given recurrence


relation with initial condition a0  2 and a1  5 .
Activity: 3.12
Solve the recurrence relation an  2an1  an2  2an3  0 for n  3
subject to the initial values a0  1 , a1  2 , and a2  0 .

131
2. The characteristic polynomial having multiple roots
If the characteristic polynomial C (t ) of a homogenous recurrence

relation an  c1an1  c2 an2  ...  ck ank  0 for n  k has t

distinct roots 1 ,  2 ,...,  t with multiplicities m1 , m2 ,..., mt , respectively,


so that m1  m2  ...  mt  k . The general form of the solutions for the
relation is given by
an  (c1,0  c1, 2 n  ...  c1,m1 1n m1 1 ) 1  (c2,0  c2,1n  ...  c2,m21 n m2 1 ) 2 
n n

 ...  (ct ,0  ct ,1n  ...  ct ,mt 1 n mt 1 ) t


n

where ci , j are constants for 1  i  t and 0  j  mi  1 .


Example: 3.3.2.3.5
Suppose that the characteristics polynomial for a linear homogenous
recurrence relation is C (t )  (t  2) 3 (t  3) 2 (t  4) 3 . Clearly the roots of
the given polynomial are 2, 3, and 4 with multiplicity 3, 2, and 3,
respectively. Thus the general solution is
an  (c1,0  c1,1n  c1, 2 n 2 )2 n  (c2,0  c2,1n)3n  (c3,0  c3,1n  ...  c3, 2 n 2 )4 n

Example: 3.3.2.3.6
Solve the recurrence relation an  7an1  16an2  12an3  0 for n  3
with the initial conditions a0  1 , a1  4 , and a2  8 .
Solution:
The characteristic polynomial is of the recurrence relation is
C (t )  t 3  7t 2  16t  12  (t  2) 2 (t  3) and its roots are 2 and 3 with

multiplicity 2 and 1, respectively. Hence an  (c1,0  c1,1n)2 n  c2,0 3n is


the general solution of the given relation.

132
Now, a0  1  c1,0  c2,0  1 ,

a1  4  2c1,0  2c1,1  3c2,0  4 ,

a2  8  4c1,0  4c1,1  9c2,0  8

Solving this system of equations we get c1,0  5 c1,1  3 ,

and c2,0  4 . Hence

an  (5  3n)2 n  (4)3n  (5)(2 )  3(n2 )  (4)(3 ) is the unique


n n n

solution of the given recurrence relation .


Remark:
Here we have restricted our attention in the examples to linear recurrence
relation whose characteristic polynomials have had only real roots.
Activity: 3.13
Solve the recurrence relation an  an1  3an2  5an3  2an4  0 for n  4
subject to the initial values a0  1 , a1  0 , a2  1 and a3  2 .

3.3.2.4 Solving inhomogeneous linear recurrence


relations(IHR)using generating function
Let us turn our attention now to learn how to solve the
inhomogeneous recurrence relation (IHR):
an  c1an1  c2 an2  ...  ck ank  f (n) for n  k where, ck  0 and

f (n) is some specified function of n . Here we attempt to find a

solution using generating function. We follow the same procedure as


in solving homogenous recurrence relations HR
Example: 3.3.2.4.1
Find a solution to an  an1  3(n  1) where n  1 and, where a0  2 .
Solution:

133
We then have the following equations:
A( x)  a0  a1 x  a2 x 2  ...  an x n  ...

 xA( x)   a0 x  a1 x 2  ...  an1 x n  ...

Adding these two equations, we obtain


(1  x) A( x)  a0  (a1  a0 ) x  (a2  a1 ) x ...  (an  an1 ) x  ...
2 n

Since an  an1  3(n  1) for n  1, we have



(1  x) A( x)  a0  3 (n  1) x
n

n 1


a0  3 (n  1) x n
A( x)  n 1

1 x

3 (n  1) x n
a0
  n 1
.
1 x 1 x

3x 2 x2
1 (n  1) x  (1  x) 2
2
  , since a0  2 and n

1  x (1  x)3
  
3x 2
 2 x n  3 2 ( n(n  1) x n ) since,
n 0 n 0 (1  x) 3
 3 2 ( 
n 0
n(n  1) x n )


  (2  (3 2.n.(n  1)) x n for n  0
n 0

Thus an  2  3 2 (n)(n  1) is a solution of the given recurrence


relation.
Example: 3.3.2.4.2
Find a general expression for a solution to the recurrence
relation an  5an1  6an2  4 n where n  2 .
Solution:

134

Let A( x)   a n x be the generating function for the sequence {an }n0 ,
n

n 0

where a n satisfies the recurrence relation

an  5an1  6an2  4 n where n  2

We then have the following equations:


A( x)  a0  a1 x  a2 x 2  ...  an x n  ...

 5xA( x)   5a0 x  5a1 x 2  ...  5an1 x n  ...

6 x 2 A( x)  6a0 x 2  ...  6an2 x n  ...

Adding these three equations, we obtain


(1  5x  6 x 2 ) A( x)  a0  (a1  5a0 ) x  (a2  5a1  6a0 ) x 2 

...  (a n  5a n 1  6a n  2 ) x n  . . .

Since, an  5an1  6an2  4 n for n  2 we have



(1  5x  6 x 2 ) A( x)  a0  (a1  5a0 ) x   4 x
n n

n 2


a0  (a1  5a0 ) x   4 n x n
Thus A( x)  n2

1  5x  6 x 2

a0  (a1  5a0 ) x 4 n
xn
  n2 .
1  5x  6 x 2
1  5x  6 x 2
  
x2
But,  4 n x n  4 2 x 2  4 n2 x n2  4 2 x 2  4 n x n  4 2
2 n2 n 0 1  4x

This is true because of a change of dummy variables,


Therefore
a0  (a1  5a0 ) x 42 x 2
A( x)  
1  5x  6 x 2 (1  4 x)(1  5 x  6 x 2 )

135
a0  (a1  5a0 ) x 42 x 2
A( x)  
1  5x  6 x 2 (1  4 x)(1  5 x  6 x 2 )

But since (1  5x  6 x 2  (1  2 x)(1  3x) , we have


(1  4 x)a0  (a1  5a0 )4 2 x 2 c d e
A( x)    
(1  4 x)(1  3x)(1  2 x) 1  4 x 1  2 x 1  3x
  
 c  4 n x n  d  2 n x n  e 3 n x n
n 0 n 0 n 0


  (c 4 n  d 2 n  e3n ) x n
n 0

an  c4 n  d 2 n  e3n is the general solution of the given IHR, where

d 2 n  e3n is a solution of the homogenous part of the recurrence


relation an  5an1  6an2  0 and c4 n is a particular solution of the of the
IHR a specific choice c . To determine the value of c substitute
an  c4 n  d 2 n  e3n in the IHR an  5an1  6an2  4 n .

But we observe that substituting an  c4 n  d 2 n  e3n is the same as


substituting c4 n this because d 2 n  e3n is a solution of the homogenous
relation an  5an1  6an2  0 .
Thus we have
c4 n  5c4 n1  6c4 n2  4 n
 c4 n2 (4 2  5. 4  6)  4 n

 2c4 n2  4 n
c 8
Hence an  (8)4 n  d 2 n  e3n is the complete solution of the given IHR
an  5an1  6an2  4 n where n  2 and

(8)4 n is a particular solution of the IHR an  5an1  6an2  4 .


n

136
42 x 2
Note: The expression also generates the sequence
(1  4 x)(1  5 x  6 x 2 )

{a n }n0 where an  (8)4 n  d 2 n  e3n , thus it plays the role of A(x)

Example: 3.3.2.4.3
Find the complete solution of the above example if f (n)  2 n .

Solution:

Let A( x)   a n x be the generating function for the sequence {an }n0 , where
n

n 0

a n satisfies the recurrence relation an  5an1  6an2  2 where n  2


n

From the above example we see that


a0  (a1  5a0 ) x 2 n
xn
A( x)   n 0

1  5x  6 x 2
(1  4 x)(1  5 x  6 x 2 )
 
Now  2 n x n  2 2 x 2  2 n2 x n2 , this by a change of dummy variables
2 n2

becomes,

22 x 2 a  (a1  5a0 ) x 4x 2
22 x 2  2n x n  . Thus, A( x)  0 
n 0 1  2x (1  3x)(1  2 x) (1  3x)(1  2 x) 2

4x 2
Since A(x) and generates the same sequence, by partial
(1  3x)(1  2 x) 2

fraction decomposition we have


4x 2 a b c
  
(1  3x)(1  2 x) 2
1  3x 1  2 x (1  2 x) 2
  
 c 3n x n  d  2 n x n  e (n  1)2 n x n
n 0 n 0 n 0

137

  (c3n  d 2 n  e(n  1)3n ) x n
n 0

4x 2
Thus, the expression generates the sequence {an }n0 the
(1  3x)(1  2 x) 2

sequence, where
an  a3n  b2 n  c(n  1)2 n

 a3n  (b  c)2 n  cn2 n

 a3n  d 2 n  cn2 n where b  c  d .


Note that A(x) also generates {bn }n0 .

Hence, an  a3n  d 2 n  cn2 n is the general solution of the given


IHR where a3n  d 2 n is a solution to the homogenous relation,
an  5an1  6an2  0 , but cn2 n is a particular solution of the

inhomogeneous relation for a specific choice c .


In fact by substituting cn2 n into the recurrence relation we
obtain cn2 n  5c(n  1)2 n1  6c(n  2)2 n2  2 n ,
 c2 n2 (4n  10(n  1)  6(n  2))  4 n

 c  2
Thus  2n2 n is a particular solution of the inhomogeneous
relation an  5an1  6an2  2 n .

Hence an  a3n  d 2 n  2n2 n is the complete solution of the given IHR


an  5an1  6an2  2 n where n  2

Note that in example 3.3.2.4.3, a particular solution was of the form cf (n) ,
but in example 3.3.2.4.4 a particular solution had the form cnf (n) . This is
because f (n)  4 n gave us the factor (1  4 x) in the denominator of the

138
expression for A(x) , and in this case 4 was not a root of the characteristic
polynomial so no higher power of (1  4 x) occurred in the denominator of
A(x) , but in the case of f (n)  2 n , the factor (1  2 x) 2 occurs in the

denominator of A(x) because 2 is the root of the characteristic polynomial.


There are three clues that seem to be consistent in both of the above
examples:
1. any solution of the IHR is the sum of a particular solution of the IHR
and a solution of HR;
2. the form of the particular solution is directly related to the function
f (n) ;and

3. the form of a particular solution is affected by the roots of the


characteristic polynomial C (t )
The key concept about inhomogeneous recurrence relation (IHR) with
constant coefficient is that every solution is the sum of a particular solution
a nP and the solution of the associated linear recurrence relation a nH that is

an  anH  anP becomes the complete solution of the HIR. Here we apply the

method called the method of undetermined coefficient.


3.3.2.5 Solving inhomogeneous linear recurrence relations the
method of Undetermined Coefficients
The method of guessing the general form of a particular solution to an
inhomogeneous recurrence relation and then determining the values of the
coefficients in the general expression is called the method of
undetermined coefficients.
In order for this method to be successful we require a little insight and
more experience. We use generating function to gain that experience and to
verify what forms are good guesses for solutions. Once we have done this

139
for several types of situations, we will not have to resort to generating
functions anymore; rather we will make educated guesses based on our
experience. Hence we follow the following rules.

1. A trial solution for exponentials:


In the IHR an  c1an1  c2 an2  ...  ck ank  f (n) for n  k where, ck  0
If f (n)  da n , then

a) a n  ca is a particular solution of IHR


p n

an  c1an1  c2 an2  ...  ck ank  f (n) for n  k

if a is not the root of the characteristic polynomial C (t ) .

b) anp  cn m a n is a particular solution of IHR if a is the root of the


characteristic polynomial C (t ) of multiplicity m .
Example: 3.3.2.5.1
Find a particular solution to an  7an1  10an2  7. 3n for n  2.
Solution:
Clearly the characteristic polynomial C (t ) of the relation is
C (t )  t 2  7t  10  (t  2)(t  5) .

Hence the homogenous solutions have the form a nH  c1 2 n  c2 5n .


Since 3 is not the root of C (t ) , the particular solution of the recurrence
relation is of the form anp  c3n where c is the constant yet to be determined.
Substituting anp  c3n for a n in the recurrence relation
an  7an1  10an2  7. 3n gives

c3n  7c3n1  10c3n2  7 . 3n

 63
 c3n2 (32  7 . 3  10)  7 . 3n  c  .
2

140
 63  n
Thus a np   3 is a particular solution and
 2 

  63  n
an   3  c1 2  c2 5 , is the complete solution of the given relation.
n n

 2 

P 
Note that if {a n1 }n0 is a particular solution to
an  c1an1  c2 an2  ...  ck ank  f1 (n) and if {anP2 }n0 is a particular solution

to an  c1an1  c2 an2  ...  ck ank  f 2 (n) , then {anP  anP }n0 is a particular
1 2

solution to an  c1an1  c2 an2  ...  ck ank  f1 (n)  f 2 (n).


Example: 3.3.2.5.2
Find a particular solution to an  7an1  10an2  7. 3n  4 n for n  2.
Solution:
To solve this, we use the above comments to resolve the problem into
finding particular solutions to an  7an1  10an2  7.3n
 63  n
and an  7an1  10an2  4 n . We know from the above example a np   1
3 is
 2 

a particular solution of the relation an  7an1  10an2  7.3n


Let us solve a particular solution for an  7an1  10an2  4 n . Since 4 is not the
root of the characteristic polynomial C (t )  t 2  7t  10  (t  2)(t  5) . The
particular solution is of the form anp  c4 n where c is the constant yet to be
2

determined. Substituting anp  c4 n for a n in the recurrence relation gives


2

c4 n  7c4 n1  10c4 n2  4 n

 c4 n2 (4 2  7 . 4  10)  4 n

 c  8 .

141
Thus anp  (8)4 n is a particular solution of the second relation.
2

 63  n
Therefore, an  anP  anP  
1 2
3  (8)4 is a particular solution
n

 2 

to an  7an1  10an2  7.3n  4 n .


Example: 3.3.2.5.3
Find a particular solution an  4an1  4an2  2 n .

Solution:
Since the characteristic polynomial is C (t )  t 2  4t  4  (t  2) 2 and 2 is the
root of C (t ) with multiplicity 2 , thus particular solution is of the form
anp  cn 2 2 n where c the constant is yet to be determined. Substituting

anp  cn 2 2 n for a n into the recurrence relation, we obtain

cn 2 2 n  4c(n  1) 2 2 n1  4c(n  2) 2 2 n2  2 n

 c2 n2 [4n 2  8(n  1) 2  4(n  2) 2 ]  2 n

 8c  4
 c 1 2

There fore anp  (1 2)n 2 2 n is a particular solution.


 n2 
And a n   2 n  c1 2 n  c2 n2 n is the complete solution of the given
 2 

relation.
2. A trial solution for products of polynomials and exponentials
Now let us suppose that f (n)  ( p0  p1n  ...  pt n t ) a n where pi ‟s are
constants. The particular solution of the IHR
an  c1an1  c2 an2  ...  ck ank  f (n) for n  k is of the form

142
a) anP  ( A0  A1n  ...  At n t ) a n if a is not the root of the characteristic
polynomial C (t ) and
b) anP  n m ( A0  A1n  ...  At n t ) a n if a is the root of the characteristic
polynomial C (t ) of multiplicity m .
Example: 3.3.2.5.4
Solve the recurrence relation an  6an1  8an2  n4 n where a0  8 and a1  22 .

Solution:
Since 4 is the root of the characteristic polynomial
C (t )  t 2  6t  8  (t  2)(t  4) with multiplicity 1 , the particular solution takes

the form anP  n( A0  A1n) 4 n . Substituting this expression into the recurrence
gives
n( A0  A1n) 4 n  6(n  1)( A0  A1 (n  1)4 n1  8(n  2)( A0  A1 (n  2)4 n2  n4 n

But by canceling the common term 4 n2 , we have


16n( A0  A1n)  24(n  1)( A0  A1 (n  1))  8(n  2)( A0  A1 (n  2))  16n

Now this is an expression that holds for all values of n , now if n  0 we


obtain the simplified equation A0  A1  0 , and then for n  1 we obtain
A0  3 A1  2 .

 A0  A1  0
Now solving  we get A0  1 and A1  1
3 A0  4 A1  2

Hence anP  n(1  n) 4 n  n(n  1)4 n is a particular solution.


And an  n(n  1)4 n  c1 4 n  c2 n4 n is the general solution of the relation, and
the initial conditions a0  8 and a1  22 gives c1  3 and c2  5 .

143
Hence, an  n(n  1)4 n  (3)4 n  (5)n4 n is the unique solution to the recurrence
relation with the given initial conditions.

3. A trial solution for products of polynomials


The case where f (n)  p0  p1n  ...  pt n t is just a special case of the above
discussion where a  1 . Then we need be concerned only with whether or not
1 is a root of the characteristic polynomial C (t ) .

Example: 3.3.2.5.5
Find a particular solution of an  2an1  an2  5  3n .
Solution:
Since 1 is the root of the characteristic polynomial C (t )  t 2  2t  1  (t  1) 2 of
multiplicity 2 , the particular solution takes the
form anP  n 2 ( A0  A1n)  A0 n 2  A1n 3 .
Substituting this expression into the recurrence gives
A0 n 2  A1n 3  2[ A0 (n  1) 2  A1 (n  1) 3 ]  [ A0 (n  2) 2  A1 (n  1) 3 ]  5  3n , and this

simplifies to (2 A0  6 A1 )  6 A2 n  5  3n and holds for all n . In particular


for n  0 and n  1, we get
2 A0  6 A1  5 and 2 A0  8 , this gives A0  4 and hence A1  1 2 .

Thus, a particular solution is anP  4n 2  (1 2)n 3 , and the general solution


anP  4n 2  (1 2)n 3  c1  c2 n , where c1 and c 2 are the constants that can be

determined by the initial conditions.


Activity: 3.14
1. Find a particular solution to the following inhomogeneous recurrence
relation using the method of undetermined coefficients.
a) an  3an1  3n

144
b) an  4an1  n  2
c) an  2an1  an2  2 n
d) an  2an1  an2  4
e) an  3an1  1oan2  n 2  n  1
2. Find the complete solution (homogenous plus particular solutions) to
a) an  10an1  25an2  2 n , where a0  2 3 and a1  3 .
b) an  2an1  n  3 for n  1 , and a0  3

145

You might also like