function multinomial_coef1_test ( )

%*****************************************************************************80
%
%% MULTINOMIAL_COEF1_TEST tests MULTINOMIAL_COEF1.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  maxfactor = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'MULTINOMIAL_COEF1_TEST\n' );
  fprintf ( 1, '  MULTINOMIAL_COEF1 computes multinomial\n' );
  fprintf ( 1, '  coefficients using the Gamma function;\n' );
 
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Line 10 of the BINOMIAL table:\n' );
  fprintf ( 1, '\n' );

  n = 10;
  nfactor = 2;

  for i = 0 : n

    factor(1) = i;
    factor(2) = n - i;

    ncomb = multinomial_coef1 ( nfactor, factor );

    fprintf ( 1, '  %2d  %2d   %3d\n', factor(1), factor(2), ncomb );

  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Level 5 of the TRINOMIAL coefficients:\n' );

  n = 5;
  nfactor = 3;

  for i = 0 : n

    factor(1) = i;

    fprintf ( 1, '\n' );

    for j = 0 : n - factor(1)

      factor(2) = j;
      factor(3) = n - factor(1) - factor(2);

      ncomb = multinomial_coef1 ( nfactor, factor );

      fprintf ( 1, '  %2d  %2d  %2d   %3d\n', ...
        factor(1), factor(2), factor(3), ncomb );

    end

  end

  return
end
