Docsity

Lecture Notes on Counting Techniques in Probability Theory by Ryan Martin - Prof. Ryan G. , Study notes of Probability and Statistics

Toggle sidebar
bg1
Stat 225 Lecture Notes
Counting Techniques
Ryan Martin
Spring 2009
1 Basic Counting Rule
Recall that in the classical probability model, the probability of an event Eis
P(E) = N(E)
N(Ω) ,(1.1)
the number of outcomes in Edivided by the total number of outcomes. Counting the
number of outcomes that make up a given event can be very difficult and impractical
since, even for relatively simple situations, there can be a tremendous number of such
outcomes. For example:
•There are 2,598,960 ways to deal a poker hand.
•A sequence of 10 tosses of a coin has 1024 possible outcomes.
•There are 13,983,816 to select 6 out of 49 lottery numbers.
Let’s consider an easier example first.
Example 1.1. Suppose we flip a coin and then roll a 6-sided die. Let Ebe the event
that we get a “Tail” on the coin and an even number on the die. To use formula (1.1)
to find P(E), we need to know the total number of outcomes. From a tree diagram (see
Figure 1) it is easy to see that there are 12 possible outcomes. Three of the outcomes
result in a “Tail” and an even roll, therefore, P(E) = 3/12 = 0.25.
Exercise 1.2. I own 5 shirts, 2 pair of pants and two pair of shoes. How many different
outfits could I wear? Draw a tree diagram.
Mathematicians are lazy and did not want to work this hard. They developed a set of
counting rules, which are included in what is called combinatorics. The first is the Basic
Counting Rule (BCR), often called the multiplication rule for obvious reasons.
Proposition 1.3 (BCR).Suppose that ractions are to be performed in a definite order.
Suppose further that there are mkpossibilities for action k, for k= 1,...,r. Then there
are m1m2···mrpossibilities altogether for the ractions.
1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Lecture Notes on Counting Techniques in Probability Theory by Ryan Martin - Prof. Ryan G. and more Study notes Probability and Statistics in PDF only on Docsity!

Stat 225 Lecture Notes

Counting Techniques

Ryan Martin

Spring 2009

1 Basic Counting Rule

Recall that in the classical probability model, the probability of an event E is

P(E) =

N(E)

N(Ω)

the number of outcomes in E divided by the total number of outcomes. Counting the number of outcomes that make up a given event can be very difficult and impractical since, even for relatively simple situations, there can be a tremendous number of such outcomes. For example:

  • There are 2,598,960 ways to deal a poker hand.
  • A sequence of 10 tosses of a coin has 1024 possible outcomes.
  • There are 13,983,816 to select 6 out of 49 lottery numbers.

Let’s consider an easier example first.

Example 1.1. Suppose we flip a coin and then roll a 6-sided die. Let E be the event that we get a “Tail” on the coin and an even number on the die. To use formula (1.1) to find P(E), we need to know the total number of outcomes. From a tree diagram (see Figure 1) it is easy to see that there are 12 possible outcomes. Three of the outcomes result in a “Tail” and an even roll, therefore, P(E) = 3/12 = 0.25.

Exercise 1.2. I own 5 shirts, 2 pair of pants and two pair of shoes. How many different outfits could I wear? Draw a tree diagram.

Mathematicians are lazy and did not want to work this hard. They developed a set of counting rules, which are included in what is called combinatorics. The first is the Basic Counting Rule (BCR), often called the multiplication rule for obvious reasons.

Proposition 1.3 (BCR). Suppose that r actions are to be performed in a definite order. Suppose further that there are mk possibilities for action k, for k = 1,... , r. Then there are m 1 m 2 · · · mr possibilities altogether for the r actions.

H , 1 H , 2 H , 3 H , 4 H , 5 H , 6

T , 1

T , 2

T , 3

T , 4

T , 5

T , 6

Fig 1: A tree diagram for Exercise 1.1. The first set of branches denote the outcome of the coin toss (H or T) and the second set denote the outcome of the die roll (1–6).

Exercise 1.4. If you rolled four fair six-sided dice, what is the probability that you get at least one 3?

