Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Random Number Functions > Functions That Generate Normally Distribut...

Functions That Generate Normally Distributed Numbers

Function:RANNOR
Purpose:To generate random numbers that are normally distributed. This function generates random numbers that come from a distribution with a mean of 0 and a standard deviation of 1. You can easily scale this to generate any normally distributed values. For example, to generate normally distributed numbers with a mean of 100 and a standard deviation of 10, you multiply the result of the RANNOR function by 10 and add 100.
Syntax:RANNOR (seed)
 seed is either a 0, in which case you will obtain a different series of normally distributed random numbers each time you run your program (it uses the computer's clock to generate the seed), or a number of your choosing, in which case every time the program runs, it produces the same series of random numbers.


Examples

FunctionReturns
RANNOR(0)A random number from a normal distribution (mean = 0, standard deviation =1) with a machine-generated seed
RANNOR(1234)A random number from a normal distribution (mean = 0, standard deviation =1) with user-defined seed
10*RANNOR(0) + 100A random number from a normal distribution (mean = 100, standard deviation =10) with a machine-generated seed



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial