Use a while loop to calculate terms of summation

Assignment Help Programming Languages
Reference no: EM1372343

The brilliant mathematician Srinivasa Ramanujan found an infinite series that can be used to generate a numerical approximation of π:

2 √ 2 ∞ (4k)!(1103+26390k)1= ∑π (k!)4 3964k9801 k=0

Write a function called estimate_pi that uses this formula to compute and return an estimate of π. It should use a while loop to compute terms of the summation until the last term is smaller than 1e-15 (which is Python notation for 10-15). You can check the result by comparing it to math.pi.

Reference no: EM1372343

Questions Cloud

Compute percentage change of real exchange rate : Compute percentage change of real exchange rate between US and Japan in past year. Has US Dollar become weaker or stronger in real term.
How much thicker is the center than edges : Assume this is the innermost line of interference (m = 0) and that speed of sound in air is 331 m/s, find the (linear) frequency of the sound in Hz.
Compute total profits at the optimum level of output : The Zinger Corporation manufactures and sells a line of sewing machines. Demand per period for a particular model is given by the following relationship:
What should be quantity sold in each market : If they charge same price in each market, what should be quantity sold in each market, equilibrium price and total profit.
Use a while loop to calculate terms of summation : Write function called estimate_pi that uses this formula to calculate and return estimate of π. It must use a while loop to calculate terms of summation until last term is smaller than 1e-15.
Compute the output level to maximize profit : Woodland Instruments, Company operates in highly competitive electronics industry. Prices for its R2-D2 control switches are stable at $100 each.
What long run adjustments should you anticipate : what price and quantity of computers should you produce to maximize your firm's profits. What long run adjustments should you anticipate.
How much heat does the system liberate : while a system is taken from state a to state b in the figure below the path acb, 84.0 of heat flows into the system and 57.0 of work is done by the system.
Write a strategic form also find optimal strategy of player : There are two players 1 and 2. re are two cards: "High" and "Low". Player 1 chooses at random one card. Write a strategic form also find optimal strategy of player.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd