STAT-UB.003 Notes for Wednesday, 0.FEB.0. For many problems, we need to do a little counting. We try to construct a sample space S for which the elements are equally likely. Then for any event E, we will have P( E) elements in E elements in S. It can tricky counting up the numbers of elements in E and S. For example, S might consist of all the five-card poker hands. There are many probability notions that depend on the ability to count. We ll do this quickly, as we can get easily distracted by all the difficulties. The number of ways to arrange n things in sequence is n! 3 n. This gets the name permutation. For instance, 4! 4, and here are the ways to arrange 4 books (A, B, C, and D) on a shelf: ABCD BACD CABD DABC ABDC BADC CADB DACB ACBD BCAD CBAD DBAC ACDB BCDA CBDA DBCA ADBC BDAC CDAB DCAB ADCB BDCA CDBA DCBA The list above gives all permutations of the letters A, B, C, D. There are 5! 0 arrangements of five letters, 6! 70 arrangements of six letters, 7! 5,040 arrangements of seven letters, and so on.
You can show easily that n! n (n - )! and then you get quickly to!! 3! 6 4! 4 5! 0 6! 70 7! 5,040 8! 40,30 and so on. The value 68! can be made to appear on (some) calculators that have a factorial key, but 69! cannot. This says merely that 68! < 0 00 < 69! The number 0 00 is called a googol. (The Web browser is Google.) Example: Five people go to a restaurant and check their coats. At the end of the meal, the five coats are given out at random. What is the probability that all five get the correct coat? Assuming that all assignments of coats to people is equally likely, there are 5! ways to give the coats out, and only one of these is correct. The probability must be 5! 0 0.0083. Think of the people as A, B, C, D, and E. Suppose that their coats have the corresponding names α, β, γ, δ, and ε. Imagine that the people line up in some random arrangement of the Roman letters and that the coats are given out in the order α, β, γ, δ, and ε. If the people line up as A, E, C, D, B, then A and D will get their own coats, while the others are mixed up. You might observe here that we ve established a procedure for giving out the coats (fixed order α through ε) and put the randomness on the way in which the people line up. We could also have said that the people line up in order A through E and at each step a coat is selected at random. We could also have said that the coats were matched with their check tickets (A with α,, E with ε) and that the tickets were given randomly to the five people. All these thought games will produce the same solution.
For n coats and n people, the probability that all coats are given out to the correct owners, the probability is n!. The probability that exactly n of the n people get the correct count must be zero. (They can t all match, except for one!) All other probabilities are complicated to compute. For factorials, we will need the side agreement that 0!. The number of ways to place n things in order is n!. The number of ways to n!. n r! place in order r things selected out of n works out to ( ) Try this out for a situation in which you get to taste three tapioca puddings out of eight. The order of tasting is generally considered relevant. You have 8 choices for the first tapioca pudding. Thereafter, you have 7 choices for the second and 6 choices for the third. You have 8 7 6 336 possible orderings. This is the start of the calculation of 8!, but the factors 5, 4, 3,, do not appear. This illustrates the result above with n 8, r 3, n - r 5, and 336 8 7 6 8 7 6 5 4 3 8! 5!. 5 4 3 More common than this, however, is the need to count the number of ways to select without regard to order. Examples of such problems are these: How many ways can four cheeses (out of available) be selected for serving at a party? How many ways can three utility companies (out of available) be selected for inclusion in a balanced mutual fund? How many ways can three people (out of 5) from a board of directors be chosen to form a subcommittee? Let s consider the last situation. Suppose that we selected first in order. There are 5 ways to pick the first person. Following that, there are 4 ways to select the second person. Finally there are 3 ways to select the third person. All in all, there are 5 4 3,730 ways to select the three people, in order. However, the committee chosen as DKB is indistinguishable from KBD or DBK. Indeed, 3
we have overcounted by a multiple of 3! 6. The final number of ways is,730 6 455. In formula layout, we would say that the number of ways of selecting r things out of n, without regard to order, is given as n choose r combinations of n things, r at a time n C r n! r! n r! ( ) binomial coefficient, n choose r r The notation is probably most common. This is sometimes also called a r binomial coefficient, based on the interesting result (a + b) n n a r b n r r 0 r. Here s a simple version of this with n 4. We ll note that 0, 4, 6, 3 4, 4 Then note that (a + b) 4 4 r 4 r a b r 0 r a b a b a b a b a b 0 + + + + 3 4 0 4 3 3 4 0 4 3 3 4 b + 4 b a + 6 b a + 4 ba + a. n Practical tips to calculating? It really helps to use. This says r n r that the number of ways to select the r things you want is equal to the number of ways of discarding the n r things you don t want. For example, 0 7 F 0 3 I HG K J 0 9 8 3 0 4
F I HG 8 K J 4 0 9 4 3 495 There are some quick facts that are helpful. Note that for any 0 n positive integer n. This is consistent with our previous definitions. It also uses 0!. ( ) n n Sometimes we need n and. You might conceptualize as the number of handshakes is a room with n people. It s also the number of lines that could be used to connect n points. It s also the maximum possible number of two-person links in a social network with n people. Sometimes the binomial coefficients are related to Pascal s triangle. This is it: 3 3 4 6 4 5 0 0 5 6 5 0 5 6 7 35 35 7 This continues indefinitely. The first line starts with a pair of s, and each following number is the sum of the ones above it. This pattern gives binomial coefficients. For the display above, this is 5
0 0 3 3 3 3 0 3 0 3 4 5 5 5 5 5 5 0 3 4 5 6 6 6 6 6 6 6 0 3 4 5 6 7 7 7 7 7 7 7 7 0 3 4 5 6 7 Let s call the top row as row. It has two entries. The next row will be row, with three entries. Label the positions within rows as 0,,, then (row n, position r) holds value r. The total of row n is n. For instance, the total of row 3 is 3 3 3 3 + + + + 3 + 3 + 8. This is just an instance of the 0 3 binomial theorem: n ( + ) n n j n j j 0 j n j 0 j The general form of the binomial theorem is (a + b) n a b n j n j j 0 j. The rule that defines the triangle is n n + j j j For example, 7 6 6 +. This is 35 5 + 0. 3 3 6
You can think of this result as ways of counting up people for a committee. n n j + j j { 3 3 number of committees number of committees with number of committees with of j out of n people Fred and j other people j people (and no Fred) The outermost diagonals of this display are stripes of s. The next diagonals give the integer sequences,, 3, 4,. The diagonals that follow are, 3, 6, 0, 5,, These are the triangle numbers. For instance, 3 is the number of dots in the display. Then 6 is the number of dots in the display and 0 is the number of dots in You can show easily that T n n th triangle number ( n+ ). n, but this is n + Similar geometric stories can be constructed for the next diagonal. It would be foolish in the extreme to use the triangle to compute binomial coefficients. Just imagine how much clerical work would be needed to get 0 0 9 8 7 6 something like. The routine arithmetic on this is, and 5 5 4 3 this simplifies quickly to 5,504. 7
Suppose that a political committee has 8 Democrats and 6 Republicans. You wish to select a subcommittee with 3 Democrats and Republicans. The number of 8 ways of selecting 3 of the 8 Democrats is 3 8 7 6 56. The number of 3 6 ways of selecting of the 6 Republicans is 6 5 5. Overall, the number of ways of making the selections together is 56 5 840. (We multiply here because each selection for the three Democrats can be matched with each selection for the two Republicans.) Suppose that the subcommittee of five were actually selected at random, without regard to party. The number of such selections would be 5 4 3 0,00, and each would be equally likely. 5 4 3 The probability that by chance alone the subcommittee would have three 840 Democrats and two Republicans is then 0.496, around 4%.,00 This type of logic will become the basis of the hypergeometric distribution, which we will see again. The probability of getting three Democrats and two Republicans by chance is about 4%. Could you have made an approximate guess at this number? Yes, and here s how. Let s describe the situation through the number of Democrats turning up in this group of 5. The possible values are {0,,, 3, 4, 5}. The probabilities associated with these six outcomes must sum to 00%. Thus, we start with 00% 7% as a starting guess. We would shrink this for the 6 unlikely events (say 0 and 6) and we would enlarge it a lot for the likely events (say and 3). You may not come up with 4% as your guess, but you should be somewhere between 30% and 50%. 8