Every problem in the chapter beside the book’s answer, a chapter at a time as you scroll.
Chapter 3: Combinatorics
31 problems · 0 figuresExercise 3.1.1 §3.1 source ↗
Four people are to be arranged in a row to have their picture taken. In how many ways can this be done?
Answer
Exercise 3.1.3 §3.1 source ↗
In a digital computer, a bit is one of the integers {0,1}, and a word is any string of 32 bits. How many different words are possible?
Answer
Exercise 3.1.5 §3.1 source ↗
There are three different routes connecting city A to city B. How many ways can a round trip be made from A to B and back? How many ways if it is desired to take a different route on the way back?
Answer
, .
Exercise 3.1.7 §3.1 source ↗
Five people get on an elevator that stops at five floors. Assuming that each has an equal probability of going to any one floor, find the probability that they all get off at different floors.
Answer
.
Exercise 3.1.11 §3.1 source ↗
There are applicants for the director of computing. The applicants are interviewed independently by each member of the three-person search committee and ranked from 1 to . A candidate will be hired if he or she is ranked first by at least two of the three interviewers. Find the probability that a candidate will be accepted if the members of the committee really have no ability at all to judge the candidates and just rank the candidates randomly. In particular, compare this probability for the case of three candidates and the case of ten candidates.
Answer
, , .
Exercise 3.1.13 §3.1 source ↗
A certain state has license plates showing three numbers and three letters. How many different license plates are possible
(a) if the numbers must come before the letters?
(b) if there is no restriction on where the letters and numbers appear?
Answer
(a)
(b)
Exercise 3.1.15 §3.1 source ↗
A computing center has 3 processors that receive jobs, with the jobs assigned to the processors purely at random so that all of the possible assignments are equally likely. Find the probability that exactly one processor has no jobs.
Answer
.
Exercise 3.1.17 §3.1 source ↗
Find a formula for the probability that among a set of people, at least two have their birthdays in the same month of the year (assuming the months are equally likely for birthdays).
Answer
, if , and , if .
Exercise 3.1.21 §3.1 source ↗
Modify the program AllPermutations to count the number of permutations of objects that have exactly fixed points for , 1, 2, …, . Run your program for to 6. Make a conjecture for the relation between the number that have 0 fixed points and the number that have exactly 1 fixed point. A proof of the correct conjecture can be found in Wilf. (H. S. Wilf, “A Bijection in the Theory of Derangements," Mathematics Magazine, vol. 57, no. 1 (1984), pp. 37–40. )
Answer
They are the same.
Exercise 3.1.23 §3.1 source ↗
Barbara Smith is interviewing candidates to be her secretary. As she interviews the candidates, she can determine the relative rank of the candidates but not the true rank. Thus, if there are six candidates and their true rank is 6, 1, 4, 2, 3, 5, (where 1 is best) then after she had interviewed the first three candidates she would rank them 3, 1, 2. As she interviews each candidate, she must either accept or reject the candidate. If she does not accept the candidate after the interview, the candidate is lost to her. She wants to decide on a strategy for deciding when to stop and accept a candidate that will maximize the probability of getting the best candidate. Assume that there are candidates and they arrive in a random rank order.
(a) What is the probability that Barbara gets the best candidate if she interviews all of the candidates? What is it if she chooses the first candidate?
(b) Assume that Barbara decides to interview the first half of the candidates and then continue interviewing until getting a candidate better than any candidate seen so far. Show that she has a better than 25 percent chance of ending up with the best candidate.
Answer
(a) ,
(b) She will get the best candidate if the second best candidate is in the first half and the best candidate is in the secon half. The probability that this happens is greater than .
Exercise 3.2.1 §3.2 source ↗
Compute the following:
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
Answer
(a)
(b)
(c)
(d)
(e)
(f)
(g)
Exercise 3.2.3 §3.2 source ↗
How many seven-element subsets are there in a set of nine elements?
Answer
Exercise 3.2.5 §3.2 source ↗
Use the program BinomialProbabilities to find the probability that, in 100 tosses of a fair coin, the number of heads that turns up lies between 35 and 65, between 40 and 60, and between 45 and 55.
Answer
, ,
Exercise 3.2.7 §3.2 source ↗
Show that for . Use this fact to determine the value or values of which give its greatest value. Hint: Consider the successive ratios as increases.
Answer
But if and only if , and so gives its largest value. If is an integer there will be two possible values of , namely and .
Exercise 3.2.9 §3.2 source ↗
Find integers and such that the following equation is true:
Answer
,
Exercise 3.2.11 §3.2 source ↗
A restaurant offers apple and blueberry pies and stocks an equal number of each kind of pie. Each day ten customers request pie. They choose, with equal probabilities, one of the two kinds of pie. How many pieces of each kind of pie should the owner provide so that the probability is about .95 that each customer gets the pie of his or her own choice?
Answer
Eight pieces of each kind of pie.
Exercise 3.2.13 §3.2 source ↗
If a set has elements, show that it has more subsets with elements than with any other number of elements.
Answer
The number of subsets of objects of size is . Thus makes maximum.
Exercise 3.2.15 §3.2 source ↗
A baseball player, Smith, has a batting average of and in a typical game comes to bat three times. Assume that Smith’s hits in a game can be considered to be a Bernoulli trials process with probability .3 for success. Find the probability that Smith gets 0, 1, 2, and 3 hits.
Answer
, , , .
Exercise 3.2.17 §3.2 source ↗
Using the technique of Exercise 16, show that the number of ways that one can put different objects into three boxes with in the first, in the second, and in the third is .
The Siwash University football team plays eight games in a season, winning three, losing three, and ending two in a tie. Show that the number of ways that this can happen is
Answer
There are ways of putting different objects into the 1st box, and then ways of putting different objects into the 2nd and then one way to put the remaining objects into the 3rd box. Thus the total number of ways is
Exercise 3.2.19 §3.2 source ↗
A gin hand consists of 10 cards from a deck of 52 cards. Find the probability that a gin hand has
(a) all 10 cards of the same suit.
(b) exactly 4 cards in one suit and 3 in two other suits.
(c) a 4, 3, 2, 1, distribution of suits.
Answer
(a) .
(b) .
(c) .
Exercise 3.2.21 §3.2 source ↗
A lady wishes to color her fingernails on one hand using at most two of the colors red, yellow, and blue. How many ways can she do this?
Answer
(We subtract 3 because the three pure colors are each counted twice.)
Exercise 3.2.23 §3.2 source ↗
Using the method for the hint in Exercise 22, show that indistinguishable objects can be put in boxes in different ways.
How many ways can six indistinguishable letters be put in three mail boxes? Hint: One representation of this is given by a sequence LLLLLL where the ’s represent the partitions for the boxes and the L’s the letters. Any possible way can be so described. Note that we need two bars at the ends and the remaining two bars and the six L’s can be put in any order.
Answer
To make the boxes, you need bars, 2 on the ends and for the divisions. The bars and the objects occupy places. You can choose any of these places for the bars and use the remaining places for the objects. Thus the number of ways this can be done is
Exercise 3.2.25 §3.2 source ↗
An elevator takes on six passengers and stops at ten floors. We can assign two different equiprobable measures for the ways that the passengers are discharged: (a) we consider the passengers to be distinguishable or (b) we consider them to be indistinguishable (see Exercise 23 for this case). For each case, calculate the probability that all the passengers get off at different floors.
Using the method for the hint in Exercise 22, show that indistinguishable objects can be put in boxes in different ways.
How many ways can six indistinguishable letters be put in three mail boxes? Hint: One representation of this is given by a sequence LLLLLL where the ’s represent the partitions for the boxes and the L’s the letters. Any possible way can be so described. Note that we need two bars at the ends and the remaining two bars and the six L’s can be put in any order.
Answer
(a)
(b)
Exercise 3.2.27 §3.2 source ↗
John claims that he has extrasensory powers and can tell which of two symbols is on a card turned face down (see Example 3.11). To test his ability he is asked to do this for a sequence of trials. Let the null hypothesis be that he is just guessing, so that the probability is 1/2 of his getting it right each time, and let the alternative hypothesis be that he can name the symbol correctly more than half the time. Devise a test with the property that the probability of a type 1 error is less than .05 and the probability of a type 2 error is less than .05 if John can name the symbol correctly 75 percent of the time.
Suppose that ordinary aspirin has been found effective against headaches 60 percent of the time, and that a drug company claims that its new aspirin with a special headache additive is more effective. We can test this claim as follows: we call their claim the alternate hypothesis, and its negation, that the additive has no appreciable effect, the null hypothesis. Thus the null hypothesis is that , and the alternate hypothesis is that , where is the probability that the new aspirin is effective.
We give the aspirin to people to take when they have a headache. We want to find a number , called the critical value for our experiment, such that we reject the null hypothesis if at least people are cured, and otherwise we accept it. How should we determine this critical value?
First note that we can make two kinds of errors. The first, often called a type 1 error in statistics, is to reject the null hypothesis when in fact it is true. The second, called a type 2 error, is to accept the null hypothesis when it is false. To determine the probability of both these types of errors we introduce a function , defined to be the probability that we reject the null hypothesis, where this probability is calculated under the assumption that the null hypothesis is true. In the present case, we have
Note that is the probability of a type 1 error, since this is the probability of a high number of successes for an ineffective additive. So for a given we want to choose so as to make quite small, to reduce the likelihood of a type 1 error. But as increases above the most probable value , , being the upper tail of a binomial distribution, approaches 0. Thus increasing makes a type 1 error less likely.
Now suppose that the additive really is effective, so that is appreciably greater than .6; say . (This alternative value of is chosen arbitrarily; the following calculations depend on this choice.) Then choosing well below will increase , since now is all but the lower tail of a binomial distribution. Indeed, if we put , then gives us the probability of a type 2 error, and so decreasing makes a type 2 error less likely.
The manufacturer would like to guard against a type 2 error, since if such an error is made, then the test does not show that the new drug is better, when in fact it is. If the alternative value of is chosen closer to the value of given in the null hypothesis (in this case ), then for a given test population, the value of will increase. So, if the manufacturer’s statistician chooses an alternative value for which is close to the value in the null hypothesis, then it will be an expensive proposition (i.e., the test population will have to be large) to reject the null hypothesis with a small value of .
What we hope to do then, for a given test population , is to choose a value of , if possible, which makes both these probabilities small. If we make a type 1 error we end up buying a lot of essentially ordinary aspirin at an inflated price; a type 2 error means we miss a bargain on a superior medication. Let us say that we want our critical number to make each of these undesirable cases less than 5 percent probable.
We write a program PowerCurve to plot, for and selected values of , the function , for ranging from .4 to 1. The result is shown in Figure 3.7. We include in our graph a box (in dotted lines) from .6 to .8, with bottom and top at heights .05 and .95. Then a value for satisfies our requirements if and only if the graph of enters the box from the bottom, and leaves from the top (why?—which is the type 1 and which is the type 2 criterion?). As increases, the graph of moves to the right. A few experiments have shown us that is the smallest value for that thwarts a type 1 error, while is the largest which thwarts a type 2. So we may choose our critical value between 69 and 73. If we’re more intent on avoiding a type 1 error we favor 73, and similarly we favor 69 if we regard a type 2 error as worse. Of course, the drug company may not be happy with having as much as a 5 percent chance of an error. They might insist on having a 1 percent chance of an error. For this we would have to increase the number of trials (see Exercise 28).
Figure 3.7: The power curve.
In Example 3.11 assume the alternative hypothesis is that and that it is desired to have the probability of each type of error less than .01. Use the program PowerCurve to determine values of and that will achieve this. Choose as small as possible.
Answer
Ask John to make 42 trials and if he gets 27 or more correct accept his claim. Then the probability of a type I error is and the probability of a type II error is
Exercise 3.2.29 §3.2 source ↗
A drug is assumed to be effective with an unknown probability . To estimate the drug is given to patients. It is found to be effective for patients. The method of maximum likelihood for estimating states that we should choose the value for that gives the highest probability of getting what we got on the experiment. Assuming that the experiment can be considered as a Bernoulli trials process with probability for success, show that the maximum likelihood estimate for is the proportion of successes.
Answer
. Taking the derivative with respect to and setting this equal to 0 we obtain and so .
Exercise 3.2.31 §3.2 source ↗
Each of the four engines on an airplane functions correctly on a given flight with probability .99, and the engines function independently of each other. Assume that the plane can make a safe landing if at least two of its engines are functioning correctly. What is the probability that the engines will allow for a safe landing?
Answer
.
Exercise *3.2.33 §3.2 source ↗
balls are chosen at random from a total of red balls and blue balls. Find a combinatorial expression for the probability that the chosen balls are equally divided in color. Use Stirling’s formula to estimate this probability. Using BinomialProbabilities, compare the exact value with Stirling’s approximation for .
Answer
By Stirling’s formula,
Exercise *3.2.35 §3.2 source ↗
Prove the following binomial identity Hint: Consider an urn with red balls and blue balls inside. Show that each side of the equation equals the number of ways to choose balls from the urn.
Answer
Consider an urn with red balls and blue balls inside. The left side of the identity counts the number of ways to choose balls out of the balls in the urn. The right hand counts the same thing but breaks the counting into the sum of the cases where there are exactly red balls and blue balls.
Exercise 3.2.38 §3.2 source ↗
Lucas (E. Lucas, “Théorie des Functions Numériques Simplement Periodiques," American J. Math., vol. 1 (1878), pp. 184-240, 289-321.) proved the following general result relating to Exercise 37. If is any prime number, then can be found as follows: Expand and in base as and , respectively. (Here is chosen large enough to represent all numbers from 0 to in base using digits.) Let and . Then For example, if , , and , then
so that
and this result states that Since , and , we see that the result is correct for this example.
Show that this result implies that, for , the st row of your triangle in Exercise 37 has no zeros.
Let denote the remainder when the integer is divided by the integer . Write a computer program to compute the numbers where is a binomial coefficient and is an integer. You can do this by using the recursion relations for generating binomial coefficients, doing all the arithmetic using the basic function mod(). Try to write your program to make as large a table as possible. Run your program for the cases to 7. Do you see any patterns? In particular, for the case and a power of 2, verify that all the entries in the st row are 1. (The corresponding binomial numbers are odd.) Use your pictures to explain why this is true.
Answer
Consider the Pascal triangle (mod 3) for example. Note first that the entries in the third row are 0 for . Lucas notes that this will be true for any . To see this assume that . Note that is an integer. Since is prime and , is not divisible by any of the terms of , and so must be divisible by . Thus for we have . Let us call the triangle of the first three rows a basic triangle. The fact that the third row is produces two more basic triangles in the next three rows and an inverted triangle of 0’s between these two basic triangles. This leads to the 6’th row .
This produces a basic triangle, a basic triangle multiplied by 2 (mod 3), and then another basic triangle in the next three rows. Again these triangles are separated by inverted 0 triangles. We can continue this way to construct the entire Pascal triangle as a bunch of multiples of basic triangles separated by inverted 0 triangles. We need only know what the mutiples are. The multiples in row occur at positions . Looking at the triangle we see that the multiple at position is the sum of the multiples at positions and in the ’th row. Thus these multiples satisfy the same recursion relation that determined the Pascal triangle. Therefore the multiple at position in the triangle is . Suppose we want to determine the value in the Pascal triangle mod at the position . Let and , where and are . Then the point is at position in a basic triangle multiplied by .
Thus But now we can repeat this process with the pair and continue until . This gives us the result: where If for some then the result is 0 since, in this case, the pair lies in one of the inverted 0 triangles.
If we consider the row then for all , and so the product will be positive resulting in no zeros in the rows . In particular for the rows will consist of all 1’s.
Exercise 3.2.39 §3.2 source ↗
Prove that the probability of exactly heads in tosses of a fair coin is given by the product of the odd numbers up to divided by the product of the even numbers up to .
Answer
Exercise 3.3.3 §3.3 source ↗
Let and be two positive integers. Let be the set of all ordered pairs in which the first entry is an -shuffle and the second entry is a -shuffle. Let be the set of all -shuffles. Then there is a 1-1 correspondence between and with the following property. Suppose that corresponds to . If is applied to the identity ordering, and is applied to the resulting ordering, then the final ordering is the same as the ordering that is obtained by applying to the identity ordering. Proof. The easiest way to describe the required correspondence is through the idea of an unshuffle. An -unshuffle begins with a deck of cards. One by one, cards are taken from the top of the deck and placed, with equal probability, on the bottom of any one of stacks, where the stacks are labelled from 0 to . After all of the cards have been distributed, we combine the stacks to form one stack by placing stack on top of stack , for . It is easy to see that if one starts with a deck, there is exactly one way to cut the deck to obtain the stacks generated by the -unshuffle, and with these stacks, there is exactly one way to interleave them to obtain the deck in the order that it was in before the unshuffle was performed. Thus, this -unshuffle corresponds to a unique -shuffle, and this -shuffle is the inverse of the original -unshuffle.
If we apply an -unshuffle to a deck, we obtain a set of stacks, which are then combined, in order, to form one stack. We label these stacks with ordered pairs of integers, where the first coordinate is between 0 and , and the second coordinate is between 0 and . Then we label each card with the label of its stack. The number of possible labels is , as required. Using this labelling, we can describe how to find a -unshuffle and an -unshuffle, such that if these two unshuffles are applied in this order to the deck, we obtain the same set of stacks as were obtained by the -unshuffle.
To obtain the -unshuffle , we sort the deck into stacks, with the th stack containing all of the cards with second coordinate , for . Then these stacks are combined to form one stack. The -unshuffle proceeds in the same manner, except that the first coordinates of the labels are used. The resulting stacks are then combined to form one stack.
The above description shows that the cards ending up on top are all those labelled . These are followed by those labelled . Furthermore, the relative order of any pair of cards with the same labels is never altered. But this is exactly the same as an -unshuffle, if, at the beginning of such an unshuffle, we label each of the cards with one of the labels . This completes the proof.
Let be a deck of cards. We have seen that there are -shuffles of . A coding of the set of -unshuffles was given in the proof of Theorem 3.9. We will now give a coding of the -shuffles which corresponds to the coding of the -unshuffles. Let be the set of all -tuples of integers, each between 0 and . Let be any element of . Let be the number of ’s in , for . Suppose that we start with the deck in increasing order (i.e., the cards are numbered from 1 to ). We label the first cards with a 0, the next cards with a 1, etc. Then the -shuffle corresponding to is the shuffle which results in the ordering in which the cards labelled are placed in the positions in containing the label . The cards with the same label are placed in these positions in increasing order of their numbers. For example, if and , let . Then and . So we label cards 1 and 2 with a 0, card 3 with a 1, and cards 4, 5, and 6 with a 2. Then cards 1 and 2 are placed in positions 2 and 5, card 3 is placed in position 1, and cards 4, 5, and 6 are placed in positions 3, 4, and 6, resulting in the ordering .
(a) Using this coding, show that the probability that in an -shuffle, the first card (i.e., card number 1) moves to the th position, is given by the following expression:
(b) Give an accurate estimate for the probability that in three riffle shuffles of a 52-card deck, the first card ends up in one of the first 26 positions. Using a computer, accurately estimate the probability of the same event after seven riffle shuffles.
Answer
(a)
(b)
Loading chapter 4…
Exercises and answers are adapted from Grinstead and Snell's Introduction to Probability by The CHANCE Project, which is free to read and download, and are used under the GNU FDL licence. They are taken from the GNU version’s LaTeX source (4 July 2006), with answers from the authors’ published answers to the odd-numbered exercises, and set for the web, so they may differ slightly from the printed page. This adaptation is released under the same licence and is neither affiliated with nor endorsed by Grinstead and Snell or American Mathematical Society. Copyright (C) 2006 Peter G. Doyle. This work is a version of Grinstead and Snell's ‘Introduction to Probability, 2nd edition’, published by the American Mathematical Society, Copyright (C) 2003 Charles M. Grinstead and J. Laurie Snell.