function q = composite_monte_carlo ( m, n, a, b, f )

  breaks = linspace ( a, b, m + 1 );

  q = 0.0;
  for i = 1 : m
    ai = breaks(i);
    bi = breaks(i+1);
    q = q + monte_carlo ( n, ai, bi, f );
  end

  return
end
