mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-09-22, 14:49   #595
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 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
Exactly -- because log(1e100) is about 230.

Edit: Mini-Geek, your death will be swift.

Last fiddled with by CRGreathouse on 2010-09-22 at 14:50
CRGreathouse is offline   Reply With Quote
Old 2010-09-22, 15:01   #596
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

I put L in the code but don't I have to check every numbers for factors below a given L ? so what do i do to the code i haven't figure it out yet lol.
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 15:19   #597
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

that means for the 6n+1 and 6n-1 L would be at least 5

if I did the math right that would decrease 230 to about 80-81 cuts it down quite a bit.

Last fiddled with by science_man_88 on 2010-09-22 at 15:21
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 15:47   #598
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I put L in the code but don't I have to check every numbers for factors below a given L ?
No!

You're not checking n numbers, you're predicting the results if a person checks n numbers. All you have to do is adjust the probability by the factor I gave.
CRGreathouse is offline   Reply With Quote
Old 2010-09-22, 15:51   #599
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
No!

You're not checking n numbers, you're predicting the results if a person checks n numbers. All you have to do is adjust the probability by the factor I gave.
oh so multiply the final probability by that I see lol.
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 15:53   #600
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Code:
(12:53) gp > poisson2(N,t,n,L) = ((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
%212 = (N,t,n,L)->((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
(12:53) gp > poisson2(10^100,20,0,5)
%213 = 2.628049047414643169717703463
(12:53) gp >
if I was correct
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 15:57   #601
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
(12:53) gp > poisson2(N,t,n,L) = ((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
%212 = (N,t,n,L)->((((t/log(N))^n)*exp(-(t/log(N))))/n!)*(exp(Euler)*log(L))
(12:53) gp > poisson2(10^100,20,0,5)
%213 = 2.628049047414643169717703463
(12:53) gp >
if I was correct
Doesn't look right. Let's clean up the code and see if that makes it any easier:

Code:
estimatePrimes(N,t,n,L)={
  my(lambda=...);
  (lambda^n*exp(-lambda))/n!
};
addhelp(estimatePrimes, "estimatePrimes(N,t,n,L): ...");
CRGreathouse is offline   Reply With Quote
Old 2010-09-22, 16:23   #602
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
(13:23) gp > estimatePrimes(10^100,230,1,5)
%217 = 0.1634366358216543572411964273
with code:

Code:
estimatePrimes(N,t,n,L)=my(lambda=(t/log(N))*(exp(Euler)*log(L)));(lambda^n*exp(-lambda))/n!;
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 16:32   #603
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

I love how that change in code fits exactly the range of 80-81 I predicted.
science_man_88 is offline   Reply With Quote
Old 2010-09-22, 16:40   #604
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

The code looks good.

Quote:
Originally Posted by science_man_88 View Post
that means for the 6n+1 and 6n-1 L would be at least 5

if I did the math right that would decrease 230 to about 80-81 cuts it down quite a bit.
Quote:
Originally Posted by science_man_88 View Post
I love how that change in code fits exactly the range of 80-81 I predicted.
You expect about one prime per 230 for numbers near a googol, but one prime per 115 for odd numbers near a googol and one prime per 77 for odd numbers not divisible by 3 near a googol.

So 80-81 is close, but no cigar.

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

10111010110112 Posts
Default

So now can you write a different function that takes a limit L, base b, an exponent e, and a k-range kmin,kmax and determines
1. The expected number of candidates remaining after sieving to L?
2. The number of primes in the range? (Use your estimatePrimes function.)
CRGreathouse 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:49 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.