mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-09-22, 13:06   #584
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

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 is offline   Reply With Quote
Old 2010-09-22, 13:09   #585
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Code:
poisson2(N,t,n) = (((t/log(N))^n)*exp(t/log(N)))/n!

Last fiddled with by science_man_88 on 2010-09-22 at 13:09
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 13:16   #586
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

I think something's wrong: it gave a 109% chance for 20 numbers near a googol to have 0 primes.
CRGreathouse is offline   Reply With Quote
Old 2010-09-22, 13:19   #587
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

I found it lol I forgot the - sign
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 13:21   #588
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
poisson2(N,t,n) = (((t/log(N))^n)*exp(-(t/log(N))))/n!
this is how it should of been lol I'll test it out again lol.
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 13:23   #589
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

838410 Posts
Default

Code:
(10:21) gp > poisson2(10^100,0,20)
%89 = 0
this more likely ? I've got to increase my precision though.
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 14:04   #590
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
(10:21) gp > poisson2(10^100,0,20)
%89 = 0
this more likely ? I've got to increase my precision though.
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
CRGreathouse is offline   Reply With Quote
Old 2010-09-22, 14:24   #591
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
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
sorry I'm getting confused lol.
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 14:42   #592
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

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
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 14:47   #593
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

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 e^\gamma\log L 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 \gamma is
Code:
Euler
in Pari.

Last fiddled with by CRGreathouse on 2010-09-22 at 14:48
CRGreathouse is offline   Reply With Quote
Old 2010-09-22, 14:49   #594
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

10000101010112 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
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
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.
Mini-Geek is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prime posting thread, part 2. (With a catch.) 3.14159 Miscellaneous Math 55 2010-11-19 23:55
Tiny range request .... 555.1M petrw1 LMH > 100M 1 2010-07-13 15:35
Other primes thread nuggetprime No Prime Left Behind 32 2009-10-21 21:48
Error: tiny factoring failed 10metreh Msieve 26 2009-03-08 23:28
Tiny error on nfsnet pages. antiroach NFSNET Discussion 1 2003-07-08 00:27

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


Fri Aug 6 22:24:50 UTC 2021 up 14 days, 16:53, 1 user, load averages: 3.27, 3.35, 3.22

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.