> Correct, that is exactly what I am saying. If you pick a random point in time, you expect 20 minutes between the previous block and the next block on average.
I thought this sounded funny, and I did a little simulation to see if it was correct. Given his assumptions (poisson with lambda 10), you do not get that answer. I got right around 10, which is what I would expect.
You've made the exact mistake the article is talking about. You're weighting all blocks equally, but at any moment the current block is more likely to be one that was the current block for a long time.
You are using rpois as if it returned the time between blocks, but that's wrong. It returns a count of blocks mined in a certain amount of time.
Here is a formula to calculate your cumulative_times array correctly for a 10,000 minute period (which is expected to generate 1,000 blocks but may vary of course):
I thought this sounded funny, and I did a little simulation to see if it was correct. Given his assumptions (poisson with lambda 10), you do not get that answer. I got right around 10, which is what I would expect.
https://gist.github.com/tvladeck/e7a164dfe70fa765b10c1af64b3...