Question: Exercise 1 - Statistics on array with random numbers write a program in C which fills with random values between 0 and M, a square

 Exercise 1 - Statistics on array with random numbers write a

Exercise 1 - Statistics on array with random numbers write a program in C which fills with random values between 0 and M, a square inatrix r|N N Consider that AM and N are constants. Then, your program should calculate and print the following: The number of occurrences of each number in the matrix r (frequencies of all the numbers). You will need a second 1D array with the name freq nd size M +1. . The mean value and the population standard deviation g of all the elemnts in the matrix r The mean value and the population standard deviation of a set of n numbers {xi,22, . . . , xr are real numbers and they are defined as: n. Try to calculate efficiently by transforming the Equation 1. You will need the function sart, which is defined in , and the function rand, which is defined in Kstdlib.h>. Do not use any build-in functions that calculate the mean and the standard deviation values automatically Exercise 2 - Random number generation Modify your solution in Exercise 1, so as to ask from the user a maximum tolerable standard deviation Omar, Your program should repeat the generation of the numbers for the array r until the standard deviation is smaller than mar or a number of maaximum tries (e.g. 1000) has been reached. In the first case, your program should print all the elements of the array along with the standard deviation while in the second case a message should inform the user that the maximum numbers of tries has been reached. /

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!