8

What is the probability distribution of solving a block, given the same difficulty.

So if I try to mine multiple times using the same difficulty, is it normal distribution with mean of 10 minutes? What is the variance? Or is it some other distribution? Or maybe even deterministic chaos?

Murch
  • 71,155
  • 33
  • 180
  • 600
jaybny
  • 163
  • 1
  • 9
  • It is a [poisson distribution](http://en.wikipedia.org/wiki/Poisson_distribution). Every attempt to form a block has the same probability of success and the number of attempts per second is roughly constant. – David Schwartz May 12 '14 at 23:47
  • 1
    @DavidSchwartz: No, it's a Poisson _process_. Which means that the number of blocks in an interval follows the Poisson distribution - but the time between blocks, which the OP asked about (I think), follows the exponential distribution. – Meni Rosenfeld May 13 '14 at 09:14
  • 1
    @MeniRosenfeld The question is sufficiently vague that it could be asking either about the expected number of blocks found or about the expected time between blocks found. They follow two different distributions. – David Schwartz May 13 '14 at 17:34

2 Answers2

11

The time between consecutive blocks follows the exponential distribution, with mean (roughly) 10 minutes. This means that the variance is 100 minutes^2.

Meni Rosenfeld
  • 19,650
  • 35
  • 70
  • so standard deviation is 10? So its just as likely to take 1 minute vs 19 minutes? – jaybny May 12 '14 at 18:43
  • http://bitcoin.stackexchange.com/questions/4690/what-is-the-standard-deviation-of-block-generation-times – jaybny May 12 '14 at 18:58
  • @jaybny: Yes, the standard deviation is 10 - however, the distribution is not symmetric, so 1 minute and 19 minutes have different probability densities. – Meni Rosenfeld May 13 '14 at 09:12
  • im now asking if the probability that it takes exactly 1 minute or exactly 19 minutes the same? since they are both the same STD from mean? – jaybny May 13 '14 at 13:39
  • @jaybny: This is a continuous variable so the probability that it is exactly 1 minute is 0. That's not what you wanted. You meant to ask about the probability densities. And I already answered negatively. The distribution is not symmetric so being 1 sd from the mean does not mean it's the same density. You can see a graph of the density in the linked Wikipedia article. – Meni Rosenfeld May 13 '14 at 20:58
  • I am not sure why this should follow exponential distribution. The hashing function that bitcoin follows uniform distribution ie .. all hashes are equally likely to occur. So assuming that hash rate is constant between two blocks, it is equally likely that you get a block in 0 - 20 min. Can you explain why u say its exponential distribution ? – dark knight Jul 29 '15 at 17:30
  • im assuming it has to do with real world factors, like mining rigs online/offline, and human operators of the mining strategy – jaybny Jul 29 '15 at 18:54
  • If you factor increase of hashrate during difficulty period, the average will be much less than 10 min. Its fair to assume same hashrate , the next difficulty is also calculated assuming uniform probability distribution https://en.bitcoin.it/wiki/Difficulty – dark knight Jul 30 '15 at 04:04
  • read up on poisson processes. maybe meni has answers – jaybny Jul 30 '15 at 06:23
  • @darkknight: I didn't see your comment when you first wrote it. In case it's still relevant: Unlike jaybny's suggestion this has nothing to do with real-world factors, I'm assuming the most ideal model possible, including that the difficulty and hashrate is constant. The hash of each attempt is uniformly distributed but that's irrelevant - the only thing that matters is if it's below the target or not. That's a Bernoulli trial with (continued...) – Meni Rosenfeld Mar 15 '16 at 14:19
  • 1
    (...continuing from previous comment) some probability. These trials are all independent. So the time to find a block can be arbitrarily long (because I can just be unlucky and fail again and again and again). But the probability decreases exponentially: The probability to find a block in the 4th minute is the probability to fail in the 1st and fail in the 2nd and fail in the 3rd and succeed in the 4th. Because of the extra conditions, this has less probability than just succeeding in the 1st minute. This results in the https://en.wikipedia.org/wiki/Exponential_distribution. – Meni Rosenfeld Mar 15 '16 at 14:21
  • @MeniRosenfeld Thanks for explaining. So get the part that its exponential distribution. Minor question is had is that in the 4th minute is it not more probable that we find a block. I am thinking we already covered lots of hashes in the first 3 minutes(versus a coin toss its always 0.5 each time). – dark knight Dec 14 '17 at 12:34
  • @darkknight: The number of hashes you can find is a tiny portion of the space of all hashes (something like 0.0000000000000000000000000000000000000000000000000000000001%), and an even tinier portion of the space of all possible inputs. There's not even a guarantee that there is any solution. Each hash attempt is its own independent coin toss. – Meni Rosenfeld Dec 14 '17 at 12:59
10

The expected time (mean) for a new block is of course 10 minutes, assuming constant hashrate, and no block propagation time.

The tricky part is that there is no such thing as a point in time. You can only ask only for an interval.

Let's illustrate this. First it is important to not fall for the Gambler's fallacy. Luck has no "memory". Thus if no block has been found (or if a block has just been found), what is the chance of a block being found in the next minute? The easy answer would be 1/10 = 10%. Or in the next second? 1/600 = 0.16667%. But this is not quite true.

If you ask how often a block is found before or after 10 minutes, you are asking for the cumulative distribution function (CDF) of the exponential distribution.

We can use Wolfram Alpha to plot this:

cdf exponential distribution λ=1/600

How many blocks are found after the mean (600 seconds)?

exp(-600/600) = exp(-1) ~= 36.788%

How many blocks are found before the mean?

1-exp(-1) ~= 63.212%

How many blocks are separated by more than 1, 2, 5, 10, 20, 30, 60 minutes?

exp( -1/10) ~= 90.484%
exp( -2/10) ~= 81.873%
exp( -5/10) ~= 60.653%
exp(-10/10) ~= 36.788%
exp(-20/10) ~= 13.534%
exp(-30/10) ~=  4.979%
exp(-60/10) ~=  0.248%

So what is the chance of finding a block in the next second/minute?

1-exp(-1/600)  ~= 0.16653%
1−exp(−60/600) ~= 9.516%

Bonus: How many blocks are found between 5 minutes an 20 minutes?

exp(−5/10)−exp(−20/10) ~= 47.120%
Felix Weis
  • 319
  • 3
  • 10