Lecture 12 – Probability

DSC 10, Fall 2022

Announcements

Agenda

We'll cover the basics of probability theory. This is a math lesson; take written notes. ✍🏽

Probability resources

Probability is a tricky subject. If it doesn't click during lecture or on the assignments, take a look at the following resources:

Probability theory

Probability theory

Terminology

Terminology

Equally-likely outcomes

$$ P(A) = \frac{ \text{# of outcomes satisfying $A$} }{ \text{total # of outcomes} } $$

Example 1 solved

Concept Check ✅ – Answer at cc.dsc10.com

I have three cards: red, blue, and green. What is the chance that I choose a card at random and it is green, then – without putting it back – I choose another card at random and it is red?

Solution

Conditional probabilities

$$ P(B \text{ given } A) = \frac{ \text{# of outcomes satisfying both $A$ and $B$} }{ \text{# of outcomes satisfying $A$} } $$

Concept Check ✅ – Answer at cc.dsc10.com

$$ P(B \text{ given } A) = \frac{ \text{# of outcomes satisfying both $A$ and $B$} }{ \text{# of outcomes satisfying $A$} } $$

I roll a six-sided die and don't tell you what the result is, but I tell you that it is 3 or less. What is the probability that the result is even?

Solution

$$ P(B \text{ given } A) = \frac{ \text{# of outcomes satisfying both $A$ and $B$} }{ \text{# of outcomes satisfying $A$} } $$

Probability that two events both happen

$$ P(A \text{ and } B) = \frac{ \text{# of outcomes satisfying both $A$ and $B$} }{ \text{total # of outcomes} } $$

Example 2 solved

I roll a fair six-sided die. What is the probability that the roll is 3 or less and even?

The multiplication rule

$$ P(A \text{ and } B) = P(A) \cdot P(B \text{ given } A) $$

Example 2 solved, again

I roll a fair six-sided die. What is the probability that the roll is 3 or less and even?

Generally, situations involving an "and" involve multiplication.

What if $A$ isn't affected by $B$? 🤔

Independent events

Example 3 solved

Suppose we have a coin that is biased, and flips heads with probability 0.7. Each flip is independent of all other flips. We flip it 5 times. What's the probability we see 5 heads in a row?

$$0.7 \cdot 0.7 \cdot 0.7 \cdot 0.7 \cdot 0.7 = 0.7^5$$

Probability that an event doesn't happen

Concept Check ✅ – Answer at cc.dsc10.com

Every time I call my grandma 👵, the probability that she answers her phone is $\frac{1}{3}$. If I call my grandma three times today, what is the chance that I will talk to her at least once?

Solution

Probability of either of two events happening

$$ P(A \text{ or } B) = \frac{ \text{# of outcomes satisfying either $A$ or $B$} }{ \text{total # of outcomes} } $$

Example 4 solved

I roll a fair six-sided die. What is the probability that the roll is even or at least 5?

The addition rule

$$P(A \text{ or } B) = P(A) + P(B)$$

Example 5 solved

Suppose I have two biased coins, coin $A$ and coin $B$. Coin $A$ flips heads with probability 0.6, and coin $B$ flips heads with probability 0.3. The two coins are independent of one another. I flip both coins once. What's the probability I see two different faces?

$$0.6 \cdot (1 - 0.3) + (1 - 0.6) \cdot 0.3 = 0.54$$

Generally, situations involving an "or" involve addition.

Aside: proof of the addition rule for equally-likely events

You are not required to know how to "prove" anything in this course; you may just find this interesting.

If $A$ and $B$ are events consisting of equally likely outcomes, and furthermore $A$ and $B$ are mutually exclusive (meaning they have no overlap), then

$$ \begin{align*} P(A \text{ or } B) &= \frac{ \text{# of outcomes satisfying either $A$ or $B$} }{ \text{total # of outcomes} } \\[1em] &= \frac{ (\text{# of outcomes satisfying $A$}) + (\text{# of outcomes satisfying $B$}) }{ \text{total # of outcomes} } \\[1em] &= \frac{ (\text{# of outcomes satisfying $A$}) }{ \text{total # of outcomes} } + \frac{ (\text{# of outcomes satisfying $B$}) }{ \text{total # of outcomes} } \\[1em] &= P(A) + P(B) \end{align*} $$

Summary

Summary