Skip to main content

Discrete Mathematics for Computing (Draft)

Section 6.1 Discrete Probability Basics

In life, we are almost always dealing with uncertainty. We determine what time to leave for an appointment based on what we think traffic will be like, how many red lights we expect to hit, how likely it is that we’ll find a desireable parking spot, and more. While it is unlikely that you are sitting down to actually determine the probabilities associated with overly heavy traffic or finding no parking spot in your favorite parking lot, probability is what gives us the framework to assess how these events impact the risk associated with arriving late to our appointment.
This chapter is all about computing and interpreting probabilities. In this first section, we’ll begin with some information about probabilities associated with basic (atomic) processes/events. For example, the probability of flipping a fair coin and observing heads or the probability of rolling a fair 20-sided die and observing at least a 13. We’ll expand on this knowledge of probabilities of atomic events by considering combinations of events, and their probabilities. For example, "the probability of rolling a fair 20-sided die and observing at least a 13 or less than 3" or "the probability of flipping a coin and rolling a fair 20-sided die and observing a flip of heads and a roll of atleast 13". Let’s dig in.

Subsection 6.1.1 Probability and Atomic Processes

As a reminder, atomic processes are events which cannot be decomposed into smaller, "sub"-events. For example, drawing a single marble from a bag containing some number of red, green, and blue marbles is an atomic process. However, flipping a coin and drawing a marble, or drawing two marbles from the bag are not atomic processes since these can each be decomposed into two subprocesses: (i) flipping the coin, and (ii) drawing the marble for the first example, or (i) drawing the first marble, and then (ii) drawing the next marble in the second exaple.
For any event, whether the event results from an atomic process or not, we can define the probability associated with that event (outcome). We’ll use the definition of probability which appears below:

Definition 6.1.1. [Discrete] Probability.

Given some discrete process \(P\) and some event/outcome \(E\text{,}\) let \(n\left(P\right)\) denote the total number of possible outcomes from \(P\text{,}\) and \(n\left(E\right)\) denote the total number of outcomes of \(P\) where the event \(E\) has occurred. The probability of the event \(E\) is then denoted and computed as follows:
\begin{gather*} \mathcal{P}\left[E\right] = \frac{n\left(E\right)}{n\left(P\right)} \end{gather*}
In the definition above, the total number of outcomes possible (\(n\left(P\right)\)) is sometimes referred to as the size of the sample space. Let’s take a look at an example before you try a few exercises to check your understanding of the probability formula from the definition.

Example 6.1.2. Rolling a fair 20-sided die.

Given a fair 20-sided die, find the probability of rolling at least a 13.
Answer.
Note that the process \(P\) is the rolling of a fair 20-sided die. There are \(20\) outcomes possible here since rolls can result in any number between 1 and 20. This means that \(n\left(P\right) = 20\text{.}\)
Similarly, the event \(E\) is that we roll at least a 13. This means that \(n\left(E\right) = 8\) since any outcome resulting in values 13 to 20 (includsive) satisfy \(E\text{.}\)
From here, we can apply the formula from the definition of discrete probability to discover that
\begin{align*} \mathcal{P}\left[E\right] &= \frac{n\left(E\right)}{n\left(P\right)}\\ &= \frac{8}{20}\\ &= \boxed{~\frac{2}{5}~~\left(\text{ or } 40\%~\right)~} \end{align*}
Now that you’ve seen an example, verify your understanding by completing exercises below.

Checkpoint 6.1.3. Spinning a Wheel.

Checkpoint 6.1.4. Drawing Cards.

Checkpoint 6.1.5. Running a Red Light.

Good work. In the next subsection, we’ll see how to calculate probabilities associated with compound events. These compound events combine atomic events to allow for requirements like several events occurring simultaneously, or considering events where at least one outcome criteria from a collection of desired outcomes is satisfied.

Subsection 6.1.2 Compound Events and their Probabilities

Consider the scenario in which we are drawing a single card from a standard 52-card deck
 1 
intranet.missouriwestern.edu/cas/wp-content/uploads/sites/17/2020/05/Standard-Deck-of-Cards.pdf
. An example of an atomic event is drawing the four of clubs, and a separate atomic event might be the event that we draw a red card. We can use what we learned in the previous subsection to determine
\begin{gather*} \mathcal{P}\left[\text{four of clubs}\right] = \frac{1}{52}~~\left(~\text{or about}~1.9\%\right)\\ \mathcal{P}\left[\text{red card}\right] = \frac{26}{52}~~\left(~\text{or } 50\%~\right) \end{gather*}
What if we aren’t interested in these outcomes independently of one another? Perhaps instead, we are interested in the outcome where we draw the four of clubs or a red card. We could also be interested in the outcome where we draw the four of clubs and a red card. Let’s see how to calculate the probability of these two compound events below.

Example 6.1.6. Drawing the Four of Clubs or a Red Card.

