Week 8 - Probability
- Probability measures how likely an event is to occur.
- It helps us predict outcomes in uncertain situations.
![]() |
![]() |
![]() |
We are going to use well-established mathematical theory
- Probability measures how likely an event is to occur.
- It helps us predict outcomes in uncertain situations.
![]() |
![]() |
![]() |
- Two main types:
- Based on actual experiments or observations. π π
- Depends on the data collected. ππ
- Formula: \[ \text{Experimental Probability} = \frac{\text{Number of times an event occurs}}{\text{Total number of trials}} \]
- As in the example of tossing a coin πͺ:
If I toss a coin 100 times, and I get 55 Heads, then the probability of heads is \[ \frac{55}{100}= 0.55 \approx \frac{1}{2} \]
In general: if a coin is tossed $N$ times, \[ P(\text{Head}) = \frac{\text{Number of Heads}}{N}. \]
As $N$ gets larger, then the experimental probability gets closer to what we call theoretical probability.
In other words,
- Based on reasoning or mathematical analysis.
- Assumes all outcomes are equally likely.
- Formula: \[ \text{Theoretical Probability} = \frac{\text{Number favorable outcomes}}{\text{Total number of possible outcomes}} \]
- Tossing a coin β Probability of getting Heads \(= \dfrac{1}{2}.\)
- An event is a specific outcome or a set of outcomes.
Examples:
- Simple Event:
One outcome (e.g., π² rolling a 6)
- Compound Event:
Multiple outcomes (e.g., π² rolling an odd number: 1, 3, or 5)
⚀ ⚁ ⚂ ⚃ ⚄ ⚅
Consider the event: Trowing a die π².
All the possible outcomes are: \(1, 2, 3,4, 5, 6\)
We count the occurrence of each event over a very large number of tests $N$ to get $$N_1, N_2, N_3, N_4, N_5, N_6$$ for the events.
Since there are the only possible events, we must have
\(N_1+ N_2+ N_3+ N_4+ N_5+ N_6 = N.\)
⚀ ⚁ ⚂ ⚃ ⚄ ⚅
Consider the event: Trowing a die π².
All the possible outcomes are: \(1, 2, 3,4, 5, 6\)
Since there are the only possible events, we must have
\(N_1+ N_2+ N_3+ N_4+ N_5+ N_6 = N.\)
The probability of the event $i$ is then
\(P(i) = \dfrac{N_i}{N}\) for $N\ra \infty.$
Consider the event: Trowing a die π².
All the possible outcomes are: \(1, 2, 3,4, 5, 6\)
Since there are the only possible events, we must have
\(N_1+ N_2+ N_3+ N_4+ N_5+ N_6 = N.\)
Now, let's divide by $N$ the previous expression, so we obtain:
\(\dfrac{N_1+ N_2+ N_3+ N_4+ N_5+ N_6 }{N}= \dfrac{N}{N}\)
\(\Ra \dfrac{N_1}{N}+ \dfrac{N_2}{N}+ \dfrac{N_3}{N}+ \dfrac{N_4}{N}+ \dfrac{N_5}{N}+ \dfrac{N_6}{N}= 1\)
Consider the event: Trowing a die π².
All the possible outcomes are: \(1, 2, 3,4, 5, 6\)
\(\Ra \dfrac{N_1}{N}+ \dfrac{N_2}{N}+ \dfrac{N_3}{N}+ \dfrac{N_4}{N}+ \dfrac{N_5}{N}+ \dfrac{N_6}{N}= 1\)
\(\Ra P(1) + P(2) + P(3) + P(4)+ P(5)+P(6)= 1\)
For a "fair" die we have that \(P(1)=P(2)=P(3)=P(4)=P(5)=P(6).\)
\(\Ra\,6 P(1)=\) \(P(1) + P(2) + P(3) + P(4)+ P(5)+P(6)\) \(=1\)
\(\Ra P(1)=P(2)=P(3)=P(4)=P(5)=P(6) = \dfrac{1}{6}.\)
The probability of $A$ occurring is given by the formula \[ P(A) = \frac{\text{Number favorable outcomes}}{\text{Total number of possible outcomes}}. \]
$P(A)$ is a real number between 0 and 1. That is, \[ 0\leq P(A) \leq 1. \]
If the different outcomes of an experiment are $N_1, N_2, N_3, \ldots, N_n,$ then \[ P(N_1)+P(N_2)+P(N_3)+\cdots+P(N_n)=1. \]
- The sample space is the set of all possible outcomes of an experiment.
Examples:
The probability of an event is the number of cases of that event in the sample space divided by the size of the sample space
For example: Consider the sample space for three coins
What is the probability of getting 2 heads in 3 tosses?
\(P(\text{exactly 2 heads in 3 tosses})\) \(=\dfrac{\# 2\text{ heads}}{\# \text{Total}}\)
\(=\dfrac{\#\{\text{THH, HTH, HHT}\}}{8}\) \(=\dfrac{3}{8}\)
\[ \left\{\text{HHHH, HHHT, HHTH, HHTT, HTHH, HTHT, HTTH, HTTT}\right.\\ \left.\;\; \text{THHH, THHT, THTH, THTT, TTHH, TTHT, TTTH, TTTT}\right\} \]
Experiment: Rolling two dice π²π².
Die 2
Die 1
|
1 | 2 | 3 | 4 | 5 | 6 |
1 | ||||||
2 | ||||||
3 | ||||||
4 | ||||||
5 | ||||||
5 |
Experiment: Rolling two dice π²π².
βοΈ Sample space Total # of outcomes = 36 |
Get a double:
+Getting a total of 7:
Getting a 6 on one die only:
+Getting a total of 10 or more:
|
Experiment: Rolling two dice π²π².
βοΈ Sample space Total # of outcomes = 36 |
What is the probability of getting a 2 on one die only? π
\(A\) = get a 2 on one die only
\(P(A)\) \(=\dfrac{10}{36}\) \(=\dfrac{5}{18}\) |
- Mutually exclusive or distinct events
- Complementary events
- Independent events
- Related events
- Mutually exclusive events have no outcomes in common.
Example: There are 10 balls, numbered 1, 2, 3,...,10. One ball is drawn and the number noted. What is the probability that the number is less than 3 or greater than 7?
Example: [...] What is the probability that the number is less than 3 or greater than 7?
|
A = event of getting a number \(\lt\) 3 (i.e., 1 or 2). B = event of getting a number \(\gt\) 7 (i.e., 8, 9, or 10). A and B are mutually exclusive! π \(P(A \text{ or } B)\) \(= P(A) + P(B)\) \(\qquad\quad= P(1 \text{ or } 2) \) \(+\; P(8 \text{ or } 7 \text{ or } 9)\) \(\qquad\quad= P(1) + P(2) \) \(+ \;P(8 )+ P(7) + P(9)\) \(\qquad\quad= \dfrac{1}{10} + \dfrac{1}{10}+\dfrac{1}{10}+ \dfrac{1}{10} + \dfrac{1}{10}\) \(\qquad\quad= \dfrac{5}{10}= \dfrac{1}{2}\) |
π€ What happens if A and B are NOT mutually exclusive?
Example: There are 10 balls as above. One ball is drawn and the number noted. What is the probability that the number is greater than 7 or even?
π€ What happens if A and B are NOT mutually exclusive?
Example: [..] What is the probability that the number is greater than 7 or even?
|
A = getting a number \(\gt\) 7 (i.e. 8, 9, 10). B = getting an even number (i.e., 2, 4, 6, 8, or 10). A and B are NOT mutually exclusive! π \(P(A \text{ or } B)\) \(= P(A) + P(B) - P(A \text{ and } B)\) \(\quad\quad= P(> 7) \) \(+\; P(\text{even} )\) \(-\; P(>7 \text{ and }\text{even} )\) \(\quad\quad= \dfrac{5}{10}\) \(+ \; \dfrac{3}{10}\) \(- \;\dfrac{2}{10}\) \(= \dfrac{6}{10}= \dfrac{3}{5}\) |
- Two events are complementary when they are mutually exclusive (they cannot both happen at the same time) and together cover all possible outcomes of an experiment.
- If event A occurs, then its complement (denoted as $A'$ or not $A$) does not occur βand vice versa.
- If $A$ and $A'$ are complementary events then
\(P\left(A\right) + P\left(A' \right) = 1\)
- If $A$ and $A'$ are complementary events then
\(P\left(A\right) + P\left(A' \right) = 1\) \(\Ra \; P\left(A\right)= 1- P\left(A' \right) \)
Example: Rolling a die π²
Example: Suppose you randomly select a card from a standard deck of 52 playing cards.
For each example, compute the probabilities of each event and verify:
\(P\left(A\right) + P\left(A' \right) = 1.\)
Example: Rolling a die π²
Example: Suppose you randomly select a card from a standard deck of 52 playing cards.
- Two events are independent if the chance of one occurring is not altered by the outcome of the other.
\(P(A \text{ and } B) = P(A) \times P(B)\)
Example: Consider a box containing 3 yellow balls and 4 blue balls. What is the probability of drawing 2 blue balls
Example: Consider a box containing 3 yellow balls and 4 blue balls. What is the probability of drawing 2 blue balls
π 1. If the first ball is returned.
What is the probability that the first ball is blue? \(\;\Ra P(A)=\dfrac{4}{7}\)
Then, I put it back. Now, what is the probability that the second ball is blue? \(\;\Ra P(B)=\dfrac{4}{7}\)
|
These are independent events! π
\(P(\text{blue-1st } \textbf{and} \text{ blue-2nd})\) |
π 2. If the first ball is NOT returned!
What is the probability that the first ball is blue? \(\;\Ra P(A)=\dfrac{4}{7}\)
Then, we keep it out. Now, what is the probability that the second ball is blue? \(\;\Ra P(B)=\dfrac{3}{6}\)
|
These are NOT independent events! π
\(P(\text{blue-1st } \textbf{and} \text{ blue-2nd})\) |
Independent | Not Independent |
---|---|
|
|
Probabilities don't change! | Probabilities change! |
Consider $A$ and $B$ two events that are NOT independent. The conditional probability
$P(B\,|\,A)$ $= \dfrac{\text{# of favorable outcomes}}{\text{total # of outcomes}}$ $= \dfrac{P(A \text{ and } B)}{P(A)}$
is defined as the probability that event $B$ occur given that event $A$ has occurred.
Given that $A$ occurs, the conditional probability that $B$ occurs is:
\(P(B\,|\,A) = \dfrac{P(A \text{ and }B)}{P(A)}\) \(\;\Ra P(A \text{ and }B) = P(B\,|\,A) \times P(A)\)
Given that $B$ occurs, the conditional probability that $A$ occurs is:
\(P(A\,|\,B) = \dfrac{P(A \text{ and }B)}{P(B)}\) \(\;\Ra P(A \text{ and }B) = P(A\,|\,B) \times P(B)\)
ππ
\(P(B\,|\,A) = \dfrac{P(A \text{ and }B)}{P(A)}\) \(\;\Ra P(A \text{ and }B) = P(B\,|\,A) \times P(A)\)
Problem: A box contains 10 red socks, 8 yellow socks and 12 green socks. A girl wants a pair of red socks. If she selects 2 socks at random, what is the probability that the first sock is red and the second sock is also red?
Note: The probability of the second sock being red depends on what colour the first sock was.
π This means that we have NOT independent events.
1. Probability of first sock is RED: \(\;P(R_1) = \dfrac{10}{30}\)
2. Probability of second sock is RED: \(\;P(R_2|R_1) = \dfrac{9}{29}\)
\(\Ra \;P(R_1 \text{ and } R_2)\) \(= P(R_1) \times P(R_2|R_1)\) \(= \dfrac{10}{30} \times \dfrac{9}{29}\) \(= \dfrac{3}{29}.\)
Problem: A box contains 10 red socks, 8 yellow socks and 12 green socks. A girl wants a pair of red socks. If she selects 2 socks at random, what is the probability that the first sock is red and the second sock is also red?
Challenge! What is the probability that the second sock is RED, if we do not know the colour of the first sock?
- Independent and Not Independent events
- Conditional probability
What is the probability of winning, if you keep your first choice?
What is the probability of winning, if you switch doors?
- Combinatorics is the mathematics of counting
- We already made list of events to compute probabilities
π² | β₯οΈβ οΈβ£οΈβ¦οΈ | 𧦠| π΅ π‘
- But lists can get extremely long! π¬
- With combinatorics we can answer questions like:
Simple words with repetition:
Consider the number of ways we can make a nonsense word of 3 letters.
Thus, there are $(26)(26)(26)$ $=26^3 $ $=17576 $ possible words.
Simple words with restrictions:
Now consider how we make (nonsense) three letter words with
First, we have 20 consonants and 6 vowels.
Second, we can put the vowel in the first, second, or third spot which are mutually exclusive.
Simple words with restrictions:
Now consider how we make (nonsense) three letter words with
π Solution: 7200 possible words.
Challenge: What is the probability that a three letter word contains exactly one vowel and two consonants?
- A permutation is an arrangement of a set of objects, that is, permutations are the different ways a set of objects can be arranged.
- How many ways can you arrange $n$ different things?
1st item can be chosen in $n$ ways,
2nd item can be chosen in $(n-1)$ ways,
3rd item can be chosen in $(n-2)$ ways,
$\vdots$
$(n-1)$-th item can be chosen in $2$ ways,
$n$-th item can be chosen in only $1$ way.
$n!=$ $n \times (n-1)\times (n-2)\times (n-3)\times\cdots \times2 \times 1$
- A permutation is an arrangement of a set of objects, that is, permutations are the different ways a set of objects can be arranged.
- How many ways can you arrange $n$ different things?
$n!=$ $n \times (n-1)\times (n-2)\times (n-3)\times\cdots \times2 \times 1$
is called Factorial
- However there are many situations when we are only selecting $r$ things from $n.$ How many different ways can $r$ things be selected from $n$ different things?
- However there are many situations when we are only selecting $r$ things from $n.$ How many different ways can $r$ things be selected from $n$ different things?
1st item can be chosen in $n$ ways,
2nd item can be chosen in $(n-1)$ ways,
3rd item can be chosen in $(n-2)$ ways,
$\vdots$
$r$-th item can be chosen in $[n-(r-1)]$ ways,
that is, $r$-th can be chosen $(n-r+1)$ ways.
$ ^{n}P_{r}=$ $n \times (n-1)\times (n-2)\times (n-3)\times\cdots \times(n-r+1)$
- However there are many situations when we are only selecting $r$ things from $n.$ How many different ways can $r$ things be selected from $n$ different things?
$ ^{n}P_{r}=$ $n \times (n-1)\times (n-2)\times (n-3)\times\cdots \times(n-r+1)$
π
This is the formula to calculate permutations!
\( ^{n}P_{r}= \dfrac{n!}{(n-r)!} \)
- What if the order in which things are chosen does not matter?
Example: Suppose there is a jar which contains seven different coloured jelly beans - red, white, green, yellow, purple, black and orange. In how many ways can a child select three jelly beans from the jar?
That is, in how many ways can we select 3 things from 7 things where the order does not matter.
For instance, we can have the following outcomes:
RGB RBG GBR GRB BGR BRG
are all the same!
Example: Suppose there is a jar which contains seven different coloured jelly beans - red, white, green, yellow, purple, black and orange. In how many ways can a child select three jelly beans from the jar?
Here we are looking for the number of combinations of choosing 3 things from 7!
\(\quad=\dfrac{\text{# of permutations of choosing 3 things from 7}}{\text{# of permutations of 3 things}}\) \(=\dfrac{^{7}P_3}{3!}\)
\(\quad=\dfrac{\dfrac{7!}{(7-3)!}}{3!}\) \(=\dfrac{7!}{(7-3)!3!}\) \(=\dfrac{7\times 6\times5\times4\times3\times2\times1 }{(4\times3\times2\times1)(3\times2\times1)}\) \(=7\times 5 = 35.\)
The number of combinations (also called binomial coefficient) for choosing $r$ objects from a set of $n$ distinct objects is given by: \[ \large ^nC_r = \frac{n!}{r!(n-r)!} \]
- If I have 10 differently numbered balls in a box. How many ways can I draw 4 balls from the box ?
- In how many ways can a group consisting of 3 women and 5 men be selected from 6 women and 8 men?