• No results found

Calculating with permutations

In discussing factorial notation, we have already dealt with permutations. You remember that a permutation is an arrangement. The number of possible permutations of nine things is given by

9! ˆ 9  8  7  6  5  4  3  2  1

Another way of illustrating permutations is to think of a tree diagram (Figure 2.2). For instance, what are the permutations of the four letters A, B, C and D? If we start with A, our possible choices of second letter are three (B, C or D). If we choose C, our possible choices of third letter are two (B or D). If we then choose B, our choice of fourth letter is only D. So there are six permutations beginning with A. Likewise, there are six permutations begin- ning with B, six beginning with C and six beginning with D. Therefore, the number of permutations of n things is given by the formula

P ˆ n!

Suppose though, you had four things, say letters A, B, C and D, and you wanted to know how many arrangements of three of them were possible. Well, that is not too dicult because you have four possible ways of picking the ®rst letter, that leaves you with three possible ways of picking the second

A necessary glimpse of probability 33

letter, that leaves you with two possible ways of picking the third letter ± a total of 4  3  2 ˆ 24 ways.

What is the number of permutations of seven things three at a time? That is, if you have seven things, how many arrangements of three things are there? Again, you have seven choices for the ®rst thing, six choices for the second thing and ®ve choices for the third thing ± a total of

7  6  5

1st 2nd 3rd 4th

choice choice choice choice

34 Basic concepts in statistics and epidemiology

Put into factorial notation, do you see that this is 7! 4! because 7! 4!ˆ 7  6  5  4! 4! .

Now, we were asked to make arrangements of three things from a choice of seven things. As it turns out. 4 ˆ 7 3, so we could write our answer as

7! …7 3†!ˆ

7! 4!

ˆ 7  6  5

So the number of permutations of seven things taken three at a time is given by

P7;3ˆ…7 3†!7!

We can generalise that to: the number of permutations of n things taken r at a time is

Pn;r ˆ…n r†!n!

Combinations

`Combinations' are more restrictive than `permutations'. For instance, if we list the 24 permutations of ABCD, we get

ABCD BACD CABD DACB ABDC BADC CADB DABC ACBD BDAC CBAD DCAB ACDB BDCA CBDA DCBA ADBC BCAD CDAB DBAC ADCB BCDA CDBA DBCA

A necessary glimpse of probability 35

But out of all of these permutations there is only one combination ± because in two di€erent permutations, the same things do not count as di€erent combinations.

If we have ®ve (say A, B, C, D and E) things taken three at a time, the number of permutations taken three at a time is given by

P5;3ˆ…5 3†!5!

But among those permutations, ABC, ACB, BCA, BAC, CBA and CAB will all be counted as separate permutations. Now if we want the number of combinations of ®ve things taken three at a time (C5;3) we have to divide the

number of permutations (P5;3) by 3! because every three di€erent things in

P5;3is itself arranged in 3! ways. Since all 3! of these permutations all count as

the same combination, if we divide P5;3 by 3! we will get the number of

combinations of ®ve things taken three at a time.

That is, the number of combinations of ®ve things taken three at a time is given by

C5;3ˆP3!5;3ˆ…5 3†!3!5!

So the number of combinations of n things taken r at a time must be Cn;r ˆr!…n r†!n!

The big problem that you will have in doing problems associated with permutations and combinations will involve deciding whether you are dealing with a `perm' or a `com'. You can tell which by the wording of the problem. Think in each case: Is it the order of the things in each cluster that counts or is it the number of di€erent clusters? If the order of things in each cluster is important, you are talking about permutations. If you are just concerned with the number of clusters, you are dealing with combinations.

An example will help. A student body president is asked to appoint a committee consisting of ®ve boys and three girls. He is given a list of ten boys and seven girls from which to make the appointments. From how many possible committees must he make his selection?

He just has to pick ®ve boys from a list of ten boys and three girls from a list of seven girls. The order in which he phones them up and tells them that they

36 Basic concepts in statistics and epidemiology

have been selected doesn't matter, does it? So we are dealing with combina- tions.

For the boys, this is

C10;5 ˆ5!…10 5†!10! ˆ5!5!10! ˆ 252

For the girls, this is

C7;3ˆ3!…7 3†!7! ˆ3!4!7! ˆ 35

There are 252 ways of picking the boys and 35 ways of picking the girls, so there are

252  35 ˆ 8820 ways of selecting the committee.

Repeatedtrials

