Question: Run a Java program generating a uniform random number U(0,1]1000 times calling a success if the value is greater than . Determine the number of
Run a Java program generating a uniform random number U(0,1]1000 times calling a success if the value is greater than . Determine the number of successes. E.g 520 successes.
Repeat the above 500 times; there will be 500 values.
The theoretical distribution of the 500 values is a binomial distribution and probability of having i successes (p), i=0,1,...,1000 is C(1000,i)*()1000 . This is hard to calculate for any i. Instead a good approximation is a normal distribution with mean 500 and standard deviation of =sqrt(n*p*(1-p)= sqrt(1000/4)=15.8. Then under the null hypothesis 95% of the points will be between 468 and 531 (mean+/- 2). If 95%of the number of experimental values are within these limits, we accept that the random number generator is good.
Run a program to check.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
