3.5. Discrete Probability#

3.5.1. Learning goals:#

After working through these notes, you will be able to:

  1. Compute probabilities of discrete outcomes for events such as drawing cards or rolling dice.

  2. Distinguish between the addition and multiplication rule for probabilities.

  3. Compute conditional probabilities of discrete events.

  4. Use the choose function to compute the number of possible outcomes for discrete events

3.5.2. Coding concepts:#

No coding concepts are used in this notebook.

3.5.3. Discrete Probability of Single Events#

Rolling a six sided die has six possible outcomes. Rolling a 4, for example, is an outcome of this type of discrete event. Here, we focus on compute the probability of such events.

The probability of rolling a 4 with a six sided die is given by

(3.59)#\[\begin{equation} P = \frac{1}{6} = \frac{\text{# way of getting a 4}}{\text{total # of possible outcomes}} \end{equation}\]

In general, the probability of a discrete event \(A\) can be determined by

(3.60)#\[\begin{equation} P = \frac{\text{# way of getting $A$}}{\text{total # of possible outcomes}} \end{equation}\]

3.5.3.1. Example: Computing Probabilities of Discrete Events#

  1. What is the probability of rolling a \(4\) with an \(8\)-sided die?

  2. What is the probability of drawing a \(J\spadesuit\) for a standard deck of 52 cards?

  3. What is the probability of drawing a white marble from a bucket with 20 red, 30 white, and 50 blue marbles?

  4. What is the probability of getting heads when flipping a (fair) coin?

3.5.4. Discrete Probability of Multiple Outcomes in a Single Event (OR)#

In certain cases we might be interested in the probability of multiple outcomes. For example, you might ask

“What is the probability of drawing a white OR a red marble from a bucket with 20 red, 30 white, and 50 blue marbles?”

In this case, we are considering picking one marble from the bucket and asking what is the probability that this marble is either white OR red. Since the drawing of a white marble is mutually exclusive from the drawing of a red marble, the probability of one OR the other is the sum of the independent probabilities:

(3.61)#\[\begin{equation} P(W \text{ or } R) = P(W) + P(R) = \frac{30}{100} + \frac{20}{100} = \frac{1}{2} \end{equation}\]

The equation above only generalizes for independent events.

3.5.4.1. Independent Events#

The probability of \(A\) or \(B\) where \(A\) and \(B\) are independent events is

(3.62)#\[\begin{equation} P(A \text{ or } B) = P(A) + P(B) \end{equation}\]

Examples of independent events \(A\) and \(B\):

  1. \(A =\) heads, \(B =\) tails for a single coin flip

  2. \(A =\) 6, \(B = \) 2 for a single roll of dice

3.5.4.2. Dependent Events#

The probability of \(A\) or \(B\) where \(A\) and \(B\) are dependent events is

(3.63)#\[\begin{equation} P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B) \end{equation}\]

Examples of dependent events \(A\) and \(B\):

  1. \(A =\) drawing a spade, \(B =\) drawing a Jack for a single card draw

  2. \(A = \) rolling a 2, \(B = \) rolling an even number for a single dice roll

3.5.5. Probability of Multiple Outcomes for Multiple Events (AND)#

What if we consider problems like what is the probability that I get two tails in a row from flipping a fair coin. This is the AND rule and requires that we multiply probabilities:

(3.64)#\[\begin{equation} P(T,T) = P(T)\cdot P(T) = \frac{1}{2}\cdot\frac{1}{2} = \frac{1}{4} \end{equation}\]

We can check this by considering all possible outcomes. Here is a list of all possible outcomes:

(3.65)#\[\begin{align} &T, T \\ &T, H \\ &H, T \\ &H, H \end{align}\]

From this, we see that there are four possible outcomes of flipping two-sided coin twice. Of these, there are only one outcome that has both tails. Thus,

(3.66)#\[\begin{equation} \frac{\text{# ways of getting two tails in a row}}{\text{total # of possible outcomes}} = \frac{1}{4} \end{equation}\]

Generally, we multiply probability of events to find the probability of these two events happening. However, this only holds for independent events. For dependent events, such as drawing of cards without replacment, we introduce conditional probabilities.

3.5.5.1. Independent Events#

The probability of independent events \(A\) AND \(B\) is given by

(3.67)#\[\begin{equation} P(A \text{ and } B) = P(A)P(B), \end{equation}\]

Examples include:

  1. Rolling two 2s in a row

  2. Flipping a heads and then a tails

3.5.5.2. Dependent Events#

The probability of dependent events \(A\) AND \(B\) is given by

(3.68)#\[\begin{equation} P(A \text{ and } B) = P(A)P(B|A), \end{equation}\]

where \(P(B|A)\) is the “probability of \(B\) given \(A\)”, or the conditional probability of \(B\) and \(A\).

Examples include:

  1. Drawing, without replacement, a heart and a spade.

  2. Drawing, without replacment, two red cards in a row.

3.5.6. Conditional Probability of Events#

Conditional probabilities are the measure of something given other, prior, information. For example, you might ask “what is the probability that I draw a Jack given that I draw a spade?” This probability is written as

(3.69)#\[\begin{equation} P(J|\spadesuit) = \frac{1}{13} \end{equation}\]

This is best compute by counting (or calculating) a total number of the outcome and the total possible. Most probabilities can be cast as conditional. For example, the probability of a drawing a heart from a standard deck can be stated as “What is the probablity that I draw a heart given that I have a 52 card deck, 13 of which are hearts?”

Conditional probabilities are important in probability theory and also are important in statistical Thermodynamics.

3.5.7. Binomial Coefficients#

One of the hardest things in discrete probability is counting the total number of possible outcomes. For example, if I ask what is the probability of getting a royal flush when dealt five cards, we must determine (1) the number of five card hands that are royal flushes and (2) the total possible number of five card hands.

(3.70)#\[\begin{equation} P(\text{royal flush}) = \frac{\text{# royal flush hands}}{\text{total number of five card hands}} \end{equation}\]

To count the total number of five card hands, it is useful to introduce the concept of binomial coefficients. These coefficients are useful in statistical mechanics as well. The number of five card hands is given by

(3.71)#\[\begin{equation} 52C5 = \frac{52!}{5!47!} = 2598960 \end{equation}\]

where \(C\) stands for the choose function and \(!\) stands for the factorial operation.