Author Topic: How to calculate probability of solo mining?  (Read 3026 times)

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
How to calculate probability of solo mining?
« on: October 26, 2013, 06:41:29 am »
Hi,

I want to offer a tool which calculates some stats based on your mining behaviour. I'm just wondering how to calculate the probability of finding a block solo? And what variables are needed?

Thanks

Offline optimusprime

  • Jr. Member
  • **
  • Posts: 33
  • Karma: +3/-4
  • Hello I'm new here
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #1 on: October 26, 2013, 07:06:03 am »

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #2 on: October 26, 2013, 02:15:20 pm »
Thanks, that's something i can work with,

Offline mhps

  • Hero Member
  • *****
  • Posts: 904
  • Karma: +31/-3
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #3 on: October 26, 2013, 02:52:12 pm »
This should be helpful http://anty.info/primecoin-calculator

I think Mikael's formula mistakenly ignored chains that are longer than 9. These chains are counted as blocks once found, and can significantly affect block rate if the difficulty is greater than 9.9. Please see my post here https://bitcointalk.org/index.php?topic=255782.msg3327731#msg3327731 about the correction term for 10- 11- 12-chains, assuming each step of chain-length increase makes it ten times difficult to find a chain.
PPC PU6zS8RRBWP2UxhuRFengGsu8n4tEYB5xV XPM AJAgBpPjGQoL38mrtW91dVqhbMHqu25vfG NBT B6fBiAZyL3xxNRJYwDwQz2RAtWnC5Tdk2S

Offline mikaelh

  • Jr. Member
  • **
  • Posts: 36
  • Karma: +17/-0
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #4 on: October 26, 2013, 04:40:48 pm »
This should be helpful http://anty.info/primecoin-calculator

I think Mikael's formula mistakenly ignored chains that are longer than 9. These chains are counted as blocks once found, and can significantly affect block rate if the difficulty is greater than 9.9. Please see my post here https://bitcointalk.org/index.php?topic=255782.msg3327731#msg3327731 about the correction term for 10- 11- 12-chains, assuming each step of chain-length increase makes it ten times difficult to find a chain.

Well, you're correct about the formula not being accurate because I ignored chains longer than 9. However, the amount of 10-chains is pretty small compared to 9-chains. I did some testing which showed that the amount of 10-chains is only about 2% of the amount of 9-chains. My old formula was essentially this:

blocks/day = chains/day * (1 - fractionalDifficulty)

Correcting for 10-chains that becomes:

blocks/day = chains/day * (1 - fractionalDifficulty) + 0.02 * chains/day

Now that the difficulty is around 9.94, the estimated blocks/day becomes 33% higher.
BTC: 1MgDFUwZnnyGRHh1uUotKxpkNYX5Kx3SXr   XPM: AdmoBC4HiDiMQdJDmetTZLyyd8VCmkjCcz   PPC: PRJ5ejBxukDEpoK4rw4QcfQG4LSC14F6jA

Offline mhps

  • Hero Member
  • *****
  • Posts: 904
  • Karma: +31/-3
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #5 on: October 27, 2013, 01:42:22 am »

Well, you're correct about the formula not being accurate because I ignored chains longer than 9. However, the amount of 10-chains is pretty small compared to 9-chains. I did some testing which showed that the amount of 10-chains is only about 2% of the amount of 9-chains.

Wow I didn't know 10-chains are that rare. Thanks for pointing it out. My own mining gets at least 5% because I happened to spot a few blocks were 10's.

I wonder what the distribution of number of blocks so far found from length 7 to length 13 is, and how it is related to the intrinsic Cunningham chain length distribution (of number of chains vs length), which is constant and has scientific value. At any difficulty the instantaneous distribution of found number vs. chain length  is the intrinsic distribution multiplied by a miner length preferrence profile averaged across the whole network (at that moment). To get the average miner response profile, we have to know which miner are producing how many chains, which is not eazy to measure.
PPC PU6zS8RRBWP2UxhuRFengGsu8n4tEYB5xV XPM AJAgBpPjGQoL38mrtW91dVqhbMHqu25vfG NBT B6fBiAZyL3xxNRJYwDwQz2RAtWnC5Tdk2S

