function normal ( trial_num )

%*****************************************************************************80
%
%% normal() displays a histogram of normal random numbers.
%
%  Discussion:
%
%    Displaying a histogram of normal random numbers illustrates
%    how they tend to be distributed.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 January 2018
%
%  Author:
%
%    Paul Nahin
%
%  Reference:
%
%    Paul Nahin,
%    Dueling Idiots and Other Probability Puzzlers,
%    Princeton, 2012,
%    ISBN: 978-0691155005.
%
%  Input:
%
%    integer trial_num: the number of trials.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'normal():\n' );
  fprintf ( 1, '  Displaying a histogram of %d normal random numbers\n', trial_num );
  fprintf ( 1, '  illustrates how they tend to be distributed.\n' );

  y = randn ( trial_num, 1 );
%
%  Graphics.
%
  clf ( );
  hist ( y, 100 );
  grid ( 'on' );
  title ( 'Histogram of Normal Random Number Generator' );
  label = sprintf ( '100 bins, %d normals', trial_num );
  xlabel ( label );
  ylabel ( 'bin populations' );
  filename = 'normal.png';
  print ( '-dpng', filename );
  fprintf ( '  Graphics saved as "%s"\n', filename );

  return
end

