function hexagon01_monte_carlo_test01 ( )

%*****************************************************************************80
%
%% hexagon01_monte_carlo_test01() requests integrals over the unit hexagon.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 April 2019
%
%  Author:
%
%    John Burkardt
%
  area = hexagon01_area ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'hexagon01_monte_carlo_test01():\n' );
  fprintf ( 1, '  hexagon01_monte_carlo() estimates\n' );
  fprintf ( 1, '  monomial integrals x^p y^q over the unit hexagon.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   N  P   Q             Nu(P,Q)\n' );
  for s = 0 : 10
    for p = s : -1 : 0
      q = s - p;
      if ( mod ( p, 2 ) == 0 && mod ( q, 2 ) == 0 )
        fprintf ( 1, '\n' );
        n = 1;
        for log2n = 0 : 15
          [ x, y ] = hexagon01_sample ( n );
          v = monomial_value_2d ( n, p, q, x, y );
          nu_pq = ( area / n ) * sum ( v );
          fprintf ( 1, '  %6d  %2d  %2d  %14.6g\n', n, p, q, nu_pq );
          n = n * 2;
        end
        nu_pq = hexagon01_integral ( p, q );
        fprintf ( 1, '   Exact  %2d  %2d  %14.6g\n', p, q, nu_pq );
      end
    end
  end

  return
end
