Question

In today's lecture, several of you were suspicious of my claim that the E (i.e., distribution...

In today's lecture, several of you were suspicious of my claim that the E (i.e., distribution mean) of the ith element of a sample of size n is equal to the population mean, i.e. E[x_i] = E[x]. To convince you, write code to - take 10^7 samples of size 50 from a normal distribution with mu = 2 and sigma = 3, - select the 3rd element in each of the 10^7 samples, and store them in an array called x3. - compute the mean of x3. Convinced?! Note: your code will take a while to run because we are taking 10^7 samples (i.e., a large number). But that's what it takes to compute the E of something. E is a distribution mean, and the only way to approximate it numerically is to take a very large sample.

Homework Answers

Answer #1

I hope Rstudio is fine for the exercise, since you didn't mention a specific language.

x3=c() #Initialize the vector which will contain the 3rd element of each sample.
for (i in 1:10000000) {
sample_vector=rnorm(50,2,3) #This gives us a random sample of 50 elements from a normal distribution with mean=2 and standard deviation=3
x3=c(x3,sample_vector[3]) #This simply appends the 3rd element of the sample generated to the x3 vector

}
mean(x3) #This calculates the mean.

Note: The output will be different each time you run the code. Sample output I got:

Remember that output will differ every time you run this code. You may use set.seed to fix a simulation

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Class sizes at a certain high school have the following probability distribution. Let X = the...
Class sizes at a certain high school have the following probability distribution. Let X = the class size. Assume the values of X below are the only possible class sizes. X has the following probability mass function: x 10 20 30 40 50 p(x)      .053 .291 .322 .175 .159   a. If F is the cumulative distribution function of X, then evaluate F(30) (i.e. P(X ≤30)   b. Calculate the probability that X ≥35   c. Calculate the expected value of X.   d....
BridgeRock is a major manufacturer of tires in the U.S.. The company had five manufacturing facilities...
BridgeRock is a major manufacturer of tires in the U.S.. The company had five manufacturing facilities where tires were made and another 20 facilities for various components and materials used in tires. Each manufacturing facility produced 10,000 tires every hour. Quality had always been emphasized at BridgeRock, but lately quality was a bigger issue because of recent fatal accidents involving tires made by other manufacturers due to tread separation. All tire manufacturers were under pressure to ensure problems did not...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...