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 GNU LGPL license.
%
%  Modified:
%
%    19 September 2018
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer X, the index of the outcome.
%    1 <= X <= N.
%
%    Input, integer N, the number of legal outcomes.
%
%    Input, 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
