function multinomial_pdf_values_test ( )

%*****************************************************************************80
%
%% MULTINOMIAL_PDF_VALUES_TEST tests MULTINOMIAL_PDF_VALUES.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    31 July 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'MULTINOMIAL_PDF_VALUES_TEST:\n' );
  fprintf ( 1, '  MULTINOMIAL_PDF_VALUES stores values of the Multinomial PDF.\n' );
  fprintf ( 1, '  Given M possible outcomes on a single trial,\n' );
  fprintf ( 1, '  with each outcome having probability P,\n' );
  fprintf ( 1, '  PDF is the probability that after N trials,\n' );
  fprintf ( 1, '  outcome I occurred X(I) times.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '     N     M     I      P        X        PDF()\n' );

  n_data1 = 0;
  n_data2 = 0;

  while ( true )

    [ n_data1, m ] = multinomial_pdf_sizes ( n_data1 );

    if ( n_data1 == 0 )
      break
    end

    [ n_data2, n, p, x, pdf ] = multinomial_pdf_values ( n_data2, m );

    fprintf ( 1, '\n' );
    for i = 1 : m
      fprintf ( 1, '              %4d  %8.4f  %4d\n', i, p(i), x(i) );
    end
    fprintf ( 1, '  %4d  %4d                        %14.6g\n', n, m, pdf );

  end

  return
end
