Question: PYTHON please answer asap ill be leaving a thumbs up! problem 1 Problem 1 [10 points ] Approximating Pi. The value of the mathematical constant
Problem 1 [10 points ] Approximating Pi. The value of the mathematical constant up to the first 15 digits is 3.141592653589793. The number is an irrational number and there are many differont methods to approximate its value. One approach to approximate is from an infinite product, which is the product of infinitely many terms in a sequence. In this problem, we focus our attention on the following infinite product for : F=4[33245546776899810] As more terms of the sequence are included, we get better approximations of , as shown below. (We print 15 digits after the decimal point, to compare with the actual value of above). As you can seo, this infinite product converges quite slowly to . It takes a million terms for the product to agree with the actual value of up to just five digits! (There are series, such as Thylor's series, that converge to much faster, but we'l focus on just this infinite product in this problem.) - The product of the first term of the sequence equals 3.5555555555555554. - The product of the first two terms of the sequence is 3.41333333333333. - The product of the first ten terms of the sequence is 3.213784940293189. - The product of the first ten thousand terms of the sequenee is 3.1416711865345 (agrees with the nctual value of up to three digits after decimal point). - The prodnet of the first million terms of the sequence is 3.1415934389872975 (agroes with the actual value of up to five digits after decimal point). Implement n function called approx.pi with a siugle parameter n (an integer 1, that calcnlates and retirns the product of the first n terms of the above soquence for
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
