function i4_partition_random_test ( )

%*****************************************************************************80
%
%% i4_partition_random_test() tests i4_partition_random().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 July 2021
%
%  Author:
%
%    John Burkardt
%
  n = 8;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4_partition_random_test():\n' );
  fprintf ( 1, '  i4_partition_random() generates a random partition.\n' );
  fprintf ( 1, '\n' );
%
%  Get the partition table.
%
  table = i4_partition_count2 ( n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The number of partitions of N\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '     N    Number of partitions\n' );
  fprintf ( 1, '\n' );

  for j = 1 : n
    fprintf ( 1, '  %4d    %6d\n', j, table(j) );
  end

  fprintf ( 1, '\n' );

  for i = 1 : 5

    [ a, mult, npart ] = i4_partition_random ( n, table );

    i4_partition_print ( n, npart, a, mult );

  end

  return
end
