Coutig ad Probabilit CMSC 50 1
Coutig Coutig elemets i a list: how ma itegers i the list from 1 to 10? how ma itegers i the list from m to? assumig m CMSC 50
How Ma i a List? How ma positive three-digit itegers are there? this meas ol the oes that require digits 999 99 900 999 or fewer digit umbers 99 or fewer 999 100 1 900 100, 101,, 999 previous slide 9 10 10 900 9 hudreds digits, 10 tes digits, 10 uit digits How ma three-digit itegers are divisible b 5? 0 5, 1 5,, 199 5 cout the itegers betwee 0 ad 199 199 0 1 180 CMSC 50
The breakfast problem Bill eats Rice Krispies, Corflakes, Raisi Bra, or Cheerios. Bill driks coffee, orage juice, or milk. How differet tpes of breakfast ca Bill have? CMSC 50
The multiplicatio rule If the 1 st step of a operatio ca be performed 1 was Ad the d step ca be performed was Ad the k th step ca be performed k was The the operatio ca be performed 1 k was CMSC 50 5
Usig the multiplicatio rule for selectig a PIN Number of digit PINs of 0,1,,. with repetitio allowed 56 with o repetitio allowed 1 Etra rules :. the period ca t be first or last 0 ca t be first with repetitio allowed without repetitio allowed 1 first colum, the last colum, the middle two CMSC 50 6
Permutatios Number of was to arrage differet objects Pick first object was Pick secod object -1 was Pick third object - was Etc. Pick th object 1 wa -1-1! CMSC 50 7
r-permutatios Number of was to arrage r differet objects out of Pick first object was Pick secod object -1 was Pick third object - was Etc. Pick rth object -r1 was -1- -r1! r! CMSC 50 8
Combiatios Problem: Choose r objects out of order does ot matter. Solutio: First choose r objects out of order does matter. The divide b umber of orderigs of r objects. r! r! r! CMSC 50 9
Permutatios with Idistiguishable Items I Eample: Assume ou have a set of 15 beads: 6 gree orage red black How ma permutatios? Select positios of the gree oes, the the orage oes, the the red oes, the the black oes. 15 9 5 6 15! 6!!!! CMSC 50 10
Permutatios with Idistiguishable Items II Eample: Assume ou have a set of 15 beads: 6 gree orage red black How ma permutatios? Take all permutatios. Divide b the umber of permutatios of the gree oes, the the orage oes, the the red oes, the the black oes. 15! 6!!!! CMSC 50 11
Permutatios with Idistiguishable Items Eample: Permutatios of revere 6!!! 70 6 0 CMSC 50 1
Combiatios with repetitio How ma combiatios of 0 A's, B's, ad C's ca be made with ulimited repetitio allowed? Eamples: 10 A s, 7 B s, C s; 0 A s, 0 B s, 0 C s; 1 A s, 0 B s, 6 C s. Reformulate as how ma oegative solutios to CMSC 50 1 0 1
Geeralize The umber of oegative iteger solutios of the equatio r 1 The umber of selectios, with repetitio, of size r from a collectio of size. The umber of was r idetical objects ca be distributed amog distict cotaiers. Solve i class CMSC 50 1
Choosig r elemets out of elemets repetitio allowed repetitio ot allowed order matters r times! P, r r! r order does t matter r r 1 r! r! r! CMSC 50 15
Where the multiplicatio rule does t work People {Alice, Bob, Carol, Da} Need to be appoited as presidet, vice-presidet, ad treasurer, ad obod ca hold more tha oe office how ma was ca it be doe with o restrictios? how ma was ca it be doe if Alice does t wat to be presidet? how ma was ca it be doe if Alice does t wat to be presidet, ad ol Bob ad Da are willig to be vicepresidet? CMSC 50 16
Harder eamples of selectig represetatives Cadidates {Azar, Barack, Clito, Da, Eri, Fred} 1. Select two, with o restrictios. Select two, assumig that Azar ad Da must sta together. Select three, with o restrictios. Select three, assumig that Azar ad Da must sta together 5. Select three, assumig that Barack ad Clito refuse to serve together CMSC 50 17
Properties of combiatios ad their proofs 1 0 1 1 1 1 1 r r CMSC 50 18
How ma subsets are there of {1,,, }? Solutio I: 1 i or out, i or out,, i or out: Hece Solutio II: Hece CMSC 50 Ca CHOOSE set with 0 elemets, or 1 elemet, or, or elemets: Hece i 0 A Combiatorial Idetit i0 i i 19
0 CMSC 50 The biomial theorem 6 1 0 i i i i 0
Differet tpes of members {Alice, Bob, Carol, Da, Eri, Fred, George, Harr} Suppose Alice, Carol, ad Eri are MATH majors, ad the rest are CS majors. 8 people i the set: MATHs & 5 CSs make a 5-member team of MATHs ad CSs make a 5-member team that has ol oe MATH make a 5-member team that has o MATHs make a 5-member team that has at least oe MATH CMSC 50 1
Probabilit The likelihood of a specific evet. Sample space set of all possible outcomes Evet subset of sample space Equal probabilit formula: give a fiite sample space S where all outcomes are equall likel select a evet E from the sample space S the probabilit of evet E from sample space S: P E E S CMSC 50
Eamples of Sample Spaces Two cois sample space {H,H, H,T, T,H, T,T} Cards values:,,,5,6,7,8,9,10,j,q,k,a suits: D, H, S, C Dice sample space {1,1,1,,1,,1,,1,5,1,6,,1,,,,,,,,5,,6, 6,1,6,,6,,6,,6,5,6,6} CMSC 50
Probabilities with PINs Number of four letter PINs of {a,b,c,d} with repetitio allowed 56 with o repetitio allowed 1 What is the probabilit that our digit PIN has o repeated digits? What is the probabilit that our digit PIN does have repeated digits? Tree method: 1 CMSC 50
Straight Flush Four of a kid Full house Flush Straight Three of a kid Two pairs Pair Nothig Probabilit of Poker Hads Solve i class CMSC 50 5
Multi-level probabilit If a coi is tossed oce, the probabilit of head ½ If it s tossed 5 times the probabilit of all heads: the probabilit of eactl heads: 1 1 1 1 This is because the coi tosses are all idepedet evets 1 5 5 1 5 CMSC 50 6
Touramet pla Team A ad Team B compete i a best of touramet The each have a equal likelihood of wiig each game Do the leaves add up to 1? Do the alwas have to pla games? What's the probabilit the touramet fiishes i games? Do A ad B have a equal chace of wiig? CMSC 50 7
What if A wis each game with prob /? Each lie for A must have a / Each lie for B must have a 1/ CMSC 50 How likel is A to wi the touramet? How likel is B to wi the touramet? What is the probabilit the touramet fiishes i two games? 8