Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

The graph of an equation is sketched in Fig. 29 -2 -4

Answered: 1 week ago