We can now relate all of this back to probability theory. Suppose in a throw of a dice you want a `3'. The probability of success on a single trial is

p ˆ16

while the probability of failure on a single trial is q ˆ56

Now, suppose you throw a dice 4 times in a row. You might get 4 successes in a row

3 successes and 1 failure 2 successes and 2 failures 1 success and 3 failures 4 failures in a row.

A necessary glimpse of probability 37

If you got, say, 1 success and 3 failures, would it make any di€erence whether your success came ®rst followed by the 3 failures

s€f? or second: fs€?

or third: €sf? or fourth: €fs?

Of course not! So really you need to know the number of ways you can select 3 things out of 4 trials where the order does not count.

C4;3ˆ1!3!4! ˆ 4

There are 4 ways that can happen, but out of how many possible outcomes. Well on the ®rst trial you can succeed or fail (2). The second trial is not in¯uenced by the result of the ®rst trial so on the second trial you can succeed or fail (2). On the third trial you can succeed or fail (2). On the fourth trial you can succeed or fail (2). So there are 2  2  2  2 ˆ 16 possible outcomes. We have found that 4 of them will give 3 successes and 1 failure.

How many ways are there of getting all successes? That is, how many ways are there of combining 4 things 4 at a time? Only 1 obviously. Even if your common sense does not tell you that, the formula does

C4;4ˆ0!4!4! ˆ 1

How many ways of getting 2 successes and 2 failures? C4;2ˆ2!2!4! ˆ 6

How many ways of getting 1 success and 3 failures? C4;1ˆ1!3!4! ˆ 4

How many ways of getting 0 successes and 4 failures? C4;0ˆ4!0!4! ˆ 1

38 Basic concepts in statistics and epidemiology

So our 16 possible outcomes of successes/failures in the 4 throws of a dice are:

1 (4 successes) 4 (3 successes, 1 failure) 6 (2 successes, 2 failures) 4 (1 success, 3 failures) 1 (0 successes, 4 failures) 16

Now we must work out in each single trial what the probability of success or failure is. Well, the probability of success is p ˆ1

6and of failure is q ˆ56. So

the probability of 4 successes is

p  p  p  p ˆ p4ˆ 1

6 4

ˆ 1 1296 The probability of 3 successes and 1 failures is

p  p  p  q ˆ p3q ˆ 163 5612965 The probability of 2 successes and 2 failures is

p  p  q  q ˆ p2q2ˆ 1 6 2 5 6 2 ˆ 25 1296 The probability of 1 success and 3 failures is

p  q  q  q ˆ pq3ˆ 16 563 ˆ1296125 The probability of 0 successes and 4 failures is

q  q  q  q ˆ q4ˆ 564ˆ1296625 So the probability of 4 successes in a row is

1 1296

A necessary glimpse of probability 39

The probability of 3 successes and 1 failure is 4 12965 ˆ129620 (because there are 4 ways it can happen). The probability of 2 successes and 2 failures is

6 129625 ˆ1296150 (because there are 6 ways it can happen). The probability of 1 success and 3 failures is

4  125 1296ˆ

500 1296 The probability of 0 successes and 4 failures is

1 1296625 ˆ1296625

Now look, though, as we remind ourselves of a little algebra. Using your knowledge of the binomial expansion, expand … p ‡ q†4

… p ‡ q†4 ˆ p4‡ 4p3q ‡ 6p2q2‡ 4pq3‡ q4

This makes a very easy way to solve probability problems based on repeated trials. As we have already seen, a convenient way to obtain the coecients of the binomial expansion is to note that each coecient of the expansion can be obtained from the previous term as follows: Multiply the coecient of the previous term by the exponent of q and divide the result by one more than the exponent of p. Thus, for example, in the expansion

… p ‡ q†8ˆ q8‡ 8q7p ‡ 28q6p2‡ 56q5p3

‡ 70q4p4‡ 56q3p5‡ 28q2p6‡ 8qp7‡ p8

we obtain the coecient of q6p2from the term 8q7p as …8†…7†=2 ˆ 28, or the

40 Basic concepts in statistics and epidemiology

The examples that follow are there for those who are interested in strengthening their con®dence with probability theory and its ideas. I ®nd that the practice helps.

Study exercises 2

Don't say that I haven't given you enough practice!

Express all the answers representing probabilities as fractions in lowest terms.

1 A card is drawn at random from a deck of 52 playing cards. What is the probability that it is an ace or a face card?

2 If a dice is rolled twice, what is the probability that the ®rst roll yields a 5 or a 6, and the second anything but a 3?

3 In a single throw of two dice, what is the probability that neither a double nor a 9 will appear?

4 In a bag there are 6 white and 5 black balls. If they are drawn out one by one without replacement, what is the chance that the ®rst will be white, the second black, and so on alternately?

5 One man draws three cards from a well-shu‚ed deck without replace- ment, and at the same time another tosses a coin. What is the probability of obtaining three cards of the same suit and a head?

6 A man owns a house in town and a cabin in the mountains. In any one year the probability of the house being burgled is 0:01, and the prob- ability of the cabin being burgled is 0:05. For any one year what is the probability that:

(a) both will be burgled

(b) one or the other (but not both) will be burgled (c) neither will be burgled?

7 The probability that a certain door is locked is1

2. The key to the door is

one of 12 keys in a cabinet. If a person selects two keys at random from the cabinet and takes them to the door with him, what is the probability that he can open the door without returning for another key?

8A pair of dice is tossed twice. What is the probability that either a 7 or a 12 appears on the ®rst throw, and that neither a double nor an 8appears on the second throw.

9 If 3 dice are thrown, ®nd the probability that: (a) all 3 will show fours

(b) all 3 will be alike

(c) 2 will show fours and the third something else (d) only 2 will be alike

A necessary glimpse of probability 41

10 How many 4-digit numbers can be formed from the digits 1, 3, 5, 7, 8and 9, if none of these appears more than once in each number?

11 A girl has invited 5 friends to a dinner party. After locating herself at the table, how many di€erent seating arrangements are possible?

12 From 7 men and 4 women, how many committees can be selected consisting of:

(a) 3 men and 2 women

(b) 5 people of which at least 3 are men?

13 A company has 7 men quali®ed to operate a machine which requires 3 operators for each shift.

(a) How many shifts are possible?

(b) In how many of these shifts will any one man appear?

14 In how many seating arrangements can 8men be placed around a table if there are 3 who insist on sitting together.

15 A committee of 10 is to be selected from 6 lawyers, 8engineers and 5 doctors. If the committe is to consist of 4 lawyers, 3 engineers and 3 doctors, how many such committees are possible?

16 Seven dice are rolled. Calling a 5 or a 6 a success, ®nd the probability of getting:

(a) exactly 4 successes (b) at most 4 successes.

Chapter 3