function coupon_sample_test ( )

%*****************************************************************************80
%
%% coupon_sample_test() tests coupon_sample().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 April 2016
%
%  Author:
%
%    John Burkardt
%
  n_trial = 10;
  max_type = 25;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'coupon_sample_test():\n' );
  fprintf ( 1, '  coupon_sample() samples the coupon PDF.\n' );

  for n_type = 5 : 5 : max_type

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Number of coupon types is %d\n', n_type );
    expect = n_type * log ( n_type );
    fprintf ( 1, '  Expected wait is about %f\n', expect );
    fprintf ( 1, '\n' );

    average = 0.0;
    for i = 1 : n_trial
      [ coupon, n_coupon ] = coupon_sample ( n_type );
      fprintf ( 1, '  %6d  %6d\n', i, n_coupon );
      average = average + n_coupon;
    end

    average = average / n_trial;
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Average wait was %f\n', average );

  end

  return
end
