Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USING PYTHON PROGRAMMING LANGUAGE I want you to create a program that asks the user to enter in A, B and an even integer N,
USING PYTHON PROGRAMMING LANGUAGE
I want you to create a program that asks the user to enter in A, B and an even integer N, and uses Simpson's rule with N intervals to approximate the value of B1-12 dx For instance, if A--1, B- 1 and N is sufficiently large, this should be close to 0.68; if A- -2, B- 2 and N is large, this should be close to 0.95; if A =-3, B-3 and N is large, this should be close to 0.997. (If those numbers sound vaguely familiar, that's because the given integral gives the area under the standard bell curve, between the z-values A and B.) Don't be intimidated by this problem - it's just a big sum! But do be careful about the details, like initializing your sum, using the right number of terms, and providing the right coefficient for each term And finally, make sure you understand Simpson's rule well enough to perform some calculations by hand. It can be tedious, sure, but if you can't perform Simpson's rule by hand, you'll never be able to code it. Specifications: your program must ask the user for values of A, B and N, where N is an even integer (you may assume the user complies) print an estimate for the value of e-"2dx using Simpson's rule with N steps Challenge (optional): instead of asking the user for an integer N, ask the user to enter an error tolerance. Then, have your program determine an N on its own, so that the error between the Simpson's rule estimate and the true value of the integral is no more than the given error tolerance. There is an inequality related to Simpson's rule that can help you be sure about whether your N is sufficient I want you to create a program that asks the user to enter in A, B and an even integer N, and uses Simpson's rule with N intervals to approximate the value of B1-12 dx For instance, if A--1, B- 1 and N is sufficiently large, this should be close to 0.68; if A- -2, B- 2 and N is large, this should be close to 0.95; if A =-3, B-3 and N is large, this should be close to 0.997. (If those numbers sound vaguely familiar, that's because the given integral gives the area under the standard bell curve, between the z-values A and B.) Don't be intimidated by this problem - it's just a big sum! But do be careful about the details, like initializing your sum, using the right number of terms, and providing the right coefficient for each term And finally, make sure you understand Simpson's rule well enough to perform some calculations by hand. It can be tedious, sure, but if you can't perform Simpson's rule by hand, you'll never be able to code it. Specifications: your program must ask the user for values of A, B and N, where N is an even integer (you may assume the user complies) print an estimate for the value of e-"2dx using Simpson's rule with N steps Challenge (optional): instead of asking the user for an integer N, ask the user to enter an error tolerance. Then, have your program determine an N on its own, so that the error between the Simpson's rule estimate and the true value of the integral is no more than the given error tolerance. There is an inequality related to Simpson's rule that can help you be sure about whether your N is sufficient
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started