Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Spjuth on March 06, 2015, 01:41:41 PM



Title: Is the expected waiting time for a block always 10 min?
Post by: Spjuth on March 06, 2015, 01:41:41 PM
I was wondering about waiting time for blocks. Is the probability of finding a new block always the same, like the probability of rolling a six on a dice does not change no matter how many sixes you have rolled in a row, or does it decrease because the search space of the problem exhausts?  

Ex: I go to blockchain.info and see that the last block was created 60min ago. I think "oh, how unlucky the miners have been, but that's good, then they should find a new block any second now."
Is that correct, or should I expect the average time until a new block is 10min no matter how long ago the last block was created?


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: nextblast on March 06, 2015, 01:47:28 PM

To say 10 min per block is only statistically right.
You might see several blocks mined in a row in a few minutes but in another time none for an hour.

Height    Age    Transactions    Total Sent    Relayed By    Size (kB)
346427    29 minutes    46    1,773.59 BTC    BTC Guild    21.74
346426    29 minutes    217    607.58 BTC    F2Pool    119.97
346425    32 minutes    772    6,959.44 BTC    BTC Guild    416.73
346424    46 minutes    320    1,659.23 BTC    F2Pool    155.84
346423    51 minutes    1010    8,987.83 BTC    F2Pool    507.12
346422    1 hour 10 minutes    614    6,597.82 BTC    KnCMiner    417.55


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: Spjuth on March 06, 2015, 01:50:26 PM

To say 10 min per block is only statistically right.
You might see several blocks mined in a row in a few minutes but in another time none for an hour.

Height    Age    Transactions    Total Sent    Relayed By    Size (kB)
346427    29 minutes    46    1,773.59 BTC    BTC Guild    21.74
346426    29 minutes    217    607.58 BTC    F2Pool    119.97
346425    32 minutes    772    6,959.44 BTC    BTC Guild    416.73
346424    46 minutes    320    1,659.23 BTC    F2Pool    155.84
346423    51 minutes    1010    8,987.83 BTC    F2Pool    507.12
346422    1 hour 10 minutes    614    6,597.82 BTC    KnCMiner    417.55

Yes, I understand that. My question is about average waiting time for a block. Is the average time until a new block is found always 10 min no matter how long I have waited, or does the average waiting time decrease the more time has passed since the last block?

Edit: I'm waiting for a confirmation right now, that's why I'm asking ;)


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: dothebeats on March 06, 2015, 01:52:51 PM

To say 10 min per block is only statistically right.
You might see several blocks mined in a row in a few minutes but in another time none for an hour.

Height    Age    Transactions    Total Sent    Relayed By    Size (kB)
346427    29 minutes    46    1,773.59 BTC    BTC Guild    21.74
346426    29 minutes    217    607.58 BTC    F2Pool    119.97
346425    32 minutes    772    6,959.44 BTC    BTC Guild    416.73
346424    46 minutes    320    1,659.23 BTC    F2Pool    155.84
346423    51 minutes    1010    8,987.83 BTC    F2Pool    507.12
346422    1 hour 10 minutes    614    6,597.82 BTC    KnCMiner    417.55

Yes, I understand that. My question is about average waiting time for a block. Is the average time until a new block is found always 10 min no matter how long I have waited, or does the average waiting time decrease the more time has passed since the last block?

Edit: I'm waiting for a confirmation right now, that's why I'm asking ;)

The average time is 10 minutes. But as to what nextblast have said, several blocks could be mined in a row and there could be none for an hour.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: DannyHamilton on March 06, 2015, 02:07:54 PM
- snip -
My question is about average waiting time for a block. Is the average time until a new block is found always 10 min no matter how long I have waited, or does the average waiting time decrease the more time has passed since the last block?

Edit: I'm waiting for a confirmation right now, that's why I'm asking ;)

There is no relevant decreasing of the search space.

If the difficulty has recently been adjusted (it is adjusted every 2016 blocks, which is approximately every 2 weeks), then the average time until a block is solved is 10 minutes.  It doesn't matter if its been 3 hours since the last block, or if 10 blocks were all just solved in the past 15 seconds.  The average time until the current block will be solved is 10 minutes.

