# Pi approximation games

Tim Wescott
Guest
Posts: n/a

 05-01-2012, 11:16 PM
Instead of doing productive work, I just spent a few enjoyable minutes
with Scilab finding approximations to pi of the form m/n.

Because I'm posting to a couple of nerd groups, I can be confident that
most of you probably know 22/7 off the tops of your heads.

What interested me is how spotty things are -- after 22/7, the error
drops for a bit until you get down to 355/113 (which, if you're at an
equal level of nerdiness to me will ring a bell, but not have been
swimming around in your brain to be found).

But what's _really_ interesting, is that the next better fit isn't found
until you get up to 52163/16604. Then things get steadily better until
you hit 104348/33215 -- at which point the next lowest ratio which
improves anything is 208341/66317, then 312689/99532. At this point I
decided that I would post my answers for your amusement, and get back to
being productive.

Discrete math is so fun. And these newfangled chips are just destroying
the joy, by making floating point efficient and cheap enough that you
don't need to know little tricks like pi = (almost) 355/113.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com

John S
Guest
Posts: n/a

 05-01-2012, 11:21 PM
On 5/1/2012 6:16 PM, Tim Wescott wrote:
> Instead of doing productive work, I just spent a few enjoyable minutes
> with Scilab finding approximations to pi of the form m/n.
>
> Because I'm posting to a couple of nerd groups, I can be confident that
> most of you probably know 22/7 off the tops of your heads.
>
> What interested me is how spotty things are -- after 22/7, the error
> drops for a bit until you get down to 355/113 (which, if you're at an
> equal level of nerdiness to me will ring a bell, but not have been
> swimming around in your brain to be found).
>
> But what's _really_ interesting, is that the next better fit isn't found
> until you get up to 52163/16604. Then things get steadily better until
> you hit 104348/33215 -- at which point the next lowest ratio which
> improves anything is 208341/66317, then 312689/99532. At this point I
> decided that I would post my answers for your amusement, and get back to
> being productive.
>
> Discrete math is so fun. And these newfangled chips are just destroying
> the joy, by making floating point efficient and cheap enough that you
> don't need to know little tricks like pi = (almost) 355/113.
>

I like the idea that both 22 and 7 each fit into a byte whereas 355 does
not. And, 22/7 is hi by only .04%. Beautiful!

John S

Tim Wescott
Guest
Posts: n/a

 05-01-2012, 11:28 PM
On Tue, 01 May 2012 18:21:29 -0500, John S wrote:

> On 5/1/2012 6:16 PM, Tim Wescott wrote:
>> Instead of doing productive work, I just spent a few enjoyable minutes
>> with Scilab finding approximations to pi of the form m/n.
>>
>> Because I'm posting to a couple of nerd groups, I can be confident that
>> most of you probably know 22/7 off the tops of your heads.
>>
>> What interested me is how spotty things are -- after 22/7, the error
>> drops for a bit until you get down to 355/113 (which, if you're at an
>> equal level of nerdiness to me will ring a bell, but not have been
>> swimming around in your brain to be found).
>>
>> But what's _really_ interesting, is that the next better fit isn't
>> found until you get up to 52163/16604. Then things get steadily better
>> until you hit 104348/33215 -- at which point the next lowest ratio
>> which improves anything is 208341/66317, then 312689/99532. At this
>> point I decided that I would post my answers for your amusement, and
>> get back to being productive.
>>
>> Discrete math is so fun. And these newfangled chips are just
>> destroying the joy, by making floating point efficient and cheap enough
>> that you don't need to know little tricks like pi = (almost) 355/113.
>>
>>

> I like the idea that both 22 and 7 each fit into a byte whereas 355 does
> not. And, 22/7 is hi by only .04%. Beautiful!
>
> John S

245/78. It's only a bit better than twice as good as 22/7 -- then along
comes 355/113, which is over 1000 times better than 245/78.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com

Joel Koltner
Guest
Posts: n/a

 05-01-2012, 11:30 PM
Tim Wescott wrote:
> Discrete math is so fun. And these newfangled chips are just destroying
> the joy, by making floating point efficient and cheap enough that you
> don't need to know little tricks like pi = (almost) 355/113.

--> http://xkcd.com/1047/

:-)

Joel Koltner
Guest
Posts: n/a

 05-01-2012, 11:35 PM
John S wrote:
> I like the idea that both 22 and 7 each fit into a byte whereas 355 does
> not. And, 22/7 is hi by only .04%. Beautiful!

