Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Solutions to practice counting problems. (Watch for inclusion/exclusion and/or Stirling numbers of the second kind.) 1) A survey of US households yields the following statistics: 96% have at least one television set. 98% have telephone service 95% have a television and telephone service. What percentage of US households have neither a television set nor telephone service? Let c1=" has a TV" c2="has a phone" Then the number we want is N N(c1 ) N(c 2 ) N(c1c 2 ) 100 96 98 95 1. Answer: 1%. 2) How many 8-bit binary strings do not contain a string of 6 identical bits? (such as 01111110 or 00000001) Let c1=first 6 bits are identical c2=middle 6 bits are identical c3=last 3 bits are identical Then the number we want is N N(c1 ) N(c 2 ) N(c 3 ) N(c1c 2 ) N(c1c 3 ) N(c 2 c 3 ) N(c1c 2 c 3 ) where N is the number of 8-bit binary strings (28), N(c1)= number of 8-bit strings in which the first 6 bits are identical = (2 choices of identical 6 bits)(2 choices for bit 78)(2 choices for bit 8)=23=8, N(c2)= 8, N(c3)= 8, N(c1c2)=(2 choices for first 7 bits)(2 choices for bit 8)=22=4, N(c2c3)=(2 choices for last 7 bits)(2 choices for bit 1)=22=4, N(c1c2)=(2 choices for all 8 bits) =2, N(c1c2c3)=(2 choices for all 8 bits) =2. I.e. 28-8-8-8+4+4+2-2=256-24+10-2=240 Answer: 240. 266-242 Discrete Mathematics II F. Baulieu Counting problems 3) How many permutations of the ten digits {0,1,2,3,4,5,6,7,8,9} either begin with the sequence 987 or contain the sequence 06 in the fifth and sixth positions or end with the sequence 451? Let c1=starts with 987 c2=has 06 in the fifth and sixth positions c3=ends with 451 Then the number we seek is N(c1 ) N(c 2 ) N(c 3 ) N(c1c 2 ) N(c1c 3 ) N(c 2 c 3 ) N(c1c 2 c 3 ) 7!8!7!5!4!5! 2! 8!2(7!) 2(5!) 4!2! 40320 2(5040) 2 2(120) 24 50402 264 50138 4) How many integers from 1 to 1000000 are divisible by 5 but not by 11? 1000000/5=200000 so there are 200000 numbers in that range divisible by 5, and 1000000/55=18181.8181.... so there are 18181 numbers in that range divisible by both 5 and 11. Thus there are 200000-18181 numbers in that range divisible by 5 but not 11. Answer: 181819 5) Let S be a set containing eight of the integers {1, 2, 3, ..., 24}. Prove that there must be two different subsets of S that have the same sum. (e.g. If S were {1,2,3,4,5,11,17,19}, then {1,2,17} and {2,3, 4,11}have the same sum.) The largest possible sum of such a subset is 24+23+22+21+20+19+18+17 = 164, so we have 164 pigeon holes. We will have 28 =256 subsets of any 8-element set, so we have 256 pigeons. Thus by the pigeonhole principle, two subsets must have the same sum. 6) In how many ways can we partition the set {1,2,3,4,5} into two disjoint subsets? We have 25 = 32 possible subsets to choose from, and we can pair each with its complement, so there are 32/2 = 16 possible wasy to partition the set into two subsets. 266-242 Discrete Mathematics II F. Baulieu Counting problems 7) 18 people gather for a baseball game. How many ways can they "choose up sides" to form two teams of 9 players each? (Ignore what position each person will play). We merely have to select 9 players for one team, and the rest will be on the "other" team. 18 Answer: 48620 . 9 8) 25 different students are each to be assigned an faculty advisor. There are three different advisors available. In how many ways can students be assigned to advisors if each advisor must be assigned at least one student? We must distribute 25 distinct objects into 3 distinct containers. There are 3!S 25,3 = 423,593,973,075 ways to do this. 9) 60 square dancers are to be bused to the state convention in Oshkosh on three identical buses. In how may ways can the group be distributed onto the buses if each bus must carry at least one square dancer? We must distribute 60 distinct objects into 3 identical containers. There are S 60,3 = 7,065,193,045,292,906,500,078,982,046 ways to do this. (If we had a computer list all of these possibilities at the rate of 100 per second, it would take more than 22,403,600,000,000,000 centuries!) 266-242 Discrete Mathematics II F. Baulieu Counting problems