function i4vec_choose_test ( )

%*****************************************************************************80
%
%% i4vec_choose_test() tests i4vec_choose().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 January 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4vec_choose_test():\n' );
  fprintf ( 1, '  i4vec_choose() computes the generalized binomial coefficient.\n' );

  m = 5;
 
  j = randi ( [ 0, 6 ], m, 1 );
  k = randi ( [ 0, 6 ], m, 1 );
  n(1:m) = j(1:m) + k(1:m);

  i4vec_transpose_print ( m, n, '  N:' );
  i4vec_transpose_print ( m, k, '  K:' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '   M        V1        V2\n' );
  fprintf ( 1, '\n' );
  v1 = 1;
  for mm = 0 : m
 
    if ( mm == 0 )
      v1 = 1;
    else
      v1 = v1 * i4_choose ( n(mm), k(mm) );
    end
    v2 = i4vec_choose ( mm, n, k );
    fprintf ( 1, '  %2d  %8d  %8d\n', mm, v1, v2 );

  end

  return
end
