Hi, I tried mario's code. Now it solves the equation for almost all the values of A and B. Thank you very much mario for the help given.
But I found two bugs. One was, descent (4, -7) returned (None, None, None) instead of the correct solution (1, 0, 2). (signs of the values in the solution tuple does not matter). I corrected this and the code is attached herewith. Another bug was that descent(234, -65601) also returned (None, None, None) but it has a solution (17, 1, 45). I am currently trying to fix this. Original algorithm presented in the book contained few errors. Credit should go to mario for fixing them. Regards, Thilina On Tue, Jul 16, 2013 at 11:13 PM, Thilina Rathnayake <[email protected] > wrote: > Thank you very much mario for the trouble taken. I'll let you guys know > whether > this fix works. > > > > On Tue, Jul 16, 2013 at 7:43 PM, Ondřej Čertík <[email protected]>wrote: > >> Thanks Mario! >> >> Thilina, let us know if that works. I apologize I didn't have time >> yesterday. >> >> Ondrej >> >> On Tue, Jul 16, 2013 at 5:38 AM, mario <[email protected]> wrote: >> > In the attached file there is my attempt; it seems to work; it seems to >> me >> > that there is a bug >> > in the code in the book; in line 4 it should be >> > ``Find r in [0,..., ceiling(abs(B)/2] such that r**2 == A mod B`` >> > >> > >> > >> > >> > On Tuesday, July 16, 2013 2:13:32 AM UTC+2, Thilina Rathnayake wrote: >> >> >> >> Hi Ondrej, >> >> >> >> Here is my attempt to debug: >> >> http://nbviewer.ipython.org/94ee433a4dca26e3fee1 >> >> >> >> Regards, >> >> Thilina. >> >> >> >> >> >> >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "sympy" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected]. >> > To post to this group, send email to [email protected]. >> > Visit this group at http://groups.google.com/group/sympy. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/sympy. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
descent.py
Description: Binary data
