function urn_50_50_test ( )

%*****************************************************************************80
%
%% URN_50_50_TEST tests URN_SAMPLE with 50 white and 50 black balls.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 January 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'URN_50_50_TEST\n' );
  fprintf ( 1, '  Test URN_SAMPLE with 50 white and 50 black balls:\n' );

  marble_num = 100;
  draw_num = 10;
  color_num = 2;
  color_count = [ 50, 50 ];

  draws = 10000;
  draw_color = zeros(color_num,draws);
  for j = 1 : draws
    draw_color(1:color_num,j) = urn_sample ( marble_num, draw_num, color_num, color_count );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  %d marbles in urn, drawn %d without replacement\n', ...
    marble_num, draw_num );
  fprintf ( 1, '  %d repetitions of draw\n', draws );
  fprintf ( 1, '  %d colors, distributed as follows:\n', color_num );
  for i = 1 : color_num
    fprintf ( 1, '  %d', color_count(i) );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '\n' );
%
%  Draw plot for 2 color case.
%
  hold on
  histogram ( draw_color(1,:), 'Normalization', 'pdf' )
  wmax = max ( draw_color(1,:) );
  w = 0:wmax;
  pw = urn_two_color_pdf ( w, draw_num, color_count );
  plot ( w, pw, 'r-', 'linewidth', 3 );
  grid on
  hold off
  xlabel ( 'Number of white marbles drawn' );
  ylabel ( 'Probability' );
  title ( 'PDF for number of white marbles' );
  filename = 'urn_50_50_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, 'Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'URN_50_50_TEST\n' );
  fprintf ( 1, '  Normal end of execution:\n' );

  return
end
