Question

In: Computer Science

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.

Solutions

Expert Solution

We need to generate the 1000 uniformly distributed random numbers with minimum of 2 and maximum of 18. Then we need to check it by plotting histogram.

In MATLAB, the function rand(m, n) generates uniformly distributed random numbers between 0 and 1. Now, since we need an array of 1000 numbers, in our case m = 1 and n = 1000. Also, we need minimum value of 2. That can be achieved by adding 2 to the array created. Then we need maximum value of 18. That can be achieved by multiplying the difference i.e. 16 to the array created. Therefore, the formula for getting the a uniformly distributed number in interval [a, b] is:

(b – z)y + a

 

Where

is the random number generated

 

The MATLAB code is shown below:

 

Input:

a = 2;

b = 18;

y = (b-a)*rand(1, 1000) + a;

mean(y)

hist(y, 16)

We have also checked the array generated by calculating mean and the histogram

 

Output:

ans =

10.1841

 

We see that the mean is 10.1814, which is very close to the mean of 10 in question.

 

The histogram is shown below:

 

Histogram is shows that all the bins are nearly of equal length with slight variations. Hence, this can be approximated as a uniform distribution.


We see that the mean is 10.1814, which is very close to the mean of 10 in question.

Related Solutions

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.
Task 2: Random Number Generator (10 Pts) Random numbers are usually computed using a formula from...
Task 2: Random Number Generator (10 Pts) Random numbers are usually computed using a formula from discrete mathematics. This type of random number generator is called the linear congruential generator and it is described by the following formula Xn+1=(aXn+c)modm where a, c and m are parameters of the generator, with Xn being the previous random number, and Xn+1 being the next random number. Variable X0 is referred to as the seed. Note: this is integer arithmetic, not floating-point arithmetic. Term...
Develop a random number generator for a Poisson distribution with mean = 10. Generate five values...
Develop a random number generator for a Poisson distribution with mean = 10. Generate five values manually with a random number table. Please show work.
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...
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...
Appendix B.4 is a table of random numbers that are uniformly distributed. Hence, each digit from...
Appendix B.4 is a table of random numbers that are uniformly distributed. Hence, each digit from 0 through (including) 9 has the same likelihood of occurrence. (Round your answers to 2 decimal places.) a) Compute the population mean and standard deviation of the uniform distribution of random numbers. Population mean    Population Standard Deviation b) Assume that 10 random samples of five values are selected from a table of random numbers. The results follow. Each row represents a random sample....
Generate 2500 random numbers that are uniformly distributed between 90 and 160. Prove experimentally that STD...
Generate 2500 random numbers that are uniformly distributed between 90 and 160. Prove experimentally that STD of sample means = STD of Population/sqrt(sample size) for sample sizes of 10 and 100. How close is your calculation of STD of sample means to the theoretical approximation? Keep number of samples in each case equal to sample size. Repeat for normal and weibull (also between 90 and 160). What does it say about STD of sample means as you increase your sample...
Below are 50 random numbers taken from a random number generator. 0.534 0.401 0.401 0.445 0.445...
Below are 50 random numbers taken from a random number generator. 0.534 0.401 0.401 0.445 0.445 0.125 0.094 0.094 0.104 0.104 0.345 0.259 0.259 0.288 0.288 0.785 0.589 0.589 0.654 0.654 0.975 0.731 0.731 0.813 0.813 0.834 0.626 0.626 0.695 0.695 0.683 0.512 0.512 0.569 0.569 0.322 0.242 0.242 0.268 0.268 0.526 0.395 0.395 0.438 0.438 0.234 0.176 0.177 0.198 0.196 a) Using 5 class intervals, determine the computed chi-square value. Answer in 1 decimal place.    b) What is...
Use Random number generator (under Data Analysis) to simulate the following data set. Create 10 columns,...
Use Random number generator (under Data Analysis) to simulate the following data set. Create 10 columns, each 20 points long and use the following parameters: Number of variables (10), number of data point (20), Distribution (Normal), Mean (40), Standard Deviation (10), Random seed (1234). The data should be in columns: A,B,C,….,I,J. Randomly pick two columns (say Column B and Column H) and perform 2-sided t-test on these two data columns. Record the P-value and repeat this procedure several times (at...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT