02 - } # Estimate desired probabilities by computing the #...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
BTRY/STSCI 4080 Homework # 2 Due Date: 9/16/10 Problem numbers beginning with P (e.g., P1) denote problems from the “PROB- LEMS” section; those beginning with T (e.g., T1) denote problems taken from the “THEORETICAL EXERCISES” section. 1. Ross: p 51, P11 2. Ross: p 51, P12(a,b) 3. Ross: p 51, P14 4. Ross: p 52, P24 (assume the dice are both fair). Check your answer by running the following (somewhat ineFcient) R code: # number of dice rolls to simulate numsim=10000 # a vector that will store results sumroll = rep(0,numsim) # a ’for’ loop that simulates ’numsim’ rolls of 2 dice # and records the sum of ’upturned’ faces. for (j in 1:numsim) { # roll two dice one time diceroll = sample(1:6,2,replace=TRUE) # calculate the sum and store the results in the j-th # position of the vector ’sumroll’ sumroll[j] = sum(diceroll)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } # Estimate desired probabilities by computing the # relative frequency with which each sum appears upturn = 2:12 probs = rep(0,length(upturn)) for (k in 1:11) { probs[k] = mean(sumroll==upturn[k]) } 5. Ross: p 52, P26 (this is a challenge; you might save it for last!) 6. Problem: Ross: p 53, P41. Hint: consider computing the probability of the complement of the speciFed event . Write a program that approximates the answer. In particular, write and run a program that will (i) simulate 5000 rolls of 4 dice; then, (ii) compute the percentage of these simulated rolls in which at least one of the 4 dice comes up as a 6. The R program on the previous page may be helpful 7. Ross: p 53, P43 8. Ross: p 55, T10 9. Ross: p 55, T12 10. Ross: p 55, T16...
View Full Document

Page1 / 2

02 - } # Estimate desired probabilities by computing the #...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online