Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This code has to be done with python 2.7 The program has to be done with python 2.7 Background: Consider the first N terms of
This code has to be done with python 2.7The program has to be done with python 2.7
Background: Consider the first N terms of the summation formula: SN = W V12(-3)* L 2k +1 (1) k=0 Somewhat magically (although its just math), SN converges to T as N + 0. With mathematical symbols this means T = lim Sy. N+00 (2) In fact, before computers you could compute T by-hand" by evaluating Sn for some integer N. Here are the first few values of Sn S_0 = 3.4641016151377544 S_1 = 3.0792014356780038 S_2 = 3.1561814715699539 S_3 = 3.1378528915956800 S_4 = 3.1426047456630846 Evidently Sy is getting closer to T. We can quantify how close from the relative error |SN T| EN = between Sn and T. Your job: Write a program that prints Sy and en for N = 1, 2, 3, 4, ..., 20. Using your code, demonstrate that Sn approaches T. In a code comment, answer the following question: What is the smallest value of N such that Sn matches the first 5 digits of t: 3.14159? Save your program as pisum.pyStep 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