Simulating multiplying a random variable
In this exercise you'll use simulation to confirm the rule you just learned about how multiplying a random variable by a constant effects its expected value.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Foundations of Probability in R
คำแนะนำการฝึกหัด
- Simulate 100,000 draws of X, a binomial random variable with size 20 and p = .1. Save this as
X - Use this simulation to estimate the expected value of X.
- Use this simulation to estimate the expected value of 5*X, as well.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Simulate 100,000 draws of a binomial with size 20 and p = .1
X <- ___
# Estimate the expected value of X
# Estimate the expected value of 5 * X