Note that if hash power has been added to the network since the last difficulty adjustment (new miners joining, or existing miners upgrading their hardware), then the average time is decreased.  If the hash power is steadily increasing, then the average time until the current block is solved decreases in direct proportion to the increase in hash power since the last difficulty adjustment (imagine your hypothetical dice roller rolling the dice faster, or rolling more dice at once).  Then when difficulty is adjusted again, the average time is re-adjusted back to 10 minutes (imagine increasing the number of sides on the hypothetical die from 6 to 10, or 20, or 100, or whatever is necessary to get the appropriate target time of 10 minutes between successful rolls).


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: Brewins on March 06, 2015, 05:12:22 PM
statistically the blocks are being generated faster than 10min.

Check the expected time of halvings and the real time of the halvings to confirm it


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: justusranvier on March 06, 2015, 05:26:00 PM
There is no relevant decreasing of the search space.

If the difficulty has recently been adjusted (it is adjusted every 2016 blocks, which is approximately every 2 weeks), then the average time until a block is solved is 10 minutes.  It doesn't matter if its been 3 hours since the last block, or if 10 blocks were all just solved in the past 15 seconds.  The average time until the current block will be solved is 10 minutes.
If blocks are solved every 10 minutes on average, then shouldn't the average answer to the question "How long do I need to wait until the next block is solved?" be 5 minutes?


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: DannyHamilton on March 06, 2015, 05:42:06 PM
If blocks are solved every 10 minutes on average, then shouldn't the average answer to the question "How long do I need to wait until the next block is solved?" be 5 minutes?

If I roll a six-sided die until I get a 1, then the average number of rolls between 1's is six rolls.

Does that mean that if I walk into a room where someone is rolling a die, the average answer to the question "How long do I need to wait until the next 1 is rolled?" is three?

No.

The die has no memory of what has been rolled recently, or how many times it has been rolled since the last 1.  The average will always be six rolls starting "now", no matter when "now" is.

It's the same with mining.

Shortly after a difficulty adjustment, he average is 10 minutes from "now" no matter when "now" is.

That average shrinks or grows depending on how much hash power has been added to or removed from the network since the difficulty adjustment, but the average time between blocks and the average time until the next block will always be the same.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: ebliever on March 06, 2015, 05:54:14 PM
If blocks are solved every 10 minutes on average, then shouldn't the average answer to the question "How long do I need to wait until the next block is solved?" be 5 minutes?

If I roll a six-sided die until I get a 1, then the average number of rolls between 1's is six rolls.

Does that mean that if I walk into a room where someone is rolling a die, the average answer to the question "How long do I need to wait until the next 1 is rolled?" is three?

No.

The die has no memory of what has been rolled recently, or how many times it has been rolled since the last 1.  The average will always be six rolls starting "now", no matter when "now" is.

It's the same with mining.

Shortly after a difficulty adjustment, he average is 10 minutes from "now" no matter when "now" is.

That average shrinks or grows depending on how much hash power has been added to or removed from the network since the difficulty adjustment, but the average time between blocks and the average time until the next block will always be the same.

Just wanted to say, I always appreciate your clear explanations and the time you spend patiently (well, mostly :-) educating people. You are one of the people making bitcoin a success.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: justusranvier on March 06, 2015, 06:27:24 PM
The die has no memory of what has been rolled recently, or how many times it has been rolled since the last 1.  The average will always be six rolls starting "now", no matter when "now" is.
Something's going wrong here with my mental image.

I get that at any particular moment, the probability of the next hash being valid is (essentially) the same as the previous hash.

Yet after the fact, they do appear every 10 minutes on average.

If I was a bad dart player throwing darts at a very long timeline where there were regular marks every 10 inches, I'd expect half of the darts to end up closer to the right mark and half the darts to end up closer to the left mark.

In this case the marks aren't evenly spaced, but I have trouble seeing why that matters over a long timespan since the intervals average out to once per 10 minutes.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: remotemass on March 06, 2015, 06:37:34 PM
The average time until a new block is 10 min. no matter how long ago the last block was created.
Once you start devoting processing power to add a new block, the time it took to add the previous block doesn't matter.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: CIYAM on March 06, 2015, 06:42:37 PM
If I was a bad dart player throwing darts at a very long timeline where there were regular marks every 10 inches, I'd expect half of the darts to end up closer to the right mark and half the darts to end up closer to the left mark.

In this case the marks aren't evenly spaced, but I have trouble seeing why that matters over a long timespan since the intervals average out to once per 10 minutes.

Sometimes the blocks can take more than one hour to solve (so we aren't just talking about those getting solved quicker).

The average is 10 minutes but there can be quite a bit of variance.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: justusranvier on March 06, 2015, 06:48:28 PM
Sometimes the blocks can take more than one hour to solve (so we aren't just talking about those getting solved quicker).

The average is 10 minutes but there can be quite a bit of variance.
Variance should average out over time.

For every block that takes an hour, there should be one that takes a few seconds.

Encountering each case should be equally likely.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: CIYAM on March 06, 2015, 06:52:18 PM
For every block that takes an hour, there should be one that takes a few seconds.

Encountering each case should be equally likely.

I haven't studied the stats but I think you need to take into account the "difficulty adjustments" also (i.e. before an increase in difficulty I'd expect the average time to have become less than 10 minutes and of course the opposite for a difficulty decrease).


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: Bit_Happy on March 06, 2015, 06:57:43 PM
If blocks are solved every 10 minutes on average, then shouldn't the average answer to the question "How long do I need to wait until the next block is solved?" be 5 minutes?

If I roll a six-sided die until I get a 1, then the average number of rolls between 1's is six rolls.

Does that mean that if I walk into a room where someone is rolling a die, the average answer to the question "How long do I need to wait until the next 1 is rolled?" is three?

No.

The die has no memory of what has been rolled recently, or how many times it has been rolled since the last 1.  The average will always be six rolls starting "now", no matter when "now" is.

It's the same with mining.

Shortly after a difficulty adjustment, he average is 10 minutes from "now" no matter when "now" is.

That average shrinks or grows depending on how much hash power has been added to or removed from the network since the difficulty adjustment, but the average time between blocks and the average time until the next block will always be the same.

"The die has no memory of what has been rolled recently..."
True, but...
If you "suffer through" an unusually long streak (high wait time for blocks, dice rolls under 7, etc), then at some point you have to get fast blocks or high dice rolls in order for the stats to normalize. Is it accurate to say the dice have long-term memory?  :)



Title: Re: Is the expected waiting time for a block always 10 min?
Post by: CIYAM on March 06, 2015, 07:00:18 PM
If you "suffer through" an unusually long streak (high wait time for blocks, dice rolls under 7, etc), then at some point you have to get fast blocks or high dice rolls in order for the stats to normalize. Is it accurate to say the dice have long-term memory?  :)

Not according to the laws of math (i.e. a random number generator could produce a number < X for years without being flawed).

Again the "difficulty adjustment" is used to "try and fix" this sort of problem (in terms of adjusting based upon the history).


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: DannyHamilton on March 06, 2015, 07:09:02 PM
Sometimes the blocks can take more than one hour to solve (so we aren't just talking about those getting solved quicker).

The average is 10 minutes but there can be quite a bit of variance.
Variance should average out over time.

For every block that takes an hour, there should be one that takes a few seconds.

Encountering each case should be equally likely.

Hopefully someone who can explain the reasoning will show up here and explain why it works out the way it does.

If I walk into the room with the guy rolling the die, it's equally likely that he just rolled a 1 as it is that he just rolled something other than a 1, and yet, the average number of rolls until the next 1 is still 6 (regardless of whether he just rolled several 1's in a row or he hasn't rolled a 1 in the last 36 rolls).

I think there are probably a few effects in play here, but one that I notice right away, is that you are assuming that "average of 10 minutes" means "pretty close to 10 minutes most of the time".  Then in your mental image, you are assuming that if you are 7 minutes after the most recent block, you are somehow "closer" to the next block than the previous block.  Of course, if you are 7 minutes after the most recent block, then you can eliminate from your average all blocks that are less than 7 minutes apart (since if the next block was going to be 5 minutes, for example, after the previous one then it would already have happened and you'd really only be 2 minutes since the previous block)



Title: Re: Is the expected waiting time for a block always 10 min?
Post by: DannyHamilton on March 06, 2015, 07:14:22 PM
"The die has no memory of what has been rolled recently..."
True, but...
If you "suffer through" an unusually long streak (high wait time for blocks, dice rolls under 7, etc), then at some point you have to get fast blocks or high dice rolls in order for the stats to normalize. Is it accurate to say the dice have long-term memory?  :)

http://en.wikipedia.org/wiki/Law_of_large_numbers
Quote
It is important to remember that the LLN only applies (as the name indicates) when a large number of observations are considered. There is no principle that a small number of observations will coincide with the expected value or that a streak of one value will immediately be "balanced" by the others (see the gambler's fallacy).

http://en.wikipedia.org/wiki/Gambler%27s_fallacy
Quote
The gambler's fallacy, also known as the Monte Carlo fallacy or the fallacy of the maturity of chances, is the mistaken belief that, if something happens more frequently than normal during some period, it will happen less frequently in the future, or that, if something happens less frequently than normal during some period, it will happen more frequently in the future (presumably as a means of balancing nature). In situations where what is being observed is truly random (i.e., independent trials of a random process), this belief, though appealing to the human mind, is false.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: Lauda on March 06, 2015, 07:40:13 PM
statistically the blocks are being generated faster than 10min.

Check the expected time of halvings and the real time of the halvings to confirm it
Exactly, the next halving is slowly coming sooner and sooner. OP you could have used the search function. I've seen similar threads multiple times.
The average time is under 10 minutes, but the blocks don't really come at the same intervals just as somebody said.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: teukon on March 06, 2015, 07:44:32 PM
I assume througout that there is no problem with mining and I ignore the subtleties of difficulty changes throughout.

Ex: I go to blockchain.info and see that the last block was created 60min ago. I think "oh, how unlucky the miners have been, but that's good, then they should find a new block any second now."
Is that correct, or should I expect the average time until a new block is 10min no matter how long ago the last block was created?

No, this is not correct.  If you see that the last block was created 60 mins ago then the expected waiting time until the next block is 10 minutes and the expected length of time between the current block and the next block is 70 mins.

If blocks are solved every 10 minutes on average, then shouldn't the average answer to the question "How long do I need to wait until the next block is solved?" be 5 minutes?

Good question.  You've stumbled into a probability paradox.

Consider also that the block-generating process looks exactly the same with time reversed.  If you select points in time uniformly (between 2010-01-01 and 2012-12-31 say) you'll find that the next block is, on average, 10 minutes into the future just as you find that the previous block is, on average, 10 minutes into the past.  You'll find that the average time interval between the previous and next blocks is indeed 20 minutes!

In this case the marks aren't evenly spaced, but I have trouble seeing why that matters over a long timespan since the intervals average out to once per 10 minutes.

Resolving the paradox:
Selecting a block at random is different to selecting a point in time at random.  When selecting a point in time at random you're more likely to land between blocks which are far apart than blocks which are close together.  Your averages are then biased towards longer waiting times.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: DeathAndTaxes on March 06, 2015, 10:36:16 PM
While the expected time between blocks is 10 minutes the time until the next block is unknown.  The expected waiting time for a block in isolation is not very useful because it doesn't tell you the whole story instead it is more useful to look at the distribution of possible values and use probability to provide a level of confidence of how long the next block will take.   Often the question that is behind the question asked is "What is the probability that my txn will be confirmed in the next x minutes?"

Consider these two questions:
1) Right now what is the probability that the next block will be found in 10 minutes or less?
2) What is the length of time such that there is a 50% probability that the next block will be found in that amount of time or less?

Some people incorrectly think the answers are 50% and 10 minutes respectively but that isn't correct.  While the expected block time has a mean of 10 minutes the distribution is not linear.  We can use a CDF (cumulative distribution function) to graph the probability of the next block being found in the next x minutes.

CDF (Bitcoin Blocks = mean of 10 minutes)
50%    6.9 minutes   
63%   10.0 minutes
80%   16.9 minutes
90%   22.8 minutes
99%   42.0 minutes

So the answer to the two questions above are 63% and 6.9 minutes respectively.  Some rounded easy to remember numbers as a rule of thumb 50% chance of of txn being confirmed in <7 minutes, 75% chance of being confirmed in in <15 minutes, 90% in less than a half an hour, and >99% in an hour.   As others have pointed out that is always time from 'now'.  If I submit a txn there is a 50% chance the next block will be found in less than seven minutes but if two hours pass the probability from that point is still 50% chance in the next seven minutes.

All this assumes hashrate is constant and actual difficulty matches the expected difficulty for the hashrate.




Title: Re: Is the expected waiting time for a block always 10 min?
Post by: odolvlobo on March 06, 2015, 11:06:25 PM
For every block that takes an hour, there should be one that takes a few seconds.

True, but...
If you "suffer through" an unusually long streak (high wait time for blocks, dice rolls under 7, etc), then at some point you have to get fast blocks or high dice rolls in order for the stats to normalize. Is it accurate to say the dice have long-term memory?  :)

The average time between blocks has been about 10 minutes. There is no mechanism to guarantee that the future average time between blocks will be 10 minutes. However unlikely it might be, the average time between the 2016 blocks in a difficulty period could be 1 hour or 30 seconds. If the first 1008 blocks averaged 20 minutes each, there is nothing that will make the last 1008 blocks average 0 minutes in order to maintain the expected 10 minute average. Statistics describing the past can be extrapolated in order to predict the future, but they can't affect the future.

FYI This is related to the fallacy of the concept of "reversion to the mean".


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: goose20 on March 07, 2015, 12:29:32 PM
If you "suffer through" an unusually long streak (high wait time for blocks, dice rolls under 7, etc), then at some point you have to get fast blocks or high dice rolls in order for the stats to normalize. Is it accurate to say the dice have long-term memory?  :)

Not according to the laws of math (i.e. a random number generator could produce a number < X for years without being flawed).

Again the "difficulty adjustment" is used to "try and fix" this sort of problem (in terms of adjusting based upon the history).


For every block that takes an hour, there should be one that takes a few seconds.

True, but...
If you "suffer through" an unusually long streak (high wait time for blocks, dice rolls under 7, etc), then at some point you have to get fast blocks or high dice rolls in order for the stats to normalize. Is it accurate to say the dice have long-term memory?  :)

The average time between blocks has been about 10 minutes. There is no mechanism to guarantee that the future average time between blocks will be 10 minutes. However unlikely it might be, the average time between the 2016 blocks in a difficulty period could be 1 hour or 30 seconds. If the first 1008 blocks averaged 20 minutes each, there is nothing that will make the last 1008 blocks average 0 minutes in order to maintain the expected 10 minute average. Statistics describing the past can be extrapolated in order to predict the future, but they can't affect the future.

FYI This is related to the fallacy of the concept of "reversion to the mean".

This is interesting. I have done some reading up on 'reversion to the mean' as I've  never heard of the term.

To me, my thinking was along the lines to Bit_Happy. That is, if there is an average x, and for years the number produced is < x,  then there needs to be a period where for years the number produced has to be > x, in order for that average to stand.

Am i understanding the fallacy of the reversion to the mean correctly - the above is not necessary the case?


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: CIYAM on March 07, 2015, 02:11:03 PM
To make it really easy to understand just think of tossing a coin.

If I tossed the coin and it came up "heads" 10 times in a row you might think that there could be something wrong with the coin (i.e. perhaps it has been weighted on one side) and if you didn't think that it was a weighted coin then maybe you now think it is best to "bet it will land on tails".

