Skip to content

Gandhi-uses-nukes/hw3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homework 3

Homework 3, due until 18.11., 8:30

In this homework you will do some statistics of pseudo-random numbers. C++ provides random numbers via the command int rand() which is from cstdlib. It will output an integral value between 0 and RAND_MAX. RAND_MAX is an integer constant coming from cstdlib and the maximum possible random number.

Your assignment is:

  • Write a program which creates an array of N=100 random double values between 0 and 1.
    • The array is to be created in main, but filling it with random numbers should be done in an extra function. You will need pointers for this.
  • Calculate the expected value m and the variance v of your N random numbers x_i, where

* Write one function which calculates *m* and *v*. Your function should return both values to the main program at the same time. Use references for this. The resulting values should be printed in the main program.

In case of any questions, please use the Issues section on the right panel of GitHub to pose the question.

About

Homework 3, due until 18.11., 8:30

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 93.8%
  • Makefile 6.2%