function multinoulli_pdf_test ( )

%*****************************************************************************80
%
%% MULTINOULLLI_PDF_TEST tests MULTINOULLI_PDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    19 September 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'MULTINOULLI_PDF_TEST\n' );
  fprintf ( 1, '  MULTINOULLI_PDF evaluates the Multinoulli PDF.\n' );

  n = 5;
  seed = 123456789;
  [ theta, seed ] = r8vec_uniform_01 ( n, seed );
  theta_sum = sum ( theta(1:n) );
  theta(1:n) = theta(1:n) / theta_sum;

  fprintf ( 1, '\n' );
  fprintf ( 1, '   X     pdf(X)\n' );
  fprintf ( 1, '\n' );
  for x = 0 : n + 1
    pdf = multinoulli_pdf ( x, n, theta );
    fprintf ( 1, '  %2d  %14g\n', x, pdf );
  end

  return
end
