DSPRelated.com
Forums

Pi approximation games

Started by Tim Wescott May 1, 2012
Uwe Hercksen wrote:

> > > David Brown schrieb: > >> <http://en.wikipedia.org/wiki/Lazy_evaluation> >> >> The most relevant section, "working with infinite data structures", is >> missing - but I hope you get the point anyway. > > Hello, > > even with infinite data structures, with finite time and finite RAM, it > is not possible to compute all digits of pi.
That's where David Brown blew it -- when he wrote "it didn't bother calculating the entries until you tried to print them out". Without that, you can fall back on the idea that logical truths exist a priori, and argue that what's impossible is to *print* all digits of pi. There's an argument about LISP that goes: it's easy to write a LISP interpreter in LISP such that the source code can be printed on a sheet of paper; it's also easy to quine that source code so that it's applied to itself; then you have a LISP interpreter executing on a sheet of paper. I/O bandwidth is the only problem. Maybe with e-paper .. Mel.
> > Bye
"George Herold" <gherold@teachspin.com> wrote in message 
news:b406f594-a809-4b4e-9adf-056e7c8bc53f@m7g2000vbg.googlegroups.com...
On May 1, 8:26 pm, John Larkin <jlar...@highlandtechnology.com> wrote:
> On Tue, 01 May 2012 18:16:25 -0500, Tim Wescott <t...@seemywebsite.com> > 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.
Grin... I always just let 2*pi = 10, so pi = 5! (and then remember there's a 1.59 floating around) George H. ________________________________________ 1 + 1 = 3 for extremely large values of 1!
On Wed, 02 May 2012 06:23:45 +0100, John Devereux <john@devereux.me.uk> wrote:

>John S <Sophi.2@invalid.org> writes: > >> 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! > >We had a teacher that insisted it was exactly equal!
Shoulda been a congressman.
David Brown wrote:
> On 02/05/2012 11:21, Nico Coesel wrote: >> spope33@speedymail.org (Steve Pope) wrote: >> >>> John Devereux<john@devereux.me.uk> wrote: >>> >>>> John S<Sophi.2@invalid.org> writes: >>> >>>>> 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! >>>> >>>> We had a teacher that insisted it was exactly equal! >>> >>> I recall the time when you couldn't consider 25.4 mm to be exactly >>> one inch. But, they fudged enough standards so that it is now exact. >>> >>> Prior to that, neither the British inch nor the American inch >>> measures 25.4 ... and they deviated from that value in opposite >>> direction! >> >> So you are saying the inch is in fact metric? >> > > Most imperial units are defined in terms of the metric units these days. > Originally they were only rough definitions (I believe an inch was > variously defined as the length from a thumb joint to the end of the > thumb, or alternatively as the length of three grains of barley). Then > they were a bit more standardised (such as the length of a particular > metal rod). But now they use specific metric definitions - so an inch > is precisely 25.4 mm - and will stay that way even if the definition of > a millimetre varies! >
meter (m) "The metre is the length of the path traveled by light in vacuum during a time interval of 1/299 792 458 of a second." kilogram (kg) "The kilogram is equal to the mass of the international prototype of the kilogram." second (s) "The second is the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom." Note that the kilogram is now the only one defined by a physical object. ("International prototype"). Let's define pi as in Euler's identity: e^i*pi + 1 = 0 -- Virg Wall
On Wednesday, May 2, 2012 11:50:36 AM UTC-4, mwi...@the-wire.com wrote:
> Uwe Hercksen wrote: >=20 > >=20 > >=20 > > David Brown schrieb: > >=20 > >> <http://en.wikipedia.org/wiki/Lazy_evaluation> > >>=20 > >> The most relevant section, "working with infinite data structures", is > >> missing - but I hope you get the point anyway. > >=20 > > Hello, > >=20 > > even with infinite data structures, with finite time and finite RAM, it > > is not possible to compute all digits of pi. >=20 > That's where David Brown blew it -- when he wrote "it didn't bother=20 > calculating the entries until you tried to print them out". Without that=
,=20
> you can fall back on the idea that logical truths exist a priori, and arg=
ue=20
> that what's impossible is to *print* all digits of pi. >=20 > There's an argument about LISP that goes: it's easy to write a LISP=20 > interpreter in LISP such that the source code can be printed on a sheet o=
f=20
> paper; it's also easy to quine that source code so that it's applied to=
=20
> itself; then you have a LISP interpreter executing on a sheet of paper. =
I/O=20
> bandwidth is the only problem. Maybe with e-paper .. >=20 > Mel. > >=20 > > Bye
An easy way to print all digits of pi is to simply use base pi. Sure it is = self referential like the lisp example. How about asking for practical ways= to write all digits of pi in a common base such as base 10. The Borwein fo= rmula is a spigot formula for pi in base 16 although getting all digits wil= l take a long long time. Clay
Nico Coesel wrote:
> spope33@speedymail.org (Steve Pope) wrote: > >> John Devereux <john@devereux.me.uk> wrote: >> >>> John S <Sophi.2@invalid.org> writes: >>>> 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! >>> We had a teacher that insisted it was exactly equal! >> I recall the time when you couldn't consider 25.4 mm to be exactly >> one inch. But, they fudged enough standards so that it is now exact. >> >> Prior to that, neither the British inch nor the American inch >> measures 25.4 ... and they deviated from that value in opposite >> direction! > > So you are saying the inch is in fact metric? >
See: http://www.unc.edu/~rowlett/units/index.html "Meanwhile, only a few Americans know that the legal definitions of the English customary units are actually based on metric units. The U. S. and British governments have agreed that a yard equals exactly 0.9144 meter and an avoirdupois pound equals exactly 0.453 592 37 kilograms. In this way, all the units of measurement Americans use every day are based on the standards of the metric system. Since 1875, in fact, the United States has subscribed to the International System of Weights and Measures, the official version of the metric system." -- Virg Wall, P.E.
Nico Coesel <nico@puntnl.niks> wrote:

>spope33@speedymail.org (Steve Pope) wrote: > >>John Devereux <john@devereux.me.uk> wrote: >> >>>John S <Sophi.2@invalid.org> writes: >> >>>> 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! >>> >>>We had a teacher that insisted it was exactly equal! >> >>I recall the time when you couldn't consider 25.4 mm to be exactly >>one inch. But, they fudged enough standards so that it is now exact. >> >>Prior to that, neither the British inch nor the American inch >>measures 25.4 ... and they deviated from that value in opposite >>direction! > >So you are saying the inch is in fact metric?
Yes, that would be one way of saying it. Inches are now defined in terms of SI units, which have replaced "metric". Steve
"Tim Wescott" <tim@seemywebsite.com> wrote in message 
news:_f2dnZ4A5_JU8z3SnZ2dnUVZ_uwAAAAA@web-ster.com...
> 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
Yes total nerd :)
On May 2, 1:44=A0am, John Devereux <j...@devereux.me.uk> wrote:
> spop...@speedymail.org (Steve Pope) writes: > > John Devereux =A0<j...@devereux.me.uk> wrote: > > >>John S <Soph...@invalid.org> writes: > > >>> 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! > > >>We had a teacher that insisted it was exactly equal! > > > I recall the time when you couldn't consider 25.4 mm to be exactly > > one inch. =A0But, they fudged enough standards so that it is now exact. > > Aha, good idea, we should standardize pi to a more convenient value! :) >
But who want to use your PY to calculate the circle circumference, with given diameter ???
In comp.dsp VWWall <vwall@large.invalid> wrote:

(snip)

> kilogram (kg)
> "The kilogram is equal to the mass of the international > prototype of the kilogram."
There are at least two projects to redefine the kilogram, such that it isn't dependent on a physical object. One involves a more accurate determination of Avogadro's number. -- glen