Permutations and Combinations

Review

Let's be sure to review the following from last time, to make sure we're all comfortable with them.

Decision Trees

If you have to make a series of decisions, you can chart your choices using a tree. For example, if you're going to the "monochrome ball" where the dress code says your outfit has to have one shared color, and here's what's in your closet:

topsbottomsshoes
  1. red and white
  2. red and black
  3. black and white
  4. black
  1. black
  2. white
  3. red and white
  1. black
  2. white
  3. black and white
  4. red

Q: How many outfit choices do you have?

We'll draw out the choices of tops, bottoms and shoes and count how many possible outfits you have.

The Multiplication Rule

What makes the previous example hard is the constraint between choices. If you don't have any constraint, the number of joint choices turns out just to be the product of the choices at each step. This is the multiplication rule.

Q: How many outfits do you have if you're not going to the monochrome ball?

Q: How many ways can you feed your guests if the caterers have 3 choices of appetizer, 2 choices of salad, 10 choices of entree, 4 desserts?

Q: How many times does your simulation have to run if you want to do a joint sensitivity analysis with 5 choices of birth rate, 4 choices of death rate, and 7 choices of consumption rate?

Q: Suppose an exam consists of 20 multiple choice questions, each with 4 choices. What are the chances of randomly guessing every problem correctly? What are the chances of randomly guessing every problem incorrectly?

Note: For problems like that last one, the Excel power(base,exponent) function can be useful.

Permutations

The idea of permutations follows directly from the decision tree, because there's a constraint that once you've chosen something, you can't choose it again. Therefore, the number of choices at each level of the tree is one fewer than the one above. But there's no other constraint, so the multiplication rule then applies, and so we can count the number of possible joint choices by using the factorial function:

n! = n*(n-1)*(n-2)*...2*1

Values of n!:

nn!
01
11
22
36
424
5120
6720

As you can see, the factorial function grows very quickly. (It's actually faster than exponential: more like nn.)

Examples:

Q: How many ways are there to arrange 3 books on a shelf? 4 books?

Q: Assume you have 5 books. How many ways are there to arrange 2 of the books on a shelf? 3 of the books?

Q: How many 7-digit phone numbers are there? How many with no repeated numbers?

Q: How many possible 3-letter words are there? How many with no repeated letters? How many with a vowel in the middle?

Q: How many possible arrangements are there of the letters in "egg"? "Geese"? "Mississippi"?

Note: You can compute the factorial function using Excel: fact(n).

Combinations

In several of the permutation problems, we ended up choosing a subset of a larger set. For example, choosing three books from five and arranging them on a shelf. If you don't care about the order of the ones you've chosen, the only thing you are counting is the number of ways to choose. This is called combinations

Q: Assume you have 5 books. How many ways are there to choose 2 of the books? 3 of the books? 4 of the books?

Q: Assume you have 10 friends. How many ways are there to choose 2 of them to join you for the movies? Three of them?

Q: The menu at your favorite Chinese restaurant has 30 entrees. Assuming you and your three friends are planning to share and so you don't want to have any duplicate entrees, how many possible ways are there to choose your meal?

Q: The menu at your favorite Chinese restaurant also has 10 appetizers. Assuming you and your three friends are also ordering appetizers, how many meals are there now?

What is the connection between combinations and the expansion of a binomial? With Pascal's triangle?

(a+b)n
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1

rule:

N choose K = N choose (N-K)

note: Excel can compute these values for you using the combin(n,k) function.

Probability

Now that we can count large numbers of things, if we make assumptions about possibilities being equally likely, we can define and calculate probabilities

Q: What's the probability of drawing an ace from deck of cards?

Q: What's the probability of getting a "natural" (an ace and a face card or ten) in blackjack?

Q: What's the probability of getting a pair of aces in 5-card stud?

Law of Large Numbers

The law of large numbers can be stated many ways. Here's one:

In a binary experiment (success or failure), as the number of experiments increases, the proportion of successes approaches the probability of success in a single experiment.

Using Extend, here's a way to illustrate the law of large numbers:

large-numbers.mox

The model involves some new blocks:

Try some different scenarios for the law of large numbers.

Note that we could use the decision block to, for example, count the number of time steps that the lake pollution is over some threshold.

This work is licensed under a Creative Commons License | Creative Commons License | Viewable With Any
Browser | Valid HTML 4.01! | Valid CSS!