input: Write a python function to estimate an integral using Monte Carlo simulation.
  assert abs(estimate_integral(lambda x: x**2, 0, 1, 10000) - 1/3) < 0.01
  assert abs(estimate_integral(lambda x: x**3, 0, 1, 10000) - 1/4) < 0.01
  assert abs(estimate_integral(lambda x: 2*x, 0, 1, 10000) - 1) < 0.01
output: import random
  
  def estimate_integral(f, a, b, num_samples):
      total = 0
      for _ in range(num_samples):
          x = random.uniform(a, b)
          total += f(x)
      return (b - a) * total / num_samples