Question: NEED HELP IN C! Part 1. Random Numbers and PDFs Design an algorithm for collecting histograms for the Probability Distribution Functions (PDFs) of the sequence

NEED HELP IN C!

Part 1. Random Numbers and PDFs

Design an algorithm for collecting histograms for the Probability Distribution Functions (PDFs) of the sequence of random numbers which you will generate.

Write the corresponding code in C. Present that code.

Present screen shots of the results in which you produce that histogram with :

a (hopefully) uniformly distributed PDF from rand() [first with a seed of 1] scaled and shifted to have 6 digits of resolution on each random number in a distribution from 0 to 1 with a bin-width of 1/10 for the histogram. Print those 10 numbers and comment on the PDF is it very uniform? Etc. Use 1000 calls to rand(). So x[0], x[999] are processed by your histogram program into pdf[bin 1], pdf[bin 10] and you print pdf[].

repeat (a) this time by seeding srand() with the current time of day 100 different times for each of the 1000 calls to rand() which form x. Average the 100 different x sequences and calculate and print the histogram.

repeat (a) this time mapping x to a (hopefully) exponentially distributed PDF before you

calculate and print the histogram.

Part 2. Autocorrelation Functions

Calculate the autocorrelation function for each sequence on which you calculated a histogram in (a) (b) and (c) above. Present that code and the first 10 numbers in these 3 autocorrelation functions. Put the sequence x for (a) above through (the equations and hence the code for) a filter (of time-constant = 1) and calculate and print the resulting autocorrelation function. Also present the code you use for the filter.

Thanks a lot!

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!