-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathindependence.Rmd
More file actions
101 lines (84 loc) · 4.34 KB
/
independence.Rmd
File metadata and controls
101 lines (84 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Independence {#independence}
## Motivating Example {-}
Many gamblers believe that after a string of losses, they are "due"
for a win. Consider a gambler who repeatedly bets on reds in
roulette, an event with probability $18 / 38 \approx 0.474$. The ball has
not landed in a red pocket on any of the last 4 spins of the wheel.
Does this make it more likely that he will win on the next spin?
This is really a conditional probability question in disguise.
We want to know the probability that the ball will land in a
red pocket on the 5th spin, _given_ that it did not land in a
red pocket on any of the first 4 spins:
$$ P(\text{red on 5th spin}\ |\ \text{not red on first 4 spins}). $$
## Theory {-}
To verify that the two probabilities are _exactly_ the same, we
do the calculation:
\begin{align*}
P(\text{red on 5th spin}\ |\ \text{not red on first 4 spins}) &= \frac{P(\text{not red on first 4 spins} \textbf{ and } \text{red on 5th spin}) }{P(\text{not red on first 4 spins})} \\
&= \frac{ 20^4 \cdot 18 \big/ 38^5 }{20^4 \big/ 38^4} \\
&= \frac{18}{38}.
\end{align*}
We see that the conditional probability is $18 / 38$, which is the same as the probability that the 5th
spin is red if we did not know the outcome of the first 4 spins. In mathematical notation,
\begin{align*}
P(\text{red on 5th spin}\ |\ \text{not red on first 4 spins}) &= P(\text{red on 5th spin})
\end{align*}
When conditioning on one event (e.g., "not red on first 4 spins") does not change the probability
of another event (e.g., "red on 5th spin"), we say that the two
events are **independent**. In this case, whether the gambler wins on the 5th spin is
independent of the fact that he has lost each of the last 4 spins. The folk belief that one is
"due" for a win after a series of losses is plain wrong and is known as the **gambler's fallacy**.
```{definition independence, name="Independence"}
Two events $A$ and $B$ are said to be **independent** if the
\begin{equation}
P(B | A) = P(B).
(\#eq:independence)
\end{equation}
```
The next result follows by applying the Multiplication Rule (\@ref(thm:multiplication-rule)) to
the definition of independence.
```{theorem independence-mult}
Two events $A$ and $B$ are independent if and only if their probabilities multiply:
\begin{equation}
P(A \textbf{ and } B) = P(A) P(B).
(\#eq:independence-mult)
\end{equation}
```
```{proof}
First, we assume \@ref(eq:independence) and show that \@ref(eq:independence-mult) holds:
\begin{align*}
P(A \textbf{ and } B) &= P(A) P(B | A) & \text{by the Multiplication Rule} \\
&= P(A) P(B) & \text{by assumption}.
\end{align*}
Conversely, we assume \@ref(eq:independence-mult) and show that \@ref(eq:independence) holds:
\begin{align*}
P(B | A) &= \frac{P(A \textbf{ and } B)}{P(A)} & \text{by the definition of conditional probability} \\
&= \frac{P(A) P(B)}{P(A)} & \text{by assumption} \\
&= P(B).
\end{align*}
```
Here is an example that combines several concepts from the past few lessons.
<iframe width="560" height="315" src="https://www.youtube.com/embed/Kgudt4PXs28" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
```{example}
You and a fellow castaway are stranded on a desert island, playing dice for the last banana. Two dice will be rolled.
If the biggest number is 1, 2, 3, or 4, then Player 1 wins. If the biggest number is 5 or 6, then Player 2 wins.
Would you rather be Player 1 or Player 2?
```
```{solution}
Player 2 has a $20/36 = 0.5556$ chance of winning. Here's why:
\begin{align*}
P(\text{biggest number is 5, 6}) &= 1 - P(\text{biggest number is 1, 2, 3, 4}) \\
&= 1 - P(\text{1st die is 1, 2, 3, 4} \textbf{ and } \text{2nd die is 1, 2, 3, 4}) \\
&= 1 - \frac{4}{6} \cdot \frac{4}{6}\ \ \text{(by independence)} \\
&= 1 - \frac{16}{36} \\
&= \frac{20}{36}
\end{align*}
```
## Examples {-}
1. One card is dealt off the top of a well-shuffled deck of cards. Is the event that the card is a
heart independent of the event that the card is an ace?
2. Two cards are dealt off the top of a well-shuffled deck of cards. Is the event that the
first card is a heart independent of the event that the second card is a heart?
3. In the dice game Yahtzee, five dice are rolled. The outcomes of the five dice are independent.
What is the probability of rolling a "Yahtzee" (i.e., when all five dice show the same number)?
## Additional Exercises {-}