ArticleslgStudy

computer science

Borwein's algorithm

Borwein's algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Borwein's algorithm rather than just read about it. In short: Borwein's algorithm was devised by Jonathan and Peter Borwein to calculate the value of 1/π. This and other algorithms can be found in the book Pi and the AGM – A Study in Analytic Number Theory and Computational Complexity.

Key takeaways

  • Borwein's algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Borwein's algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Borwein's algorithm from memory before moving on to harder problems.

Reference excerpt

Borwein's algorithm was devised by Jonathan and Peter Borwein to calculate the value of 1/π. This and other algorithms can be found in the book Pi and the AGM – A Study in Analytic Number Theory and Computational Complexity.

Ramanujan–Sato series These two are examples of a Ramanujan–Sato series. The related Chudnovsky algorithm uses a discriminant with class number 1.

Class number 2 (1989) Start by setting

A=21217571091261+1657145277365B=1377398089267261+107578229802750C=(5280(236674+3030361))3 Then

1π=12∑n=0∞(−1)n(6n)!(A+nB)(n!)3(3n)!Cn+12 Each additional term of the partial sum yields approximately 25 digits.

Class number 4 (1993) Start by setting

A=63365028312971999585426220+283377021408008420468256005+3845(10891728551171178200467436212395209160385656017+48709290865788102250773385345416887213512550405)12B=7849910453496627210289749000+35105866782609320289656064005+25159683110(6260208323789001636993322654444020882161+27996502730604442965772068907188251902355)12C=−214772995063512240−960494033386480325−12965(10985234579463550323713318473+49127462536923627546073959125)12 Then

−C3π=∑n=0∞(6n)!(3n)!(n!)3A+nBC3n Each additional term of the series yields approximately 50 digits.

Iterative algorithms

Quadratic convergence (1984) Start by setting

a0=2b0=0p0=2+2 Then iterate

an+1=an+1an2bn+1=(1+bn)anan+bnpn+1=(1+an+1)pnbn+11+bn+1 Then pk converges quadratically to π; that is, each iteration approximately doubles the number of correct digits. The algorithm is not self-correcting; each iteration must be performed with the desired number of correct digits for π's final result.

Cubic convergence (1991) Start by setting

a0=13s0=3−12 Then iterate

rk+1=31+2(1−sk3)13sk+1=rk+1−12ak+1=rk+12ak−3k(rk+12−1) Then ak converges cubically to ⁠1/π⁠; that is, each iteration approximately triples the number of correct digits.

Quartic convergence (1985) Start by setting

a0=2(2−1)2y0=2−1 Then iterate

yk+1=1−(1−yk4)141+(1−yk4)14ak+1=ak(1+yk+1)4−22k+3yk+1(1+yk+1+yk+12) Then ak converges quartically against ⁠1/π⁠; that is, each iteration approximately quadruples the number of correct digits. The algorithm is not self-correcting; each iteration must be performed with the desired number of correct digits for π's final result. One iteration of this algorithm is equivalent to two iterations of the Gauss–Legendre algorithm. A proof of these algorithms can be found here:

Quintic convergence Start by setting

a0=12s0=5(5−2)=5ϕ3 where ϕ=1+52 is the golden ratio. Then iterate

xn+1=5sn−1yn+1=(xn+1−1)2+7zn+1=(12xn+1(yn+1+yn+12−4xn+13))15an+1=sn2an−5n(sn2−52+sn(sn2−2sn+5))sn+1=25(zn+1+xn+1zn+1+1)2sn Then ak converges quintically to ⁠1/π⁠ (that is, each iteration approximately quintuples the number of correct digits), and the following condition holds:

0<an−1π<16⋅5n⋅e−5nπ

Nonic convergence Start by setting

a0=13r0=3−12s0=(1−r03)13 Then iterate

tn+1=1+2rnun+1=(9rn(1+rn+rn2))13vn+1=tn+12+tn+1un+1+un+12wn+1=27(1+sn+sn2)vn+1an+1=wn+1an+32n−1(1−wn+1)sn+1=(1−rn)3(tn+1+2un+1)vn+1rn+1=(1−sn+13)13 Then ak converges nonically to ⁠1/π⁠; that is, each iteration approximately multiplies the number of correct digits by nine.

See also

Bailey–Borwein–Plouffe formula Chudnovsky algorithm Gauss–Legendre algorithm Ramanujan–Sato series

References

External links Pi Formulas from Wolfram MathWorld

Worked examples

Example 1 — a first encounter with Borwein's algorithm

Start with the simplest possible case. Write down what Borwein's algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Borwein's algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Borwein's algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Borwein's algorithm

In research
Borwein's algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Borwein's algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Borwein's algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Pi algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Borwein's algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Borwein's algorithm” →

How to study Borwein's algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Borwein's algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Borwein's algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Borwein's algorithm in simple terms?

Borwein's algorithm was devised by Jonathan and Peter Borwein to calculate the value of 1/π. This and other algorithms can be found in the book Pi and the AGM – A Study in Analytic Number Theory and Computational Complexity.

Why does Borwein's algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Borwein's algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Borwein's algorithm.

Tags

  • Pi algorithms

Keep exploring