Saturday 31 March 2012

Calculating pi = 4/1 - 4/3 + 4/5 ...

There's a mildly interesting series on BBC4 at the moment called The Story of Maths, which is unfortunately more about history than maths (and an excuse to take a few expenses paid holidays around the world), in which the presenter explained how somebody had worked out that you could calculate pi by taking 4/1, subtracting 4/3, adding 4/5, subtracting 4/7 and so on.

All I can say is, although it was clearly an insight of blinding genius to realise this, they must have been really bored after that, as it takes you a heck of a long time to get anywhere near pi in this manner.

The first chart showing the results for the first 20 iterations looks very promising, but it strikes me that after about 40 iterations (second chart), somebody will have said "Sod this for a game of soldiers, let's take an average of the last few results and call it a day." Even if they'd slogged their way up to 100 iterations (third chart) or up to 1,000 iterations (bottom chart), they wouldn't have got much closer than by just averaging the 39th and 40th results:

12 comments:

Sarton Bander said...

I tend to think pi/4 "slice" is a more useful number.

it's 0..1 range and makes visualising the maths easier 8 lines around a circle making a square = 8 slice = radius.

4 slice r2 = area : there are 4 (identical after rotation) r2 sized squares making the full square which "slicing" gives you the circular area.

Tim Almond said...

quite. What's wrong with "3.14"?

It's not like that formula tells you anything about Pi, it's just a series of numbers that comes to the same answer.

TV's actually got worse. If you want to learn something, you can hit the internet and see lectures, or read about say, the Haversine Formula on Wikipedia. This means that factual TV programmes are aimed at an audience that just want to see shiny things.

Sarton Bander said...

Forgot to add this means it's

pi = 1/1 - 1/3 + 1/5 ...

Which seems a more "natural" expansion.

Mark Wadsworth said...

SB, your second comment makes a lot of sense.

TS: "it's just a series of numbers that comes to the same answer."

Well is it? That's the question, is it 'the same answer' or is it 'the answer'?

Anonymous said...

You're missing the point, do you think that any mathematicians actually did the arithmetic? The fun was proving that the formula works, and despite pi being a transcendental number, it can be calculated using a very simple pattern. Tedious calculations were delegated to slaves. To relate this to homeownerism, mathematicians were usually sponsored by the Lord of the Manor. If one of the tenants was crap at farming, he could get invited to the mathematician's house and work with his brain.

Mark Wadsworth said...

J: "do you think that any mathematicians actually did the arithmetic? "

No of course not.

So the question is: at what stage did the slaves crunching the numbers realise that it was waste of time and just started guessing the answers - they knew what the overall picture would look like, so they could safely assume that the 50th iteration would be 3.16 and the 51st would be 3.125 (or thereabouts) and when the Lord of the Manor came back to check on progress they could tell him the made up numbers but that it would need another few months' work.

And then a few months later, they could tell him that they'd got as far as 1,000 iterations, but they still hadn't calculated pi exactly, but it definitely somewhere between 3.140 and 3.142 and so on.

Beats being a bad farm worker!

Sarton Bander said...

I build a spreadsheet and averaged the last two pi approximations. It gets near pi quickly.

Graeme said...

frankly, there must be a better way to get to the answer...I cannot believe that this is how the Greeks got to 3.1414...according to the original post it would need another 100,000 iterations at least to get close

Graeme said...

Jorge...an interesting point...when the properties of pi were discovered, hbow many "mathematicians" in the world were there? Are you formulating a sub-class of slaves with slide-rules?

Sarton Bander said...

Averaging the last 2 values gives you 3.141 after 36 iterations.

Mark Wadsworth said...

SB, on my spreadsheet, and rounded to 4 sig figs, you have to do 60 iterations before the result starts flipping back and forth between 3.1415 and 3.1417, at which stage Jorge's slaves probably started making up results to keep the Lord Of The Manor happy. If he came back once a month and found that the range was getting narrower and narrower he was probably happy.

G, these two amiable but mad Russian expat brothers didn't abandon the search until 1997, several hundred million decimal places later.

Sarton Bander said...

http://mathworld.wolfram.com/BBPFormula.html