Back to the Table of Contents

Statistics: Probabilities and Distributions - Lesson 2

Counting: Permutations and Combinations

Lesson Overview

Fundamental Counting Rule

In the previous lesson we put two or more simple events together to create compound events. There are various ways of combining such events. Specifically, we might ask the number of outcomes when event A OR event B occurs, or we might ask the number of outcomes when event A AND then event B occurs. The quantity of outcomes will be used as the numerator when we calculate the probability.

Example: Assume you have 20 M&M® brand candies as follows: 5 orange, 6 yellow, 5 red, and 4 green. In one selection, how many ways can you select either 1 orange or 1 yellow M&M®? What is the corresponding probability?
Answer: Of the 20 M&M's®, 5 are orange and 6 are yellow. Hence 5+6=11 of the M&M's® are yellow or orange. The probability of selecting a yellow or orange M&M® is 11/20=0.55.

The M&M's® are either one color or another, hence getting a certain color is mutually exclusive of getting a different color—that is, no M&M's® are rainbow-colored, zebra-striped, or some shade such as orange-yellow or blue-green which thus might be judged different colors by different people. To clarify further the meaning of mutually exclusive, let's say that only one or another event can occur, never both at the same time.

Example: Assume you have 20 M&M's® color distributed as above. If selected without replacement, in how many ways can you select two red ones in two selections? What is the corresponding probability?
Answer: For the first selection, five of the 20 M&M's® are red. Since we need to get two reds in only two selections, we need only consider this successful case further, ignoring what happens if we do not get a red on this first selection. For the second selection, only four red of the 19 M&M's® remain. Hence there are 5•4=20 ways of selecting two reds M&M's® in two selections. The corresponding probability would be: (5/20)•(4/19)=20/380=1/19 or approximately 0.0526.

The first example above (OR) will be dealt with further below. We will now discuss the second example (AND then). We studied in the last lesson repeated coin flips and die rolls. The size of our sample space, that is the set of all possible outcomes, was the product of the set of possible outcomes for each event: 2•2=4 for two coin flips and 6•6=36 for rolling two dice.

This is often referred to as the Multiplication Rule. It can only be applied if the events are independent. For more on that subject see the next lesson.

If event A can occur in m possible ways and event B can occur in n possible ways,
there are m•n possible ways for both events to occur.
 
n(A and then B)=n(A)×n(B)

This is generally expressed as event A and then event B occurring. This is an AND situation where both are performed. This calculation extends to three or more events. For example, if event C can occur in o possible ways, there are m•n•o possible ways for these three events to turn out.

Example: How many different ways can parents have three children.
Answer: For each child we will assume there are only two possible outcomes (thus neglecting effects of extra X or Y chromosomes, or any other chromosomal/birth defects). The number of ways can be calculated: 2•2•2 = 8. These can be listed: BBB, BBG, BGB, BGG, GBB, GBG, GGB, GGG where B=boy, G=girl. We could have just as well used the symbols 0 and 1: 000, 001, 010, 011, 100, 101, 110, 111. Note that this is the same as counting in base 2. This fact can be used to more easily list outcomes or to check for missing outcomes (exactly 4 have boy first, exactly 4 have boy second, exactly 4 have boy last, etc). Another way to represent this information is in tree form with the branches from each node representing the possibilities for the next event. Note that this can become very large and thus listing or displaying the complete sample space is often impractical.

This is often referred to as the Addition Rule.

If event A can occur in m possible ways and event B can occur in n possible ways,
there are m+n possible ways for either event A or event B to occur,
but only if there are no events in common between them.
 
n(A or B)=n(A)+n(B)-n(AB)

Because often one works with non-overlapping events, you will find that the last term is commonly omitted, but added later. It is better to learn the formula correctly the first time and make a special case when the intersection is indeed empty. An empty intersection might occur due to happenstance or it might occur because the events cannot occur simultaneously, i.e. the events are mutually exclusive. In the M&M® example above, the color selections were mutually exclusive.

We already saw an example of overlapping events when we calculated the probability of the green die having a 2 or the red die of having a 5. A careful inspecation of the diagram in the prior lesson indicates that although there are six outcomes where the green die has a 2 and six outcomes where the red die has a 5, we must be careful not to double count the event where both the green die has a 2 and the red die has a 5. There are thus only 11 not 12 corresponding outcomes and the probability was 11/36 or about 0.306.

