Counting Dms

You might also like

Download as pdf
Download as pdf
You are on page 1of 21
>) Covartog: if Chapter S : ) i| (COUNTING lore: ry J * Pesfosm a task - pessible ways w ex: © AiFfeveot ways yo set passuord. SP abr @® Afferent ways to allocate IP addtece, @ ® AiFffesenr ways to Allocate Phone Cumbes. Wfesent ways to numbes the obiects like chatsc, | > Basic Roles of Counting OSord Rvie OQs8tsckior wie @Prodect Rie @ Division vole >) Seem Rule: Cake 2 Event 'E’ occurs “9 times, Event 'F' occuss) *' birmes. both “E ‘acd. 'F' axe NOT happentog SIMLLTANEOUSLY, i+ Ditfexemt ways to whieh “E’ 08 “F’ can octus: 4 Baod Fy sets. lef +le] = Aiffesent ways 10 which E ow F' can eccus, lel=ro aod |Fl=9. B male. professoss aod B female “poofessems, ase student (cad chodse the prorescod B-male podfessoxs sa 5 female protessaog > 0 OMS 5 auras : _eheice don the student to take Ooms 240 ~St5 =13 ways (df Pesent ways) E' and ‘Fl OSS TO times Fi occuxs “AS times, Afferent ways of . combination of FE! and ‘Fi: ame “Fis happening independant of cee Hits anc 2 pants. what aye Aiffexent WAYS $O Weas them, 4 -Tshinats 2m 2- Pants -= 9 pombes of Aifigverd ways to weas thern: s MxN = 4ax2 7B Aiffeseot ways. Compary has 2 employees Ram and Shyam. Tt has 2 offices. How many diffesens ways ase there to assign different Offices to these employees, 12) = choices fou Rann sm WW = cheices fow Shyam 9 nemben of SiFferen, ways ko as fo these Cmplyeegi mk 132 difeaeon These cae chain lak Neat With Engl Jotlened by positive imegey noe Ee 100, <<“ tS ST = atphanet [Tt 100) 26 ways, (looweys) y " 2@—~ choices fos alphabet >> lOO— cheices fox positive integes 9. : fas OLUMbes of diffesent ~ayS tolabel the chais: TORY = 26ExXIOO= 2GOO aAiffesertr ways, Tones Fees be BA 'ser with ‘ro’ elements to a set with ‘on’ elements | F How many functiorS ase © there. Ff: A>B ren W_can be any elemeot mapped to cxacty any Ome | clement ta B. - ovmbes OF Choices fos each element inA- =) lovmbes of elements in a9 = ™ os = | Tore\ _nemben of possible functions = =n? xX i Suppose 3 bits ave there in bik echoing. what ave __ Aiffewent possible bit Stxings. oe fos each Potion of positions ee 3 Feovert pessible bit stings = 2 rot Substoaction Role: bar and 22 4 seets(everts) Jewel] = fol + 102) - lo 6 32 Students -» electivel > Ex 4% students — elective 2 1B students ~ both electives. m how many students will take eithes EF. os Son: (a1) =32 6e27=45 nCEINE2)= 16. n(evel2)= o(e) + 0le2)- o(ene2) = 22445-15 = —— A bit stving of lengtn + Stacts wit 1 ad Ex: ends with 3 obits. How many possible bit ea 1 o9o°o Det oo Oo ae 23 moron 34 possible bit stetege: (2¢ +24 ) -(23) - fet | Bit etring of lengto 4 stast whts 1) ach endl wth 0.| ‘6. t 7 ey fon pigs ' a possinie ib Aging: possin art SAsing: 2349322 | Ug! ————— a | PAGE NO. pam Ft level = lel 16) (om tte) a Ss ee In] (Prodoct Rule) _level s_ le] +leJ “= lane]_ (Geret ye waction Rule Steteot Tp the class have opted Fotlowtag WwOy!32 PE, 4B-—> 156 = Eland €2,12 ser and 53, G~ E\and £2 and £3, How many etederts have tren edtleact 1 elective, | N62) sea) -(lerora|sferoga|_ : 2 §soe + /eOe3)) + letoez oes) = (32 #45420) = Ciptiatio)-6 = GS goin 1 Event cam happen io) 0-diffexemt ways. + Bot specific event happens in id’ different: ways, sways to happeds (Pd) End + These are G6 blocka ! 4 Ped) | 2 swhite ai Plexeot, ways £0 avtange 6 blocks. fe et Cre dda! Eee Dme pce et Rint 6 boxes: '6l * 3 nembes of ways of arranging. A identical rect _ boxes 10 4 place ~ aoe putas Aenced of ways, of erwanging 2 identical white _| boxes 9 2 places: '2) fs iaxtl 2. Ree eae Pee ee ee ree g ways to ayzange S&S blotks = | 2 18 Fs How wany different ways ave these to seat hea 4 people axound ciscolas table with 4 seats? | Somat | Fetat oombes of ways of seating + People i fA seats (cf scotay) <4! = Ko a elo! E 3 Seas S = OF Fderttced eaagehvat he MEMES omy pone awiangement. = 4. WL SB OSS of diffesent wor of seating -2 a1 =3126 Si Avrangement ce a N — Tree Gagryan a s used 49 Show all pessible eventa, | Ext «How many bit Stings of | Ext a; engts a have conse corte I's. S bit stetogs: 1000, 1010, lool e001, 9010, C00D O1o1, OOO Sra KLE Techy Tenints come in a2 fesent colours S.M,L, XL, XXL. Foxtnes suppese that each size comes in 4 colovss: Rw, &,2 L e fos: ¥L Which comes in’ RG, AYL which comes in GB. How many cHffexent t-shists does a shopkeeper have to Stock to have atleast one of each available and coloos of 4-dhyivt. 7 cffesen: t-shivets (4+a+ 44342) Pigeso hole pyincipie: we Hems to be lnsested 10 ‘0 containers, (m>n) s tHE At least Ne contained must have Move than one itero, x: FA boxes}/eomainess er 2 using pigeon hole pe iach Kr oembes of People k 2 20° People 16 Foor. k>0 > poseinte oumbee ‘ i Pace wo | [OATE: 1 (tnt OAS) 9 coctatoess + YD | To tnsest “k’ Hems at least goe containes ~ loot Of SKI contetnens have roore thao. } one trem. | {| Toroerat j as ; se ; eletion, 9 led Ct) demote ‘syoararetatt Rrerbrtes ete ee ee he Nrmetic means .A=AT { ' SB if a-at i 1 | + 4 mS 88,6 symmetric matrices, | PL S2tot since 9 Is svremetyie, 9-6! 2 ALA Aellertve. i let “A be symmetric matrices. | a ih 0-87 2eOeR | mt then 678 (8207) ’ | ML . Bre (a=) 2 BLA > symmetric. | a ley 6,0.C be symmetric matrties: nN. “of A =—T DaeyA Ny tH mel $f) Bact g&c 4 Ye, Th since? &=BT DY AxcT DA AMC D twancitive. Ba Ve " mt Q) | The welartion Sis ot eqvivalence. on set of teal i Numbes® + Sh Bator let a:{an)] agb LabeR} if Comer 9 ach bot bea is ndt possible 5c) EQ 9 Net SYMMeELdIc es ee \ a —> Pesrout ations: + Basic soles 500. of Woys @ eent xcvrs, 4 Combination(ror considering osdes of events) | + DeMbex of ways event will Occos 19 ordey, (PML tstion) | q [ How mary WAS sad yU Select, 3 sivdents trom < GeOuO s Of -& stuclents to sSstand In aline to take a rote? | Selo: SPa ; s | Defo: 6 TP oo Positive icteges and x ig ao foteger, | With IS %SO then * (Peedver. sule ) C98) = OP = 9: (Q-9(9-29 -. Ln-ca-)) —— of pessvtatiog pot Pooof: using psoduct sole. ; PY elemenr cad be SBFAN GES ID DW WAYS, os . a = [Pan element can ba exsenged io (e-') ways 1 rd oo ae ie is oe 13 element can be in_(n-2) woys tr eee | | an _bé otmnged “in Cn: 26020. -2) 2. -@-0) 2! Onl. | sas | |S Stl fm =8 24 cag © PC5.3)= 5) SES exandyar = 69 (Sy! 2. ea + Corollony: TF andy! ase integers | With 0<2< 0 PWD= Or oar fos 320, ploy= >) Tare; BPO! 27 (9-9); (exie?eg elements axe i6 ore oxdex) sThere ore 100 participacts. Mow Peay VWOYS 40 Select fisst pofze winery and second) prize imrey and thst pwize eee: PH00 82% — p(1003)= 100! (ie0-3)! sp reset aleopetson must visit 8 diffaent citi 2_'OOX49X Ag = 110200 home torn 49 F Orthes Cites can pists doy he welosny to his bore bow Odes ae ‘ MOIS can be ‘sed by Salespersat do vist tne Gties, Ot the end of the Noe PMA Possive X-shorme? as, LK / 4 | a | tettensef abecte, £9} | i = mm tevin | 3 a r i J}ere20 Ways, 1 attend = s | * eembloations: | ~ 4 Aw combination of elerments of aset is an unorderd| Ne ete tM of y-clements form set of -elementa, { SannTaR Tannen mes BL 4 Veambination of dements ig a obset OF 1 elements, | REE ; SeReE 2 SY Thraween bf et ana ‘ane Positive fobeger, with osrsa { “ CP) OL ai We By | 1. i} ‘ | fiaah: PIND* Clow) Ploy) | ii Plawiewt DeCMaI= clr BL | © COO PCO)» @ass) | 37 | | tt \ D2 diny)e ny Ow lat ¢ Theve ese 5 members In committe, How ma. 2ob were YOv Om Gelert 3 members, | { Pace no. ae] | DATE ee | ,, ss . = a eer x Cr © 2 = 4 Find ook following + { — + P (100,26)* st001 i at j ails é BOXIO —_—_— an 4 (00-20) 1 ¢ (9013)= (1000! = Lagx 107% I wt 5 4 Qooo-2)! (13)! >| Genevaying _pesmvtation: @ | WITS pexmoparions of the set O=1]12,3) 3 HR & > Boers, $23), f132} [23h L203 jal= 3.2}, {3-12} Stepl? Sore poe clerseors io ine scbin ascending oxdes. Genesate next pesmutation voril last pesmuttaion last permutation > elernents of seb in descendingatde, Next pear batioN? Step Lucomsides pseviors pexmvtarion osdet. .oeao wind sigrkamast numberlebaracies whied is seailes than iS ext chosactex/nu mbes. e lek that sightroost nvmober be ‘Fixst nvmbes”, Actor [numbew of *Fincl the ceiling Fisst porcbes" Lot Tisct numbex © which is gueates than Fivst rumbey Seep First numbes" and “ceiling nombes.”. a) |[Step4i dost sobarntog in axcenAMog onder ofbex \| origional fedex of ina number", asl] Lexographic Ay || Gre next “(A P2, Ps... Pn) PENMORTANTTOTT {I Ke fodex of st Bing. || OFiod largest “ki such that J] sb dd led ats Pr < Press (Poot pure 5) GQ) Find losgest 4! such that i $>ke ‘and P3>% (ceiling nombe x) GQ Swap’ Pi and | LA) Revesse the onder of — A Pn, | | 4 WD | Corsides peamvration orden of the Stating | ALA Bc DEF | t 23. a _ + | peamotation oxdes ={ DCF E BAS | what ie OXk pesrovtationP | a c DecF EBA ‘ er a oO K=2, Tisest charsactey = Cc. Do Pesce, Qmiesn Ceiling chosacter* E Bee Q_| Sep Picns Px: DEFe BA @ —= DEABCE 02) || $2 B74. whatis next pesmutation? S010: | i B22 ey A eA wi (tke 2s 3S _—_—_— 0 EAS 3 ai 234 23 D || &=3 chowrctes = 5 2 Pet5 ] cin _pumber + 7 2 P3=F | _ sap 3.27/54] : | 3267 4s | | Place mese pewmvtarions of set {1234 5h in lexogza | poe i 435 21,154 32,45321,2345) 23514 '4 532, 21'345, 45213, B14 5235S 42 14 532 Q2'ae5 31452 43621 | 154232 25451 3.642 45213 | 23594 45321 | G a combinations: Li2,3.cto} combinations: Sebsets, “ea. {2,3} Yea Stings: -a6A , F Ae in combination 9 1' bit istorn nen, if an in combinatios > ‘o' bit st bn Dit ste length = In| ts fac, ate — > tort 2000... 000, > Noi ett Ch dares ee se een we bien Shi00 (kits) al Vs to O while scanning + Proms “sight left. nined in Step, pext combieation: 10o} Jonith > 40 cenevate next tombinatien,, e .Combinartio s (onsen DATE > _beretate (x comboat 109 ra phie eode pees fies x Combinations | | {u2,3,.... 24,2} (ascending otdes) I ask combination fo-v+ ptr... nen, et (Cee ) | rotepd: Fixst locate last element Gi the j seqvence of x combinations such tat, # O- r+ Ther weplace aii with art as with a: e5-it 1 > (SE Sr T+ t+2 ly ae Brey ozdex) Flod lesgest fous combination of the set 12,345.46} attesr (453 56) => B-combin ation. Pert corbinatign: “$2 1to 4 st O-f[1.23,4.5.c) lAl-a-6 a4 = 6-4+4=6' C(x) = 6-4+3=5 Cx) G- 4428 4 EC a, FA aes az wth aari= 3tl=4 Cig = 34+ 3-241 =56 beta ce 3+4-241=6 {2-4.5, 64 sf lso-s, 2 923 sombinatten Ay with 4 wih aaieg SNe en algorithm to Generate nent y combination, Cacae oy) [Bescon en car ¥ Gono e nes eae) ee La SeS} generate at 3 combinations @ fuaay a ovea ff-f-fff-F EF | | [rent combiontion\ tel to tag 4 n-wis 95-519 © 35 pf oat al (aya) a ateait! D ayeart ry Our ihaas y Leff Popa ts , 1 peak combination: fet to is Q-dtie 6-3+395 a-ret ta (a4) @ 4h, 8} i 23) (124) G25) (134) ©6835) (235) G45) Gas? (as) (239) | Pert combinarion ta3 tove os) O-BtHis 5-343- 5, 2 O-si=a Ca3=5) in O-d4i = 5-342 =4 D-H FAL Gan 50) | O2=A2at! DA=241=3— +H D3 Y= Ai+j-it] Aa = Art 3-21 23> 2+ 3-241 © Dageg @ i364 | Rex combination 123 to O-Bti = 5-33 5 Q-s4i FQ; (as=4) S35 OgH Pay-ati-g © 113543 | See inane sombination: i=3 to i=l, O-sri © 8-343. 5 P- Bt =a; Cas=5 > Ort = 5-349 = 4 DoH FS Get (C2 = 3) aaa ain ary “40 LSet he Sate ites ati he le Tras; ea { fos i:s=miti tow ~ ~ ays ars mY Display la,aras...ar} 1 mS j Pext combination; 4=3 to f=) | O-e+i = 5-3t3+5 | | onweiner Cages) | O-w+i = 6-342 = 4 PrBti Fai (ar- 4) | | onsets 53412 3 o-siifar Cars 1) Arraret Dayetee Das2 ere bey Ba at s-i+ OV = at 2-H! bN A, 1+2-l+l DaQ=2, Eso hay = aisd-itl K is Ast ar3-l+! ree aye lt+Zg-t+! Paz-4, } OD {23,44 st {rece mn { bare REM combination: i=3 pe fel, : Ort 8 5-343 O-tt? Ba; Cas24), 2 3 Pag) Becdei a Bi 325. Dy tas, EME combinction: 23 to O-Brian 5-34+3-5 O-stiB A, (2325) 5-32 =4, O-et ti (en= 3) O- Bri O2= A241 Daag +t D je age avr s-its AZ= G24 3-24) =344+ 3-94) as* 65 OD {214,54 Llekb combination: 23 to jet, M-Bti = 56-3432 5 P-ari = ai Car=6) N-B4i = 6-342=4 O-stizai (ar=4) O-bFi = B-3rle BD O-vtF tai (az2) Arartl 9 az a je 4h ~ | ORF Qy4a-ie) \ sue Ope ge Q—ltl 2d a2 Be, \ ~ =e | ayeay,+i-i+/ wae : ~ | AZZ a, 43-14) os ~ A3> 243-141 Dages A S 1 34,5}. \ ms, \ ~~ \ ~ \ 4 4 a | \ ™ \

You might also like