• 30 Posts
  • 140 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle


  • Reply by rucknium:

    If I understand your question right, I think you’re looking for the inverse cumulative distribution function (a.k.a. quantile function) of the Erlang distribution.

    The random length of time to mine the next block has an exponential distribution with rate parameter 1/t. The length of time to mine n blocks has an Erlang distribution with shape parameter n and rate parameter 1/t.

    The Erlang distribution is a special case of the Gamma distribution. The Erlang distribution’s shape parameter must be an integer, but the Gamma distribution’s shape parameter can be any positive real number. We can use the Gamma distribution if Erlang isn’t given to us by our calculator.

    You would compute T in the R language with:

    qgamma(p = p, shape = n, rate = 1/t)/n
    

    The results of this simulation match the closed-form computation:

    t <- 120
    n <- 15
    p <- 0.4
    
    set.seed(314)
    
    mining.times <- matrix(rexp(n * 100000, rate = 1/t), ncol = n)
    
    mining.times <- rowSums(mining.times)
    
    quantile(mining.times/n, probs = p)
    
    qgamma(p = p, shape = n, rate = 1/t)/n
    # Divide by n to get the mean instead of the total
    


  • I am currently the sole admin. If a trusted community member wants to join me, they of course can but there really is not much to do besides approving new registrations and upgrading lemmy from time to time. In the case of me getting hit by a bus, decentralization is still given since federation with monero.town would work for at least a couple more months. Ideally, at some point in the future, the community moves away from federation to a properly decentralized system like nostr anyways.