Question: 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.7This code has to be done with python 2.7The program has toThe 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.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!