cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

PELL_151_a

TomGutman
1-Newbie

PELL_151_a

Don't keep starting new threads. As long as you are still discussing the Pell equation, just respond to a message in the original thread.

The solution to the Pell equation. Note that, as previously mentioned, you need the symbolic processor for high precision arithmetic.
__________________
� � � � Tom Gutman
10 REPLIES 10

On 8/29/2009 6:14:13 PM, lvl107 wrote:
>Hi everyone. My background:
>high school. My language:
>Vietnamese. I am new Mathcad
>user. I was interested in
>solving Pell equation. Please
>help me solving x^2 - 151*y^2
>= 1. I have often got errors
>in Mathcad programming. Please
>check the root: (1728148040 ;
>140634693) and give your
>comment. Thanks again.
_______________________________

Please stop changing thread. If a Mathcad chevron has read your first "Pell", he will not see any of your other ones. Next time, "Save as" as low as Mathcad 8, even an additional as low as Mathcad 6.

Your background is immaterial for this new problem.

The two numbers are the convergent of the SQRT(151), as demonstrated. The Pentium will not give the required accuracy and neither the Mathcad floating point. That ratio goes in a fixed arithmetic machine [just guessing]. I can't help more really because of the lack of interest. Who wants > 15 figures that the Pentium can't render ? To view those numbers, at 15 true decimals a measured distance of 1000000 km the error would be 1mm.

When you get > 20 figures from the symbolic, it is because there is a continued fraction that the Mathcad "Big Number" can crunch. When you get only 20 figures, that is because the Mathcad symbolic explodes the Pentium floating point. Only 17, 18 are considered possibly true, thus the Pentium convention to limit to 15 figures considering the error propagation. Your numbers are in the range above the Pentium, as it looks.

BTW, those numbers, they didn't drop with the last rain, did they ? The source from where they come from should also indicate the linear relationship to other SQRT than the SQRT2, your answer is right there. Even with the source in hand, my answer is that I have no answer because not knowing the linear relationship to other SQRT than SQRT2, and also limited by the Pentium. Again, send an e-mail to either or both Neil Sloane or Simon Plouffe. A bit of why you are asking this solution with such a degree of accuracy would make the readers more willing to devote some time and research. Another point is that I have no knowledge if there would be a software capable from the Pentium to emulate a big blue. In fact there may still be one ... visiting the "Martindale". Years ago, Boris had the emulator and offered me such services for free right from my equations, taking some time to calculate.

jmG


lvl107
20-Turquoise
(To:ptc-1368288)

Hi. My English is vevy little. I just have a file attachment for my meaning. I only have Mathcad 12. Thanks.

It's not generally good practice to delete messages that have been replied to. It results in thread fragments, with messages that make little sense without their context.

MC12 was a particularly poor and buggy version. Here is a version of the MC14 sheet previously posted mucked up so as to work, more or less, in MC12. As you can see MC12 has a problem evaluating the floor function for the last convergent (MC14 has no problem there). This can be worked around by using the float keyword.

The accumulation, and return, of the set of convergents (in r) is not really necessary, it was added in an attempt to diagnose the MC12 problems. MC12 also does not support symbolic evaluation of parallel local assignment. Makes for some kludgy looking code.
__________________
� � � � Tom Gutman

I don't understand your work and you don't refer to source for collabs to understand +. The num2str ... what is that part supposed to do ? I have removed it yellow. Now your program provides the first convergent of SQRT(N). I don't like your 'D', just like that ! Your program fails for all exact SQRT(N), a condition is missing for recuperating 'a' . Whatever, your first < N is incorrect. You must ALWAYS complete the condition to avoid undetectable failure, undetectable otherwise. The program works for decimal N.XXXX. Now, for the next convergent(s), you have to complete the program for the suite of the convergents ... see KNUTH 398.37.

The program or the use of it for computing SQRT(N) is risky to be very inefficient vs the actual implementation in the Pentium (which I don't know exactly) or the Cyrix years ago where SQRT(N) was like they said "hard wired", obviously chip style. Why num2str ? Can you make make it work otherwise, because it is a very incoherent end. What I don't understand at all is why you plug 15 true decimal SQRT(N) in the program and you return less. That will be OK if you could return convergents of very high accuracy, say 40 ... but the Pentium will render on only 15 ! or 20/18 floating point as explained in an earlier reply. Your project is like a dog chasing his tail. Maybe you should put some words and don't worry, plenty of collabs will turn the pancake over to read english.

jmG
lvl107
20-Turquoise
(To:ptc-1368288)

...
'if statement was corrected.'...

On 9/4/2009 1:35:47 AM, lvl107 wrote:
> ...
>'if statement was
>corrected.'...
_______________________

OK, and does that solves your problem ?

jmG



What's going on ?

You had no work sheet and now you have ???
Delay in the transmission, a very rare case.

jmG

What is the use of such inaccurate approximation SQRT(N<151) ? As the first convergent OK, but if you can't create more accurate convergents = no use. In binary computing machinery, lot of things are approximate modulo, particularly SQRT(N). Other functions are modulo their original design range. So, up until now, all that Pell does nothing modulo.



For number <<< 1, there is another modulo. The example above is built-in into the Pentium, very fast vs anything else that requires + AOPs [ArithmeticOperations], SQRT(2, 3, 5, 10) are built-in constants for the respective modulo SQRT and all that goes by the Power search three ... one of many seminumerical algorithms [Knuth].

jmG

It seems your program collects the last convergent of the SQRT(N). As a CF [Continued fraction] exercise, fine. But to be of any use: totally useless, unless it would apply to some unknown physical applications. To be complete and visual, the err(N) plot is added for the general interest.

Comments:

1. the perfect square error message is missing
2. your last line of programme is redundant (deleted).
3. that stuff seems to go past 151, as demonstrated.
4. past 150, some numbers appear "not a machine number",
i.e: can't be computed [calculated]
That may be the all trick about the puzzle.

jmG
Announcements

Top Tags