function multinoulli_pdf_test ( )

%*****************************************************************************80
%
%% multinoullli_pdf_test() tests multinoulli_pdf().
%
%  Licensing:
%
%    This code is distributed under the MIT 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;
  theta = rand ( n, 1 );
  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
