function counterfeit_detection_brute_test ( )

%*****************************************************************************80
%
%% counterfeit_detection_brute_test tests counterfeit_detection_brute.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 March 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'counterfeit_detection_brute_test\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  Test counterfeit_detection_brute,\n' );
  fprintf ( 1, '  which seeks to identify multiple counterfeit coins among n coins\n' );
  fprintf ( 1, '  using brute force.\n' );

  n = 100;
  correct = 17.0;
  coin(1:n,1) = correct;
%
%  Decide randomly how many coins will be fake.
%
  fake_num = randi ( [ 3, 10 ] );
%
%  Randomly choose which fake_num coins will be fakes.
%  randsample() is only available with the statistics and machine learning toolbox.
% 
% fake_index = randsample ( n, fake_num );
%
  fake_index = ksub_random2 ( n, fake_num );

  fake_index = sort ( fake_index );
  coin(fake_index) = correct + 3.0 * randn ( fake_num, 1 );

  suspect = counterfeit_detection_brute ( n, coin, correct );
  suspect_num = length ( suspect );
%
%  Compare actual fakes to your suspect.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  There were %d fakes; the function found %d suspects.\n', fake_num, suspect_num );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Indices of fakes:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : fake_num
    fprintf ( 1, '  #%d:  %d\n', i, fake_index(i) );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Indices of suspects:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : suspect_num
    fprintf ( 1, '  #%d:  %d\n', i, suspect(i) );
  end

  return
end

