mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Reply
 
Thread Tools
Old 2013-06-21, 11:08   #12
Mr. P-1
 
Mr. P-1's Avatar
 
Jun 2003

7×167 Posts
Default

Quote:
Originally Posted by LaurV View Post
That method you describe is far too inefficient. LL test is a more efficient method. Comparing the "school method" you describe, with LL test, is even worse then comparing a snail with a supersonic airplane. We are talking about the same speed proportion, except that in the case of LL versus "school method", you have to add few thousand zeroes at the end of the speed number, in the favor of LL tests...
Several million more like.

Note to the original author: We are not saying that an LL test is several million times faster than trial division as a method of primality testing. That would be adding just 6-7 zeros at the end of the speed number.

If it was several billion times faster, that would be adding 9-10 zeros. Several trillion times faster would add 12-13 zeros.

Instead of using a single computer, we could distribute the task across many. Suppose every atom in the universe is a computer. Some estimates put that number at about 1080 That would add about 80 zeros to the speed factor.

The LL test is much faster than that. Words cannot express how much faster adding several million zeros to the speed number is. The human mind cannot picture it.

Now turn that around. If an LL test takes three weeks, think how long it would take to prove our numbers prime using TF alone.

Last fiddled with by Mr. P-1 on 2013-06-21 at 11:10
Mr. P-1 is offline   Reply With Quote
Old 2013-06-21, 11:22   #13
Mr. P-1
 
Mr. P-1's Avatar
 
Jun 2003

7·167 Posts
Default

Quote:
Originally Posted by LaurV View Post
The only work type which is affected by the memory amount is the "stage 2 of P-1/ECM", which you don't normally do if you do "first tests" or "world records", etc.
Acually there is quite a high chance that a newly assigned first time test will need P-1 pretesting.

Quote:
Even for that, not the speed is affected, but the chance to find a factor (i.e. more memory increases the chance).
I don't think that's correct, even in practice.

What actually happens is, unless the client has sufficient memory to make using the Brent-Suyama extension worthwhile (multi-gigabytes on numbers in the current test range), more memory increases the speed at which the client is able to complete stage 2 to particular limits. However, the client takes this into account when computing those limits, preferring to increase the limits (thereby increasing the chance of finding a factor) in exchange for spending more time, when the memory allocation is generous.

I could so happen, I suppose, that the effect of this is to exactly cancel out the time saving, but I don't think it does, and I can think of no reason why it should.
Mr. P-1 is offline   Reply With Quote
Old 2013-06-21, 12:02   #14
Mr. P-1
 
Mr. P-1's Avatar
 
Jun 2003

7×167 Posts
Default

Quote:
Originally Posted by Unregistered View Post
Ah, I see. But I don't understand it. If a number is a composite, then you find that out be finding the smallest divisor.
Actually it is the other way around. If we find a factor (it doesn't matter whether or not it is the smallest), then the number is composite.

If we don't find a factor, then we need to use another method to determine whether the number is prime or composite. That method is the LL test.

Quote:
If it's a prime, you have to test all the possible divisors? Or is the LL-algorithm different from this?
Totally different.

The LL algorithm itself is quite simple:

1. Start with the number 4.
2. Square it and subtract 2.
3. Repeat step 2 p-2 times, where p is the exponent you are testing.
4. If the result is divisible by Mp then Mp is prime. If not then Mp is composite.

What makes this feasible (i.e., millions of zeros faster than TF) is that it requires only about p operations, while TF would require about 2p operations.

The algorithm is simple enough that any high-school programmer could implement it. (In fact, one did). Implementing it efficiently is another matter, as is understanding why the algorithm works in the first place. A good explanation can be found here, though you will need a certain level of mathematical sophistication to be able to understand it.

Quote:
Thats weird, I didnt think my machine was old or slow in this context. Yeah, about 3 weeks according to the schedule to complete LL on a world record number. But the TF did go much faster than what the schedule said.
That's because TF has only a small chance of finding a factor Obviously it would be a waste of time to spend weeks and weeks trying to find a factor which might be successful, when an LL test will definitely decide the matter. Factoring is like playing roulette. We "bet" a small amount of compute time that we will find a factor. If we win, we save two lengthy LL tests. Most of the time we lose, but we only lose the compute time we steaked.

Of course we only do this as long as the odds are in our favour. Over millions of tests, the project comes out ahead. Roulette isn't really a gample for the casino, is it?

Quote:
The Prime95 says that the chance of finding a world record prime, running 4 threads, were about 1:115,000. And also that it will take about 3 weeks to complete this.

It seems unvalid to me, but if it actually is true, then the chances are better than in the "lottery" that we have here, which are about 1:5,000,000. Hehe.
That calculation is based upon an unproven conjecture about the distribution of primes among the Mersenne numbers.
Mr. P-1 is offline   Reply With Quote
Old 2013-06-22, 00:11   #15
TheMawn
 
TheMawn's Avatar
 
May 2013
East. Always East.

11·157 Posts
Default

If you were to give a person just enough information about what a prime number is, and asked them to tell you how they would determine the primality of a number, they would probably give you the most naive way that exists. Dividing a number k by every number up to k and seeing if one of them returns a whole number.

Next, one might realize that you don't need to divide a number by, for example, 4. If a division by 4 gives a whole number, then so does a division by 2. A much better way is to divide by every prime number up to k. Next, a person might notice that if, for example, you were to divide the number 173 by 17, you would get a smaller than 17 because 17 x 17 is 289. You don't even need to try 17 because if it DID give you a whole number, it would be smaller than 17 and you already tried all the ones smaller than 17! You can then eliminate all the prime numbers equal to or larger than the square root of k.

We've gone from trying all numbers up to k to trying all the prime numbers up to the square root of k. This is essentially what trial factoring is. It's a very brute force kind of method.

My video card, a GTX 670, can factor 260892163-1 to 274 in about 5 hours. That is checking every single prime number up to roughly 18 sextillion. It takes about twice as much time to check every factor between 2x and 2x+1 as it does 2x-1 and 2x. So, going up to 275 would take another 5 hours. 276 would take 10 hours.

Assuming the trend continues, the time it takes to trial factor is O(2n). To check 260892163, you would need to go up to 230446082 which is 230446008 times longer than 10 hours.

It would take my video card around 230446011 hours to do that. The universe is about 247 hours old.

Last fiddled with by TheMawn on 2013-06-22 at 00:14
TheMawn is offline   Reply With Quote
Old 2013-06-22, 00:18   #16
TheMawn
 
TheMawn's Avatar
 
May 2013
East. Always East.

11×157 Posts
Default

It would take my video card around 230446011 hours to [try every prime factor for M60892163]. The universe is about 247 hours old.

I want to say this in it's own post since people might not read the whole thing I posted just previous to this.

Last fiddled with by TheMawn on 2013-06-22 at 00:18
TheMawn is offline   Reply With Quote
Old 2013-06-22, 02:02   #17
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2×112×47 Posts
Default

Quote:
Originally Posted by Mr. P-1 View Post
Acually there is quite a high chance that a newly assigned first time test will need P-1 pretesting.
I disagree on this point.

While a few hundred first time LL tests were assigned without P-1 pre-done after the last Mersenne Prime was announced, we're back to the point where all LL tests are assigned with P-1 already done.
chalsall is offline   Reply With Quote
Old 2013-06-22, 04:49   #18
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

41·251 Posts
Default

Quote:
Originally Posted by Mr. P-1 View Post
I could so happen, I suppose, that the effect of this is to exactly cancel out the time saving, but I don't think it does, and I can think of no reason why it should.
I (also) disagree on this (different) point. I however, may be wrong. OTOH, the explanation you give in your last paragraph is quite right (about how the things happen). We only disagree on duration and the reason is explained below.

If you read the link I provided above, about how GIMPS intelligently chooses the B1 and B2 limit, you will see that the story is "time related". If you spend the time T to do LL test, then maybe you can save two times T if you find a factor. So, how long time (x% of T) should you spend doing TF and P-1? It depends of the chance to find a factor.

If you have a method with a higher chance to find a factor, it makes sense to chase that method longer (in time). So, logically, it is viceversa than one should expect. But you can't chase that chance too long, as your odds improve only logarithmically, reported to the time you spend doing it (P-1, in our case). So, in case a factor is not found, you lost precious time, which would have been better invested in doing LL from the start. Therefore there is a "cutoff" somewhere, and that cutoff (B1 and B2) have to be intelligently chosen, to maximize the chance of finding a factor in a limited time (x% of T), but the time is still the limit. So, at the end, the time variation is tiny. Adding more memory to the stage 2, you will work about the same time on that P-1 assignment, but you might get luckier.

Last fiddled with by LaurV on 2013-06-22 at 05:08
LaurV is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
TF factor as work type: F-PM1? dh1 Information & Answers 2 2016-05-17 04:43
Type of work to get? Bispen Information & Answers 3 2016-01-27 16:46
Best type of work for my cpu Unregistered Information & Answers 11 2013-05-17 05:22
Type of work to get? ZFR Information & Answers 7 2011-09-17 08:43
LL no factoring work type edorajh Information & Answers 1 2010-04-16 16:55

All times are UTC. The time now is 16:13.


Fri Jul 7 16:13:30 UTC 2023 up 323 days, 13:42, 0 users, load averages: 1.66, 1.55, 1.31

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