Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Law of Large Numbers in R Generate 2000 random numbers that are independent and normally distributed with mean 1 and variance 4. Create a graph

image text in transcribed

Law of Large Numbers in R Generate 2000 random numbers that are independent and normally distributed with mean 1 and variance 4. Create a graph in which the course of the empirical expectation and the empirical variance can be seen if you first look at one, then two, then ... up to 2000 random numbers together. The x-axis should therefore indicate the number of random numbers considered and the y axis should indicate the empirical values with this number of random numbers. What is striking? Enter your code. Note: With numeric(n) a list of length n can be filled with zeros. The list is then "initialized" (the computer now knows that it should be a list with n elements) and its entries can be described. You can't just access the 100th element of an empty list like that! Hint: Remember that you can "cut out" a part of a list. If y is a list, then y[1:10] returns a list of the first 10 elements of y (if they exist). (Head (y,10) would do the same.) Hint: Remember the syntax of a for loop: for(i in 1:2000)\{

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions