function pivot_sequence_random_test ( )

%*****************************************************************************80
%
%% pivot_sequence_random_test() tests pivot_sequence_random().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 June 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pivot_sequence_random_test():\n' );
  fprintf ( 1, '  pivot_sequence_random() randomly selects a pivot\n' );
  fprintf ( 1, '  sequence of N terms\n' );

  n = 5;
  pivot_sequence_num = pivot_sequence_enum ( n );

  fprintf ( 1, '  Let n = %d\n', n );
  fprintf ( 1, '  Number of possible balanced sequences is %d\n', pivot_sequence_num );

  fprintf ( 1,'\n' );

  for test = 1 : 10

    t = pivot_sequence_random ( n );
    for i = 1 : n
       fprintf ( 1, '%2d', t(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
