Bitcoin Forum
May 21, 2018, 07:55:13 PM
 News: Latest stable version of Bitcoin Core: 0.16.0  [Torrent]. (New!)
 Home Help Search Donate Login Register
 Pages: [1]
 Author Topic: Math question: what is the average time to the next block?  (Read 2584 times)
jav
Sr. Member

Offline

Activity: 249
Merit: 250

 April 07, 2011, 07:59:11 AM

I'm trying to get a better grip on the correct math to use on block distribution: If the average time between blocks is 10 minutes, does that mean that the average time - from a random point in time - until the next block is 5 minutes? Or is that reasoning flawed for this kind of distribution?

Also: Can you fill in the correct values for A and B in this statement: "The average waiting time until the next confirmation block is between A and B minutes in 95% of all cases". It would be nice if you could explain how you go about calculating that. :-)

Hive, a beautiful wallet with an app platform for Mac OS X, Android and Mobile Web. Translators wanted! iOS and OS X devs see BitcoinKit. Tweets @hivewallet. Donations appreciated at 1HLRg9C1GsfEVH555hgcjzDeas14jen2Cn.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1526932513
Hero Member

Offline

Posts: 1526932513

Ignore
 1526932513

1526932513
 Report to moderator
1526932513
Hero Member

Offline

Posts: 1526932513

Ignore
 1526932513

1526932513
 Report to moderator
Pieter Wuille
Legendary

Offline

Activity: 1050
Merit: 1005

 April 07, 2011, 08:52:34 AM

Assuming the hashing power of miners is constant over time, the average number of generations per unit of time is also constant, and the generations are independent from eachother. This leads to an exponential distribution for the time between two generations (see http://en.wikipedia.org/wiki/Exponential_distribution).

To estimate the parameter lambda of this distribution, we need the total hash rate of the network (currently around 600GH/s) and the difficulty (82347.22294654). Since each tried hash has a chance of 1 in 4295032833*difficulty to result in a block, lambda is network_speed/(4295032833*difficulty), or around 0.0016964/s currently.

The mean time between two generations is 1/lambda, or 589.47s currently. This is independent from any information from the past. In fact, it doesn't even matter how long it was since the previous generation. Even if there hasn't been a block for 5 hours (highly unlikely), it will still take on average 589.47s before a block is founds.

Other statistical information you can derive: the standard deviation is also 1/lambda, or 589.47s.
To find the 95% range, use the formula F(x;lambda) = 1 - exp(-lambda*x) = 0.95, or x=-log(1-0.95)/lambda, or 1765.9s currently.
To find the chance of not finding a block in a period of T seconds, use exp(-lambda*T), which is about 0.22% for T=1 hour. For T=1 day, it becomes 0.000000000000000000000000000000000000000000000000000000000000022%.

About your last question, you could say we want A and B to correspond to 2.5% and 97.5%, leading to intervals between 14.92s and 2174.53s (36 minutes).

Note that the network tries to have lambda=1/600s, but as long as hash rate is increasing (which is true most of the time), it is actually systematically faster.

aka sipa, core dev team

Tips and donations: 1KwDYMJMS4xq3ZEWYfdBRwYG2fHwhZsipa
jav
Sr. Member

Offline

Activity: 249
Merit: 250

 April 07, 2011, 10:43:42 AM

Thx for the detailed explanation, that was very helpful!

Hive, a beautiful wallet with an app platform for Mac OS X, Android and Mobile Web. Translators wanted! iOS and OS X devs see BitcoinKit. Tweets @hivewallet. Donations appreciated at 1HLRg9C1GsfEVH555hgcjzDeas14jen2Cn.
 Pages: [1]