function coupon_sample_test ( )

%*****************************************************************************80
%
%% COUPON_SAMPLE_TEST tests COUPON_SAMPLE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL 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' );
  fprintf ( 1, '\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' );

    seed = 123456789;

    average = 0.0;
    for i = 1 : n_trial
      [ coupon, n_coupon, seed ] = coupon_sample ( n_type, seed );
      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
