The NormalDistribution Function

Kenneth Levasseur
Mathematical Sciences
UMass Lowell
Kenneth_Levasseur@uml.edu

If you are using a version of Mathematica prior to 6.0, click here.

How is NormalDistribution defined.

As with any built-in function, you can get a quick description like this

?NormalDistribution

The "<<" at the end of the description is a link that will take you to the Documentation Center's full documentation of NormalDistribution

Using NormalDistribution

Here are a few simple applications of the function.

f=NormalDistribution[100,20]

PDF[f,x]

Plot[PDF[f,x],{x,40,160}]

Plot[CDF[f,x],{x,40,160}]

CDF[f,110.]

Integrate[PDF[f,x],{x,0,110.}]

Integrate[PDF[f,x],{x,-Infinity,110.}]

Pre - 6.0 Version of this Notebook

With the transition to Mathematica 6.0, this Notebook was drastically changed.  What follows only applies to you if you are using an earlier version.

Loading the package

To load the NormalDistribution package, all you need to do is evaluate the following expression.   The accent mark you see at two points between the quotes is the key below the "escape" key  on the top left of most keyboards.

Needs["Statistics`NormalDistribution`"]

You may also substitute the nearly equivalent expression  <<Statistics`NormalDistribution` to load the package.  Using Needs is better because it will avoid loading the package if it is already loaded.

What's in the package

You can use the Help Browser to see what capabilities are contained in the package.  Also you can get a list of functions defined by the package by evaluating the following.

?Statistics`NormalDistribution`*

Using the Package

To see how to use a function, you can use the Help Browser or do the following.

?NormalDistribution

f=NormalDistribution[100,20]

PDF[f,x]

Plot[PDF[f,x],{x,40,160}]

Plot[CDF[f,x],{x,40,160}]

CDF[f,110.]

Integrate[PDF[f,x],{x,0,110.}]

Pitfalls

A common error once you've gotten accustomed to using a specific package is to forget to load it before using one of its functions.  Here is what happens

PDF[NormalDistribution[100,20]]

Notice how the output is identical to the input, instead of the density function we got above.   This kind of thing happens mostly when you've forgotten to load a package.   Now if we load the package, look at what happens.

Needs["Statistics`NormalDistribution`"]

The names PDF and NormalDistribution that you used are actually different from the ones in the package.  Mathematica puts names that are defined in packages into "contexts"  and the names PDF and NormalDistribuion that you had entered earlier are in a different context.  The easiest thing to do at this point is to select "Quit Kernel" from the Kernel menu and start over again, making sure to load the package first.