

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
homework 5 of discrete math Docsity homework 5 of discrete math
Typology: Assignments
Uploaded on 05/12/2021
1 / 2
This page cannot be seen from the preview
Don't miss anything!


SONJAPETROVICSTATS.COM/TEACHING/563SP
Solve any 5 of problems 1-6, and problem 7. If you solve all 6 of the first 6 problems, then you may earn up to 5 points of homework extra credit.
Re-read the course homework policies written in the syllabus of this course.
All problems require explicit and detailed proofs/ arguments/ reasons. Solutions should be written clearly, legibly, and concisely, and will be graded for both mathematical correctness and presen- tation. Points will be deducted for sloppiness, incoherent or insufficient explanation, or for lack of supporting rationale.
You are allowed to discuss the homework problems with no one except your classmates, the TA, and the instructor. However, the solutions should be written by you and you alone in your own words. Any incident of plagiarism/ cheating (from a person or from any online resource) will be strictly dealt with.
If you discuss the problems with anyone, please note their name at the top of your HW submis- sion under a subtitle ‘Collaborator:’ or ’Discussed with:’.
ˆπ 1 =
n
∑^ n
i=
Xi, where Xi =
1 if U (^) i^21 + U (^) i^22 < 1 0 otherwise; and ˆπ 2 =
n
∑^ n
i=
Yi, where Yi = (1 − V (^) i^2 )^1 /^2 , i = 1,... , n,
and the Ui 1 , U 1 , 2 , Vi are all independent U nif (0, 1) random variables^1 If smaller variance is better, which of ˆπ 1 and ˆπ 2 is best? Also explain why the two estimators do estimate π. (Hints:
∑n i=1 Xi^ is a binomial random variable, and^ V ar(
∑n i=1 Yi) =^
∑n i=1 V ar(Yi).)
Date: Spring 2021. For due dates, see Campuswire/Google Classroom. (^1) See last page for code! 1
Other suggested study problems (no need to submit): 7.26, 7.38, 7.40, 7.47, 7.48.
R code for problem 5:
##-------------------------------------------------------
##-------------------------------------------------------
pi.est1 <- function(n, reps) { pi.hat <- numeric(reps) for(i in 1:reps) pi.hat[i] <- 4 * mean((runif(n)2 + runif(n)2) < 1) return(pi.hat) }
out1 <- pi.est1(n=10000, reps=1000) print(c(mean(out1), var(out1)))
pi.est2 <- function(n, reps) { pi.hat <- numeric(reps) for(i in 1:reps) pi.hat[i] <- 4 * mean(sqrt(1 - runif(n)**2)) return(pi.hat) }
myOutput <- pi.est2(n=10000, reps=1000) print(c(mean(myOutput), var(myOutput)))
You should try to run these commands in R for yourself. The results will also help you see which of ˆπ 1 and ˆπ 2 is better. Code details: the function pi.est1 returns the vector containing the sequence of estimates ˆπ 1 , and the function pi.est2 returns the sequence of estimates ˆπ 2.
2