forked from dlsun/probability
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreplacement.Rmd
116 lines (94 loc) · 4.58 KB
/
replacement.Rmd
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Sampling With Replacement {#replacement}
## Motivating Example {-}
Recall Galileo's problem from Lesson \@ref(counting). He wanted to know whether
a sum of 9 or a sum of 10 was more likely when 3 dice are rolled. In fact,
Galileo's peers reasoned that the two events should be equally likely,
since there are six ways to get a sum of 9
\begin{align*}
3 + 3 + 3 & & 2 + 3 + 4 & & 2 + 2 + 5 & & 1 + 4 + 4 & & 1 + 3 + 5 & & 1 + 2 + 6
\end{align*}
and also six ways to get a sum of 10:
\begin{align*}
3 + 3 + 4
& & 2 + 4 + 4
& & 2 + 3 + 5
& & 2 + 2 + 6
& & 1 + 4 + 5
& & 1 + 3 + 6
\end{align*}
But gamblers of the day knew better. From experience, they knew that
a sum of 10 was more likely than a sum of 9. But where did Galileo's
peers go wrong in their reasoning?
## Discussion {-}
Recall from Lesson \@ref(box-models) that the three rolls of a die can be
modeled as $n=3$ draws _with replacement_ from the box
\[ \fbox{$\fbox{1}\ \fbox{2}\ \fbox{3}\ \fbox{4}\ \fbox{5}\ \fbox{6}$}. \]
Galileo's peers showed that there are 6 ways to get a sum of 9
_if you ignore the order in which the tickets were drawn_.
(Notice that they included 2 + 3 + 5, but not 3 + 5 + 2 and other orderings of the same three rolls.)
They also showed that there are 6 ways to get a sum of 10. Why does this not
guarantee the probabilities of the two events are the same?
Notice that this case (draws with replacement, order doesn't matter) is one that
we have not studied yet.
| | with replacement | without replacement |
|-------------------:|:----------------:|:-------------------:|
| order matters| $N^n$ |$\frac{N!}{(N-n)!}$ |
|order doesn't matter| ??? | $\binom{N}{n} = \frac{N!}{n!(N-n)!}$ |
To settle the question, let's go back to counting ordered outcomes.
- The outcome $2 + 3 + 4$ corresponds to $3! = 6$ outcomes, when you account for the possible orderings:
- $2 + 3 + 4$
- $2 + 4 + 3$
- $3 + 2 + 4$
- $3 + 4 + 2$
- $4 + 2 + 3$
- $4 + 3 + 2$
- On the other hand, the outcome $2 + 2 + 5$ can only be reordered $3$ different ways:
- $2 + 2 + 5$
- $2 + 5 + 2$
- $5 + 2 + 2$
- And the outcome $3 + 3 + 3$ only has one possible ordering.
In other words, when we draw with replacement, the same ticket can be drawn more than once, and
repetitions reduce the number of ways that tickets can be reordered. The problem with
simply counting the number of outcomes is that the 6 outcomes
\begin{align*}
3 + 3 + 3 & & 2 + 3 + 4 & & 2 + 2 + 5 & & 1 + 4 + 4 & & 1 + 3 + 5 & & 1 + 2 + 6
\end{align*}
are not all equally likely. $2 + 3 + 4$ is twice as likely as $2 + 2 + 5$ and
six times as likely as $3 + 3 + 3$. When draws are made with replacement, only ordered outcomes
are equally likely.
This was Galileo's insight. When he took into account the number of possible orderings associated
with each unordered outcome:
\begin{array}{rr}
\hline
\text{Unordered Outcome} & \text{Possible Orderings} \\
\hline
3 + 3 + 3 & \text{1 way}\ \\
2 + 3 + 4 & \text{6 ways} \\
2 + 2 + 5 & \text{3 ways} \\
1 + 4 + 4 & \text{3 ways} \\
1 + 3 + 5 & \text{6 ways} \\
1 + 2 + 6 & + \text{6 ways} \\
\hline
& \text{25 ways}
\end{array}
he found that the probability of a 9 was actually
\[ \frac{25}{216}. \]
(Remember that there are $6^3 = 216$ equally likely outcomes when order matters.)
Repeating the calculation for the probability of a 10, Galileo showed that the two
probabilities were indeed different.
## Examples {-}
1. Here's a different illustration of the fact that not all unordered outcomes are
equally likely when draws are made with replacement. In the Pick 3 Lotto, a winning number is
chosen between 000 to 999. Contestants win if the digits in their chosen number matches
the winning number, _in any order_.
a. What is your chance of winning if you bet on 053?
b. What is your chance of winning if you bet on 055?
c. What is your chance of winning if you bet on 555?
2. Complete the solution to Galileo's problem. What is the probability that the sum is 10
when 3 fair dice are rolled? How does this compare with the probability that the sum is 9?
## Bonus Material {-}
You will rarely need to
count the _unordered_ ways that $n$ tickets can be drawn _with replacement_, since the
unordered outcomes are not equally likely. However, in case you are curious how this
can be calculated, the following video explains how. This video is completely optional!
<iframe width="560" height="315" src="https://www.youtube.com/embed/UTCScjoPymA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>