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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started