Hacker News new | ask | show | jobs
by modeless 3033 days ago
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):

    minutes = 10000
    cumulative_times <- sort(runif(rpois(1, minutes/10), 0, minutes))
See https://en.wikipedia.org/wiki/Poisson_point_process#Simulati...

With correct block times, I get ~20 minutes from your formula.

1 comments

ahhh you're right