mersenneforum.org Is it feasible to define a simple P-1 probability "approximator"?
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 2021-10-02, 16:01 #1 petrw1 1976 Toyota Corona years forever!     "Wayne" Nov 2006 Saskatchewan, Canada 12F916 Posts Is it feasible to define a simple P-1 probability "approximator"? I know there is a very robust accurate P-1 probability calculator here. But I'd like to find a simplified version that is still "pretty close"; and that can be used as a single formula or function. At first glance it does not seem like it should be very hard. There are only 4 variables: - Exponent - Current TF Bit level - Bound 1 - Bound 2 However, it has eluded my synapses. I track all my P1 work for my Under-2000 sub-project in an Excel spread sheet (sorry, I'm a geek from the 80's). A big part of this project is determining whether is it more efficient to find the remining required factors with TF or with P-1. (Or more accurately how much more of each and in what order?) Where I determine I need more P-1, the bigger question is: "How much more?" Or more specifically what are the optimal bounds that will produce the desired number of factors with the least total work effort. My vision is to have a spreadsheet where I: (I actually already have this ... but step 2 below is inefficient and poorly done) 1. Download the current P-1 work from here 2. Add a column with a "neat and tidy" P-1 estimator formula for the current success rate. 3. Add another few columns with proposed bounds, success rates and work effort 4. Determine which new bounds will generate the required number of factors with the least total work effort. I can easily complete steps 1, 3 and 4. I just have not had any luck creating a useful simpler estimator. Thanks
 2021-10-02, 16:31 #2 axn     Jun 2003 2×23×113 Posts You can write a macro for the full blown function in your spreadsheet tool of choice. Probably the easiest way (in the long run). The actual C code can be extracted from P95 source for reference. Last fiddled with by axn on 2021-10-02 at 16:32
2021-10-02, 17:04   #3
petrw1
1976 Toyota Corona years forever!

"Wayne"
Nov 2006

12F916 Posts

Quote:
 Originally Posted by axn You can write a macro for the full blown function in your spreadsheet tool of choice. Probably the easiest way (in the long run). The actual C code can be extracted from P95 source for reference.
Thanks...I did that for the prior version.

The problem I had then was being unable to (or not knowing how to) have the macro trigger for every row in the spreadsheet as soon as it was populated.
Having to run it manually for every row (or at least every different row) was time consuming.

 2021-10-03, 02:31 #4 axn     Jun 2003 121168 Posts Write it as a function that takes all the 4 parameters and then returns a double. Then you just put it as a formula in a cell. Are you using Excel (in Windows) or something else for your spreadsheet?
2021-10-03, 03:20   #5
petrw1
1976 Toyota Corona years forever!

"Wayne"
Nov 2006

3×1,619 Posts

Quote:
 Originally Posted by axn Write it as a function that takes all the 4 parameters and then returns a double. Then you just put it as a formula in a cell.
That's exactly what I am trying to do .

Quote:
 Are you using Excel (in Windows) or something else for your spreadsheet?
Yes

 2021-10-03, 03:42 #6 axn     Jun 2003 2×23×113 Posts Ok. So you need a .xslm file, where you insert a Module and define a public function. Code: Public Function Pminus1Probability(e as Long, tf as Integer, B1 as Long, B2 as Long) As Double and then put a formula in the cell as, for example, =Pminus1Probability(A1, B1, C1, D1)
2021-10-03, 05:24   #7
petrw1
1976 Toyota Corona years forever!

"Wayne"
Nov 2006

3×1,619 Posts

Quote:
 Originally Posted by axn Ok. So you need a .xslm file, where you insert a Module and define a public function. Code: Public Function Pminus1Probability(e as Long, tf as Integer, B1 as Long, B2 as Long) As Double and then put a formula in the cell as, for example, =Pminus1Probability(A1, B1, C1, D1)
Yes, I understand the process...my problem is converting this into an excel Function/macro.

Having looked at this source and after a few poor attempts at converting this version into a macro I've come to realize that for my purposes I don't need accuracy to many decimal points; 2 would be enough.

That is why I'd be content with a much simpler "reasonable" formula.

Thanks

 Similar Threads Thread Thread Starter Forum Replies Last Post Zhangrc mersenne.ca 16 2021-06-16 02:47 Uncwilly Lounge 15 2020-04-14 18:35 wildrabbitt Miscellaneous Math 11 2015-03-06 08:17 cheesehead Soap Box 3 2008-09-15 12:12 nitai1999 Software 7 2004-08-26 18:12

All times are UTC. The time now is 11:32.

Mon Dec 6 11:32:26 UTC 2021 up 136 days, 6:01, 0 users, load averages: 1.31, 1.17, 1.79