So, I was watching this video on Willan's formula by Eric Rowland, and it was mentioned that this formula does not count for generating primes, as it is extremely hard and time consuming to compute. I was wondering why it would not be considered as valid? While it is time consuming to compute, I don't feel it's valid to not consider it an equation, as pure mathematics is often not restrained by our physical limitations. Just because a formula is hard for us to calculate does not really make it invalid I feel, as in a hypothetical world such as math, physical boundaries such as computation time does not make sense. While it is not the most efficient way to calculate, I still feel it gives the correct answer. I was also wondering if quantum computers could make the process faster, just like prime factorization.
-
5Is your question "Is the formula correct?" (yes) or "Why does YouTuber Eric Rowland not like it?" (impossible to speculate about) or "Is the formula useful?" (no) or something else? – Misha Lavrov Mar 31 '23 at 13:45
-
I always had doubts about the Shor algorithm , whether it would actually work , even if we had such a quantum computer. Whether such a computer could test for primality efficiently as well is another story. – Peter Aug 17 '23 at 18:47
-
@Peter I agree with you. – Tsar Asterov XVII Aug 19 '23 at 10:03
-
See also comments on this closely related question. $\ \ $ – Bill Dubuque Jul 05 '24 at 15:39
-
1Complaints about Willan's formula go back to essentially it's introduction in the literature...as do defenses of it. Compare Neill and Singer 1965 vs Goodstein and Wormell 1967. – Semiclassical Jul 05 '24 at 20:08
3 Answers
The formula is not incorrect. What we mean by saying it is invalid is that it is of no practical use since it is highly inefficient. To put it into perspective, consider this (I am not writing the entire formula so refer to it to understand what I mean)
A part of the formula uses Wilson's theorem which states that a number p greater than 1 is prime if and only if (p-1)!+1 is divisible by p. Now this is the only problem, the factorial. Factorials grow really fast. 10! is more than one million and 70! is more than one googol (which is 10^100) So even the fastest super computers we currently have can compute it till about the first 200 numbers, not at all impressive. As far as quantum computers are concerned, first of all it will be a long time till we can actually use them for any practical purpose because we have till now only created quantum computers with 300 qbits and we will need much more than that. Second although quantum computers are fast, they are not infinitely fast. You must have heard about them being able to break RSA encryption but we have created a different kind of encryption that even quantum computers can not break (watch Veritasium's latest video for more details on this). Hence even quantum computers may not give a very impressive result with this.
Hence this formula can not be used although it is correct.
Hope it helps
- 727
-
1So it is not incorrect, just extremely inefficient. As for Veritasium's video, I have watched it, and while I do agree new encryption methods have been found, I don't think this calculation is not as complex as the encryption system now, is it? And if quantum computers can prime factorize huge numbers, why can't it do this calculation? – Tsar Asterov XVII Mar 31 '23 at 14:59
-
Well I am not an expert in quantum computers all I mean to say is that they have their limitations. They are faster and more accurate than our current computers but their is a limit for them as well. So rather we must use them with more efficient formulas – Aarush Saharan Apr 01 '23 at 12:59
-
1
The deeper question to ask here is: what is a formula, after all? If you have a very strict definition of a formula, for instance that a formula is a polynomial $P(n)$ such that $P(n)$ is the $n$-th prime, then there is no formula for primes. On the other hand, if by "formula" you just mean any expression that gives you the $n$-th prime, then it's easy to come up with formula for computing primes: simply let $f(n)$ be the $n$-th natural number which only has two positive divisors. Then, $f(n)$ gives you the $n$-th prime.
Willans formula is not much more interesting than my formula. It's not like these formulae require significant number-theoretic results to be derived – they basically boil down to saying that the $n$-th prime is the $n$-th prime. Along with the fact that Willans formula is extremely computationally inefficient, this is why it is of little interest.
- 22,603
-
1I see, so it is not incorrect, just so inefficient it is not worth much interest? – Tsar Asterov XVII Mar 31 '23 at 14:57
-
1@Aster17: That's about right. In addition, the reason that the formula works is not very mathematically significant, and showing that the formula works does not prove anything of much significance either. There are primality tests that are of theoretical importance even though they are not useful in practice, such as the the AKS primality test. This test is significant from a pure mathematics perspective because it shows that we can determine whether a given integer is prime in polynomial time. – Joe Apr 01 '23 at 11:32
-
The AKS primality test does seem very interesting. Thank you for linking it to me! – Tsar Asterov XVII Apr 01 '23 at 13:03
-
@Aster17: No problem! Here is an analogy for why it is useful in theory, but not in practice. Imagine two different primality tests. The first one takes $10^{100}\times n^2$ seconds to determine whether a given integer $n$ is prime. The second one takes $n^3$ seconds. Now, in theory, if $n$ is large enough, the first one takes less time than the second one. However, this is only true when $n$ is astronomically large, and in practice we aren't interested in working out whether astronomically large integers are prime. – Joe Apr 01 '23 at 14:43
-
1This is basically what is happening in the case of the AKS primality test compared to other tests which are actually used in practice, except that the actual functions determining how long the tests take are different. But the idea is the same. There is a term for this phenomenon: the AKS primality test is a prime (haha) example of a galactic algorithm. – Joe Apr 01 '23 at 14:47
-
10^100 * n^2 would be the O number of the algorithm right? Same with n^2? The fact that you said the former would only be faster for astronomically large values, it is also the reason why some sorting algorithms are slower for small values, but extremely fast for larger values. And Galactic Algorithms are only viable for extremely large values, so like Radix on steroids? Would Wilson's formula be an example for a galactic algorithm? I don't think so, because the 2^n part is gonna make the calculations much longer right? – Tsar Asterov XVII Apr 01 '23 at 15:38
-
@Aster17: The function $10^{100}\times n^2$ is $O(10^{100}\times n^2)$; it is also $O(n^2)$; and it is also $O(n^3)$. The same is true for the function $n^2$. A formal definition of the big O notation is given on Wikipedia. I don't know what level of education you are studying at – this definition should make sense to most undergraduate students, but perhaps not a school student. – Joe Apr 01 '23 at 18:45
-
When using big O notation, we tend to use the "sharpest" asymptotic upper bound for the function in question, so although it is technically true that $10^{100}\times n^2$ is $O(n^3)$, this statement is at odds with how people use the notation in practice. – Joe Apr 01 '23 at 18:46
-
@Aster17: There is no formal definition of a galactic algorithm, but it is an algorithm which is $O\bigl(f(n)\bigr)$, where $f(n)$ is a function "which grows relatively slowly", but it only outperforms other algorithms for "ridiculously large" values of $n$. This could happen, for instance, if the running time of the algorithm was $10^{1000000}\times f(n)$, which belongs to the class $O\bigl(f(n)\bigr)$. The large constants which render such an algorithm impractical in real life are "hidden" by the big O notation. – Joe Apr 01 '23 at 18:49
-
@Aster17: Finally, Willans formula is not a galactic algorithm, since it is ridiculously slow for all values of $n$, even astronomical values :-) I think the main reasons for this are given on Wikipedia, but to be honest I don't think anyone has seriously considered the possibility of using it to compute primes for practical applications. Even though the formula is a curiosity, it definitely belongs within the realm of recreational mathematics. – Joe Apr 01 '23 at 18:55
-
Perfectly understandable, and thank you for all this information! It's people like you that make this website so friendly for beginners like me. – Tsar Asterov XVII Apr 02 '23 at 10:29
-
@Aster17: Thank you for your kind words. I am very happy to be of assistance. If you do have any more questions, then please let me know. – Joe Apr 02 '23 at 15:31
-
I'm good for now, haha, but, when I probably have more of my usual curiosities in math, I hope people like you come to help me become smarter in the vast realms of mathematics. This website would not be possible without people like you : ) – Tsar Asterov XVII Apr 03 '23 at 08:28
-
AKS is rarely used for a primality test. "Polynomial" des not mean "efficient" , this test is only of theoretical interest since it proves that primality testing is in $P$ , but there are far better tests in practice. – Peter Aug 17 '23 at 18:44
In the beginning of this construction we ask if $(j-1)!+1$ is divisible by $j$. This can be the source of problems. The first is the obvious computational: $(j-1)!$ grows super-exponentially and it will take a huge amount of resources to calculate it. The second is conceptual: The question of a number being prime is a question on divisibility and we are answering that by another question on divisibility! A much harder problem given the size of those numbers! It's like if we have a function $f(n)$, we know f(1) and in order to find $f(n)$ we have to rely on the function value for larger arguments like $f(n!)$. That doesn't get us anywhere.
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review – Leucippus Oct 19 '24 at 22:17