function ping_pong_test ( )

%*****************************************************************************80
%
%% ping_pong_test() tests ping_pong().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 January 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ping_pong_test():\n' );
  fprintf ( 1, '  ping_pong() estimates PROB, the probability that a player\n' );
  fprintf ( 1, '  will win a game of ping pong, assuming the player has\n' );
  fprintf ( 1, '  a probability P of winning a single point.\n' );

  p_test =     [ 0.3,    0.4,    0.5, 0.6 ];
  exact_test = [ 0.0264, 0.1744, 0.5, 0.8256 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  P  PROB  Exact\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 4
    p = p_test(i);
    prob = ping_pong ( p );
    exact = exact_test(i);
    fprintf ( 1, '  %g  %g  %g\n', p, prob, exact );
  end

  return
end

