Sunday

April 20, 2014

April 20, 2014

Posted by **Anonymous** on Sunday, January 13, 2013 at 2:31am.

For example, we could split the range into two parts, then fit a rectangle whose height is the value of the function at the start of the range to the left half, and fit a rectangle whose height is the value of the function at the middle of the range to the right half. If we decide this is not a sufficiently accurate estimate of the area under the curve, we could split each part in half and repeat the process.

Here is a function that estimates the area under a curve defined by a function f, between points a and b:

def integrate(f, a, b, parts):

spacing = float(b-a)/parts

current = 0

for i in range(parts):

current += spacing * f(a+ i*spacing)

return current

Your job is to fill in the following function definition:

def successiveApproxIntegrate(f, a, b, epsilon):

# Your Code Here

To do so, use successive refinement to find the area under a curve to within a specific level of accuracy. Complete the function definition so that the procedure successiveApproxIntegrate returns an estimate of the area under the curve f. Your final estimate, using N parts, must be less than epsilon away from the estimate using N/2 parts.

- Python programming -
**hahah**, Sunday, January 13, 2013 at 3:48amsry broo , 600x

- Python programming -
**Anonymous**, Sunday, January 13, 2013 at 6:35ami dont want the answer. just help me visualize the problem and how to go for the solution. i am in class 9th and i dont know anything about integrals, yet. coding is not the problem. i am able to do that

**Related Questions**

python programming - Explain in python programming (x^n-1)/(x-1) = x^(n-1)+x^(n-...

Programming in Python - A customer in a store is purchasing five items. Design a...

math - There are 7 children who are 5ft long,their total length is 3ft longer ...

Literature - I am suppose to compare/contrast Monty Python and the Holy Grail ...

Statictics - 2. Herpetologists (snake specialists) found that a certain species ...

Language arts - Can someone give me an example of a metaphor? Is a mouse in ...

TP - What is Standard Deviation? As in what does it measure, is it a measure of ...

Statistics - is the standard deviation a measure of the center or distribution...

Algebra - The following problem must be solved 3 different ways in which X=...

Programming - Language - PYTHON Design a program that calculates the total ...