Simulating variance of sum of two binomial variables
In the last multiple choice exercise, you examined the expected value of the sum of two binomials. Here you'll estimate the variance.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Foundations of Probability in R
คำแนะนำการฝึกหัด
- Use your simulation of the variables X and Y to estimate the variance of
X + Y. - Use your simulation to estimate the variance of
3 * X + Y.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Simulation from last exercise of 100,000 draws from X and Y
X <- rbinom(100000, 20, .3)
Y <- rbinom(100000, 40, .1)
# Find the variance of X + Y
# Find the variance of 3 * X + Y