mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Miscellaneous Math (https://www.mersenneforum.org/forumdisplay.php?f=56)
-   -   Thread for posting tiny primes (https://www.mersenneforum.org/showthread.php?t=13650)

science_man_88 2010-09-22 13:06

okay so I have to program in

(((t/log(N))^n)*exp(t/log(N)))/n! that shouldn't be too hard.

science_man_88 2010-09-22 13:09

[CODE]poisson2(N,t,n) = (((t/log(N))^n)*exp(t/log(N)))/n![/CODE]

CRGreathouse 2010-09-22 13:16

I think something's wrong: it gave a 109% chance for 20 numbers near a googol to have 0 primes.

science_man_88 2010-09-22 13:19

I found it lol I forgot the - sign

science_man_88 2010-09-22 13:21

[CODE]poisson2(N,t,n) = (((t/log(N))^n)*exp(-(t/log(N))))/n![/CODE]

this is how it should of been lol I'll test it out again lol.

science_man_88 2010-09-22 13:23

[CODE](10:21) gp > poisson2(10^100,0,20)
%89 = 0[/CODE]

this more likely ? I've got to increase my precision though.

CRGreathouse 2010-09-22 14:04

[QUOTE=science_man_88;230889][CODE](10:21) gp > poisson2(10^100,0,20)
%89 = 0[/CODE]

this more likely ? I've got to increase my precision though.[/QUOTE]

That's the correct answer, but not the same as what I asked. It says that if you choose 0 numbers near a googol, your chances of finding 20 primes is 0.

For my question, I get
[code]poisson2(1e100,20,0)
%1 = 0.9168064512151768221426797071[/code]

science_man_88 2010-09-22 14:24

[QUOTE=CRGreathouse;230894]That's the correct answer, but not the same as what I asked. It says that if you choose 0 numbers near a googol, your chances of finding 20 primes is 0.

For my question, I get
[code]poisson2(1e100,20,0)
%1 = 0.9168064512151768221426797071[/code][/QUOTE]

sorry I'm getting confused lol.

science_man_88 2010-09-22 14:42

if I did the math correct that means 230 numbers near a googol seems to give the best chance of exactly 1 being prime at 36.7879 % I think

CRGreathouse 2010-09-22 14:47

No problem.


So first, a warning: choosing 20 numbers isn't really a good example, since 20 is "small" and so the binomial distribution would be more appropriate than the Poisson distribution. (Conceivably, a program could switch between these depending on input parameters; for now let's keep things simple and leave it using only Poisson.)

Moving on: a number that is known to have no prime factors below L is approximately [TEX]e^\gamma\log L[/TEX] times as likely to be prime as a 'normal' number, assuming L isn't too close to the square root of the number. Use this to modify the program by adding a parameter L that changes the lambda appropriately. Note that [tex]\gamma[/tex] is
[code]Euler[/code]
in Pari.

Mini-Geek 2010-09-22 14:49

[QUOTE=science_man_88;230899]if I did the math correct that means 230 numbers near a googol seems to give the best chance of exactly 1 being prime at 36.7879 % I think[/QUOTE]

Which makes sense, since log(10^100) is about 230, and about 1 in x numbers the size of N are prime where log(N)=x.


All times are UTC. The time now is 22:59.

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