Exercise 5

We consider our standard generator unif, as defined here, by employing "#include" to predefine unif, as explained here. So in the main program, unif may be considered as a known function.

In order to have "good" uniform random numbers, they should at least be distributed uniformely between zero and unity. We are going to test this, by determining the "x-distribution", given (in the program) in terms of the two tables xmi[i] and phi[i], as explained here.

Write a program to generate Nsim = 10000 random numbers via unif, and determine the "x-distribution", i.e. the two tables xmi[i] and phi[i], and print them to standard output. So when executing the program, one should get two columns, the first one representing xmi[i], the second one phi[i].

In case of problems in understanding basic notions of the programming langage C: see C tutorial

The solution of this exercise can be found here