User talk:Retroburrowers: Difference between revisions

m
→‎reply2: typos and grammar...
(→‎reply2: corrected sqrt limit to reduce redundant looping with no difference in the answers...)
m (→‎reply2: typos and grammar...)
Line 173:
Found 78498 primes to 1000000.</pre>
 
: This difference in the amount of operations as in the amount of work done gets even larger as the range goes up; if you want to play with it, the code is posted on [https://wandbox.org/permlink/I5PmD0YsAW0ndm6q an on-line IDE here]. The reason thisfor isthis truedifference is that the SoE has about O(n log log n) asymptotic complexity which increases quite slowly with range, where as the SoS has o(n^about O(n log n) complexity, which increases quitemore quickly with range. This can be seen from the above implementation as ''i'' ranges up theto (half of) the square root of (half of) the range, where the ''j'' variable ranges from a little above ''i'' forto something approaching (half of) the range, so the product is O(n^(3/2)) but the span of the culling increases with increaseincreased base number so as to reduce the term to about ''log n'', with the constant extra constant factor of about a quarter meaningless for showing complexity with increasing range (Big-O).
 
: That is the reason that the SoS should not be on the SoE Task Page: it doesn't have the same asymptotic complexity, it isn't that much simpler, and it is confusing for those that can't tell the difference.
474

edits