Question: I was able to do part 1 , but not parts 2 , 3 , 4 . The answers of actual should match with expected,

I was able to do part 1, but not parts 2,3,4. The answers of actual should match with expected, but mine don't match with my professor's answers. Thank you.
Part 2:
Write a program that uses the randFloat function given above to generate two
sequences of 500 points. Each sequence should have a theoretical mean of 4, but one
sequence should have a variance of 0.5 and the other should have a variance of 2. Check
the computed means and variances and compare to the theoretical means and variances.
(Hint: Use the two given equations to write two equations with two unknowns. Then solve
for the unknowns by hand.)
The practical and theoretical values for each sequence should be output as in Exercise 1.
Part 3:
Write a program that uses the randFloat function to generate two sequences
of 500 points. Each sequence should have the same variance of 3.0 but one sequence
should have a mean of 0.0 and the other should have a mean of -4.0. Compare the
computed and theoretical values of mean and variance.
(Hint: Use the two given equations to write two equations with two unknowns. Then
solve for the unknowns by hand.)
There should be no user input for this section
The output should contain the theoretical and practical values as in part 1 for both
sequences.
Part 4:
Write a function named rand_mv that generates a random floating-point
value. rand_mv should take in a user specified mean and variance. Assume the
corresponding function prototype is
double rand mv(double mean, double var);
rand_mv() should then calculate A and B, and generate a random value using
randFloat ( a,b )
The main function will provide two prompts, the first asking for the desired mean from the
user.
Note: The values denoted as x.xx represent a value of type float in all cases.
It is not a number formatted specifically as X.XX So if the output is 4.99999 it should
remain 4.99999 and not be formatted to look like 4.99```
Input:
4
0.25
\ Actual {
fail
Test 2
Input:
5
0.65
fail
Score
0/2
```
I was able to do part 1 , but not parts 2 , 3 , 4

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 Programming Questions!