Consider a scenario in which we are drawing a single card from a well-shuffled standard deck of 52 cards. What is the probability of drawing the four of clubs or a red card?
Answer.
We can proceed exactly as we did with our atomic events. The probability will be the total number of ways our outcome of interest could occur, divided by the total number of outcomes possible (the size of the sample space). Since \(P\) is the process of drawing a single card from a 52-card deck, we have \(n\left(P\right) = 52\text{.}\)
Now, there are two ways that our event of interest could occur. We could draw the four of clubs (\(n\left(\text{draw four of clubs}\right) = 1\)) or we could draw a red card (\(n\left(\text{draw a red card}\right) = 26\)). Since the four of clubs is a black card, these two sets of outcomes are disjoint (they do not overlap, and so there is no double-counting of any outcome). This means that the number of ways to draw a card in which we obtain the four of clubs or a red card is \(n\left(E\right) = 27\text{,}\) since we can just add the sizes of the disjoint collections of events together.
To obtain the probability of our event \(E\) (we draw the four of clubs or a red card), we divide the number of ways \(E\) can occur by the size of the overall sample space. That is,
\begin{align*} \mathcal{P}\left[E\right] &= \frac{n\left(E\right)}{n\left(S\right)}\\ &= \boxed{~\frac{27}{52}~~(~\text{or about}~51.9\%~)~} \end{align*}

Example 6.1.7. Drawing the Four of Clubs and a Red Card.

Consider a scenario in which we are drawing a single card from a well-shuffled standard deck of 52 cards. What is the probability of drawing the four of clubs and that card is a red card?
Answer.
Since the four of clubs is a black card, there are \(0\) ways in which we can observe an outcome where the card we draw is both the four of clubs and is a red card (the event \(E\)). Using the our definiton of the probability of an event, we have:
\begin{align*} \mathcal{P}\left[E\right] &= \frac{n\left(E\right)}{n\left(S\right)}\\ &= \frac{0}{52}\\ &= \boxed{~0~~\left(\text{ or } 0\%~\right)~} \end{align*}
These examples were quite straight-forward. Let’s take a look at two additional examples that highlight some of the intricacies involved in counting outcomes to determine probabilities of events. After reading through these completed examples, you’ll have an opportunity to check your understanding with a few checkpoint exercises.

Example 6.1.8. Drawing a Red, Face Card.

Consider a scenario in which we are drawing a single card from a well-shuffled standard deck of 52 cards. What is the probability of drawing a red, face-card from the deck?
Answer.
Note that our event \(E\text{,}\) of drawing a red, face-card could be restated as "the event that we draw a red card and that card is also a face card". Recall that face-cards in a deck are the Jacks, Queens, and Kings. This means that there are \(12\) total face cards in the deck. We also know from an earlier example that there are \(26\) red cards in the deck. However, only six of the face cards are red. This means that there are \(6\) ways in which we can observe our event \(E\) as the outcome of drawing a single card from a 52-card deck.
Using our definition of probability, we can compute:
\begin{align*} \mathcal{P}\left[E\right] &= \frac{n\left(E\right)}{n\left(S\right)}\\ &= \frac{6}{52}\\ &= \boxed{~\frac{3}{26}~~\left(\text{ or about } 11.5\%\right)~} \end{align*}

Example 6.1.9. Drawing a Red Card or a Face Card.

Consider the same scenario in which we are drawing a single card from a well-shuffled standard deck of 52 cards. What is the probability of drawing a red card or a face-card from the deck?
Answer.
As in the previous example, the face-cards in a deck are the Jacks, Queens, and Kings. This means that there are \(12\) total face cards in the deck. Similarly, we know that there are \(26\) red cards in the deck.
The problem we encounter here is that some of those face cards are also red cards. If we were to just add the \(12\) face cards to the \(26\) red cards, we would be double-counting all of the red, face-cards. To remove this double counting, we’ll subtract out the number of red, face-cards. That is,
\begin{align*} n\left(\text{red or face}\right) &= n\left(red\right) + n\left(\text{face}\right) - n\left(\text{red and face}\right)\\ &= 26 + 12 - 6\\ &= 32 \end{align*}
Now we can use our definition to compute the probability:
\begin{align*} \mathcal{P}\left[\text{red or face}\right] &= \frac{n\left(\text{red or face}\right)}{n\left(S\right)}\\ &= \frac{32}{52}\\ &= \boxed{~\frac{8}{13}~~\left(\text{ or about } 61.5\%\right)~} \end{align*}
Notice in the example where we calculated the probability of being dealt a red, face card we had to limit the event space we were interested. It wasn’t so simple as identifying the number of face cards or the number of red cards -- we needed to consider both criteria in counting the number of outcomes satisfying our event of interest.
Similarly, in the example that followed, we wanted to know the probability of being dealt a red card or a face card. In this scenario, we also needed to take extra care in counting the number of outcomes of interest. We would have double-counted the red, face cards if we simply added the number of red cards to the number of face cards. This is because the red, face cards were included in both groups. The strategy we used in reducing the overcounting is often referred to as the Principle of Inclusion and Exclusion, which we’ll formalize below.

Definition 6.1.10. Principle of Inclusion and Exclusion (PIE).

The Principal of Inclusion and Exclusion is a counting technique which can be utilized to count the number of items in a union of sets, whether those sets are disjoint (non-overlapping) or not. This counting method extends to the union between any number sets. We’ll show the two- and three-set forms below:
\begin{align*} \left|A \cup B\right| &= \left|A\right| + \left|B\right| - \left|A \cap B\right|\\ \left|A\cup B\cup C\right| & = \left|A\right| + \left|B\right| + \left|C\right| - \left(\left|A\cap B\right| + \left|A\cap C\right| + \left|B\cap C\right|\right) + \left|A\cap B\cap C\right| \end{align*}
Now, check your understanding with the following checkpoint questions.
In this section you learned, and practiced with...