Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #408876

Re: anyone take a shot at this

From Bill Sloman <bill.sloman@ieee.org>
Newsgroups sci.electronics.design
Subject Re: anyone take a shot at this
Date 2016-04-24 13:31 +1000
Organization A noiseless patient Spider
Message-ID <nfhefj$krb$1@dont-email.me> (permalink)
References <nf69c7$860$1@gioia.aioe.org> <67fb3d1b-2b65-4532-bea3-bdd282dc8f66@googlegroups.com> <4c828146-2448-4d29-8097-f01ab6577285@googlegroups.com> <bfcaefd1-c7d6-4889-b12f-0c2408ef373e@googlegroups.com>

Show all headers | View raw


On 22/04/2016 4:03 AM, mrdarrett@gmail.com wrote:
> On Wednesday, April 20, 2016 at 11:36:41 PM UTC-7, bill....@ieee.org wrote:
>> On Thursday, April 21, 2016 at 7:04:48 AM UTC+10, mrda...@gmail.com wrote:
>>> On Tuesday, April 19, 2016 at 2:53:19 PM UTC-7, Jamie M wrote:

<snip>

>>> Good luck!
>>
>> He'd need it - on present evidence what he actually needs is sci.remedial.math
>>
>> In fact he's explicitly rejected posting anywhere where anybody might be interested in what he posts - he wants to work it out for himself, which would probably need a brain transplant, or at least an implant, granting that nature seems to have drastically short-changed him in that department.
>
> Oh, I don't know.  His post inspired me to look at the Sieve of Eratosthenes.  Quite fun.  There's a sample sieve code with the FreeBasic compiler.  After some modification (it only finds the first million primes) it took my computer just 7.5 seconds to find the first 25 million primes.  I'd forgotten how much fun such things could be.  Of course, to find these primes, about 2 gigabytes of RAM for array space are needed... I'm sure the algorithm could be refined further by avoiding storage of multiples of two...
>
> Carry on!

I've known about the Sieve of Eratosthenes for many years now. In fact I 
was inspired to try to work out a probablistic estimator of it's success 
a couple of months ago.

The simplest predictor is that the chance of an individual application 
of the sieve will find a non-prime in a collection of n numbers is

1/(1-1/p) where p is the prime being tested for.

This doesn't work, because the population of numbers being sieved is 
progressively depleted of smaller primes as the test progresses. To 
improve it, you have to know (or guess) the number of primes - p_a - 
below the first number in the sample being tested - think Legendre 
Conjecture - and guess the number of primes in the sample being tested p_b.

As you work your way through p(a) the chance of finding a number 
divisible by a known prime goes up at the "k"th step by

(p_a + p_b)/(p_a + p_b - k)

It seemed to work fairly well when I tried it out in Excel, but I 
couldn't be bothered getting into my Linux partition and testing it in a 
respectable programming language over a respectable number of samples.

It generated a slightly conservative estimate for p_b when I tried it, 
but I'd need to run a lot more trials to say anything persuasive.

-- 
Bill Sloman, Sydney

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

anyone take a shot at this Jamie M <jmorken@shaw.ca> - 2016-04-19 14:53 -0700
  Re: anyone take a shot at this CORRECTED Jamie M <jmorken@shaw.ca> - 2016-04-19 14:58 -0700
  Re: anyone take a shot at this DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-04-19 22:39 -0400
    Re: anyone take a shot at this bitrex <bitrex@de.lete.earthlink.net> - 2016-04-20 14:02 -0400
      Re: anyone take a shot at this John S <Sophi.2@invalid.org> - 2016-04-20 13:13 -0500
        Re: anyone take a shot at this DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-04-20 16:34 -0400
      Re: anyone take a shot at this DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-04-20 16:31 -0400
        Re: anyone take a shot at this bitrex <bitrex@de.lete.earthlink.net> - 2016-04-20 18:32 -0400
          Re: anyone take a shot at this DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-04-20 20:50 -0400
  Re: anyone take a shot at this mrdarrett@gmail.com - 2016-04-20 14:04 -0700
    Re: anyone take a shot at this bill.sloman@ieee.org - 2016-04-20 23:36 -0700
      Re: anyone take a shot at this mrdarrett@gmail.com - 2016-04-21 11:03 -0700
        Re: anyone take a shot at this Jamie M <jmorken@shaw.ca> - 2016-04-21 16:57 -0700
        Re: anyone take a shot at this Jasen Betts <jasen@xnet.co.nz> - 2016-04-21 23:50 +0000
          Re: anyone take a shot at this mrdarrett@gmail.com - 2016-04-22 15:16 -0700
            Re: anyone take a shot at this Jasen Betts <jasen@xnet.co.nz> - 2016-04-23 08:25 +0000
              Re: anyone take a shot at this mrdarrett@gmail.com - 2016-04-23 15:36 -0700
                Re: anyone take a shot at this Jasen Betts <jasen@xnet.co.nz> - 2016-04-24 01:24 +0000
        Re: anyone take a shot at this Bill Sloman <bill.sloman@ieee.org> - 2016-04-24 13:31 +1000
          Re: anyone take a shot at this bill.sloman@ieee.org - 2016-04-23 20:35 -0700
          Re: anyone take a shot at this mrdarrett@gmail.com - 2016-04-23 21:26 -0700
            Re: anyone take a shot at this bill.sloman@ieee.org - 2016-04-24 00:06 -0700
              Re: anyone take a shot at this Jasen Betts <jasen@xnet.co.nz> - 2016-04-24 12:05 +0000
  Re: anyone take a shot at this bloggs.fredbloggs.fred@gmail.com - 2016-04-20 18:18 -0700
    Re: anyone take a shot at this Jamie M <jmorken@shaw.ca> - 2016-04-21 00:35 -0700
      Re: anyone take a shot at this bill.sloman@ieee.org - 2016-04-21 00:44 -0700

csiph-web