-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathchapter3.Rmd
257 lines (187 loc) · 7.78 KB
/
chapter3.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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
---
title: 'Lab 3 - Probability'
description: 'Questions for Lab 3'
---
## Question 1
```yaml
type: ExplorableExercise
key: 02d4222b54
xp: 50
skills: 1
```
<strong>Follow the directions in the console to open the R Markdown file:</strong>
```Type 'go()' and hit Enter to get started!```
You can use the RStudio platform just like you would on your home computer.
The markdown file contains the instuctions to answer the multiple choice question below.
<strong>Q1. Fill in the blank: A streak length of 1 means one ___ followed by one miss.</strong>
`@possible_answers`
- hit
- miss
`@hint`
Check out the instructions in the .Rmd file to answer the multiple choice question.
`@pre_exercise_code`
```{r}
# Import the helper file contained in the image
source('/usr/local/lib/R/site-library/run_rstudio.R')
# Run a new RStudio session and serve it to the user
run_rstudio(3, 1)
# .Rprofile: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex1.Rprofile
# .init.R: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex1.init.R
# lab3_ex1.Rmd: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex1.Rmd
# lab.css: https://assets.datacamp.com/production/course_1156/datasets/lab.css
```
`@sct`
```{r,eval=FALSE}
msg1 <- "Great work!"
msg2 <- "Try again."
ex() %>% check_mc(1, feedback_msgs = c(msg1, msg2))
```
---
## Question 2
```yaml
type: ExplorableExercise
key: 5440b387f2
xp: 50
skills: 1
```
<strong>Follow the directions in the console to open the R Markdown file.</strong>
You can use the RStudio platform just like you would on your home computer.
The markdown file contains the instuctions to answer the multiple choice question below.
<strong>Q2. Fill in the blank: A streak length of 0 means one ___ which must occur after a miss that ended the preceeding streak.</strong>
`@possible_answers`
- hit
- miss
`@hint`
Check out the instructions in the .Rmd file to answer the multiple choice question.
`@pre_exercise_code`
```{r}
# Import the helper file contained in the image
source('/usr/local/lib/R/site-library/run_rstudio.R')
# Run a new RStudio session and serve it to the user
run_rstudio(3, 2)
# .Rprofile: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex2.Rprofile
# .init.R: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex2.init.R
# lab3_ex2.Rmd: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex2.Rmd
# lab.css: https://assets.datacamp.com/production/course_1156/datasets/lab.css
```
`@sct`
```{r,eval=FALSE}
msg1 <- "Try again."
msg2 <- "Great work!"
ex() %>% check_mc(2, feedback_msgs = c(msg1, msg2))
```
---
## Question 3
```yaml
type: ExplorableExercise
key: eb6689ed9c
xp: 50
skills: 1
```
<strong>Follow the directions in the console to open the R Markdown file.</strong>
You can use the RStudio platform just like you would on your home computer.
The markdown file contains the instuctions to answer the multiple choice question below.
<strong>Q3. Which of the following is false about the distribution of Kobe's streak lengths from the 2009 NBA finals?</strong>
`@possible_answers`
- The distribution of Kobe's streaks is unimodal and right skewed.
- The typical length of a streak is 0 since the median of the distribution is at 0.
- The IQR of the distribution is 1.
- The longest streak of baskets is of length 4.
- The shortest streak is of length 1.
`@hint`
Check out the instructions in the .Rmd file to answer the multiple choice question.
`@pre_exercise_code`
```{r}
# Import the helper file contained in the image
source('/usr/local/lib/R/site-library/run_rstudio.R')
# Run a new RStudio session and serve it to the user
run_rstudio(3, 3)
# .Rprofile: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex3.Rprofile
# .init.R: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex3.init.R
# lab3_ex3.Rmd: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex3.Rmd
# lab.css: https://assets.datacamp.com/production/course_1156/datasets/lab.css
```
`@sct`
```{r,eval=FALSE}
msg1 <- "Try again."
msg2 <- "Not quite!"
msg3 <- "Keep trying!"
msg4 <- "Try again."
msg5 <- "Awesome!"
ex() %>% check_mc(5, feedback_msgs = c(msg1, msg2, msg3, msg4, msg5))
```
---
## Question 4
```yaml
type: ExplorableExercise
key: e64497e7f4
xp: 50
skills: 1
```
<strong>Follow the directions in the console to open the R Markdown file.</strong>
You can use the RStudio platform just like you would on your home computer.
The markdown file contains the instuctions to answer the multiple choice question below.
<strong>Q4. If you were to run the simulation of the independent shooter a second time, how would you expect its streak distribution to compare to the distribution from the exercise above?</strong>
`@possible_answers`
- Exactly the same
- Somewhat similar
- Totally different
`@hint`
Check out the instructions in the .Rmd file to answer the multiple choice question.
`@pre_exercise_code`
```{r}
# Import the helper file contained in the image
source('/usr/local/lib/R/site-library/run_rstudio.R')
# Run a new RStudio session and serve it to the user
run_rstudio(3, 4)
# .Rprofile: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex4.Rprofile
# .init.R: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex4.init.R
# lab3_ex4.Rmd: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex4.Rmd
# lab.css: https://assets.datacamp.com/production/course_1156/datasets/lab.css
```
`@sct`
```{r,eval=FALSE}
msg1 <- "Try again."
msg2 <- "You got it!"
msg3 <- "Keep trying!"
ex() %>% check_mc(2, feedback_msgs = c(msg1, msg2, msg3))
```
---
## Question 5
```yaml
type: ExplorableExercise
key: b073c8a4d3
xp: 50
skills: 1
```
<strong>Follow the directions in the console to open the R Markdown file.</strong>
You can use the RStudio platform just like you would on your home computer.
The markdown file contains the instuctions to answer the multiple choice question below.
<strong>Q5. How does Kobe Bryant's distribution of streak lengths compare to the distribution of streak lengths for the simulated shooter? Using this comparison, do you have evidence that the hot hand model fits Kobe's shooting patterns?</strong>
`@possible_answers`
- The distributions look very similar. Therefore, there doesn't appear to be evidence for Kobe Bryant's hot hand.
- The distributions look very similar. Therefore, there appears to be evidence for Kobe Bryant's hot hand.
- The distributions look very different. Therefore, there doesn't appear to be evidence for Kobe Bryant's hot hand.
- The distributions look very different. Therefore, there appears to be evidence for Kobe Bryant's hot hand.
`@hint`
Check out the instructions in the .Rmd file to answer the multiple choice question.
`@pre_exercise_code`
```{r}
# Import the helper file contained in the image
source('/usr/local/lib/R/site-library/run_rstudio.R')
# Run a new RStudio session and serve it to the user
run_rstudio(3, 5)
# .Rprofile: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex5.Rprofile
# .init.R: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex5.init.R
# lab3_ex5.Rmd: https://assets.datacamp.com/production/course_1156/datasets/lab3_ex5.Rmd
# lab.css: https://assets.datacamp.com/production/course_1156/datasets/lab.css
```
`@sct`
```{r,eval=FALSE}
msg1 <- "Awesome!"
msg2 <- "Try again."
msg3 <- "Nope, Try again."
msg4 <- "Not qute, Try again."
ex() %>% check_mc(1, feedback_msgs = c(msg1, msg2, msg3, msg4))
success_msg("Click [here](https://assets.datacamp.com/production/repositories/302/datasets/10379ce0508b5f53c01f73b6afaf7a7623459bf2/ch3_key.Rmd) to get a complete Rmarkdown file of the exercises in this Lab and click [here](https://assets.datacamp.com/production/repositories/302/datasets/c7ad825dd2191d71abef274ce662c7c9dd3e33b6/ch3_key.html) to get the Knitted HTML output.")
```