PDQ Algorithm: Infinite precision best fraction within tolerance
02-24-2019, 08:36 PM
Post: #20
 smartin Member Posts: 63 Joined: Jan 2017
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(12-13-2013 05:09 AM)Joe Horn Wrote:  PDQ Algorithm for HP Prime, by Joe Horn

Example #1: What is the best fraction that's equal to $$\pi\pm\dfrac{1}{800}$$? Answer: $$\dfrac{179}{57}$$, which is the same answer as given by Patrice's FareyDelta program. This is a difficult problem, because $$\dfrac{179}{57}$$ is not a principal convergent of pi.

Example #2: What is the best fraction that's equal to $$\pi\pm\dfrac{1}{10^{14}}$$? Patrice's FareyDelta program can't handle that problem, because it is limited by the 12-digit accuracy of Home math. PDQ gets the right answer, though: $$\dfrac{58466453}{18610450}$$.

Example #3: What is the best fraction for $$\pi\pm\dfrac{13131}{10^{440}}$$? PDQ returns the correct ratio of two huge integers (221 digits over 220 digits) in less than one second. (It takes the HP 50g over two minutes using System RPL). This is an extreme case, since the numbers are so huge, and once again the answer is not one of pi's principal convergents. Piece of cake for Prime+PDQ, which yields the unique correct answer:
$$\frac{197589170636854062408454380413327813798855733721902369198118555167226743​04730662906703593620215835931889230827416036013979330716090096564056017111952129​356153172850632330284830147063755110178945173800035059898203820427519}{628945864​16566610363809944329675177193853240546238323897010336439848926113959966464032961​05227342931817856832425836690143454522392566443183092738965162183777760340854050​065970057153850182984658932709234874407013579584688}$$

Finally inspired to try out PDQ on the Prime, but I could not get all the examples to work out. I'm using PDQ from hpcalc.org (https://www.hpcalc.org/details/7477) on a Prime with CAS ver 1.4.9 and ROM 2.1.14181.

but,
Example #2: pdq($$\pi$$,14) = $$\dfrac{111513555}{35495867}$$

Example #3: pdq($$\pi,\dfrac{13131}{10^{440}}$$) = $$\dfrac{27633741218861}{8796093022208}$$

As with trying any new program my first thought is operator error (or some setting on the Prime).

Another related question:
For example #3, even though it appears that the return fraction accurately represents pi to about 436 decimal places, is it true that one is not actually getting pi to that accuracy, just a lot of zeros after the precision of pi within the Prime is reached (12 digits)?

Thanks,
Steve
 « Next Oldest | Next Newest »

 Messages In This Thread PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 12-13-2013, 05:09 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Thomas_Sch - 02-16-2014, 02:01 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Han - 02-16-2014, 02:32 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - patrice - 03-26-2014, 10:10 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 03-28-2014, 10:47 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 05-28-2014, 05:37 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - dbbotkin - 10-08-2014, 12:56 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 12-06-2014, 05:35 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - patrice - 12-06-2014, 10:47 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 12-06-2014, 02:38 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - patrice - 12-06-2014, 05:06 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 12-07-2014, 04:30 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - patrice - 12-07-2014, 08:51 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 12-08-2014, 12:10 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - pier4r - 03-15-2018, 03:20 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Luigi Vampa - 03-15-2018, 08:50 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 03-16-2018, 02:41 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - pier4r - 03-28-2018, 06:57 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - smartin - 02-24-2019 08:36 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - cdmackay - 02-24-2019, 10:29 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 02-25-2019, 11:10 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - cdmackay - 02-25-2019, 05:56 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 02-26-2019, 03:17 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - cdmackay - 02-26-2019, 03:45 PM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - cdmackay - 01-26-2020, 12:32 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - Joe Horn - 01-26-2020, 02:41 AM RE: PDQ Algorithm: Infinite precision best fraction within tolerance - cdmackay - 01-26-2020, 08:34 PM

User(s) browsing this thread: 1 Guest(s)