Offline mikaelh

  • Jr. Member
  • **
  • Posts: 36
  • Karma: +17/-0
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #6 on: October 27, 2013, 08:57:24 am »

Well, you're correct about the formula not being accurate because I ignored chains longer than 9. However, the amount of 10-chains is pretty small compared to 9-chains. I did some testing which showed that the amount of 10-chains is only about 2% of the amount of 9-chains.

Wow I didn't know 10-chains are that rare. Thanks for pointing it out. My own mining gets at least 5% because I happened to spot a few blocks were 10's.

I wonder what the distribution of number of blocks so far found from length 7 to length 13 is, and how it is related to the intrinsic Cunningham chain length distribution (of number of chains vs length), which is constant and has scientific value. At any difficulty the instantaneous distribution of found number vs. chain length  is the intrinsic distribution multiplied by a miner length preferrence profile averaged across the whole network (at that moment). To get the average miner response profile, we have to know which miner are producing how many chains, which is not eazy to measure.

Well, I guess the probability of finding a 10-chain could be up to 4%. I actually did my testing with shorter chains on testnet. The round primorial is larger when running on mainnet which means the probability for the 10th number being prime should be slightly higher.

What I know about the distribution of Cunningham chains so far is that it actually closely follows a pretty simple statistical model. The probability of finding a Cunningham chain of length k at some location is roughly P_1 * P_2 * ... * P_k where P_i is the probability of the i'th number being prime. That's also how the chainsperday estimate is calculated.
BTC: 1MgDFUwZnnyGRHh1uUotKxpkNYX5Kx3SXr   XPM: AdmoBC4HiDiMQdJDmetTZLyyd8VCmkjCcz   PPC: PRJ5ejBxukDEpoK4rw4QcfQG4LSC14F6jA

Offline mhps

  • Hero Member
  • *****
  • Posts: 904
  • Karma: +31/-3
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #7 on: October 27, 2013, 12:55:03 pm »
The probability of finding a Cunningham chain of length k at some location is roughly P_1 * P_2 * ... * P_k where P_i is the probability of the i'th number being prime.

Are P_i's constant or nearly constant?
PPC PU6zS8RRBWP2UxhuRFengGsu8n4tEYB5xV XPM AJAgBpPjGQoL38mrtW91dVqhbMHqu25vfG NBT B6fBiAZyL3xxNRJYwDwQz2RAtWnC5Tdk2S

Offline mikaelh

  • Jr. Member
  • **
  • Posts: 36
  • Karma: +17/-0
  • Referrals: 0
    • View Profile
Re: How to calculate probability of solo mining?
« Reply #8 on: October 27, 2013, 01:50:06 pm »
The probability of finding a Cunningham chain of length k at some location is roughly P_1 * P_2 * ... * P_k where P_i is the probability of the i'th number being prime.

Are P_i's constant or nearly constant?

The exact probabilities depend on the mining parameters. The basic probability for a number N being prime is 1 / ln(N) according to the Prime Number Theorem. So the probability of a 300-bit number being prime is approximately 1/(300 * ln(2)) = 0.0048.

The probability becomes much higher because of the round primorial and the sieve algorithm. Both of them essentially filter out numbers divisible by small primes. Filtering out each prime p_i increases the probability by a factor of 1 / (1 - 1/p_i). The probability for a sieved number being prime is around 0.092 on mainnet. For unsieved numbers, it should be around 0.035 (assuming that round primorial is 59).
BTC: 1MgDFUwZnnyGRHh1uUotKxpkNYX5Kx3SXr   XPM: AdmoBC4HiDiMQdJDmetTZLyyd8VCmkjCcz   PPC: PRJ5ejBxukDEpoK4rw4QcfQG4LSC14F6jA

 
Share this topic...
In a forum
(BBCode)
In a site/blog
(HTML)


Peercoin.net Official Peercoin Website