function bernoulli_dice_test ( )

%*****************************************************************************80
%
%% bernoulli_dice_test() tests bernoulli_dice().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 January 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bernoulli_dice_test():\n' );
  fprintf ( 1, '  bernoulli_dice() considers the Bernoulli dice game.\n' );
  fprintf ( 1, '  Players A and B toss a fair die, until a 1 is rolled.\n' );
  fprintf ( 1, '  On round 1, A gets 1 toss, then B gets 1 toss.\n' );
  fprintf ( 1, '  On round k, A gets k tosses, then B gets k tosses.\n' );
  fprintf ( 1, '  What is the probability that A wins?\n' );

  p = bernoulli_dice ( );
  exact = 0.596794;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Estimate = %g, exact is %g\n', p, exact );

  return
end

