Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a ) Using loop in R to evaluate ( approximate ) the expectation of binomial distributed random variables having the following probability mass function. P
a Using loop in to evaluate approximate the expectation of binomial distributed random variables having the following probability mass function.
for cdotsn
Compute the expectation using the definition of the expectation of a discrete random variable, not a short cut formula for a binomial random variable. In your approximation, consider and with and respectively. Your code should loop through the values of and and for each combination of and it should loop through each value of in the definition of the expected value. Store your values in a matrix called expected. Do NOT use the builtin function dbinom for this question.
b Based on the code in part a create an function called BinExp that can return the approximated expectation of a binomial distributed random variable with any given and pin
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started