maths.free › Combinatorics & Graph Theory › 4. Counting › Applications to Probability
Applications to Probability
Investigation Suppose you, like the 17th-century French nobleman Chevalier de Mere, liked gambling on the outcome of rolling fair 6-sided dice (each numbered 1 to 6).
Section Preview
Investigation
Suppose you, like the 17th-century French nobleman Chevalier de Mere, liked gambling on the outcome of rolling fair 6-sided dice (each numbered 1 to 6). Would you bet him that he couldn't roll at least one 6 in four rolls of a single die? What about betting that he couldn't roll at least one double-6 in 24 rolls of both dice?
To make these decisions, we should decide
How likely is it that in four rolls of a single die, there will be at least one 6?
How likely is it that in 24 rolls of two dice, there will be at least one double-6?
Since the ratio \(4:6\) is equal to the ratio \(24:36\), should the probability of these events be the same? That's what the Chevalier de Mere thought. Do you?
Here is a python script that can help you get a feel for the questions above. You can switch between the two questions by commenting and uncommenting out the appropriate lines (lines that start with a # are comments). See how lucky you are!
If you know some python, you might want to modify the script to run the experiment 1000 times and see how many of those are wins.
We can get a feel for probability empirically by observing how frequently events occur when an experiment is repeated many times. It often happens, as it did with the Chevalier de Mere, that our intuition about probability is not quite right. Using the counting techniques we have studied, we can explain why our intuition is off and what the true probabilities are.
Most of the questions about counting we have considered in this chapter can also be asked as a question about probability. For example: How many passwords of length 8 can you make using just lower-case letters? What is the probability that randomly selecting 8 lower-case letters will give you your password?
While the subject of probability is vast and complex, the basics of discrete probability are little more than counting. So here we will take a brief look at how our study of counting can help us understand probability.
Computing Probabilities
Think about how we use the language of probability in our everyday lives. We might say that tossing a coin has a 50% chance of coming up heads. Or that when rolling two dice, having the sum of the dice result in a 7 is more likely than having the sum be a 2. Casinos certainly rely on certain pairs of cards being consistently more likely than others when setting payouts for Blackjack. All of this assumes that there is some randomness to events, and that even in this randomness, there is some consistency to what can happen. We will assume this model of reality.
The things we can assign probabilities to are called random experiments. These can have different possible outcomes. We will call the (finite) set of possible outcomes to a random experiment the sample space (we will usually denote this set as \(S\)). By definition, performing a random experiment will always result in exactly one outcome from the sample space.
Throughout this section, we will always assume the uniform probability distribution, which means that we insist that each outcome in the sample space is equally likely. Then the probability of any particular outcome in the sample space \(S\) is exactly \(\frac{1}{\card{S}}\).
Example
Suppose you flip two fair coins (a penny and a nickel). What is the sample space of possible outcomes? What is the probability of getting two heads?
Solution
The same space is the set of all possible outcomes of the experiment, which in this case is the set \(\{HH, HT, TH, TT\}\). The probability of getting two heads is then \(\frac{1}{4}\). In fact, every outcome has probability \(\frac{1}{4}\) since there are 4 outcomes in the sample space.
Consistent with our intuition, we define the probability of an event as follows.
Condensed — the full section is in Levin, Discrete Mathematics: An Open Introduction.
Probability Rules
Here are a few basic probability facts that follow easily from our definition of probability and understanding of counting. While we are still under the assumption that the outcomes in the sample space are equally likely (the uniform probability distribution), these rules will hold for all probability distributions.
First, we often are interested in the probability that an event does not occur. We call this the complement of the event. Remember, events are subsets of the sample space, and not being in the event means you are in the complement of that subset. Using the same notation we have for sets, the complement of an event \(E\) will be written \(\bar{E}\). Here is the relationship between the probability of an event and its complement.
Let's illustrate this proof with an example.
Complementary probabilities are very useful when answering historical questions about dice.
Example
What is the probability that you will roll at least one 6 in four rolls of a fair 6-sided die?
Is this the same as the probability that you will roll at least one double 6 in 24 rolls of two dice?
Solution
The complementary event is rolling a die four times and never getting a 6. Of the \(6^4\) possible rolls, there are \(5^4\) that contain no 6. So the probability of getting at least one 6 in four rolls is \[P(\text{at least one 6}) = 1 - P(\text{no 6}) = 1 - \frac{5^4}{6^4} \approx 0.5177\].
For the double 6 in 24 rolls variant, we use the complementary event as well: what is the probability of not getting double 6s? That means on every roll you get one of the 35 other pairs. \[P(\text{at least one double 6}) = 1 - P(\text{no double 6}) = 1 - \frac{35^{24}}{36^{24}} \approx 0.4914\].
Indeed, the Chevalier de Mere noticed that when playing the game with two dice, he tended to lose money in the long run. Who did he turn to to ask for help? Blaise Pascal, of course!
The proof of this fact is one of the exercises in this section. However, it should become clear how this works with an example.
Condensed — the full section is in Levin, Discrete Mathematics: An Open Introduction.
Conditional Probability
The famous probability problem, known as the Monty Hall problem, presents the following conundrum. You are on the game show Let's Make a Deal and will win whatever is behind one of three doors you decide to open. Behind one door is a car; behind the other two are goats. You pick a door, but before opening it, the host (Monty Hall) reveals one of the other doors that has a goat behind it. You then have the opportunity to switch doors. Should you switch? What is the probability of getting the car if you do?
This problem was perhaps one of the first math problems to go viral, although it did so when it appeared in the Sunday newspaper magazine Parade. After its publication, around 10,000 readers (including close to 1000 with PhDs) wrote in complaining that the author, Marilyn vos Savant, was wrong. She wasn't.
You might be tempted to say that the probability of getting the car when you switch is \(\frac{1}{2}\). After all, there are two doors left, and the car is behind one of them. However, we must ask what the probability of getting the car is given that Monty has revealed a goat behind another, unpicked door.
Does this definition agree with our intuition for what conditional probability should mean? Let's think about the sample space. We want to know the chances of \(A\) occurring under the assumption that \(B\) has already occurred. In other words, we only care about the elements of the sample space that belong to \(B\).
If \(B\) becomes the sample space, then the only outcomes from \(A\) that can possibly occur are the outcomes that are in \(A\) and \(B\). So perhaps the definition of conditional probability really should be, \[P(A | B) = \frac{\card{A \cap B}}{\card{B}}\].
Unfortunately, I'm not in charge of probability definitions. It turns out that the standard definition is just as good though. This is because, \[P(A | B) = \frac{P(A \cap B)}{P(B)} = \frac{\frac{\card{A \cap B}}{\card{S}}}{\frac{\card{B}}{\card{S}}} = \frac{\card{A \cap B}}{\card{B}}\]. Phew. Another crisis averted.
Condensed — the full section is in Levin, Discrete Mathematics: An Open Introduction.
Practice (11)
Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.
-
Which of the following are true about the equation \(P(A \cup B) = P(A) + P(B)\)?
-
Which of the following relationships hold for any two events \(A\) and \(B\)?
-
What questions do you have after reading this section? Ask at least one question about the material that you are curious about.
-
When playing 5-card poker, a full house is a hand that contains three cards of one rank and two cards of another rank. For example, you could have three 7s and two 4s.
Find the probability of being dealt a full house in two different ways:
Assume that all five cards are dealt at once, so that the sample space has size \(\binom{52}{5}\).
Assume that the cards are dealt one at a time, so that the sample space has size \(P(52,5)\).
-
A random number generator selects single-digit numbers (0 through 9) with equal probability. Suppose the generator produces five numbers.
What is the probability that the five numbers will all be different? Answer this question in two ways:
Assume the numbers come out of the generator in a sequence, so that the sample space has size \(10^5\).
Assume the numbers come out as a multiset, or equivalently, that the numbers must appear in non-decreasing order. You will want to use sticks and stones to count the size of the sample space.
-
Prove .
-
Each of 10 friends has a deck of cards that they shuffle thoroughly. Each friend draws a card from their deck. What is the probability that at least one pair of friends draw a matching card?
ଉତ୍ତରକୁ ଖୋଲନ୍ତୁ
Hint:
Use complementary probabilities. And don't be surprised if your answer is larger than you would have expected.
-
How many people do you need to have in a room to have a 50% chance that at least two people share the same birthday (day of the year)? Assume that all birthdays are equally likely, and that nobody is born on Leap Day (February 29th).
-
At your 20th high school reunion, you meet an old friend you hadn't heard from in years. You talk about pets, specifically cats and dogs. She tells you that she has two pets, and that at least one of them is a cat. What is the probability that she has two cats? (Assume that having a cat or a dog is equally likely.)
-
Another old friend overhears your pet conversation and says that he also has two pets, and that the one he has had the longest is a cat. What is the probability that he has two cats? And why is this answer different from the previous question?
-
You are playing a shell game with three cups. Under one cup are two green balls, under another cup are two red balls, and under the third cup are one green and one red ball. You close your eyes, and your friend rearranges the cups. You then open your eyes and pick a cup at random. You see that it contains a green ball. What is the probability that the other ball under that cup is also green? Explain your answer in terms of conditional probability.
Symbols used here
Number of k-element subsets of n things: n!/(k!(n−k)!).
In either; in both; in A but not B.
Chance of A; chance of A given that B happened.
Equal to the precision shown, not exactly.
n × (n−1) × … × 1; the number of orderings of n things. 0! = 1.
Add a_k for k = 1 up to n.
Multiply a_k for k = 1 up to n.
The set with no elements; the number of elements of A.
How to: Applications to Probability
- Use counting techniques to compute probabilities of events.
- Understand the basic rules of probability.
- Compute probabilities of compound events, both independent and dependent.
Questions people ask
Permutation or combination?
Ask whether order matters. A lock code is a permutation (order matters); a hand of cards is a combination (it does not).
What is a graph in this sense?
Dots (vertices) joined by lines (edges) — not a plot. Road maps, social networks and molecules are graphs; questions like "is there a route" and "how few colours" are graph theory.
ନିଜେ ଚେଷ୍ଟାକରନ୍ତୁ
Parts of this page are adapted from Levin, Discrete Mathematics: An Open Introduction (CC BY-SA 4.0). Condensed and re-explained here; errors are ours.
ଅଧିକ Combinatorics & Graph Theory
The counting principlesPigeonhole principle and inclusion–exclusionBinomial coefficients and Pascal's triangleRecurrences and generating functionsGraphs: vertices, edges, degreesPaths, cycles, trees, Euler and HamiltonColouring and planar graphs