2

Given a function: $$ f(x) = \begin{cases} ax^2 & \text{for } x\in [ -1, 1], \\0 & \text{for } x\notin [-1,1].\end{cases} $$ I am to create a random number generator. I did this by finding the CDF and so I end up with $$X = \sqrt[3]{2F-1}$$ (F being some random variable generated in a spreadsheet, for example)

The problem arises, however, with next tasks:
a) How can we check that this generator generates numbers with a given distribution?
b) Use the generator you found and the knowledge of central limit theorem to create a generator with $N(0,1)$ distribution and test it
(One can use spreadsheet or programming language for the tasks)

So as for the first, can I just generate a lot of data using the generator and then divide the $<max,min>$ into 10 intervals and see if the numbers that fall into them form a bell curve?

As for the latter, If the distribution is to be $N(0,1)$ and the generator from point a) gives me $<-1,1>$, can I just take an absolute value of it and again - divide into intervals, try to see if a bell curve forms?

Straightfw
  • 1,558
  • 1
    http://www.iro.umontreal.ca/~simardr/testu01/tu01.html (see Paper - PDF for what testing really entails) – Amzoti Jan 14 '14 at 17:46
  • Thank you, a lib is great and all but I'd like to know how and why do I test what so that if I end up having to do something like this on a test at the computer without some fancy libs, I'll still be able to do it with a spreadsheet :) Edit: OK, I'll check the Paper section, thank you – Straightfw Jan 14 '14 at 17:47

0 Answers0