Pure Programmer
Blue Matrix


Cluster Map

Project: Sample Mean

To calculate the [[Sample_mean_and_covariance|mean]] (or average)

is the sum of a number of random samples divided by the number in the sample. Write a program that computes the mean of 10 random floating point values in the interval [0,1). This closed/open [[Interval_(mathematics)|interval]] notation means 0 is in the range but 1 is not. Print the mean to four decimal places. Run the program multiple times to confirm that you get different results each time.

Output
$ perl SampleMean.pl "rand" is not exported by the Math::Trig module Can't continue after import errors at SampleMean.pl line 9. BEGIN failed--compilation aborted at SampleMean.pl line 9. $ perl SampleMean.pl "rand" is not exported by the Math::Trig module Can't continue after import errors at SampleMean.pl line 9. BEGIN failed--compilation aborted at SampleMean.pl line 9. $ perl SampleMean.pl "rand" is not exported by the Math::Trig module Can't continue after import errors at SampleMean.pl line 9. BEGIN failed--compilation aborted at SampleMean.pl line 9.

Solution