Question

In: Mechanical Engineering

Use a random number generator to produce 1000 normally distributed numbers with a mean of 20

Use a random number generator to produce 1000 normally distributed numbers with a mean of 20 and a variance of 4. Obtain the mean, variance, and histogram of these numbers, and discuss whether they appear normally distributed with the desired mean and variance.

Solutions

Expert Solution

Program plan:

• To find the mean and variance of the 1000 normally distributed random numbers.

• To plot the histogram of these random numbers.

 

Program:

%**********************************************************

%A matlab code is written to find the mean and variance of

%the normally distributed random number with mean 20 and

%variance 4. To obtain the histogram of the numbers using

%matlab.

%**********************************************************

%Declaration of constant

m=1000;

%Generates 1000 random number of mean 20 and variance 2

x=2.*randn(1,m)+20;

%Displays text

disp('The mean of the 1000 random number is ');

%Displays value

disp(mean(x));

%Displays text

disp('The variance of the random numbers is ');

%Displays value

disp((std(x))^2);

%Declaration of array

range=[min(x):max(x)];

%Creates histogram

hist(x, range),

%Assigns text to x-axis

xlabel('Random values'),

%Assigns text to y-axis

ylabel('Absolute Frequency')

 

Output:

>> Untitled

The mean of the 1000 random number is

20.1020

 

The variance of the random numbers is

4.2016


The mean of the 1000 random number is

20.1020

 

The variance of the random numbers is

4.2016

Related Solutions

Use a random number generator to produce 1000 uniformly distributed numbers with a mean of 10, a
Use a random number generator to produce 1000 uniformly distributed numbers with a mean of 10, a minimum of 2, and a maximum of 18. Obtain the mean and the histogram of these numbers, and discuss whether they appear uniformly distributed with the desired mean.
The Random class implements a random number generator, which produces sequences of numbers that appear to...
The Random class implements a random number generator, which produces sequences of numbers that appear to be random. To generate random integers, you construct an object of the Random class, and then apply the nextInt method. For example, the call generator.nextInt(6) gives you a random number between 0 and 5. Write a program DieSimulator that uses the Random class to simulate the cast of a die, printing a random number between 1 and 6 every time that the program is...
The SAT scores for students are normally distributed with a mean of 1000 and a standard...
The SAT scores for students are normally distributed with a mean of 1000 and a standard deviation of 200. What is the probability that a sample of 45 students will have an average score between 970 and 1010? Round your answer to 3 decimal places.
The lifetime of a certain type of battery is normally distributed with a mean of 1000...
The lifetime of a certain type of battery is normally distributed with a mean of 1000 hours and a standard deviation of 100 hours. Find the probability that a randomly selected battery will last between 950 and 1000 (round answers to three decimal places, example 0.xxx)? The lifetime of a certain type of battery is normally distributed with a mean of 1000 hours and a standard deviation of 100 hours. Find the probability that a randomly selected battery will last...
The heights of 1000 students are approximately normally distributed with a mean of 174.5centimeters and a...
The heights of 1000 students are approximately normally distributed with a mean of 174.5centimeters and a standard deviation of 6.9 centimeters. Suppose 200 random samples ofsize 25 are drawn from this population and the means recorded to the nearest tenth of acentimeter. Determine (a) the mean and standard deviation of the sampling distribution of ̄X; (b) the number of sample means that fall between 171 and 177 cm . Let X be a random variable following a continuous uniform distribution...
The heights of 1000 students are normally distributed with a mean of 177.5 centimeters and a...
The heights of 1000 students are normally distributed with a mean of 177.5 centimeters and a standard deviation of 6.7 centimeters. Assuming that the heights are recorded to the nearest​ half-centimeter, how many of these students would be expected to have heights ​(a) less than 167.0 centimeters? ​(b) between 173.5 and 185.0 centimeters​ inclusive? ​(c) equal to 180.0 ​centimeters? ​(d) greater than or equal to 191.0 ​centimeters?
The SAT scores for students are normally distributed with a mean of 1000 and a standard...
The SAT scores for students are normally distributed with a mean of 1000 and a standard deviation of 200. What is the probability that a sample of 36 students will have an average score between 970 and 1010? Round your answer to 3 decimal places.
Suppose you have access to a random number generator Rng() that generates uniform random numbers in...
Suppose you have access to a random number generator Rng() that generates uniform random numbers in {0, 1, . . . , n − 1}. Design a function uses Rng() generate a uniform random number in {0, 1, . . . , m − 1}, where m ≤ n
Questions 36-39: Six numbers are selected at random from a random number generator and entered into...
Questions 36-39: Six numbers are selected at random from a random number generator and entered into each of four rows. The summary statistics are presented in the chart below. Mean SD   Row 1 5.8  0.78 Row 2 3.6  0.23 Row 3 5.5  0.32 Row 4 4.0  0.59 Assume the populations are normal with equal variances. It is of interest to test the following: Ho: μ1 = μ2 = μ3 = μ4 36. What are the degrees of freedom for the...
The heights of 1000 students are approximately normally distributed with a mean of 174.5 centimeters and...
The heights of 1000 students are approximately normally distributed with a mean of 174.5 centimeters and standard deviation is unknown. Suppose 200 random samples of size 25 are drawn from this population and the means recorded to the nearest tenth of a centimeter. with n=6 and assume the true σ is unknown and S=7.5 centimeters instead Determine (a) the mean and standard deviation of the sampling distribution of ¯X ; (b) the number of sample means that fall between 172.5...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT