Directions

For this assignment you should record your answers in an R Markdown file and submit the compiled output as a pdf. At the start of each problem, set the seed to 8.

Homework #6 is due November 08 by 10:00pm \(~\)

\(~\)

Question #1

Using a for loop and 1000 iterations, what is the probability of getting at least 10 1s on 20 rolls of a fair 4 sided-die?

\(~\)

Question #2

Using the replicate function and 1000 iterations, what is the probability of getting at least 10 1s on 20 rolls of a fair 4 sided-die?

\(~\)

Question #3

Write a function that does the following:

Given:

Returns:

Make sure to name it in a reasonable fashion so you could reuse it later (i.e. do not name it q3_func like I do below)

For example, if we had this function running, we could have run the Lab 15 simulation example as:

q3_func(0, 10000,.65,1000,700)
## [1] 6e-04

\(~\)

Question #4

Demonstrate that your function works by

Part a Running it on the Lab 15 example (expected value 6e-04)

Part b Running it on the example from Question 2 (hint: what is the probability of rolling a 1 on a fair 4 sided die?)