function pw = urn_two_color_pdf ( w, draw_num, color_count )

%*****************************************************************************80
%
%% urn_two_color_pdf() returns the PDF for a two-color urn problem.
%
%  Discussion:
%
%    Only the probabilities for the white marbles are returned.
%    The probabilities for the black marbles are obvious.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 January 2019
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer W(W_NUM), the number of white marbles returned.
%
%    integer DRAW_NUM, the total number of marbles drawn.
%
%    integer COLOR_COUNT(2), the number of white marbles, and the
%    number of black balls.
%
%  Output:
%
%    real PW(W_NUM), PW(I) is the probability of drawing exactly W(I)
%    white marbles.
%
  marble_num = sum ( color_count );
  w_num = length ( w );
  pw = zeros ( w_num, 1 );
  for i = 1 : w_num
    pw(i) = nchoosek ( color_count(1), w(i) ) ...
          * nchoosek ( color_count(2), draw_num - w(i) ) ...
          / nchoosek ( marble_num, draw_num );
  end

  return
end
