function multinomial_pdf_test ( )

%*****************************************************************************80
%
%% MULTINOMIAL_PDF_TEST tests MULTINOMIAL_PDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    12 April 2016
%
%  Author:
%
%    John Burkardt
%
  b = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'MULTINOMIAL_PDF_TEST\n' );
  fprintf ( 1, '  MULTINOMIAL_PDF evaluates the Multinomial PDF.\n' );

  x(1:3) = [ 0, 2, 3 ];

  a = 5;

  c(1:3) = [ 0.10, 0.50, 0.40 ];

  check = multinomial_check ( a, b, c );

  if ( ~ check );
    fprintf ( 1, '\n' );
    fprintf ( 1, 'MULTINOMIAL_PDF_TEST - Fatal error!\n' );
    fprintf ( 1, '  The parameters are not legal.\n' );
    return
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF argument X:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : b
    fprintf ( 1, '  %6d\n', x(i) );
  end
  fprintf ( 1, '  PDF parameter A = %14g\n', a );
  fprintf ( 1, '  PDF parameter B = %14g\n', b );
  fprintf ( 1, '  PDF parameter C:\n' );
  for i = 1 : b
    fprintf ( 1, '  %14f\n', c(i) );
  end

  pdf = multinomial_pdf ( x, a, b, c );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF value =     %14g\n', pdf );

  return
end
