Chapter 22: Introduction to Counting

Meike Niederhausen and Nicky Wakim

2023-09-27

Learning Objectives

  1. Define permutations and combinations

  2. Characterize difference between sampling with and without replacement

  3. Characterize difference between sampling when order matters and when order does not matter

  4. Calculate the probability of sampling any combination of the following: with or without replacement and order does or does not matter

Basic Counting Examples

Basic Counting Examples (1/3)

Example 1

Suppose we have 10 (distinguishable) subjects for study.

  1. How many possible ways are there to order them?

  2. How many ways to order them if we can reuse the same subject and

    • need 10 total?

    • need 6 total?

  3. How many ways to order them without replacement and only need 6?

  4. How many ways to choose 6 subjects without replacement if the order doesn’t matter?

Basic Counting Examples (2/3)

Suppose we have 10 (distinguishable) subjects for study.

Example 1.1

How many possible ways are there to order them?

 

Example 1.2

How many ways to order them if we can reuse the same subject and

  • need 10 total?

  • need 6 total?

Basic Counting Examples (3/3)

Suppose we have 10 (distinguishable) subjects for study.

Example 1.3

How many ways to order them without replacement and only need 6?

 

Example 1.4

How many ways to choose 6 subjects without replacement if the order doesn’t matter?

Permutations and Combinations

Permutations and Combinations

Definition: Permutations

Permutations are the number of ways to arrange in order \(r\) distinct objects when there are \(n\) total.

\[nPr = \frac{n!}{(n-r)!}\]

Definition: Combinations

Combinations are the number of ways to choose (order doesn’t matter) \(r\) objects from \(n\) without replacement.

\[nCr = \textrm{"n choose r"} = \binom{n}{r} = \frac{n!}{r!(n-r)!}\]

Some combinations properties

  • \[\binom{n}{r} = \binom{n}{n-r}\]

     

     

  • \[\binom{n}{1} = n\]

     

     

  • \[\binom{n}{0} = 1\]

More Examples: order matters vs. not

More examples: order matters vs. not (1/2)

Example 2

Suppose we draw 2 cards from a standard deck without replacement. What is the probability that both are spades when

  1. order matters?
  2. order doesn’t matter?

Table of different cases

See table on pg. 277 of textbook

  • \(n\) = total number of objects

  • \(r\) = number objects needed

    with replacement without replacement
    order matters \[n^r\] \[nPr = \frac{n!}{(n-r)!}\]
    order doesn’t matter \[ \binom{n+r-1}{r}\] \[nCr = \binom{n}{r} = \frac{n!}{r!(n-r)!}\]

Enumerating Events and Sample Space

  • Recall, \(P(A) = \dfrac{|A|}{|S|}\). And within combinatorics, we can use the previous equations to help enumerate the event and sample space.

  • I left something out though… the enumeration of the event is not just one of the above formulas.

  • For example in the example of the spades when order does not matter, we actually need to enumerate the other cards that were NOT spades. So the event is choosing 2 spades out of 13 AND choosing 0 other cards of 39 cards (13 hearts + 13 clubs + 13 diamonds).

  • Thus the probability is actually:

\[ P(\text{two spades}) = \dfrac{{13 \choose 2}{39 \choose 0}}{{52 \choose 2}} \]

  • Note that \(13 + 39 = 52\) and \(2+ 0 = 2\). So the numerator’s \(n\)’s add up to the denominator’s \(n\) and the numerator’s \(r\)’s add up to the denominator’s \(r\)’s