Exercise 1.5. How many different pizzas can be made with 10 distinct toppings? More generally, how many possible subsets does a set containing n elements have?

Exercise 1.6. Let A and B be finite sets, each with n elements. How many one-to-one functions are there from A to B? Relate your answer to the number of tries it would take to successfully decode a simple substitution cipher by guessing. (Note: a substitution cipher is the coding scheme used in a standard cryptogram.)

2 Sampling With and Without Replacement

Definition 2.1. Consider a population with N members.

  • Sampling with replacement is where n members of the population are selected, one at a time, and after the observation is made the member is returned to the population for possible re-selection.
  • Sampling without replacement is the same as with, except the selected member is not returned to the population for re-selection.

Exercise 3.5. Suppose 6 teams take part in an international soccer championship. How many ways can the gold, silver and bronze medals be distributed among the teams (as- sume there are no ties)?

Exercise 3.6. You and two friends visit a local restaurant that features 10 different beverages. How many ways can you and your thirsty friends each enjoy a beverage?

An important special case of the permutations rule is

Proposition 3.7 (Special Permutations Rule). The number of possible permutations of m objects among themselves is m!.

Proof. (m)m = (^) (mm−m!)! = m 0!! = m!.

Exercise 3.8. Five children will sit down randomly in a line of five chairs. How many possible arrangements of children are there? What is the probability that the two friends Matt and Ben sit next to one another?

Exercise 3.9. Suppose 3 business, 5 mathematics, and 2 statistics books are arranged randomly on a shelf. What is the probability that the books of the same subject are together?

Nearly all probability courses discuss the following problem, called the Birthday Prob- lem. Not only does its solution require the counting techniques discussed above, but the conclusion is quite surprising.

Birthday Problem. Assume that people’s birthdays are equally likely to occur among the 365 days of the year (we are ignoring leap years and the fact that birth rates are not constant over the entire year). What is the probability that at least two people in a group of size n will share the same birthday? It is obvious that the probability changes with n (why?). Let En be the event that at least two people out of n share the same birthday and let θn = P(En). The surprising result in this problem is that θn can be relatively large for small n, somewhat contrary to what one would expect. Under the classical probability model θn = N(En)/N(Ω). Now N(Ω) is just the number of ways we could choose n birthdays (sampling with replacement). First,

N(Ω) = # of ways to choose n b-days w/ replacement = 365n.

For the numerator, we make use of the complementation rule. That is,

N(EnC ) = # of ways to choose n distinct b-days = (365)n.

which is sampling without replacement. Putting everything together we have

θn = 1 − P(ECn ) = 1 −

n − 1 365

Using a computer program we can graph θn versus n to see what happens; see Figure 2. Note that θ 23 > 0 .5 and θ 60 ≈ 1.

0 10 20 30 40 50 60

n

θn

Fig 2: Plot of θn vs. n

4 Combinations

A concept related to permutations is combinations, which we define below.

Definition 4.1. A combination of r objects from a collection of m objects is an unordered arrangement of r distinct objects from the m objects. The number of possible combina- tions of r objects that can be formed from a collection of m objects is denoted