Jack Crenshaw's book, "Math Toolkit for Real-Time Programming"
(http://www.amazon.com/Math-Toolkit-R.../dp/B003WUYQVY)
spends a lot of time discussing how to make "good enough" approximations
of various, e.g., transcendental functions... and how to know when "good
enough" really is. It's quite handy for this sort of thing...

Steve Pope
Guest
Posts: n/a

 05-02-2012, 12:14 AM
Tim Wescott <(E-Mail Removed)> wrote:

>On Tue, 01 May 2012 18:21:29 -0500, John S wrote:

>> On 5/1/2012 6:16 PM, Tim Wescott wrote:
>>> Instead of doing productive work, I just spent a few enjoyable minutes
>>> with Scilab finding approximations to pi of the form m/n.
>>>
>>> Because I'm posting to a couple of nerd groups, I can be confident that
>>> most of you probably know 22/7 off the tops of your heads.
>>>
>>> What interested me is how spotty things are -- after 22/7, the error
>>> drops for a bit until you get down to 355/113 (which, if you're at an
>>> equal level of nerdiness to me will ring a bell, but not have been
>>> swimming around in your brain to be found).
>>>
>>> But what's _really_ interesting, is that the next better fit isn't
>>> found until you get up to 52163/16604. Then things get steadily better
>>> until you hit 104348/33215 -- at which point the next lowest ratio
>>> which improves anything is 208341/66317, then 312689/99532. At this
>>> point I decided that I would post my answers for your amusement, and
>>> get back to being productive.
>>>
>>> Discrete math is so fun. And these newfangled chips are just
>>> destroying the joy, by making floating point efficient and cheap enough
>>> that you don't need to know little tricks like pi = (almost) 355/113.
>>>
>>>

>> I like the idea that both 22 and 7 each fit into a byte whereas 355 does
>> not. And, 22/7 is hi by only .04%. Beautiful!
>>
>> John S

>
>245/78. It's only a bit better than twice as good as 22/7 -- then along
>comes 355/113, which is over 1000 times better than 245/78.

Suppose you do the same thing with the fine structure constant --
let me know what you discover.

Steve

John Larkin
Guest
Posts: n/a

 05-02-2012, 12:21 AM
On Tue, 01 May 2012 18:16:25 -0500, Tim Wescott <(E-Mail Removed)>
wrote:

>Instead of doing productive work, I just spent a few enjoyable minutes
>with Scilab finding approximations to pi of the form m/n.
>
>Because I'm posting to a couple of nerd groups, I can be confident that
>most of you probably know 22/7 off the tops of your heads.
>
>What interested me is how spotty things are -- after 22/7, the error
>drops for a bit until you get down to 355/113 (which, if you're at an
>equal level of nerdiness to me will ring a bell, but not have been
>swimming around in your brain to be found).
>
>But what's _really_ interesting, is that the next better fit isn't found
>until you get up to 52163/16604. Then things get steadily better until
>you hit 104348/33215 -- at which point the next lowest ratio which
>improves anything is 208341/66317, then 312689/99532. At this point I
>decided that I would post my answers for your amusement, and get back to
>being productive.
>
>Discrete math is so fun. And these newfangled chips are just destroying
>the joy, by making floating point efficient and cheap enough that you
>don't need to know little tricks like pi = (almost) 355/113.

I once knew pi to 100 places, but now I've forgotten everything past
19.

--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation

John Larkin
Guest
Posts: n/a

 05-02-2012, 12:26 AM
On Tue, 01 May 2012 18:16:25 -0500, Tim Wescott <(E-Mail Removed)>
wrote:

>Instead of doing productive work, I just spent a few enjoyable minutes
>with Scilab finding approximations to pi of the form m/n.
>
>Because I'm posting to a couple of nerd groups, I can be confident that
>most of you probably know 22/7 off the tops of your heads.
>
>What interested me is how spotty things are -- after 22/7, the error
>drops for a bit until you get down to 355/113 (which, if you're at an
>equal level of nerdiness to me will ring a bell, but not have been
>swimming around in your brain to be found).
>
>But what's _really_ interesting, is that the next better fit isn't found
>until you get up to 52163/16604. Then things get steadily better until
>you hit 104348/33215 -- at which point the next lowest ratio which
>improves anything is 208341/66317, then 312689/99532. At this point I
>decided that I would post my answers for your amusement, and get back to
>being productive.
>
>Discrete math is so fun. And these newfangled chips are just destroying
>the joy, by making floating point efficient and cheap enough that you
>don't need to know little tricks like pi = (almost) 355/113.

My old HP35 calculators have a key for pi. The newer ones hide it, a
tiny pastel shift key thing. So I just key in 3.14. Rob down the hall
uses 3.

We are increasingly using floats in embedded stuff. Our ARM LPC3250
has SIMD hardware FP operations.

--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation

John S
Guest
Posts: n/a

 05-02-2012, 12:35 AM
On 5/1/2012 6:28 PM, Tim Wescott wrote:
> On Tue, 01 May 2012 18:21:29 -0500, John S wrote:
>
>> On 5/1/2012 6:16 PM, Tim Wescott wrote:
>>> Instead of doing productive work, I just spent a few enjoyable minutes
>>> with Scilab finding approximations to pi of the form m/n.
>>>
>>> Because I'm posting to a couple of nerd groups, I can be confident that
>>> most of you probably know 22/7 off the tops of your heads.
>>>
>>> What interested me is how spotty things are -- after 22/7, the error
>>> drops for a bit until you get down to 355/113 (which, if you're at an
>>> equal level of nerdiness to me will ring a bell, but not have been
>>> swimming around in your brain to be found).
>>>
>>> But what's _really_ interesting, is that the next better fit isn't
>>> found until you get up to 52163/16604. Then things get steadily better
>>> until you hit 104348/33215 -- at which point the next lowest ratio
>>> which improves anything is 208341/66317, then 312689/99532. At this
>>> point I decided that I would post my answers for your amusement, and
>>> get back to being productive.
>>>
>>> Discrete math is so fun. And these newfangled chips are just
>>> destroying the joy, by making floating point efficient and cheap enough
>>> that you don't need to know little tricks like pi = (almost) 355/113.
>>>
>>>

>> I like the idea that both 22 and 7 each fit into a byte whereas 355 does
>> not. And, 22/7 is hi by only .04%. Beautiful!
>>
>> John S

>
> 245/78. It's only a bit better than twice as good as 22/7 -- then along
> comes 355/113, which is over 1000 times better than 245/78.
>

245/78 is more easily forgotten.

Les Cargill
Guest
Posts: n/a

 05-02-2012, 12:52 AM
John S wrote:
> On 5/1/2012 6:28 PM, Tim Wescott wrote:
>> On Tue, 01 May 2012 18:21:29 -0500, John S wrote:
>>
>>> On 5/1/2012 6:16 PM, Tim Wescott wrote:
>>>> Instead of doing productive work, I just spent a few enjoyable minutes
>>>> with Scilab finding approximations to pi of the form m/n.
>>>>
>>>> Because I'm posting to a couple of nerd groups, I can be confident that
>>>> most of you probably know 22/7 off the tops of your heads.
>>>>
>>>> What interested me is how spotty things are -- after 22/7, the error
>>>> drops for a bit until you get down to 355/113 (which, if you're at an
>>>> equal level of nerdiness to me will ring a bell, but not have been
>>>> swimming around in your brain to be found).
>>>>
>>>> But what's _really_ interesting, is that the next better fit isn't
>>>> found until you get up to 52163/16604. Then things get steadily better
>>>> until you hit 104348/33215 -- at which point the next lowest ratio
>>>> which improves anything is 208341/66317, then 312689/99532. At this
>>>> point I decided that I would post my answers for your amusement, and
>>>> get back to being productive.
>>>>
>>>> Discrete math is so fun. And these newfangled chips are just
>>>> destroying the joy, by making floating point efficient and cheap enough
>>>> that you don't need to know little tricks like pi = (almost) 355/113.
>>>>
>>>>
>>> I like the idea that both 22 and 7 each fit into a byte whereas 355 does
>>> not. And, 22/7 is hi by only .04%. Beautiful!
>>>
>>> John S

>>
>> 245/78. It's only a bit better than twice as good as 22/7 -- then along
>> comes 355/113, which is over 1000 times better than 245/78.
>>

>
> 245/78 is more easily forgotten.

but highly mnenomic - it's 2345678 with the 3 dropped and the 6 turned
into a divide sign...

--
Les Cargill

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Skybuck Flying Nvidia 7 01-20-2008 03:12 PM Griffin McKorn ATI 8 10-05-2004 07:22 PM Austin Abit 3 08-02-2003 03:19 PM AC Abit 1 07-07-2003 08:17 PM

All times are GMT. The time now is 12:53 PM.

Welcome!