-
Notifications
You must be signed in to change notification settings - Fork 1
/
probability-swirl.rnw
203 lines (203 loc) · 7.63 KB
/
probability-swirl.rnw
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
\section{Swirl Review Questions}
\subsection{Lesson 1}
\begin{enumerate}
\item I roll a fair 6-sided die 3,000,000 times. The number 1 turns up approximately 500,000 times, so I conclude that the probability of a 1 is 1/6. This is the \_\_\_ approach to probability.
\begin{enumerate}
\item \rexpr{Frequentist}
\item \rexpr{Bayesian}
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'Frequentist'
@
\fi
\item Suppose that P(A)=0.4 and P(B)=0.3. What is the minimum value of P(A and not B)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.1
@
\fi
\item Out of all possible anagrams for the word CHAIR (including the original word), what is the probability that the letter I comes first?
\begin{enumerate}
\item 0.1
\item 0.2
\item 0.3
\item 0.4
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'0.2'
@
\fi
\item Which of these is NOT the numerator of a correct use of Bayes Rule and/or the definition of conditional probability, for P(A | B, C)?
\begin{enumerate}
\item P(B | A, C) P(A | C)
\item P(B, C | A) P(A)
\item P(A, B, C)
\item P(A, B | C) P(C)
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'P(A, B | C) P(C)'
@
\fi
\item A disease affects 1\% of the population. The only test for the disease returns positive 99\% of the time the disease is actually there, though it returns positive 20\% of the time if the disease is not actually there. You take this test and it returns positive. What is the probability you have the disease (rounded to nearest 0.01)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.05
@
\fi
\item What was the conditional independence assumption we made in our race + surname example?
\begin{enumerate}
\item Once we know the race of the individual, we can assume that the predictor variables are independent.
\item Once we know the probabilities of the predictor variables we can assume that the race of the individual is independent.
\item Once we know the probability of the race we can assume the probabilities of the predictor variables are independent.
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'Once we know the race of the individual, we can assume that the predictor variables are independent.'
@
\fi
\item Let A and B be two independent variables that take on only the values 0 and 1. If P(A=1, B=1)=0.12, P(A=0, B=1)=0.28, and P(A=1)=0.3, what is P(A=0, B=0)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.42
@
\fi
\item There are three prisoners: A, B, \& C. One prisoner, selected uniformly at random, will be pardoned while the other two will be executed. Prisoner A asks the jailer (who knows) to tell him one of the prisoners who will be executed: \rexpr{If I will be pardoned, just flip a coin and tell me B or C; if C will be pardoned, tell me B; and if B will be pardoned, tell me C.} The jailer says B will be executed. Using Bayes Rule, what is the numerator of the expression evaluating the probability that C is pardoned?
\begin{enumerate}
\item P(jailer says B executed | C is pardoned) * P(C is pardoned)
\item P(B is executed | C is pardoned) * P(B is executed)
\item P(C is pardoned | jailer says B is executed) * P(B is executed)
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'P(jailer says B executed | C is pardoned) * P(C is pardoned)'
@
\fi
\item Based on the previous question, What is the probability of C being pardoned (express to the nearest 0.01)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.67
@
\fi
\item You have a bucket with 2 coins: one is a regular coin, while the other has heads on both sides. You pick a coin at random and flip it: it turns up heads. What is the probability you chose the fair coin (express to the nearest 0.01)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.33
@
\fi
\item Suppose again, you have that bucket with 2 coins, one a regular coin and the other w/heads on both sides. You pick a coin at random. If at any point you get a tails, you obviously picked the fair coin. If you keep getting heads, you stop \& decide it is the unfair coin, but only if the probability you picked the fair coin is less than 1/1000, otherwise you keep flipping. What is the minimum number of times you must flip heads in a row before you can decide it is indeed the unfair coin?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
10
@
\fi
\end{enumerate}
\subsection{Lesson 2}
\begin{enumerate}
\item What is the probability that a random variable with a uniform distribution in the range [1, 4] takes on a value less than or equal to 2.5?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.5
@
\fi
\item Suppose I give you a random variable X, such that its mean is 0 and that the expectation of X\textasciicircum{}2 is 5. What is the variance of X?
\begin{enumerate}
\item 2
\item 3
\item 4
\item 5
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'5'
@
\fi
\item Suppose there are 10 voters in an election for two candidates A and B. Each voter independently chooses to vote for A with probability 0.1, and for B with probability 0.9. What is the approximate probability that A gets at least 1 vote?
\begin{enumerate}
\item 0.65
\item 0.5
\item 0.75
\item 0.25
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'0.65'
@
\fi
\item Roughly what percentage of data with a standard normal distribution falls within +/- one standard deviation from the mean?
\begin{enumerate}
\item 33
\item 50
\item 66
\item 87
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'66'
@
\fi
\item Suppose the standard deviation of a given population is 10. What is the standard deviation within a sample of size 25 from that population?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
2
@
\fi
\item You have an unfair coin that shows heads with probability p=0.7. What is the probability you get your 3rd head on flip \#5?
\begin{enumerate}
\item 0.19
\item 0.20
\item 0.21
\item 0.22
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'0.19'
@
\fi
\item Now suppose you flip a fair coin 10 times. What is the probability you get the 2nd head on flip \#4 and the 5th head on flip \#10 (rounded to the nearest 0.01)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.03
@
\fi
\item If the variance of X is b, what is the variance of 2*X?
\begin{enumerate}
\item 0.5b
\item b
\item 2b
\item 4b
\end{enumerate}
\if1\solutions
\noindent{\bf Solution:}
<<eval=FALSE>>=
'4b'
@
\fi
\item What is the (constant) slope of the CDF for a random variable X distributed uniformly from a=0 to b=20 (express to the nearest 0.01)?
\if1\solutions
\newline\newline \noindent{\bf Solution:}
<<eval=FALSE>>=
0.05
@
\fi
\end{enumerate}