(m r

and read “m choose r.”

The definition of a combination is similar to that of a permutation. The important difference is in the keyword unordered. This will be discussed in more detail in the following section.

Exercise 4.2. Explain what is meant by “unordered” in the definition of combination.

Exercise 4.3. A popular brewpub features a sampler special: 10% off your choice of two out of the five beer selections. Write out all possible samplers that are available. How many are there?

Exercise 4.4. Which is larger, (m)r or

(m r

Just as they did for permutations, the lazy mathematicians developed a rule for the number of combinations to simply calculation of

(m r

Proposition 4.5 (Combinations Rule). The number of possible combinations of r objects from a collection of m is (^) ( m r

m! r!(m − r)!

these numbers are referred to as binomial coefficients.

Exercise 4.11. In the definition of

(m r

it was mentioned that these numbers are often referred to as binomial coefficients and this exercise explains why. From calculus you are certainly familiar with the Binomial Theorem: if n ≥ 1, then

(a + b)n^ =

∑^ n

k=

cn,kakbn−k, a, b ∈ R

for some sequence of numbers cn,k. Prove that cn,k =

(n k

5 Combinations vs. Permutations

The key difference in the definitions of permutations and combinations is whether or not ordering matters. That is, in the context of permutations, the two collections (a 1 , a 2 ) and (a 2 , a 1 ) would be considered different, while in the context of combinations those collections would be the same. Standard problems that illustrate the difference are committee problems. If you are asked to choose a three-person committee from a group of ten people, this is a combi- nation problem. Alternatively, if the committee consists of a president, vice president and treasurer, then the problem is a permutation problem. In summary

Permutation =⇒ order matters Combination =⇒ order does not matter

6 Partitions

The final class of counting problem we will consider is that of counting the number of ways a collection can be partitioned into distinct subgroups.

Definition 6.1. An ordered partition of m objects into k distinct groups of sizes m 1 ,... , mk is any division of the m objects into a combination of mi objects constituting group i, for i = 1, 2 ,... , k. The number of such partitions possible is denoted by

( (^) m m 1 ,m 2 ,...,mk

Exercise 6.2. Suppose you have six differently colored balls and three baskets. In how many ways can you put three balls in the first basket, two in the second, and one in the third?

Proposition 6.3 (Partitions Rule). Let m 1 ,... , mk be non-negative integers whose sum is m. The number of possible ordered partitions of m objects into k groups of size m 1 ,... , mk, respectively is ( m m 1 ,... , mk

m! m 1! · · · mk!

and these numbers are referred to as multinomial coefficients.

Exercise 6.4. Explain how the Combinations Rule is simply a special case of the Parti- tions Rule.

Exercise 6.5. How many possible arrangements of the letters BOILERS are there? This can be done using the BCR as well as the Partitions Rule. Give both arguments.

Exercise 6.6. In the game of Bridge, each of four players are dealt 13 cards from a 52-card deck. What is the probability that one player gets all the spades?

Example 6.7. The Partition rule can also be used when some orderings are “indistin- guishable.” Suppose we have a handful of Skittles consisting of 5 red, 3 orange and 2 yellow Skittles. Note that we cannot tell the difference between those Skittles of the same color. So, given an arrangement such as

R R Y O Y R O R R O,

we could interchange the first two reds and still (as far as we can tell) have the same arrangement. We think about this problem as follows: for each of the 10! arrangements, there are 5! ways we can order the reds, 3! ways we can order the oranges and 2! ways we can order the yellows within the arrangment of 10. Therefore, the number of distin- guishable arrangments is 10! 5! · 3! · 2!

7 More Practice Problems

Counting problems can often be difficult to solve because it is not immediately obvious which of BCR, Permutations, Combinations, or Partitions Rule you should use. In some cases, you will need a combination of more than one of the rules. It takes practice to be able to easily solve these problems. Here are some to try.

Exercise 7.1. If five girls and five boys are randomly assigned to one of ten positions in a line, what is the probability that all the girls are in a row and all the boys are in a row?

Exercise 7.2. In some state, the license plate numbers consist of three distinct letters followed by three distinct digits (0–9). How many different license plates can be made?

Exercise 7.3. You are required to select a six-character case-sensitive password for an online account. Each character may be an upper-case letter, a lower-case letter or a digit from 0–9. How many different passwords can be created under each of the following restrictions?

(a) There are no restrictions.

(b) The first character may not be a number.

(c) The last four characters must all be different.

(d) There must be at least one upper-case and at least one lower-case letter.

  1. ITaP will soon require we each change our passwords every 30 days. Furthermore, they recommend not using actual words because these are easier to hack into. Many people have expressed concern that it will be difficult to remember their password if it is always changing. Here are the strategies of two hypothetical Purdue students.

(a) So that Tiffany can remember her password, she decides to use a pattern. She will always have six characters and only choose from lower-case letters, digits 0–9, and the tilde symbol (∼). If her password always starts with a letter and has at least two numbers and the tilde, how many passwords can she choose from? (b) Reggie decides to use an eight-character password. The first three letters are alway A, U and G (for his birth-month) but the case (upper or lower) will be chosen randomly. The remaining five characters are three lower-case letters and two digits in 0–9. How many passwords can Reggie create?