SARASWATIEducation Society's PAGE NO.
:
SARASWATICollege of Engineering DATE:
Module - 04
Counhing
Basic caunhing pnnciple -swm rWe, A
|roduct ule Thcluyion- Eaxecl yi on pnnciple,
Pigeonhale pinciple.
L ReCuren ce gel"saluìng zecuren ce Telations .:
Bic counhng pn nciples
Sum Tue pnnciple
Eunite set S iu patitioned intoparts
SS - S if the pats are digjoint
e theix nion S
S4 US,Vs, U.... US = S
h tha caye ls 1,|+ s2l+- |S|
Ra Lets be the set of students atendina
the combina toncs Jecture It can be
aiioned ino parts
phere Sl2 set of studerts that ike eay ex.
S) = Set of stud erts fhat don' t Jike esy e.
th en sl=30 tofed stuc.
2) Product Szh a Rule Prnciples
IA
Jf s y a finite set that the proclut
eg Conslder the car license plates They have
where, Ji de are letters brom (A - Z] f
cligjts Arom Co --3], How ever
qre
de &ns mouy be .omittecd.
Count te no of possi bilitiy for each
position Cal. the size of valide Jicen se play
set
No. of p05sibi li ti ey for each position.
G\MH hi h3
26 27
size of valide Jtcense plte set y given ày
ay
he preduct :
1X 1 K 26 27 X10 X l0 Kl|=77 2200
SARASWATI Education Society's PAGE NO.:
P SARASWATICollege of Engineering DATE:
3) Pnnciple of nclyion- Exduion i
Let A B be finite sets
Then
|AUB| =JA|+|8| -| A08
=)roof
Coyidey Venn dlaaram
dllag1am
B AUB (A-B) B
|AUB) = JA -B)V J8
A-B
= lA1+ |B)'- 190 8
Hencep10ved
|Muual hclsion- Excluion indple fer
three ses
|A080 C |A|t/6|+1C| -1A18|-161c|-9Nc
exa Ho) many ele CTe in A, UA if there
re 12
iv)
1A,0 1: 1 2 t - 0 = 30
25
mwt hire 2s Program mers
() A Comp. Com pan y
4o
to handle sustem Drog rammingjohsof &those
programmers fer ppl? pro gram mng
hired 0 will be epected to perhern jobs of
both typy Ho w many progTammers myt be
hired
) ]spl 2
|hPJ = 40
|5Pn AP) = (o
SPU AP)= |3P) + lae)- |sp a pP)
sP UAPj = ss
AP
SPUAPss
SARASWATIEducation Society's PAGE NO.:
SARASWATICollege of Engineering DATE:
Houw many iniegers bet?
not divisible by Nor by 3 nor by s2
Let AA2 As be the sets of int betn
to 6O divisible by 2 31s Tespeciely
|As]=60
A0A3):
|A20 As):
NO Of int bet 4 to 6owhich are divisible
by. 23,S
=3O + 204|2 -/0-6 - 4+2
62-20+ 2 - 2 0
= 44 ) divisible by 235
:Not divisible by 213,5
& 6o-44
( 4 How many nos be sUo are divisible by
bet"" 1to soo,
) Let,AA Aa be se of e int divisible by
bu
s 7 bes
|A= S00 =166
-33
1
4 JA,4A2 AAs )
- 166 + l00+7-33- 23-.14+ 4
= 337-70 t4
= 3 4|-70
|A,VAUA= 271
SARASWATIEducation Society's PAGE NO.:
SARASWATI College of Engineering DATE:
SO|nd
Eind the no of +ve int
int not
not exceeding
L00 that
tha aYe not dluisible by
draw orAponcng venn aliag7am.
There are (o0 int not erceeclng |0 o
A:ivisible by s
Biuisible by 2
A oo B 14
|AVB| |A| B| -A06|
32
32 int. af the nt qre diuisible
No of int not dluisible
68
* Pigeon hole Pinciple
Thm:
Zf n pigepons qre atigned to m pigeon hol es
then at least one pigeon hole
coratain3 two more Pigeons
Proof:
Suppose each piqeon hole Contauy at mos b
one pi qeon Then m pigeons will be
accoma clat ed in m piqeonholey . one pigeon
in each pigeon hole But m< not a l
pigeons have been atigned pigeonholes.
Thu conhadichion.
Hen ce there ý at Jeast One pig eon ho Ie
tohi ch Contuy more pigeons
7colours qre uyedl to paint
bitycle ehow that at least of them
will be of same Co lour.
m
Let colour denote piqeon holes e bicyeles
denote pigeons m< n
7bicyl each of 7 Colo4rs
remainder 1 will be colour from the 7
2:2. 8 bicycles may hare
SARASWATI Education Society's PAGE NO. :
SARASWATICollege of Engineering DATE:
Eaedended P'aeonhole Pinciole:
o KfK there qre m pigeonkoles e mhe thah.
2m Aigeons , then three on manepigkons
will Aqve to ba usigned td at least.\ne
of the igenholes
Thm:
T£ nabjects a1e placed nto k bores
then there i at Jeast One bo* cantang
at Jeast [ nlk ] abjects
Amon4 00 people , find the min: ho of
people coho bor n Same monthu.
n= (o0
k |2
born
no of pcople
n Sme m onth
g people wo born n same months.
lsho ) hat if 20 people are selected then
eind the min no of people born the
same day of the week
Pigons Piaeon hole.
n20 K=7
min: no of
of people born Sme day of
week
eg sho w that if g books qre
to be kept at
to
4 -shelvey there must be at Jeast one
Shelf which continy at deast3 books.
n=g, k~4
min: no- of books in a delf
[]-[2]:22
Henced proved.
+ Extended Pigeon hole Pinciple i
Jf n.piqeon holes qre ocupied by kn +I or
Pigons, Where k iyu a 4ue i n then
at least
lea_t one pegion hle oc( upied by kt! or
more piqeons
pigénboles nti Pig eons
at least 1 pigeonhole at least k+1 pigeons
eg Find the min no of stud in clas Jo be sure
that 3 of them qre born in the sCme morth.
month’ Pégeon hole student
3Ptgeon
n=12
min no of stud. = Knt| 2* 12 +1 2s
SARASWATI Education Society's PAGE NO.:
SARASWATICollege of Engineering DATE:
() wha the min no of stud.
clay to be Sure that at Jeast
eaired n
of
them will
will receive the Same
s grade f
there qre s
S possible q1ades AB, C,D£
n= piganhales = 6 K+| J_ pigen ary
n=
min- no. of qradey =26
52 How many iends mut you have to qurante
that at Seast s of them uill have bith dayy
month:
|2 h
Here., pigeonhole
pigeon = K+ S
12+4 + I 49
Thus among 41 hiends at Jeat s of
them wi| hane binthdays in the Same
q A bag containy (o red marbley, lo whte
marbles d lo blue maibley . wh at the mi n
no of marbes you have to
to chooseYandomly
brom the bag
bag fofo ensure that we get 4
marbles of same color ? Use pig eon hale
pnnciple.
D pigeonhole -h
n 3 Ccolours)se
K+l = 4
mih. no of marbley Teq ujred
SARASWATI Education Society's PAGE NO.:
SARASWATICollege of Engineering DATE:
Recuneoce nelaion
II ç an quation tha gecarsiuely cefine1
Se. where the neat fer m y
y a A
fhe previo ferm
2
Sne 2 Sn-i
n
Sn 2Sn. y meCur e ce rel
with uHaJ cond S 2
S-§3,7, !, (S, 9
Sna Sn- t4 n,2, S, 3
S , , 2, 3, 3, & , 3, - S
Sn Sn with S Se2
Fibongcci SeQu eh ce.
Lineay Yecuren ce relatian with constart
Coefficiet
(Co an +Oni+ an-2 7--tCkan-k Fn)
shere, Co, C_CG, Ck are constant
fo) may be consfant cr f " n ter ms of n
check whether
)2ah t h-1 3
eg
an ln
3) n On * On-2
4) an .4n-an
Grder : the difference bet the highest
¢ Jowest subnpt of a
Recuren ce rel order Grder
2an t 3 a 3
an t 7 - |24p-2 20 o--2)
n - (n-3) >3
Deqree i
t lefined ay tne qhet powY of an
degree of linear recnence rel 1
* Mehods of solving: AinegY recurenee e
1) Tter ati on method
y Method of characteshic roots
3) GeneraBi ng funttory
SARASWNTIEducation Society's PAGE NO.:
SARASWATICollege of Engineering DATE:
Method of charactemstic Toots
Jineax Yec: Yel with const coeff.
HomogeneaA Non- Homoqeneoy
recuryence rel Tecuence ne).
PCn)O
Homogeneou recunence rel:
Steps to solve -
|1) Pu an Y
Find n
Caled charactenstic en
n ,
Qutilar e
BSolue chay eo d And char roots
4 ff chaz 0ats. arei
T001s
qenfrad sol^ n
an b + b t b Ts
b!, b2 bs const
an= (bit nb ) , an= (b, +bh t ban),
- (by+ hbz) 7,^+ bg +by Y
8. 1 solue an an-, 20n-22°,
2 n
with initial Gonditon ao 20, q1z J
=)
h
n-2
r^Crt -2] =o
|On: b, (2)"+ ba ()"
e.b tb2 o
a, 1
1 b 2 + be (-i)'
2bib = 1
zbi= 1
:: b2: b -1
SARASWATIEducation Society's PAGE NO.:
SARASWATI College of Engineering DATE:
sb|ve an 4 an - an-2) with nittaJ
cond
Pu
+ 4Y
) char e
) char. Toot
An= (b +b h b) "
sol foy recunrence re)n
An=(btn be)
Initial condn
Qo- (btO bX2)
1-(bito) 1
bl 1
£, 1
Q = Cb,t 1 b ) l
=(1t b)2)
-3/2
an =1 tn(*)
an=[l
P3 Solve
h
char: eq
+2 Y- 1 8 0
^2233
an sbb, (2)"4 Cb th b )
an bi (2)+ Cbzt nbo)3) "
Solve an -ani -44n-3with
4ah-2
Put
d char eg
rTA t) - 4(r-)30
(r+) (Y4)o
char oot
z-, 42,
SARASWATI Education Society's PAGE NO.:
SARASWATI College of Engineering DATE:
a = (-) b+ () b2+ (-z) bs
8 b i +betbs
a = bi(-)ba (2)+ b3 (-)
6 - b i + 2b -2b3
az 26
26 = b bË +4b2 4463 -6)
(2 -3)
t 6b2 t b 3
Bg solving +(
|4 3b2 -b3
SolVe
bi =2
an 2-(-)+s (2)+ 1:(-2)
* Non homogeneoy LineaY Recunren ce Tel n uith
conyt oefficiert
Coan + Cian-i t (z an-zt-+C7n-k f(n),
fen) = Pn) ) whert, Pen) y a polynomia of
an o(h) degree s
+ an
steps to find a,(P):
- Lel ao= Ao+A,n+ Azn4 Aq+n
2:2 Put vaue of an anl 1
So on un the qiueh
eq
3 Compare the cocfficients f ke powers On n
Find Ao, A1, A2, -- As
sa,P)- AotAn +Ant--- +Asn (Putting values of
Aj's
eg ). Solve n
D)
i) To find (h) y y-tn+12t
¬ eo)
put n y
-2Yo
) charad eristic equahon
T=-1, +2
(h)
bi l)"+ be(2)
SARASWATIEducation Society's PAGE NO.
SARASWATICollege of Engineering DATE:
(P)
n+2 - h + - Z n n
h
in above eg
Aot A(ht2) +A2Cnt2) 1 -[AotAi(n+I) + Azlht1)/
T2A o +A;n+ An]:n2
CAo +eA fh42) +Az(0+yh+ y)]-A o+ A,(h+!) +Az(nizh
-2Aot A, n+ Azn n2
-2A2 - 2A,+h A2 A
2t 2Az|-h?
A+3A2- 2Ao 2A2 - 2AIJn + 2Az] n= n
Comarinq coefficieat
- 2A2 1
:. A2-/2)
put A2 n
A-/2
ArA in e O)
n
put A2
Ao 2
h= bil-)"+ bal3) -I -/2 - n
solve an t2anti -lSan 6nt l0
To And
an+ t24n41 -\S dn
Put An =Y,n
|y2Y -IS =0 char. eq"
ehar. root s
= bË (-5)b (3))
fo findn
P a an = Ao + An e
fAo+Ai (n)]- 1s (Aothgn:6nt1o
’ As Aot A1(n+2)7+ 2
2A]+2 [Aot AintA]- 1s[AatAn]- 6n +10
) CAo +Ain+
Cho t2Ai+2 Ao+2Ai -1SAo A+ 2A1IsAI]z6ntl0
-12 Ao+A+nf -12A] =6h+i0
SARASWATIEducation Society's PAGE NO.:
a SARASWATIColege of Engineering DATE:
-|2A 6
A -2
-12 Ao t 4/-/2)=|0
-|2 Ao |0 t 2
AD =
C Aot A n
.-|-L
an a,"
bil-s"+ b)(3}4a)-h
2
p ao=1
1 = bi + bz fle)- o
bi+bz : 2 -
a= b1 (-s)' + bz (3)'+l-l/
- 5 b 1 +3b2 -
-5b t+3b2 = I
bËtb 3/2
-sbit 3b2: -ssbi+3b2 - )
8b= 17|2 b2=x
an -s)t3) -A
2
2
O solve ant - S San+, t6an n
2
Ans ) qnbi2 +b3"+n n +
solve an- 2an 6n
y ) .10- 2 - 6n-12