Question: Question 3: (30 points) Write well-documented Python function for computing the nth Fibonacci number. Write a well-documented Python program that computes the circumference of the

Question 3: (30 points) Write well-documented Python function for computing the nth Fibonacci number. Write a well-documented Python program that computes the circumference of the Earth, which is assumed to be a sphere with radius 6370km. Recall that the circumference of a circle is related to the diameter by ?. In this question estimate the value of three ways-all using infinite series of Leibnitz, Nilakantha, and Adamchick The Leibnitz Series is: -3+3-7+ The Nilakantha Series is:+ The Adamchick Senes is: ? = ?-o(-_- -02n +1 -0(2n +3)3-2n+3) sri )(E) Your solution should be a Python text file piSeries.py. Your first comment should be your name. In the last line of the Python text file, please provide an answer to the question, "What is the circumference of the Earth evaluated at 100 terms using the Leibnitz, Nilakantha, and Adamchick series?", as a comment. Store these functions in a module called myPi.py. Hints: Your program should use a for-loop in each of the series being calculated. Make sure your range operator evaluates the correct number of terms in the sum. Define each senes as functions lsm nsm iand aw pi to allow the functions to be reused. Your functions each should accept an integer n, the integer to evaluate the series with. For example, if the function is called with N-4, the series is evaluated with four terms. In the case of Leibnitz, the estimate of ? ~ 4( +?- 9 2.895
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
