Probability Using Permutations and Combinations
Learning Outcomes
- Compute a conditional probability for an event
- Use Baye’s theorem to compute a conditional probability
- Calculate the expected value of an event
examples
A 4 digit PIN number is selected. What is the probability that there are no repeated digits?Answer: There are 10 possible values for each digit of the PIN (namely: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9), so there are 10 · 10 · 10 · 10 = 104 = 10000 total possible PIN numbers. To have no repeated digits, all four digits would have to be different, which is selecting without replacement. We could either compute 10 · 9 · 8 · 7, or notice that this is the same as the permutation 10P4 = 5040. The probability of no repeated digits is the number of 4 digit PIN numbers with no repeated digits divided by the total number of 4 digit PIN numbers. This probability is
Example
In a certain state's lottery, 48 balls numbered 1 through 48 are placed in a machine and six of them are drawn at random. If the six numbers drawn match the numbers that a player had chosen, the player wins $1,000,000. In this lottery, the order the numbers are drawn in doesn’t matter. Compute the probability that you win the million-dollar prize if you purchase a single lottery ticket.Answer: In order to compute the probability, we need to count the total number of ways six numbers can be drawn, and the number of ways the six numbers on the player’s ticket could match the six numbers drawn from the machine. Since there is no stipulation that the numbers be in any particular order, the number of possible outcomes of the lottery drawing is 48C6 = 12,271,512. Of these possible outcomes, only one would match all six numbers on the player’s ticket, so the probability of winning the grand prize is:
Example
In the state lottery from the previous example, if five of the six numbers drawn match the numbers that a player has chosen, the player wins a second prize of $1,000. Compute the probability that you win the second prize if you purchase a single lottery ticket.Answer: As above, the number of possible outcomes of the lottery drawing is 48C6 = 12,271,512. In order to win the second prize, five of the six numbers on the ticket must match five of the six winning numbers; in other words, we must have chosen five of the six winning numbers and one of the 42 losing numbers. The number of ways to choose 5 out of the 6 winning numbers is given by 6C5 = 6 and the number of ways to choose 1 out of the 42 losing numbers is given by 42C1 = 42. Thus the number of favorable outcomes is then given by the Basic Counting Rule: 6C5 · 42C1 = 6 · 42 = 252. So the probability of winning the second prize is.
examples
Compute the probability of randomly drawing five cards from a deck and getting exactly one Ace.Answer: In many card games (such as poker) the order in which the cards are drawn is not important (since the player may rearrange the cards in his hand any way he chooses); in the problems that follow, we will assume that this is the case unless otherwise stated. Thus we use combinations to compute the possible number of 5-card hands, 52C5. This number will go in the denominator of our probability formula, since it is the number of possible outcomes. For the numerator, we need the number of ways to draw one Ace and four other cards (none of them Aces) from the deck. Since there are four Aces and we want exactly one of them, there will be 4C1 ways to select one Ace; since there are 48 non-Aces and we want 4 of them, there will be 48C4 ways to select the four non-Aces. Now we use the Basic Counting Rule to calculate that there will be 4C1 · 48C4 ways to choose one ace and four non-Aces. Putting this all together, we have
Example
Compute the probability of randomly drawing five cards from a deck and getting exactly two Aces.Answer: The solution is similar to the previous example, except now we are choosing 2 Aces out of 4 and 3 non-Aces out of 48; the denominator remains the same: It is useful to note that these card problems are remarkably similar to the lottery problems discussed earlier.
Birthday Problem
Let's take a pause to consider a famous problem in probability theory:example
Suppose three people are in a room. What is the probability that there is at least one shared birthday among these three people?Answer: There are a lot of ways there could be at least one shared birthday. Fortunately there is an easier way. We ask ourselves “What is the alternative to having at least one shared birthday?” In this case, the alternative is that there are no shared birthdays. In other words, the alternative to “at least one” is having none. In other words, since this is a complementary event,
P(at least one) = 1 – P(none)
We will start, then, by computing the probability that there is no shared birthday. Let's imagine that you are one of these three people. Your birthday can be anything without conflict, so there are 365 choices out of 365 for your birthday. What is the probability that the second person does not share your birthday? There are 365 days in the year (let's ignore leap years) and removing your birthday from contention, there are 364 choices that will guarantee that you do not share a birthday with this person, so the probability that the second person does not share your birthday is 364/365. Now we move to the third person. What is the probability that this third person does not have the same birthday as either you or the second person? There are 363 days that will not duplicate your birthday or the second person's, so the probability that the third person does not share a birthday with the first two is 363/365. We want the second person not to share a birthday with you and the third person not to share a birthday with the first two people, so we use the multiplication rule:and then subtract from 1 to get
P(shared birthday) = 1 – P(no shared birthday) = 1 – 0.9918 = 0.0082.
This is a pretty small number, so maybe it makes sense that the answer to our original problem will be small. Let's make our group a bit bigger.Suppose five people are in a room. What is the probability that there is at least one shared birthday among these five people?
Answer: Continuing the pattern of the previous example, the answer should be
Note that we could rewrite this more compactly as
which makes it a bit easier to type into a calculator or computer, and which suggests a nice formula as we continue to expand the population of our group.
Suppose 30 people are in a room. What is the probability that there is at least one shared birthday among these 30 people?
Answer: Here we can calculate
which gives us the surprising result that when you are in a room with 30 people there is a 70% chance that there will be at least one shared birthday! The birthday problem is examined in detail in the following. https://youtu.be/UUmTfiJ_0k4