function q = hump_mc ( n )

%*****************************************************************************80
%
%% hump_mc estimates the integral of hump(x) from 0 to 2 using Monte Carlo. 
%
%  Input:
%
%    integer n: the number of points to use.
%
%  Output:
%
%    real q: the integral estimate.
%
  a = 0.0;
  b = 2.0;
  x = 2.0 * rand ( n, 1 );
  q_exact = hump_int ( a, b );

  q = ( b - a ) * ( 1.0 / n ) * sum ( hump(x) );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of points in rule = %d\n', n );
  fprintf ( 1, '  Estimated integral is %20.16g, error = %8.4g\n', q, abs ( q_exact - q ) );

  return
end

