function pdf = multinoulli_pdf ( x, n, theta )

%*****************************************************************************80
%
%% multinoulli_pdf() evaluates the Multinoulli PDF.
%
%  Discussion:
%
%    PDF(X) = THETA(X) for 1 <= X <= N.
%           = 0 otherwise
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 September 2018
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer X, the index of the outcome.
%    1 <= X <= N.
%
%    integer N, the number of legal outcomes.
%
%    real THETA(N), the probability of each outcome.
%
%  Output:
%
%    real PDF, the probability of outcome X.
%
  if ( 1 <= x && x <= n )
    pdf = theta(x);
  else
    pdf = 0.0;
  end

  return
end
