Another useful utility constructs histograms. These are frequency
distributions for a single variable. For example, the course utility
**normdist** generates a list of Gaussian distributed random
numbers. Suppose you wanted to reconstruct a graph of this
probability distribution, based on a sample that you generated. You
would make a bar graph with the x-axis representing the random number
and the y-axis representing a count (integer) as follows. First you
would mark off a series of equally spaced intervals on the x-axis to
represent the ``bins'' of the histogram. Then you would examine each
number in your sample and tally a ``one'' for the bin that that number
falls into. After processing all of the numbers in this way, each bin
would contain the count of the number of values in your sample that
fall in that bin. This is the ``frequency'' of the occurrence of
numbers in that bin. A bar graph of these frequencies is a histogram.

To see one, try this example:

normdist | hist -g | axis | xplot Enter mean 0 Enter st dev 4 How many values do you want? 1000 Enter random number seed. 35 STOP(In the dialog above, you type every other line. The computer gives the others.) The command line starts by running normdist, the course utility that generates the random numbers. The output is piped into

The **hist** options are listed here:

* option -n specifies number of bins * * option -s specifies size of bin * * option -x specifies lower and upper limits of histogram * * option -g specifies output in form suitable for "graph" * * or "axis" * * if -g 1 we get a full bar for each bin * * if -g 2 the bars don't go down to the origin * * option -m specifies the line type for use with "axis" *So you could make the bins line up with the tick marks with the command

normdist | hist -g -s 2 -x -20 20 | axis | xplot