Suppose you have a huge box of animal crackers containing plenty of each of 10 different animals. For the counting questions below, carefully examine their similarities and differences, and then give an answer. The answers are all one of the following:
With all the different counting techniques we have mastered in this last chapter, it might be difficult to know when to apply which technique. Indeed, it is very easy to get mixed up and use the wrong counting method for a given problem. You get better with practice. As you practice you start to notice some trends that can help you distinguish between types of counting problems. Here are some suggestions that you might find helpful when deciding how to tackle a counting problem and checking whether your solution is correct.
Remember that you are counting the number of items in some list of outcomes. Write down part of this list. Write down an element in the middle of the list β how are you deciding whether your element really is in the list. Could you get this element more than once using your proposed answer?
If generating an element on the list involves selecting something (for example, picking a letter or picking a position to put a letter, etc), can the things you select be repeated? Remember, permutations and combinations select objects from a set without repeats.
Does order matter? Be careful here and be sure you know what your answer really means. We usually say that order matters when you get different outcomes when the same objects are selected in different orders. Combinations and βStars & Barsβ are used when order does not matter.
There are four possibilities when it comes to order and repeats. If order matters and repeats are allowed, the answer will look like \(n^k\text{.}\) If order matters and repeats are not allowed, we have \(P(n,k)\text{.}\) If order doesnβt matter and repeats are allowed, use stars and bars. If order doesnβt matter and repeats are not allowed, use \({n\choose k}\text{.}\) But be careful: this only applies when you are selecting things, and you should make sure you know exactly what you are selecting before determining which case you are in.
Think about how you would represent your counting problem in terms of sets or functions. We know how to count different sorts of sets and different types of functions.
As we saw with combinatorial proofs, you can often solve a counting problem in more than one way. Do that, and compare your numerical answers. If they donβt match, something is amiss.
While we have covered many counting techniques, we have really only scratched the surface of the large subject of enumerative combinatorics. There are mathematicians doing original research in this area even as you read this. Counting can be really hard.
In the next chapter, we will approach counting questions from a very different direction, and in doing so, answer infinitely many counting questions at the same time. We will create sequences of answers to related questions.
\({13 \choose 9}\) ways. After giving one present to each kid, you are left with 9 presents (stones) which need to be divided among the 5 kids (giving 4 sticks).
\(5^{14}- \left[{5 \choose 1}(5-1)^{14} - {5\choose 2}(5-2)^{14} + {5 \choose 3}(5-3)^{14} \dots \right]\) ways. Now the function from the set of presents to the set of kids must be surjective.
For each of the following counting problems, say whether the answer is \({10\choose 4}\text{,}\)\(P(10,4)\text{,}\) or neither. If you answer is βneither,β say what the answer should be instead.
How many shortest lattice paths are there from \((0,0)\) to \((10,4)\text{?}\)
Your band goes on tour. There are 10 cities within driving distance, but only enough time to play 4 of them. How many choices do you have for the cities on your tour?
Neither. Actually, βkβ is the 11th letter of the alphabet, so the answer is 0. If βkβ was among the first 10 letters, there would only be 1 way - write it down.
Neither. Note that this could not be \({10 \choose 4}\) since the 10 things and 4 things are from different groups. \(4^{10}\text{,}\) assuming each kid eats one type of cerial.
Neither. If all the kids were identical, and you wanted no empty teams, it would be \({10 \choose 4}\text{.}\) Instead, this will be the same as the number of surjective functions from a set of size 11 to a set of size 5.
Neither. Itβs \({10 \choose 4}\) if you wonβt repeat any choices. If repetition is allowed, then this becomes \(x_1 + x_2 + \cdots +x_{10} = 4\text{,}\) which has \({13 \choose 9}\) solutions in non-negative integers.
If you want to wear at least one regular tie and one bow tie, but are willing to wear up to all your ties, how many choices do you have for which ties to wear?
You have 511 choices for regular ties (the \(2^{9}\) choices less the βno regular tieβ option) and 31 choices for bow ties (\(2^{5}\) total minus the βno bow tieβ option). Thus you have \({511} \cdot {31} = {15841}\) total choices.
Select one of the 2 bow ties to go on top. There are then 4 choices for the next tie, 4-1 for the tie after that, and so on. Thus \(2\cdot 4! = {48}\) choices.
You own 8 purple bow ties, 3 red bow ties, 3 blue bow ties and 5 green bow ties. How many ways can you select one of each color bow tie to take with you on a trip? \(8 \cdot 3 \cdot 3 \cdot 5\) ways. How many choices do you have for a single bow tie to wear tomorrow? \(8 + 3 + 3 + 5\) choices.
Consider numbers of the form \(\alpha = a_1a_2a_3\dots a_n\text{,}\) with \(n\) digits, each digit from the set \({\left\{1,2,3,4,5,6,7,8\right\}}\text{.}\) For example, if \(n = 4\text{,}\) the number \(\alpha = a_1a_2a_3a_4\) will have 4 digits from the set \({\left\{1,2,3,4,5,6,7,8\right\}}\text{.}\)
We need 5 or more even digits. 5 even digits: \({9 \choose 5}4^5 4^{9-5}\text{.}\) 5+1 even digits: \({9 \choose (5+1)}4^{5+1} *4^{9-5-1}\text{,}\) etc. By adding these together, we get the total number of ways to have 5 or more even digits.
In a recent small survey of airline passengers, 30 said they had flown American in the last year, 20 had flown Jet Blue, and 24 had flown Continental. Of those, 11 reported they had flown on American and Jet Blue, 14 had flown on Jet Blue and Continental, and 12 had flown on American and Continental. 9 passengers had flown on all three airlines.
How many 9-letter words contain exactly 3 vowels? (For example, an 8-letter word with 5 vowels is βaaioobttβ; donβt consider βyβ a vowel for this exercise.)
With repeated letters allowed, we select which 3 of the 9 letters will be vowels, then pick one of the 5 vowels for each spot, and finally pick one of the other 21 letters for each of the remaining 6 spots. Thus, \({9 \choose 3}5^3 21^{6}\) words.
Without repeats, we still pick the positions of the vowels, but now each time we place a vowel there, we have one fewer choice for the next one. Similarly, we cannot repeat the consonants. We get \({9 \choose 3}P(5,3) P(21, 6)\) words.
You live in Grid-Town on the corner of 2nd and 4th, and work in a building on the corner of 16th and 17th. How many routes are there which take you from home to work and then back home, but by a different route?
We are making 11-letter words from the set of letters \(a,b,c,d,e,f \dots\text{,}\) in such a way that we have exactly the first 11 letters available so that we use all letters.
How many 11-letter words can we make from the letters without repeats that do not contain the sub-word βbadβ in consecutive letters?
There are 9 spots to start the word, and then there are \(8!\) ways to arrange the other letters in the remaining three spots. Thus the number of words avoiding the sub-word βbadβ in consecutive letters is \(11! - 9\cdot 8!={3.95539\times 10^{7}}\text{.}\)
If we now need to avoid words that put βbβ before βaβ before βdβ, we must choose which spots those letters go (in that order) and then arrange the remaining 8 letters. Thus, \(11! - {11 \choose 3}8!={3.3264\times 10^{7}}\) words.
\(2^n\) is the number of lattice paths which have length \(n\text{,}\) since for each step you can go up or right. Such a path would end along the line \(x + y = n\text{.}\) So you will end at \((0,n)\text{,}\) or \((1,n-1)\) or \((2, n-2)\) or β¦ or \((n,0)\text{.}\) Counting the paths to each of these points separately, give \({n \choose 0}\text{,}\)\({n \choose 1}\text{,}\)\({n \choose 2}\text{,}\) β¦, \({n \choose n}\) (each time choosing which of the \(n\) steps to be to the right). These two methods count the same quantity, so are equal.
Note that being surjective here is the same as being injective, so we can start with all \(9!\) injective functions and subtract those which have one or more βfixed pointβ. We get \(9! - \left[{9 \choose 1}(9-1)! - {9 \choose 2}(9-2)! + {9 \choose 3}(9-3)! - \dots {9 \choose 9}0! \right]={133496}\) functions.
To thank your math professor for doing such an amazing job all semester, you decide to bake your professor cookies. You know how to make 12 different types of cookies.
If you want to give your professor 7 different types of cookies, how many different combinations of cookie type can you select? Explain your answer.
To keep things interesting, you decide to make a different number of each type of cookie. If again you want to select 7 cookie types, how many ways can you select the cookie types and decide for which there will be the most, second most, etc. Explain your answer.
You change your mind again. This time you decide you will make a total of 20 cookies. Each cookie could be any one of the 12 types of cookies you know how to bake (and itβs okay if you leave some types out). How many choices do you have? Explain.
You realize that the previous plan did not account for presentation. This time, you once again want to make 20 cookies, each one could be any one of the 12 types of cookies. However, now you plan to shape the cookies into the numerals 1, 2, ..., 20. How many choices do you have for which types of cookies to bake into which numerals? Explain.
The only flaw with the last plan is that your professor might not get to sample all 12 different varieties of cookies. How many choices do you have for which types of cookies to make into which numerals, given that each type of cookie should be present at least once? Explain.
\(P(12, 7) = 12 \cdot (12-1) \cdot (12-2) \cdot \dots \cdot (12-7+1)= {3.99168\times 10^{6}}\) ways. You are choosing and arranging 7 out of 12 cookies. Order matters now.
\({31 \choose 20}={8.46723\times 10^{7}}\) choices. You must switch between cookie type 11 times as you make your 20 cookies. The cookies are the stones; the switches between cookie types are the sticks.
\(12^{20} - \left[{12 \choose 1}(12-1)^{20} - {12 \choose 2}(12-2)^{20} + \cdots - {12 \choose 12}0^{20} \right]={1.96878\times 10^{20}}\) choices. We must use PIE to remove all the ways in which one or more cookie type is not selected.
For which of the parts of the previous problem (ExerciseΒ 1.7.19) does it make sense to interpret the counting question as counting some number of functions? Say what the domain and codomain should be, and whether you are counting all functions, injections, surjections, or something else.
You are giving your professor 4 types of cookies coming from 10 different types of cookies. This does not lend itself well to a function interpretation. We could say that the domain contains the 4 types you will give your professor and the codomain contains the 10 you can choose from, but then counting injections would be too much (it doesnβt matter if you pick type 3 first and type 2 second, or the other way around, just that you pick those two types).
We want to consider injective functions from the set \(\{\)most, second most, second least, least\(\}\) to the set of 10 cookie types. We want injections because we cannot pick the same type of cookie to give most and least of (for example).
This is not a good problem to interpret as a function. The problem is that the domain would have to be the 12 cookies you bake, but these elements are indistinguishable (there is not a first cookie, second cookie, etc.).
The domain should be the 12 shapes, the codomain the 10 types of cookies. Since we can use the same type for different shapes, we are interested in counting all functions here.
Here we insist that each type of cookie be given at least once, so now we are asking for the number of surjections of those functions counted in the previous part.