STA237: Probability, Statistics, and Data Analysis I
PhD Student, DoSS, University of Toronto
Wednesday, May 10, 2023
09-45-36-27-18-54
(9x1, 9x2, 9x3, 9x4, 9x5, 9x6)
(9, 9x2, 9x3, 9x4, 9x5, 9x6)
9
must be a lucky number and should appear more often.
(9, 9x2, 9x3, 9x4, 9x5, 9x6)
in the next draw change knowing it was drawn today?In general,
The conditional probability of event \(A\) given event \(C\) is defined as
\[P(A|C)=\frac{P(A\cap C)}{P(C)}\]
for any event \(C\) such that \(P(C)>0\).
Alternatively,
The multiplication rule states that for any events \(A\) and \(C\),
\[P(A\cap C)=P(A|C)\cdot P(C).\]
Suppose 3 students are randomly selected from a class.
What is the probability that all three have different birthdays?
Assume they are all born in a non-leap year.
Picking 3 students randomly.
\[(b_1, b_2, b_3)\]
\[\Omega =\left\{\begin{split} \\ (\text{Jan 1}, &\text{Jan 1}, &\text{Jan 1}), \\ (\text{Jan 1}, &\text{Jan 1}, &\text{Jan 2}), \\ (\text{Jan 1}, &\text{Jan 1}, &\text{Jan 3}), \\ &\quad\vdots& \end{split}\right\}\]
Let’s first consider the event that the first two birthdays are both January 1st, \(b^*\).
Denote
\[P\left(C\right)=\frac{1}{365}\]
\[P\left(A\cap C\right)=\frac{1}{365^2}\]
\[P\left(A\left\lvert C\right.\right)=\frac{1}{365^2}\left/\frac{1}{365}\right.=\frac{1}{365}\]
\[=\frac{\text{# days that is January 1st}}{\text{# possible days for }b_2}\]
\[B_{12}=\left\{\left(b_1,b_2,b_3\right):b_1=b_2\right\}\]
\[B_{13}=\left\{\left(b_1,b_2,b_3\right):b_1=b_3\right\}\]
\[B_{23}=\left\{\left(b_1,b_2,b_3\right):b_2=b_3\right\}\]
\[P\left(B_{12}^c \cap B_{13}^c \cap B_{23}^c\right)\]
The probability of two people sharing a birthday on January 1st is \(\frac{1}{365^2}\).
There are 365 disjoint events where two people share a birthday in a year.
\[P\left(B_{12}\right)=365 \times \frac{1}{365^2}=\frac{1}{365}\] \[\implies P\left(B_{12}^c\right)=1-P\left(B_{12}\right)=\frac{364}{365}\]
\[B_{12}=\left\{\left(b_1,b_2,b_3\right):b_1=b_2\right\}\]
\[B_{13}=\left\{\left(b_1,b_2,b_3\right):b_1=b_3\right\}\]
\[B_{23}=\left\{\left(b_1,b_2,b_3\right):b_2=b_3\right\}\]
\[P\left(B_{12}^c \cap B_{13}^c \cap B_{23}^c\right)\]
\[=\color{darkblue}{P\left(B_{13}^c \cap B_{23}^c \left\lvert B_{12}^c\right.\right)}P\left(B_{12}^c\right)\]
We can compute \(P\left(B_{12}^c \cap B_{13}^c \cap B_{23}^c\right)\) if we know the conditional probability that the third person doesn’t share a birthday with either of the first two given the first pair doesn’t share a birthday.
We know # days that do not overlap with the first 2 is \(365-2\) because we know they don’t share a birthday.
\[B_{12}=\left\{\left(b_1,b_2,b_3\right):b_1=b_2\right\}\]
\[B_{13}=\left\{\left(b_1,b_2,b_3\right):b_1=b_3\right\}\]
\[B_{23}=\left\{\left(b_1,b_2,b_3\right):b_2=b_3\right\}\]
\[P\left(B_{12}^c \cap B_{13}^c \cap B_{23}^c\right)\]
\[P\left(B_{12}^c \cap B_{13}^c \cap B_{23}^c\right)\] \[=\frac{363}{365}\cdot\frac{364}{365}\] \[=\frac{363\times364}{365^2}\]
(adopted from Dekking et al 3.10)
Suppose Michael knows the answer to a multiple choice question with a probability of 3/5.
When he does not know the answer, he picks an answer out of 4 choices at random. Even when Michael knows the answer, he is prone to making mistakes and answers the question correctly with a probability of 4/5.
What is the probability that Michael correctly answers a mutiple choice question?
\(K\): Michael knows the answer
\(Y\): Michael answers correctly
\[P(K)=3/5\]
\[P(Y\left|K^c\right.)=1/4\]
\[P(Y\left|K\right.)=4/5\]
\[K\]
\[Y|K\]
\[Y^c|K\]
\[Y\cap K\]
Knows and answers correctly
\[K^c\]
\[Y|K^c\]
\[Y^c|K^c\]
\[Y\cap K^c\]
Doesn’t know and answers correctly
\[P(Y)=P(Y | K)P(K) + P(Y | K^c)P(K^c)\]
Suppose \(C_1,C_2,\ldots,C_m\) are disjoint events such that \(C_1\cup C_2\cup\cdots\cup C_m=\Omega\).
The Law of Total Probability states that
\[P(A)=\sum_{i=1}^m\left[P(A\left|C_i\right.)P(C_i)\right]\]
for any arbitrary event \(A\).
\[P(\left.C_i\right|A)=\frac{P(C_i \cap A)}{P(A)}\]
\[=\frac{P(A |C_i )P(C_i)}{P(A)}\]
\(P\left(C_i\cap A\right)=P\left(A\cap C_i\right)=P\left(A |C_i \right)P\left(C_i\right)\)
\[=\frac{P(A |C_i )P(C_i)}{\sum_{i=1}^m\left[P(A\left|C_i\right.)P(C_i)\right]}\]
Law of Total Probability
Suppose \(C_1,C_2,\ldots,C_m\) are disjoint events such that \(C_1\cup C_2\cup \cdots\cup C_m=\Omega\).
Bayes’ Rule states that the conditional probability of \(C_i\) given an arbitrary event \(A\) is
\[P(\left.C_i\right|A)=\frac{P(A\left|C_i\right.)\cdot P(C_i)}{ \sum_{i=1}^m\left[P(A\left|C_i\right.)P(C_i)\right]}.\]
Provided that Michael answered the question correctly, what is the probability that Michael knew the answer?
\[P(K)=3/5\]
\[P(Y\left|K^c\right.)=1/4\]
\[P(Y\left|K\right.)=4/5\]
What does it mean for two events to be independent?
(Michael answers a question correctly today) & (it rains tomorrow) are independent.
(Michael answers a question correctly) & (Michael gets stuck on a subway delay on the test day) may not be independent.
An event \(A\) is called independent of \(B\) if
\[P(A|B)=P(A).\]
That is, whether event \(B\) occurs or not
does NOT change the probability of \(A\).
\[P(K)=\frac{3}{5} < \frac{24}{29} = P(K|Y)\]
Consider
samp <- sample(1:10, 5)
Let
samp[1]
is 10
samp[2]
is 10
samp[3]
is 5
Are they pairwise independent?
Consider
samp <- sample(1:10, 5, replace = TRUE)
Let
samp[1]
is 10
samp[2]
is 10
samp[3]
is 5
Are they pairwise independent?
\[P(A|B)=P(A)\]
Complements
\(P(A|B)=1-P(\left.A^c\right|B)\) and \(P(A)=1-P(A^c)\),
\[\implies 1-P(\left. A^c\right|B) = 1 - P(A^c)\] \[\implies P(A^c|B)=P(A^c)\]
Multiplication rule
\[P(A\cap B) = P(A|B)P(B)\]
\[\implies P(A\cap B)=P(A)P(B)\]
\[P(A|B)=P(A)\]
Mutual property
\[P(B|A) = \frac{P(A\cap B)}{P(A)}\]
\[=\frac{P(A)P(B)}{P(A)}=P(B)\]
\[\implies P(B| A)=P(B)\]
\[\phantom{a}\] \[P(A|B)=P(A)\]
\[\iff P(A^c|B)=P(A^c)\] \[\iff P(A\cap B)=P(A)P(B)\] \[\iff P(B| A)=P(B)\]
To show that \(A\) and \(B\) are independent,
it suffices to prove any one of the above.
If you show that any one of them is not true,
you show that the two events are dependent.
You roll two fair dice.
\(A\) is the event that sum of the rolls is divisible by 4,
\(B\) is the event that the two roll are the same.
Are \(A\) and \(B\) independent events?
Using the alternative \(P(A\cap B) = P(A)P(B)\) definition, we can expand the notion.
Events \(A_1,A_2,\ldots,A_m\) are called independent if
\[P(A_1\cap A_2\cap \cdots \cap A_m)=\prod_{i=1}^m P(A_i).\]
The statement holds when any number of events are replaced by their complements.
You roll two fair dice.
\(R_1\) is the event the first throw is a 3,
\(R_2\) is the event the second throw is a 3.
What is \(P(R_1\cap R_2)\)?
What is the probability of the event that \(n\) consecutive throws are the same number?
learnr
and run R worksheetClick here to install learnr
on r.datatools.utoronto.ca
Follow this link to open the worksheet
If you see an error, try:
rlesson02
from Files paneOther steps you may try:
.Rmd
and .R
files on the home directory of r.datatools.utoronto.caTools
> Global Options
install.packages("learnr")
in RStudio after the steps above or click hereChapter 3, Dekking et al.
© 2023. Michael J. Moon. University of Toronto.
Sharing, posting, selling, or using this material outside of your personal use in this course is NOT permitted under any circumstances.