Use Python's numpy library to estimate value of pi using Srinivasa Ramanujan infinite series formula without using while or for loops
Added by Dakota C.
Step 1
Import numpy library import numpy as np Show more…
Show all steps
Your feedback will help us improve your experience
Amaad Martin and 94 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
The German mathematician Gottfried Leibniz developed the following method to approximate the value of π: π/4 = 1 - 1/3 + 1/5 - 1/7 + … Write a program using Javascript that allows the user to specify the number of iterations used in this approximation and displays the resulting value
Akash M.
Leonhard Euler was able to calculate the exact sum of the $ p- $ series with $ p = 2: $ $ \zeta (2) = \displaystyle \sum_{n = 1}^{\infty} \frac {1}{n^2} = \frac {\pi^2}{6} $ (See page 720.) Use this fact to find the sum of each series. (a) $ \displaystyle \sum_{n = 2}^{\infty} \frac {1}{n^2} $ (b) $ \displaystyle \sum_{n = 3}^{\infty} \frac {1}{(n + 1)^2} $ (c) $ \displaystyle \sum_{n = 1}^{\infty} \frac {1}{(2n)^2} $
Infinite Sequences and Series
The Integral Test and Estimates of Sums
Leonhard Euler was able to calculate the exact sum of the $ p- $ series with $ p = 2: $ $ zeta (2) = displaystyle sum_{n = 1}^{infty} frac {1}{n^2} = frac {pi^2}{6} $ Use this fact to find the sum of each series. (a) $ displaystyle sum_{n = 2}^{infty} frac {1}{n^2} $ (b) $ displaystyle sum_{n = 3}^{infty} frac {1}{(n + 1)^2} $ (c) $ displaystyle sum_{n = 1}^{infty} frac {1}{(2n)^2} $
Linda H.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD