22

https://bitcoin.stackexchange.com/a/3908/659 says:

Luckily, you'll only have to wait five minutes on average for a block to be found (blocks are one every ten minutes, so the expected delay until the next block is five minutes).

Upon reading it, I instantly felt that this was incorrect, and that the expected time until the next block is always 10 minutes (assuming the network hash rate matches the current difficulty).

If the blocks were generated exactly every 10 minutes, than it would be true that the expected time would be 5 minutes, but they're not.

So what's the real expected time? Please make a plausible argument for why it is so.

Chris Moore
  • 14,825
  • 6
  • 66
  • 87

1 Answers1

20

10 minutes. Assuming, as you say, that the current network hashrate matches the difficulty - otherwise it is proportionally higher or lower.

Block finding is a Poisson process. The rate parameter λ is chosen so that 2016 blocks on average are found every 2 weeks, and since in such a process the expected number of events is proportional to the time span, it means λ is 1/(10 minutes).

The time until the next event (the next block found in our case) follows the exponential distribution with mean 1/λ, which is 10 minutes. This distribution is memoryless - the amount of time spent waiting for a block has no effect on the amount of time left to wait. When a block is found the expected time until the next block is 10 minutes (which is intuitive), and it is also 10 minutes at any other time.

If blocks arrived once every 10 minutes like clockwork, the expected time until the next block at a random point would be indeed 5 minutes - but then we wouldn't have to worry about expectations, we'd know exactly when the next block will be found.

In the future, the decreased generation reward might cause the total hashrate to fluctuate as transaction fees accumulate, causing reduced variability in block finding times, and reduced expected waiting time.

Meni Rosenfeld
  • 19,700
  • 37
  • 70
  • Don't forget that the block finding process is a factor of difficulty, not total hashrate, so at any given point it will be lagging difficulty in one direction or another. Block times should average out to 10 minutes over the long haul, but at any given moment the average block time for a day, week, etc could be quite a bit higher or lower :) – David Perry Jun 07 '12 at 07:55
  • @DavidPerry: Yes, I specified that I'm assuming that the difficulty matches the hashrate. When the hashrate changes this will of course not be accurate. – Meni Rosenfeld Jun 07 '12 at 08:05
  • 4
    Pick any random point in time. The average time from that time to the next found block is 10 minutes. Also the average time from that time back to the previous block is also 10 minutes. Also, the average time from the previous block to the following block is also 10 minutes! Try to get your intuition to accept that! – David Schwartz Jun 07 '12 at 08:40
  • 4
    @DavidSchwartz: That's wrong. The average time from the last block to the next block is 20 minutes, and follows the negative binomial distribution. There's no escaping the additivity of expectation. – Meni Rosenfeld Jun 07 '12 at 08:51
  • @MeniRosenfeld are you saying that the average time between blocks is 20 minutes? That would seem to contradict the fact that blocks are generated on average every 10 minutes (again, assuming constant hash rate and matching difficulty). – Chris Moore Jun 07 '12 at 09:13
  • 4
    Meni is right! This is not a contradiction because the 10 minute average block time is averaged over blocks. Whereas if you pick a random time, you're averaging over time. Averaging over blocks, every block interval is equally weighted. Averaging over time, longer block intervals get a higher weight (because they span more time) and hence the average is higher. – David Schwartz Jun 07 '12 at 09:26
  • 2
    So can we say that the expected time between blocks is 10 minutes, but the expected time between the previous and the next block (right now) is 20 minutes, because 'right now' is likely to be a bigger than average gap between blocks? It's certainly counter-intuitive if that's the case. – Chris Moore Jun 07 '12 at 09:49
  • 9
    @ChrisMoore: Your last comment and David's last comments are correct. It's like the problem with 2 buses, one with 10 passengers and one with 20. If you ask a random bus driver how many passengers were on his bus you get 15 on average, but if you ask a random passenger how many passengers were on his bus you get 16.67 on average. – Meni Rosenfeld Jun 07 '12 at 09:54
  • 3
    Also consider this: If you wake me up in the middle of the night and ask "How long do you think will be the interval between the last block and the next?" I'd say "20 minutes". If instead you wake me and ask, "How long will be the interval between the last and the next? Oh and by the way a block was found just now", I'd say "10 minutes". The interval between last and next is the sum of the time since the last plus the time until the next; the time until the next is always expected to be 10, but the time since the last is only expected to be 10 in absence of information to the contrary. ... – Meni Rosenfeld Jun 07 '12 at 09:59
  • The latter question is basically what you ask when you take a random block and inquire how long it takes from the time it was found to the time of the next block, which gives you the average block generation rate. – Meni Rosenfeld Jun 07 '12 at 10:00
  • I'm glad I asked this question. It's more interesting than I thought it would be. Thanks for your answers! – Chris Moore Jun 07 '12 at 10:07
  • Minor correction: The time between the last block and next block, at a random point in time, follows the Erlang distribution with shape parameter k=2. This is the continuous limit of the negative binomial distribution. – Samuel Li Jan 30 '21 at 19:14
  • @SamuelLi: Hm, right, I guess I was a bit loose with the terms there. – Meni Rosenfeld Feb 03 '21 at 22:23