Professional Documents
Culture Documents
DSGTChap 4 Counting
DSGTChap 4 Counting
COUNTING
BY, PR O F. M I T R AKSH I PAT I L
BASIC COUNTING PRINCIPLES
• In daily lives, many times one needs to find out the number of all
possible outcomes for a series of events.
1. Sum Rule: Assume some event E can occur in m ways and a second
event F can occur in n ways, and suppose both events cannot occur
simultaneously. Then E or F can occur in m + n ways.
• In general, if there are n events and no two events occur in same time
then the event can occur in n1+n2..........n ways.
• Or more generally,
• Example:
In class, there are 4 boys and 10 girls. If a boy and a girl have to
be chosen for the class monitor, the students can choose class
monitor in 4 x 10 = 40 ways.
• Example:
How many different license plates can be made if each plate
contains a sequence of three uppercase English letters followed by three
digits?
• Solution:
By the product rule, there are 26 · 26 · 26 · 10 · 10 · 10 = 17,576,000 different
possible license plates
COMBINING THE SUM AND PRODUCT RULE
• Solution −
From X to Y, he can go in 3+2=5 ways (Rule of Sum).
Thereafter, he can go Y to Z in 4+5=9 ways (Rule of Sum).
Hence from X to Z he can go in 5×9=45 ways (Rule of
Product).
2. Let, A be a finite set & let B be any set, then
|A-B|=|A|-|A ∩ B|
Proof-
Here,
A=(A-B) ∪(A ∩ B) ….disjoint union of 2sets
So, By addition principle,
|A|= |A-B|+| A ∩ B|
So, |A-B|=|A|-| A∩ B|
3. Principle of Inclusion-Exclusion-
Let A & B be 2 sets. Then,
|A ∪ B|=|A|+|B|-|A ∩ B|
24 students out of 50 students like cold drinks, 36 like hot drinks and
each of them like at least one of the two. How many like both?
Solution-
Let X be the set of students who like cold drinks and Y be the set
of people who like hot drinks.
|X∩Y|=|X|+|Y|−|X∪Y|=24+36−50=60−50=10
i. How many students were surveyed who had taken none of the three
types of courses?
ii. Of the students, how many had taken only a Computer Science
Course?
Solution-
Let A- set of students taken Maths Course.
B- set of students taken Computer Science Course.
C- set of students taken Business Course.
|∪|- |A ∪ B ∪ C|
= 260-154
=106
So, 106 students had taken none of the three types of course.
ii. Students who have taken only Computer Science Course,
= |B|-|B∩A|-|B∩C|+|A ∩ B∩C|
= 94-26-22+14
=60
So, 60 students had taken only
Computer Science Course.
Example-
In a survey of 60 people, it was found that
25 read Newsweek magazine,
26 read Time and
26 read Fortune.
Also,
9 read both Newsweek and Fortune,
11 read both Newsweek and Time,
8 read both Time, and Fortune,
8 read no magazine at all.
a)Find the number of people who read all 3 magazines.
b) Draw the Venn diagram filling the correct number of people in all
regions of the Venn Diagram.
c) Determine the number of people who read exactly 1 magazine.
a)Given-
|N ∪ T ∪F| = 60 - 8 = 52
|N|=25 |T|=26 |F|=26
|N ∩ T|=11 |T ∩ F|=8 |N ∩ F|=9
• Theorem-
If n pigeons are assigned to m pigeonholes, & m<n, then at
least one pigeonhole contains two or more pigeons.
Example-
If 13 people are assembled in a room, show that at least 2 of them must
have their birthday in the same month.
Solution-
Therefore,
By pigeonhole Principle, at least 2 people were born in the same
month.
• Show that if any 5 numbers from 1 to 8 are chosen, then 2 of them
will add up to 9.
• Solution-
Construct 4 diff sets, each containing 2 numbers that add up to
9 as-
A1={1,8}
A2={2,7}
A3={3,6}
A4={4,5}
Each of 5 nos. chosen must belong to one of these sets.
Since, there are only 4 sets, by pigeonhole principle, two of the
chosen numbers belong to the same set. These numbers add up to 9.
EXTENDED PIGEONHOLE PRINCIPLE
• Theorem-
If n pigeons are assigned to m pigeonholes, then one of
the pigeonholes must obtain at least └(n-1)/m┘+1 pigeons.
• Example1-
• Show that if 30 dictionaries in a library contain a total of 61327 pages,
then one of the dictionaries must have at least 2045 pages.
• Solution-
Let n pages- pages &
m dictionaries- the pigeonholes
Assign each page to the dictionary in which it appears.
Then by extended pigeonhole principal, one dictionary must contain at
least ,
└(n-1)/m┘+1
=└ (61327-1) /30┘+1=
= 2045.2 pages
=2045 pages.
• Example2-
6 friends discover that they have total of 2161 Rs. with them on a trip
to the movies. Show that one or more of them must have at least 361
Rs.
• Solution-
Let Rupees-pigeons
Number of friends- Number of pigeonholes.
Then,
By Extended pigeonhole principle, one friend must have at least
└(n-1)/m┘+1
=└2160/6┘+1
=360+1
=361 Rs.
RECURRENCE RELATIONS
• For example,
an-3an-1 +2an-2=0 RR of order Two.
• For example,
• Each linear recurrence is associated with its homo. Equation and the
solution of homo. Equation is called Homogeneous solution of the given
RR.
Means for any linear RR, if f( r)=0(RHS term 0), then the given equation is
homo. RR.
• For example,
ar-6ar-1 +11ar-2 +6ar-3 =2r
ar =A k
1
• Substituting this into the relation, we get,
C0 (A 1
r) + C1 (A 1
r-1 )+ C2 (A 1
r-2) +…….+ Ck (A 1
r-k) =0.
C0 (A 1 )
r + C1 (A 1
r-1 )+ C2 (A 1 )
r-2 +…….+ Ck (A 1 )
r-k =0
A 1
r-k [C0 1
k + C1 1
k-1+
…….+ Ck]=0
Or
C0 1
k+ C1 1
k-1 +……+Ck =0.
Solution-
The Characteristic equation is,
2- - 6=0
2- 3 +2 - 6=0
( - 3) +2( -3)=0
( -3)( +2)=0
so,
=3, -2 are the characteristic roots of the eqn.
So the Solution of given RR is,
ar =A1 (3)r + A2(-2)r
Example-
Solve the recurrence relation
ar - 6ar-1 + 9ar-2 =0
Solution-
The Characteristic equation is,
2- 6 + 9=0 or x2- 6x + 9=0
( -3) 2=0
so,
=3, 3 are the characteristic roots of eqn.
Since, the roots are repeated, the Solution of given RR is,
ar =(A1 + A2 r)3r where A1,A2 are constants
Example-
Solution-
The Characteristic equation is,
2 +2 -3=0
2 +3 - -3=0
( +3)-1( +3)=0
( +3)( -1)=0
so,
=-3, 1 are the characteristic roots of eqn.
So, the Solution of given RR is,
ar = A1 (-3)r + A2(1)r where A1,A2 are constants
= A1 (-3)r + A2
To find A1 , A2, Putting r=0, we get,
ar = A1 (-3)r + A2
a0 = A1 (-3)0 + A2
1 = A1 + A2
Solution-
The Characteristic equation is,
2 -6 +9=0
( -3) 2 =0
so,
=3, 3 are the characteristic roots of eqn(equal roots).
So, the Solution of given RR is,
ar =(A1r+ A2 )(3)r where A1,A2 are constants
To find A1 , A2, Putting r=0, we get,
ar =(A1 r+ A2 )(3)r
a0 = (A1 (0) + A2)(3)0
1 = A2
On solving, we get,
A1=1 A2=1
So, the Homogeneous solution of given RR is,
ar = (1r+1)(3)r
Example-
Solution-
The Characteristic equation is,
2 - -1=0
a=1,b=-1,c=-1
PARTICULAR SOLUTIONS(NON -HOMO. RR)
• Procedure for obtaining RR solution depends on the form of f(r )i.e. RHS
of given relation.
This form of parti. soln has nothing to do with order of RR. It only
depends on RHS.
• Example-
• Find the particular solution of the RR
ar -5ar-1 +6ar-2 =1
Soln-
In given RR, the RHS is a constant. So, the general form of particular solution
is,
ar(P) =P
Soln-
In given RR, the RHS is,
ar =5ar-1 -6ar-2 +7n or ar -5ar-1 + 6ar-2 =7n
The Chara. Equation of the Eqn is,
2-5 +6=0
( -3) ( -2)=0
=3,2
Roots are distinct. So, Homo. Soln of RR is,
an =A13n+A22n where A1 & A2 are constants.
Here, f(n)= 7n .
So, the Solution is,
an(p) =P. 7n
By substituting the terms in given RR, we get,
P. 7n= 5P. 7n-1-6 P. 7n-2+ 7n
49P=35P-6P+49
20P=49
p=(49/20). 7n
an =A13n+A22n P+(49/20) 7n
Thank You!!!