|
|
last edited 16 years ago by gdr |
1 2 3 4 5 | ||
Editor:
Time: 2007/11/17 22:27:13 GMT-8 |
||
Note: merging two pages |
changed: - Summary: As first reported by anonymous, factoring 12399! produces a composite number as a prime factor. Subsequently, experimenting with different versions of Axiom exhibits some "small" composite integers that the factor programs in several open source versions tested are unable to factor and yet the programs prime? give correct answers. Two example numbers are: \begin{axiom} factor 119643463 prime? 119643463 factor 129864979 prime? 129864979 \end{axiom} <br> For the record, 119643463 = (10111)(11833) and 1129864979 = (11027)(11777). The algorithms for identifying a composite integer and its factors are probabilistic. The algorithms implemented in Axiom are in the packages PRIMES and INTFACT (see intfact.spad) where the possibility of failure (that is, identifying a number as prime when it is composite) is acknowledged. In the case of primality test, the probabilities of error are given. The program 'prime?' is guaranteed to be correct for integers less than 341550071728321 with an error probability less than 4^(-10) or approximately 1 in a million. The program 'factor' does not include failure probabilities, but failure frequency is apparently much higher and failure can happen for even much smaller numbers. Please be aware that due to the randomness of the algorithms, the "live" computation may result in outputs different from those observed by the original authors. Thanks to Bill Page for fixing the display problems, which is apparently due to use of LaTeX tags involving 'verbatim'. Using html tags involving 'pre' without embedded blank lines also seem to work. \begin{axiom} )set output tex off )set output algebra on )set message autoload off \end{axiom} <hr> I type \begin{axiom} factor factorial 12399 -- or 12345 or .... \end{axiom} Sometimes I get a perhaps right result sometimes I get a wrong result. This time the last factor I get is $124028873 = 10399 \times 11927$. The other factors seem right. From wyscc Sun Dec 17 12:11:40 -0600 2006 From: wyscc Date: Sun, 17 Dec 2006 12:11:40 -0600 Subject: Windows version seems correct. Message-ID: <20061217121140-0600@wiki.axiom-developer.org> <br> The following is a (shortened) transcript: <pre> AXIOM Computer Algebra System Version of Tuesday November 30, 2004 at 21:11:14 ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- (2) -> factor factorial 12399 12391 6196 3095 2065 1238 1031 773 687 563 441 411 344 309 294 2 3 5 7 11 13 17 19 23 29 31 37 41 43 * [...] * 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 * 12329 12343 12347 12373 12377 12379 12391 Type: Factored Integer </pre> But in the Linux version (patch 50; September 2006), the last factor was $119970353 = 10253 \times 11701$ (and both primes were missing from the list, which according to the Windows version has 1479 distinct prime factors). In the Linux version (Axiom 3.9, September 2005), the last factor was $123643253 = 10243 \times 12071$. In the Linux version (Axiom 3.0 Beta, February 2005), there were TWO incomplete factors: 119643463, 129864979 (both were not factorable using 'factor' in this version (that is at least consistent!) AND the Windows version (this is inconsistent), whereas $119643463 = 10111 \times 11833$ and $129864979 = 11027 \times 11777$ (these primes were listed in the Windows version for factor factorial 12399). More inconsistencies: prime? reports both of these as 'false' (correct answer). So it appears that the factorization program and the primality check program are independent. \begin{axiom} factor 119643463 prime? 119643463 factor 129864979 prime? 129864979 \end{axiom} In the Linux version (October 25, 2004), the last factor was $117661597 = 10651 \times 11047$. This version displays many more messages about loading domains. Linux versions were run on the same machine under same OS (Fedora 2). Windows version (November 30, 2004)was run on a different machine. <br> <hr>On 17 Dec 2006 23:04:44 +0100 Francois Maltey <fmaltey@nerim.fr> wrote: >I use my own compiled axiom without change for integer >and so. >I have a random reponse : > >petoncle:~/Axiom$ axiom -noht > AXIOM Computer Algebra System > Version: Axiom (September 2006) > Timestamp: Saturday October 28, 2006 at 12:18:07 >----------------------------------------------------------------------- > >I test : > >[#factors (117661597+0*i) for i in 1..1000] -- there >are 1 and 2 factors >reduce (+, [#factors (117661597+0*i) for i in 1..1000]) > -- around 1650 > >The exact solution is 2000 of course. <hr>On 17 Dec 2006 19:04:44 -0500 William Sit <wyscc@sci.ccny.cuny.edu> wrote: I confirmed that Francois' example does give random results in the 1660 area. This suggests that the integer factoring algorithm used involves random number generators and that the program in this case only has a probability of 0.83 success rate in identifying a composite number. The case for 119643463 is worse: \begin{axiom} reduce (+, [#factors (119643463+0*i) for i in 1..1000]) reduce (+, [#factors (119643463+0*i) for i in 1..1000]) \end{axiom} and only slightly better for 129864979. This is unacceptable. However, the documentation in both the implementation of factor and prime? (see intfact.spad, see PRIMES and INTFACT packages) already acknowledged these possibilities. From WilliamSit Sun Dec 17 15:31:59 -0600 2006 From: William Sit Date: Sun, 17 Dec 2006 15:31:59 -0600 Subject: (new) Re: [#329 fuzzy error in factor.] Windows version seems correct. Message-ID: <web-9549274@cgate.sci.ccny.cuny.edu> In-Reply-To: <200612180820.kBI8Kulu018042@localhost.localdomain> On Mon, 18 Dec 2006 03:20:56 -0500 root <root@axiom-developer.org> wrote: >Bill, > >I tried this on the May 18, 2005 and December 14, 2006 >versions. >The December version is the current "gold", arch version >50. >I can't seem to reproduce the error. > >Curious about the factor factorial 12399.... > >If I do > >a:= factorial 12399 >b:= factor a >c:= a - expand b > >I get c = 0 > >Tim All that says is that the factorization produces factors (NOT prime factors) that multiplied back to give the original number. What is needed are PRIME factors. You have to actually look at the last few factors returned in Factored Integer; any thing larger than 12399 in that list must be a composite and not a prime factor and hence an error. Too bad Wiki right now is not displaying the entire result, but your Axiom should display it. William
Summary:
As first reported by anonymous, factoring 12399! produces a composite number as a prime factor. Subsequently, experimenting with different versions of Axiom exhibits some "small" composite integers that the factor programs in several open source versions tested are unable to factor and yet the programs prime? give correct answers. Two example numbers are:
factor 119643463
![]() | (1) |
prime? 119643463
![]() | (2) |
factor 129864979
![]() | (3) |
prime? 129864979
![]() | (4) |
For the record, 119643463 = (10111)(11833) and 1129864979 = (11027)(11777).
The algorithms for identifying a composite integer and its factors are probabilistic. The algorithms implemented in Axiom are in the packages PRIMES and INTFACT (see intfact.spad) where the possibility of failure (that is, identifying a number as prime when it is composite) is acknowledged. In the case of primality test, the probabilities of error are given. The program prime?
is guaranteed to be correct for integers less than 341550071728321 with an error probability less than 4^(-10) or approximately 1 in a million. The program factor
does not include failure probabilities, but failure frequency is apparently much higher and failure can happen for even much smaller numbers.
Please be aware that due to the randomness of the algorithms, the "live" computation may result in outputs different from those observed by the original authors.
Thanks to Bill Page for fixing the display problems, which is apparently due to use of LaTeX? tags involving verbatim
. Using html tags involving pre
without embedded blank lines also seem to work.
)set output tex off
)set output algebra on
)set message autoload off
I type
factor factorial 12399
Sometimes I get a perhaps right result sometimes I get a wrong result.
This time the last factor I get is .
The other factors seem right.
AXIOM Computer Algebra System Version of Tuesday November 30, 2004 at 21:11:14 ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- (2) -> factor factorial 12399 12391 6196 3095 2065 1238 1031 773 687 563 441 411 344 309 294 2 3 5 7 11 13 17 19 23 29 31 37 41 43 * [...] 12227 12239 12241 12251 12253 12263 12269 12277 12281 12289 12301 12323 12329 12343 12347 12373 12377 12379 12391 Type: Factored Integer
But in the Linux version (patch 50; September 2006), the last factor was
(and both primes were missing from the list, which according to the Windows version has 1479 distinct prime factors).
In the Linux version (Axiom 3.9, September 2005), the last factor was .
In the Linux version (Axiom 3.0 Beta, February 2005), there were TWO incomplete factors: 119643463, 129864979 (both were not factorable using
factor
in this version (that is at least consistent!) AND the Windows version (this is inconsistent), whereas and
(these primes were listed in the Windows version for factor factorial 12399). More inconsistencies: prime? reports both of these as
false
(correct answer). So it appears that the factorization program and the primality check program are independent.
factor 119643463
(6) 10111 11833
prime? 119643463
(7) false
factor 129864979
(8) 11027 11777
prime? 129864979
(9) false
In the Linux version (October 25, 2004), the last factor was . This version displays many more messages about loading domains.
Linux versions were run on the same machine under same OS (Fedora 2). Windows version (November 30, 2004)was run on a different machine.
I use my own compiled axiom without change for integer and so. I have a random reponse :petoncle:~/Axiom$ axiom -noht AXIOM Computer Algebra System Version: Axiom (September 2006) Timestamp: Saturday October 28, 2006 at 12:18:07 -----------------------------------------------------------------------
I test :
- [#factors (117661597+0*i) for i in 1..1000]?
- there are 1 and 2 factors reduce (+, [#factors (117661597+0*i) for i in 1..1000]?) -- around 1650
The exact solution is 2000 of course.
I confirmed that Francois' example does give random results in the 1660 area. This suggests that the integer factoring algorithm used involves random number generators and that the program in this case only has a probability of 0.83 success rate in identifying a composite number. The case for 119643463 is worse:
reduce (+, [#factors (119643463+0*i) for i in 1..1000])
(10) 2000
reduce (+, [#factors (119643463+0*i) for i in 1..1000])
(11) 2000
and only slightly better for 129864979. This is unacceptable. However, the documentation in both the implementation of factor and prime? (see intfact.spad, see PRIMES and INTFACT packages) already acknowledged these possibilities.
Bill,I tried this on the May 18, 2005 and December 14, 2006 versions. The December version is the current "gold", arch version 50. I can't seem to reproduce the error.
Curious about the factor factorial 12399....
If I do
a:= factorial 12399 b:= factor a c:= a - expand b
I get c = 0
Tim
All that says is that the factorization produces factors (NOT prime factors) that multiplied back to give the original number. What is needed are PRIME factors. You have to actually look at the last few factors returned in Factored Integer; any thing larger than 12399 in that list must be a composite and not a prime factor and hence an error.
Too bad Wiki right now is not displaying the entire result, but your Axiom should display it.
William