Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Advanced Statistics Expert

Homework -

George Marsaglia's Diehard tests are a battery of statistical tests to test the quality of a random number generator (RNG). In this assignment, we will run one of the tests.

The test proceeds as follows: take a cube of size 1000 x 1000 x 1000, and use your RNG to produce 4000 points uniformly distributed throughout this cube. Out of these 4000 points, find the two points that are closest to one another, distance being measured by the usual Euclidean metric. Let r be the distance between these two points, and let V = 4/3πr3. (So V is the volume of the largest sphere which is centered at one of the 4000 points, and which does not contain any of the other points in its interior.)

The variable V should be very close to being exponentially distributed with mean 40π.

Task - Write code that performs this simulation, using each of the following uniform generators (code for which can be found in the template .cpp file that I have provided):

  • the RANDU generator;
  • the LCG with a = 22695477; c = 1; m = 232;
  • and the Mersenne Twister.

For each of the three generators, run this simulation 10,000 times. This should produce 10,000 values of V: output each of those 10,000 values into a text file, with a different number on each line. (Use a different file for each of the three generators.)

I have provided starter code in the file sphere template.cpp (see below if you feel more comfortable using Python).

Need code in python.

Attachment:- Assignment Files.rar

Advanced Statistics, Statistics

  • Category:- Advanced Statistics
  • Reference No.:- M92830764
  • Price:- $80

Guranteed 48 Hours Delivery, In Price:- $80

Have any Question?


Related Questions in Advanced Statistics

Question 1before beginning a study investigating the

QUESTION 1 Before beginning a study investigating the ability of a drug to lower cholesterol, baseline values of total serum cholesterol were measured for a sample of 30 healthy controls thought not to be at risk forcard ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As