function black_test ( )

%*****************************************************************************80
%
%% black_test() tests black() and draw().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 January 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'black_test():\n' );
  fprintf ( 1, '  A bag of B black and W white marbles is to be emptied in a \n' );
  fprintf ( 1, '  series of rounds.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A round begins when a single ball is drawn from the bag, \n' );
  fprintf ( 1, '  its color is noted, and the ball is discarded.  Then,\n' );
  fprintf ( 1, '  one at a time, more balls are drawn from the bag.  If \n' );
  fprintf ( 1, '  they match the first ball, they are also discarded.  \n' );
  fprintf ( 1, '  Otherwise, they are replaced in the bag, and the \n' );
  fprintf ( 1, '  round stops.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Rounds are taken until the bag is empty.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  This function simulates the process of a single round.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimate the probability P that the last marble in \n' );
  fprintf ( 1, '  the bag is black.  It turns out P=1/2.\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '   B   W   P\n' );
  fprintf ( 1, '\n' );

  b = 1;
  w = 1;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 1;
  w = 10;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 2;
  w = 3;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 3;
  w = 3;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 5;
  w = 4;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 7;
  w = 9;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 18;
  w = 13;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );
  b = 15;
  w = 39;
  p = black ( b, w );
  fprintf ( 1, '  %2d  %2d  %g\n', b, w, p );

  return
end

