Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 in Assignment 2 shows how to use the area of rectangles to estimate the definite integral of a function. There, one uses the

image text in transcribedimage text in transcribed

Question 2 in Assignment 2 shows how to use the area of rectangles to estimate the definite integral of a function. There, one uses the midpoints in the subintervals to compute the heights of the rectangle. In this question, we use random points in the subintervals. This is also known as Monte Carlo numerical integration. Consider the definite integral, | f(x) dx. Divide the interval from = a to r = b into n equal subintervals of length Ar = - each. Let ek be a randomly generated point within the k-th subinterval (respectively). Then the definite integral can be approximated again by f(c)Ar = Ar [f(ci) + f(c2) +...+ f(n)). As before, take f(1) = 1 +3 and end points a = 0, b = 10. Approximate L" (2+;) dr. using the above method. Requirement: define a function with name "Approx integral.Q2", ### Solution to Question 2 def Approx integral.Q2 (n): ... Your codes ... The input n to the function is the number of subintervals used to approximated the definite integral. The function should return the above sum E f(c)A.. You should choose the number n such that, p10 / f(G)A.r dx

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

5-27. In all probability, were likely to have a price increase.

Answered: 1 week ago