![]() |
okay so I have to program in
(((t/log(N))^n)*exp(t/log(N)))/n! that shouldn't be too hard. |
[CODE]poisson2(N,t,n) = (((t/log(N))^n)*exp(t/log(N)))/n![/CODE]
|
I think something's wrong: it gave a 109% chance for 20 numbers near a googol to have 0 primes.
|
I found it lol I forgot the - sign
|
[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. |
[CODE](10:21) gp > poisson2(10^100,0,20)
%89 = 0[/CODE] this more likely ? I've got to increase my precision though. |
[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] |
[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. |
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
|
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. |
[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.