But if in the next 90 times it landed on "tails" now what are you going to think (presumably you would have changed your bet to "heads" for the same reason as above and now lost a lot) ?

And if in the next 1000 times it landed on "heads" now what are you going to think (presumably you would have decided that it is now "always most likely to land on heads" or perhaps you would have already gone broke) ?

And if in the next 10M times it was basically 50% heads and tails then those "runs" that seemed to mean something actually mean nothing at all (it's just the way that things can happen).

Gamblers fail to grasp this fundamental property of randomness and always tend to think that one event somehow is more likely to have a specific outcome because of previous events.

A fair coin *always* has a 50/50 chance of heads or tails no matter how many times it came up heads or tails in a row before.

It is actually part of our genetic make up to not think rationally about randomness as randomness is generally not very useful for our survival (we usually do better if we "guess right" based upon patterns we follow).


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: odolvlobo on March 07, 2015, 06:00:28 PM
This is interesting. I have done some reading up on 'reversion to the mean' as I've  never heard of the term.

To me, my thinking was along the lines to Bit_Happy. That is, if there is an average x, and for years the number produced is < x,  then there needs to be a period where for years the number produced has to be > x, in order for that average to stand.

Am i understanding the fallacy of the reversion to the mean correctly - the above is not necessary the case?

Your statement is correct, but if the results have been below average, then the average must change, and not the mechanism behind the average.

Here's an example of the "reversion to the mean" fallacy in action:

You flip a coin 100 times, and you get 40 heads and 60 tails. You expected the number heads to be 50%, but you got 40%. Next, you are going to flip the coin another 100 times.

You expect 50 heads for the next 100, so you must expect 90 heads for the total 200, that is 45% of 200 flips, not 50%. If you expect 400 of another 800 flips to be heads, then you expect the total number of heads to be 490, and the average for the 1000 flips to be 49%, not 50%. Eventually with enough flips, the average will approach the expected 50%, but not because something "reverted".

Now, let's assume that you expect the total number of heads after 200 flips to "revert to the mean" of 50%. That means that you expect 60 heads out of the next 100 flips, and not 50. In order for that to happen, then something about coin flipping must change. Otherwise, you must expect 50 heads and not 60.


Title: Re: Is the expected waiting time for a block always 10 min?
Post by: goose20 on March 08, 2015, 09:34:23 AM
This is interesting. I have done some reading up on 'reversion to the mean' as I've  never heard of the term.

To me, my thinking was along the lines to Bit_Happy. That is, if there is an average x, and for years the number produced is < x,  then there needs to be a period where for years the number produced has to be > x, in order for that average to stand.

Am i understanding the fallacy of the reversion to the mean correctly - the above is not necessary the case?

Your statement is correct, but if the results have been below average, then the average must change, and not the mechanism behind the average.

Here's an example of the "reversion to the mean" fallacy in action:

You flip a coin 100 times, and you get 40 heads and 60 tails. You expected the number heads to be 50%, but you got 40%. Next, you are going to flip the coin another 100 times.

You expect 50 heads for the next 100, so you must expect 90 heads for the total 200, that is 45% of 200 flips, not 50%. If you expect 400 of another 800 flips to be heads, then you expect the total number of heads to be 490, and the average for the 1000 flips to be 49%, not 50%. Eventually with enough flips, the average will approach the expected 50%, but not because something "reverted".

Now, let's assume that you expect the total number of heads after 200 flips to "revert to the mean" of 50%. That means that you expect 60 heads out of the next 100 flips, and not 50. In order for that to happen, then something about coin flipping must change. Otherwise, you must expect 50 heads and not 60.



Damn you've explained that well. Thanks mate.
:)





Title: Re: Is the expected waiting time for a block always 10 min?
Post by: picolo on March 08, 2015, 10:21:06 AM
If there was a big electrical problem in the US or China, the total hashrate of the network would go down and the time between blocks would likely go up until the next difficulty change.