Question: The rand() function generates values on the basis of a distribution called the normal distribution. One of the favorable properties of the normal distribution is


  • The rand() function generates values on the basis of a distribution called the normal distribution. One of the favorable properties of the normal distribution is that its average is exactly the middle value of its range. It means that if we run the rand() function in C++, having the range 0 - 32767, a large number of times and calculate the average of all the generated values, it would be exactly 16383.5. In this problem, you are required to find the smallest value of n (number of times the rand() is called) that results in the average equal to 16383.5 +- 0.0001. Specifically, your program shall call rand() 1000 times and see the average, then call it another 10000 times and see the average, and so on until the average is 16383.5 +- 0.0001.

Step by Step Solution

3.34 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can use the following program as a starting poi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!