Factorial Rule

The factorial rule is used when you want to find the number of arrangements for ALL objects.

Example: Suppose you have four candles you wish to arrange from left to right on your dinner table. The four candles are vanilla, mulberry, orange, and raspberry fragrances (shorthand: V, M, O, R). How many options do you have?
Solution: If you select V first then you still have three options remaining. If you then pick O, you have two candles to choose from. You can compute the number of ways to decorate your table by the factoral rule: for the first choice (event) you have 4 choices; for the second, 3; for the third, 2; and for the last, only 1. The total ways then to select the four candles are: 4!=4•3•2•1 = 24.

These types of problems occur frequently and can be summarized as follows.

Factorial Rule:    For n different items, there are n! arrangements.

Another word for arrangements is permutations. More commonly this word is used as in the section below when not all the objects are arranged. Please recall that the symbol ! is mathematical shorthand for factorial. n!=n•(n-1)! and 1!=1. Please also note that by definition and because it makes these types of problems easier, 0!=1.     5! = 5•4•3•2•1 = 120,     4! = 24,     3! = 3•2•1 = 6,   and   2!=2.

Try solving this exercise on your own: You need to study, practice football, fix dinner, phone a friend, and go buy a notebook. How many different ways can you arrange your schedule?

Permutations

Permutation is another name for possible arrangements with SOME items from a given set. It is important to remember that order chosen or position arranged is taken into account. Hence permutations are similar to anagrams. Given below is the necessary equation.

nPr  = n! / (n - r)!
where r is the number of items arranged from n elements.

Example: How many ways can you arrange four figurines from a set of seven?
Answer: 7P4=7!/3!=7•6•5•4=840.
Alternate solution: The figurines can be placed as follows:  7    6   5    4 , which is the same as the factorial notation 7!/3!.

Permutations with Repeated Elements

It often happens that objects which are virtually identical get arranged. Our inability to distinguish between these items reduces the number of possible permutations by the number of ways these identical items themselves can be arranged.

Example: the word MISSISSIPPI contains 11 letters of which 4 are S, 4 are I, and 2 are P. If the S's, I's, and P's are distinguishable there would be 11! permutations. However, the 4 S's can themselves be arranged 4! different ways as can the 4 I's. The 2 P's have 2!=2 arrangements.
Answer: Thus assuming these repeated elements are truly indistinguishable, the number of arrangements would be 11!/(4!4!2!)=11!/(4!•4!•2!)=34650.

Permutations on a Circle

Arrangements are also often made in a circle—we no longer have a left end and a right end. Now our first element placed merely provides a point of reference instead of having n choices. Thus with n distinguishable objects we have (n-1)! arrangements instead of n!.

Example: Consider arranging the letters ABCD. There are 4!=24 such arrangements. If considered as a circular arrangement there are but 3!=6 arrangements.

Often in circular arrangements only betweenness and not clockwise/counterclockwise is what matters. This further reduces the arrangements by a factor of 2.

Combinations

Combinations are arrangements of elements without regard to their order or position.

nCr   =   n! / (r!(n - r)!)
where r is the number of items taken from n elements.

Note that these numbers are the same as those in Pascal's Triangle, the binomial formula, and the binomial distribution. Those less than about four digits should become very familiar.

Example: You have five places left for stamps in your stamp book and you have eight stamps. How many different ways can you select five?
Answer: 8!/(5!3!) = 8•7•6/(3•2)=56.
Think of putting them in slots, the first has eight choices, the next slot has seven choices and so forth as demonstrated.

 8   7    6   5    4 

Each combination of choosing 5 out of the 8 has permutations of its own. The five can be arranged in the following ways:
 5   4   3    2   1 

Thus there are (8!÷3!)÷5! = 8!÷(5!3!)=56 ways to select five of eight, but 6720 ways to arrange five of eight.

Sampling with/without Replacement

Sampling can be done with replacement or without replacement. When done with replacement, the selected object is put back before the next object is selected. When done with replacement, the event remain independent of each other, whereas if done without replacement, they become dependent. More on that in the next lesson.

T. OF CONTENTS HOMEWORK SOLUTIONS ACTIVITY CONTINUE